@push('header') @endpush
{{-- Customer Info Card --}}
Customer Code: {{ $customer->customer_code }}
Customer Name: {{ $customer->customer_name }}
@if($customer->business_name)
Business: {{ $customer->business_name }}
@endif @if($customer->city)
City: {{ $customer->city }}
@endif @if($customer->phone)
Phone: {{ $customer->phone }}
@endif @if($customer->channel_type)
Channel: {{ $customer->channel_type }}
@endif
{{-- Summary Cards --}}
Opening Bal.
{{ number_format($summary['opening_balance'], 2) }}
Credit Sales
{{ number_format($summary['total_debits'], 2) }}
Recoveries
{{ number_format($summary['total_credits'], 2) }}
Closing Bal.
{{ number_format($summary['closing_balance'], 2) }}

Moon Traders
Customer Ledger

{{ $customer->customer_name }} ({{ $customer->customer_code }}) @if($customer->business_name) - {{ $customer->business_name }} @endif
@if($dateFrom && $dateTo) Period: {{ \Carbon\Carbon::parse($dateFrom)->format('d-M-Y') }} to {{ \Carbon\Carbon::parse($dateTo)->format('d-M-Y') }} @else All Transactions @endif | Opening Bal.: {{ number_format($summary['opening_balance'], 2) }} | Closing Bal.: {{ number_format($summary['closing_balance'], 2) }}
@if($summary['opening_balance'] != 0) @endif @forelse ($entries as $index => $entry) @empty @endforelse
Sr# Date Salesman Reference Description Type Opening Balance Credit Sales Recoveries Closing Balance
- Opening Balance {{ number_format($summary['opening_balance'], 2) }} 0.00 0.00 {{ number_format($summary['opening_balance'], 2) }}
{{ $entries->firstItem() + $index }} {{ \Carbon\Carbon::parse($entry->transaction_date)->format('d-m-Y') }} {{ $entry->employee_name ?? '-' }} @if($entry->sales_settlement_id) {{ $entry->settlement_number ?? $entry->reference_number }} {{ $entry->settlement_number ?? $entry->reference_number }} @else {{ $entry->reference_number ?? '-' }} @endif {{ $entry->description ?? '-' }} {{ ucwords(str_replace('_', ' ', $entry->transaction_type)) }} {{ number_format($entry->row_opening_balance, 2) }} {{ number_format($entry->debit ?? 0, 2) }} {{ number_format($entry->credit ?? 0, 2) }} {{ number_format($entry->balance, 2) }}
No ledger entries found.
Page Total ({{ $entries->count() }} entries) - {{ number_format($entries->sum('debit'), 2) }} {{ number_format($entries->sum('credit'), 2) }} {{ number_format($summary['closing_balance'], 2) }}
Opening Bal.: {{ number_format($summary['opening_balance'], 2) }} | Credit Sales: {{ number_format($summary['total_debits'], 2) }} | Recoveries: {{ number_format($summary['total_credits'], 2) }} | Closing Bal.: {{ number_format($summary['closing_balance'], 2) }}
@if ($entries->hasPages())
{{ $entries->links() }}
@endif