@extends('master.app') @section('title', 'Customer Outstanding List') @section('pageCSS') @endsection @section('body')
Customer Outstanding List
Unpaid Invoices (Balance > 0) | As of: {{ $asOf }}
{{-- Header for print --}} @if($isPrint)
{{ $info->business_name ?? 'Business' }}
Customer Outstanding List
Print Date: {{ date('Y-m-d') }}
@endif {{-- Filters --}}
Count: {{ $kpi->count }} Invoice: {{ number_format($kpi->invoice,2) }} Paid: {{ number_format($kpi->paid,2) }} Outstanding: {{ number_format($kpi->total,2) }}
{{-- 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 --}}
@forelse($rows as $i => $r) @empty @endforelse {{-- Footer totals --}}
# Date Invoice # Title Customer CUR Invoice Paid Balance Action
@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
No outstanding invoices found
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
@endsection