@foreach ($customers as $customer) @if ($customer->type == 'Retailer') @else @endif @endforeach @if ($customers->count() > 0) @endif
{{ __('SL') }}. {{ __('Customer Name') }} {{ __('Phone') }} {{ __('Type') }} {{ __('Total Sales') }} {{ __('Amount') }} {{ __('Paid') }} {{ __('Total Sale Due') }}
{{ $customers->firstItem() + $loop->index }} {{ $customer->name }} {{ $customer->phone }}{{ __('Customer') }}{{ $customer->type }}{{ $customer->sales?->count() }} {{ currency_format($customer->sales?->sum('totalAmount'), currency: business_currency()) }} {{ currency_format($customer->sales?->sum('paidAmount'), currency: business_currency()) }} {{ currency_format($customer->sales?->sum('dueAmount'), currency: business_currency()) }}
{{__('Total')}} {{ $customers->sum(fn($customer) => $customer->sales?->count()) }} {{ currency_format($totalAmount, currency: business_currency()) }} {{ currency_format($totalPaid, currency: business_currency()) }} {{ currency_format($totalDue, currency: business_currency()) }}
{{ $customers->links('vendor.pagination.bootstrap-5') }}