{{-- Header --}}
Invoices
Manage, filter, print and track customer invoices
{{-- KPI totals by currency (filtered) --}}
@foreach ($currencies as $cur)
@php
$t = $totalsByCurrency[$cur->id] ?? null;
$cnt = (int) ($t->cnt ?? 0);
$final = (float) ($t->final_total ?? 0);
$recv = (float) ($t->received_total ?? 0);
$bal = (float) ($t->balance_total ?? 0);
@endphp
{{ $cur->title_en }} • Summary
{{ number_format($final, 2) }}
{{ $cnt }} inv
Received
{{ number_format($recv, 2) }}
Balance
{{ number_format($bal, 2) }}
@endforeach
{{-- Filters --}}
{{-- Table --}}
| Invoice |
Type |
Title |
Customer |
Total |
Received |
Balance |
Date |
Actions |
@php
$typeMap = [
1 => 'F-Goods',
2 => 'R-Materials',
3 => 'Printing',
4 => 'Pressing',
];
@endphp
@forelse ($bills as $row)
@php
$currencyTitle = optional($row->currency)->title_en ?? '-';
$typeTitle = $typeMap[$row->type_id] ?? 'Other';
$final = (float) ($row->final_amount ?? 0);
$recv = (float) ($row->received ?? 0);
$bal = (float) ($row->balance ?? $final - $recv);
@endphp
| {{ $row->invoice_number }} |
{{ $typeTitle }} |
{{ $row->title }}
#{{ $row->id }}
|
{{ optional($row->customer)->name ?? '-' }} |
{{ number_format((float) ($row->grand_total ?? 0), 2) }}
{{ $currencyTitle }} |
{{ number_format($recv, 2) }} {{ $currencyTitle }} |
{{ number_format($bal, 2) }} {{ $currencyTitle }} |
{{ $row->invoice_date ?? '-' }} |
|
@empty
No invoices found for selected filters.
|
@endforelse
{{-- Pagination --}}
{{ $bills->links('pagination::bootstrap-4') }}