@foreach($items as $customer) @php $hasChildren = count($customer->children_tree) > 0; $isJob = (bool) $customer->is_job; @endphp
@if($hasChildren) @else @endif
{{ $customer->name }}
@if($customer->code) {{ $customer->code }} @endif @if($customer->phone)
{{ $customer->phone }}
@endif
@if($customer->email)
{{ $customer->email }}
@endif @if($customer->phone)
{{ $customer->phone }}
@endif @if(!$customer->email && !$customer->phone) @endif {{ $customer->currency?->code ?? '—' }} {{ $customer->payment_terms_days }} days {{ $isJob ? 'Job' : 'Customer' }} {{ $customer->is_active ? 'Active' : 'Inactive' }}
@if(auth()->user()->hasPermission('ar','edit'))
@csrf @method('PATCH')
@csrf @method('DELETE')
@endif
@if($hasChildren) @include('masters.customers._tree', ['items' => $customer->children_tree, 'level' => $level + 1, 'expandAll' => $expandAll ?? false]) @endif @endforeach @once @push('scripts') @endpush @endonce