@php $formatMoney = fn($v) => number_format((float) $v, 2); @endphp

{{ $employee->name }}

{{ $employee->employee_code ?: 'No Code' }} | {{ $employee->designation?->name ?? 'No Designation' }} | {{ $employee->employee_type === 'monthly' ? 'Monthly' : 'Daily Roz' }}

{{-- Summary --}}
Total Debit
{{ $formatMoney($summary['total_debit'] ?? 0) }}
Total Credit
{{ $formatMoney($summary['total_credit'] ?? 0) }}
Balance
{{ $formatMoney($summary['balance'] ?? 0) }}
Outstanding Advance
{{ $formatMoney($summary['outstanding_advance'] ?? 0) }}
{{-- Ledger Table --}} @forelse($entries as $entry) @php $typeLabel = match($entry->type) { 'opening' => 'Opening', 'advance' => 'Advance', 'advance_return' => 'Advance Return', 'salary_generated' => 'Salary Generated', 'salary_paid' => 'Salary Paid', 'bonus_generated' => 'Bonus Generated', 'bonus_paid' => 'Bonus Paid', 'bonus' => 'Bonus', 'deduction' => 'Deduction', 'adjustment' => 'Adjustment', default => ucwords(str_replace('_', ' ', (string) $entry->type)), }; $referenceText = $entry->reference_no ?: (($entry->reference_type && $entry->reference_id) ? $entry->reference_type . '#' . $entry->reference_id : '-'); @endphp @empty @endforelse
Date Type Reference Description Debit Credit
{{ optional($entry->entry_date)->format('d M Y h:i A') }} {{ $typeLabel }} {{ $referenceText }} {{ $entry->description ?: '-' }} {{ $formatMoney($entry->debit) }} {{ $formatMoney($entry->credit) }}
No ledger entry found.