@push('header') @endpush
{{-- Summary Cards --}}
Opening Bal.
{{ number_format($totals->total_opening_balance ?? 0, 2) }}
Credit Sales
{{ number_format($totals->total_credit_sales ?? 0, 2) }}
Recoveries
{{ number_format($totals->total_credits ?? 0, 2) }}
Closing Bal.
{{ number_format(($totals->total_debits ?? 0) - ($totals->total_credits ?? 0), 2) }}
Total Customers
{{ $customers->total() }}

Moon Traders
Creditors Ledger (Accounts Receivable)
@if($dateFrom && $dateTo) For the period {{ \Carbon\Carbon::parse($dateFrom)->format('d-M-Y') }} to {{ \Carbon\Carbon::parse($dateTo)->format('d-M-Y') }}
@elseif($dateFrom) From {{ \Carbon\Carbon::parse($dateFrom)->format('d-M-Y') }}
@elseif($dateTo) Up to {{ \Carbon\Carbon::parse($dateTo)->format('d-M-Y') }}
@endif Total Customers: {{ number_format($customers->total()) }} | Closing Bal.: {{ number_format(($totals->total_debits ?? 0) - ($totals->total_credits ?? 0), 2) }}
Printed by: {{ auth()->user()->name }} | {{ now()->format('d-M-Y h:i A') }}

@forelse ($customers as $index => $customer) @php $closingBalance = ($customer->total_debits ?? 0) - ($customer->total_credits ?? 0); @endphp @empty @endforelse
Sr# Code Customer Name City Opening Bal. Credit Sales Recoveries Closing Bal. Txns Actions
{{ $customers->firstItem() + $index }} {{ $customer->customer_code }} {{ $customer->customer_name }} @if($customer->business_name)
{{ $customer->business_name }}
@endif
{{ $customer->city ?? '-' }} {{ number_format($customer->opening_balance ?? 0, 2) }} {{ number_format($customer->credit_sales ?? 0, 2) }} {{ number_format($customer->total_credits ?? 0, 2) }} {{ number_format($closingBalance, 2) }} {{ $customer->ledger_entries_count }}
No creditors found.
Page Total ({{ $customers->count() }} customers) {{ number_format($customers->sum('opening_balance'), 2) }} {{ number_format($customers->sum('credit_sales'), 2) }} {{ number_format($customers->sum('total_credits'), 2) }} {{ number_format($customers->sum('total_debits') - $customers->sum('total_credits'), 2) }}
@if ($customers->hasPages())
{{ $customers->links() }}
@endif