@php $fmt = fn ($v) => number_format((float) $v, 2); $isProfit = (float) $netProfitLoss >= 0; @endphp
Profit & Loss Report
Period: {{ $from->format('d M Y') }} - {{ $to->format('d M Y') }}
Generated at {{ now()->format('d M Y h:i A') }}
{{-- Summary --}}
Total Income {{ $fmt($totalIncome) }}
Total Expense {{ $fmt($totalExpense) }}
{{ $isProfit ? 'Net Profit' : 'Net Loss' }} {{ $fmt(abs($netProfitLoss)) }}
{{-- Income --}}
Income Breakdown
@forelse($statementIncomeRows as $row) @empty @endforelse
Particular Amount
{{ $row['label'] }} {{ $fmt($row['amount']) }}
No income data found for this period.
{{-- Expense --}}
Expense Breakdown
@forelse($statementExpenseRows as $row) @php $isLoan = str_contains(strtolower($row['label']), 'loan finance cost'); @endphp @empty @endforelse {{-- Fallback Loan Finance Cost --}} @if(($loanFinanceCostTotal ?? 0) > 0 && collect($statementExpenseRows)->where('label', 'Loan Finance Cost')->count() === 0) @endif
Particular Amount
{{ $row['label'] }} {{ $fmt($row['amount']) }}
No expense data found for this period.
Loan Finance Cost {{ $fmt($loanFinanceCostTotal) }}