@php use Carbon\Carbon; function hasPassedWeek($trackingDate) { if ($trackingDate) { $trackingDate = Carbon::parse($trackingDate); $now = Carbon::now(); return $trackingDate->diffInDays($now) >= 7; } return false; } @endphp @if ($type != 0) @else @endif @foreach ($customers as $index => $customer) @php $last_tracking = $customer->trackings()->get()->last(); @endphp @if ($type != 0) @php $last_order = $customer->ordersPlaced()->first(); @endphp @else @endif @if ($last_tracking && $last_tracking->tracking_date) @else @endif @endforeach
# ID {{ __('customer.data.name') }} {{ __('customer.data.phone') }} {{ __('customer.data.email') }} {{ __('customer.data.type') }} Ultimo servicio{{ __('customer.data.reason') }}Ultimo seguimiento {{ __('buttons.actions') }}
{{ ++$index }} {{ $customer->id }} {{ $customer->name }} {{ $customer->phone }} {{ $customer->email ?? 'S/A' }}{{ $customer->serviceType->name }} {{ $last_order && $last_order->completed_date ? $last_order->completed_date : 'S/A' }}{{ $customer->reason ?? 'S/A' }} ({{ $last_tracking->tracking_date }}) {{ $last_tracking->service->name }}S/A {{ __('buttons.show') }} @can('write_customer') {{ __('buttons.edit') }} @if ($type == 0) {{ __('buttons.convert') }} @endif @endcan