@extends('master.app') @section('title', 'Invoices') @section('pageCSS') @endsection @section('body')
{{-- Header --}}

Invoices

Manage, filter, print and track customer invoices
Add
{{-- 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 --}}
Reset
{{-- Table --}}
@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 @empty @endforelse
Invoice Type Title Customer Total Received Balance Date Actions
{{ $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 ?? '-' }}

No invoices found for selected filters.
{{-- Pagination --}}
{{ $bills->links('pagination::bootstrap-4') }}
@endsection @section('pageJs') @endsection