{{-- Header for print --}}
@if($isPrint)
{{ $info->business_name ?? 'Business' }}
Customer Outstanding List
Print Date: {{ date('Y-m-d') }}
@endif
{{-- Filters --}}
{{-- Totals by Currency --}}
@foreach($totalsByCurrency as $t)
{{ $t['currency'] }}
({{ $t['count'] }})
{{ number_format($t['total'],2) }}
@endforeach
@php
$toggleDir = function($col) {
$currentSort = request('sort');
$currentDir = request('dir','asc');
if($currentSort === $col){
return $currentDir === 'asc' ? 'desc' : 'asc';
}
return 'asc';
};
$sortIcon = function($col) use ($sort, $dir){
if($sort !== $col) return 'fa-sort text-muted';
return $dir === 'asc' ? 'fa-sort-up' : 'fa-sort-down';
};
@endphp
{{-- Table --}}
| # |
Date
|
Invoice #
|
Title |
Customer
|
CUR
|
Invoice
|
Paid
|
Balance
|
Action |
@forelse($rows as $i => $r)
|
@if(method_exists($rows,'firstItem'))
{{ $rows->firstItem() + $i }}
@else
{{ $i + 1 }}
@endif
|
{{ $r->invoice_date }} |
{{ $r->invoice_number }} |
{{ $r->title }} |
{{ $r->customer->name ?? '-' }} |
{{ $r->currency->title_en ?? '-' }} |
{{ number_format((float)$r->final_amount,2) }} |
{{ number_format((float)$r->received,2) }} |
{{ number_format((float)$r->balance,2) }} |
View
|
@empty
| No outstanding invoices found |
@endforelse
{{-- Footer totals --}}
| Total |
{{ number_format((float)$rows->sum('final_amount'),2) }} |
{{ number_format((float)$rows->sum('received'),2) }} |
{{ number_format((float)$rows->sum('balance'),2) }} |
|
{{-- Pagination --}}
@if(! $isPrint)
{{ $rows->links('pagination::bootstrap-4') }}
@endif