@include('reports.partials.header', ['title' => $title, 'period' => $period])
@if($type === 'sales')
| {{ __('Date') }} | {{ __('Invoice') }} | {{ __('Customer') }} | {{ __('Total') }} | {{ __('Paid') }} | {{ __('Due') }} |
@foreach($rows as $row)| {{ \App\Support\DualDate::format($row->invoice_date, 'd M Y') }} | {{ $row->invoice_number }} | {{ $row->customer?->name ?? $row->walk_in_name ?? __('Walk-in Customer') }} | {{ number_format($row->total, 2) }} {{ $row->currency_code }} | {{ number_format($row->paid_amount, 2) }} | {{ number_format($row->due_amount, 2) }} |
@endforeach| {{ __('Total') }} | {{ number_format($rows->sum('total'), 2) }} {{ $moneyCode }} | {{ number_format($rows->sum('paid_amount'), 2) }} | {{ number_format($rows->sum('due_amount'), 2) }} |
|---|
@elseif($type === 'purchases')
| {{ __('Date') }} | {{ __('Purchase') }} | {{ __('Supplier') }} | {{ __('Total') }} | {{ __('Paid') }} | {{ __('Due') }} |
@foreach($rows as $row)| {{ \App\Support\DualDate::format($row->purchase_date, 'd M Y') }} | {{ $row->purchase_number }} | {{ $row->supplier?->name }} | {{ number_format($row->subtotal, 2) }} {{ $row->currency_code }} | {{ number_format($row->paid_amount, 2) }} | {{ number_format($row->due_amount, 2) }} |
@endforeach| {{ __('Total') }} | {{ number_format($rows->sum('subtotal'), 2) }} {{ $moneyCode }} | {{ number_format($rows->sum('paid_amount'), 2) }} | {{ number_format($rows->sum('due_amount'), 2) }} |
|---|
@elseif($type === 'stock')
| {{ __('Product') }} | {{ __('Category') }} | {{ __('Unit') }} | {{ __('Stock') }} | {{ __('Cost Value') }} |
@foreach($rows as $row)| {{ $row->name }} | {{ $row->category?->name }} | {{ $row->unit }} | {{ $row->stock_quantity }} | {{ number_format($row->stock_quantity * $row->cost_price, 2) }} {{ $moneyCode }} |
@endforeach| {{ __('Total') }} | {{ number_format($rows->sum('stock_quantity'), 2) }} | {{ number_format($rows->sum(fn ($row) => $row->stock_quantity * $row->cost_price), 2) }} {{ $moneyCode }} |
|---|
@else
| {{ __('Date') }} | {{ __('Party') }} | {{ __('Category') }} | {{ __('Amount') }} |
@foreach($rows as $row)| {{ \App\Support\DualDate::format($row['date'], 'd M Y') }} | {{ $row['party'] ?: '-' }} | {{ $row['category'] }} | {{ number_format($row['amount'], 2) }} {{ $row['currency'] }} |
@endforeach| {{ __('Total') }} | {{ number_format($rows->sum('amount'), 2) }} {{ $moneyCode }} |
|---|
@endif