@push('header') @endpush
{{-- Employee Info Card --}}
Employee Code: {{ $employee->employee_code }}
Name: {{ $employee->full_name }}
@if($employee->supplier)
Supplier: {{ $employee->supplier->supplier_name }}
@endif @if($employee->designation)
Designation: {{ $employee->designation }}
@endif
{{-- Summary Cards --}}
Opening Balance
{{ number_format($summary['opening_balance'], 2) }}
Credit Sales
{{ number_format($summary['total_credit_sales'], 2) }}
Recoveries
{{ number_format($summary['total_recoveries'], 2) }}
Closing Balance
{{ number_format($summary['closing_balance'], 2) }}
Total Customers
{{ $customerSummaries->count() }}
@if($customerSummaries->count() > 0) {{-- Customer Summary Table --}}

Customer-wise Summary

@foreach ($customerSummaries as $index => $custSummary) @php $custOpening = $custSummary->opening_balance ?? 0; $custClosing = $custOpening + $custSummary->credit_sales - $custSummary->recoveries; @endphp @endforeach
Sr# Code Customer Name Opening Balance Credit Sales Recoveries Closing Balance Txns Action
{{ $index + 1 }} {{ $custSummary->customer_code }} {{ $custSummary->customer_name }} {{ number_format($custOpening, 2) }} {{ number_format($custSummary->credit_sales, 2) }} {{ number_format($custSummary->recoveries, 2) }} {{ number_format($custClosing, 2) }} {{ $custSummary->txn_count }} Filter
Total ({{ $customerSummaries->count() }} customers) {{ number_format($customerSummaries->sum('opening_balance'), 2) }} {{ number_format($customerSummaries->sum('credit_sales'), 2) }} {{ number_format($customerSummaries->sum('recoveries'), 2) }} {{ number_format($customerSummaries->sum('opening_balance') + $customerSummaries->sum('credit_sales') - $customerSummaries->sum('recoveries'), 2) }} {{ $customerSummaries->sum('txn_count') }}
@endif

Moon Traders
Salesman Ledger

{{ $employee->full_name }} ({{ $employee->employee_code }}) @if($employee->supplier) - {{ $employee->supplier->supplier_name }} @endif
@if($dateFrom && $dateTo) 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') }} @else All Transactions @endif | Opening Balance: {{ number_format($summary['opening_balance'], 2) }} | Closing Balance: {{ number_format($summary['closing_balance'], 2) }}
@if($summary['opening_balance'] != 0) @endif @forelse ($entries as $index => $entry) @empty @endforelse
Sr# Date Customer Settlement Description 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->customer_name ?? 'N/A' }}
{{ $entry->customer_code }}
@if($entry->sales_settlement_id) {{ $entry->settlement_number ?? $entry->reference_number }} {{ $entry->settlement_number ?? $entry->reference_number }} @else {{ $entry->reference_number ?? '-' }} @endif {{ $entry->description ?? ($entry->invoice_number ? 'Inv: '.$entry->invoice_number : '-') }} {{ 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 transactions 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 Balance: {{ number_format($summary['opening_balance'], 2) }} | Credit Sales: {{ number_format($summary['total_credit_sales'], 2) }} | Recoveries: {{ number_format($summary['total_recoveries'], 2) }} | Closing Balance: {{ number_format($summary['closing_balance'], 2) }}
@if ($entries->hasPages())
{{ $entries->links() }}
@endif
@push('scripts') @endpush