@extends('layouts.app') @section('title', 'Invoices') @section('content') @php $f = $filters ?? []; $qParams = request()->query(); $tabBase = array_filter(['q' => $f['q'] ?? '', 'client_id' => $f['client_id'] ?? '', 'project_id' => $f['project_id'] ?? '', 'date_from' => $f['date_from'] ?? '', 'date_to' => $f['date_to'] ?? '', 'sort' => $f['sort'] ?? '', 'direction' => $f['direction'] ?? '']); @endphp

Invoices

Click any invoice to view details

Total Invoiced

{{ \App\Support\Format::mwkDecimal($totalInvoiced) }}

Paid

{{ \App\Support\Format::mwkDecimal($paidTotal) }}

Outstanding

{{ \App\Support\Format::mwkDecimal($outstandingTotal) }}

Overdue

{{ \App\Support\Format::mwkDecimal($overdueTotal) }}

@php $tabs = [ ['label' => 'All', 'status' => 'all'], ['label' => 'Pending', 'status' => 'Pending'], ['label' => 'Overdue', 'status' => 'Overdue'], ['label' => 'Paid', 'status' => 'Paid'], ]; $cur = $currentStatus ?? 'all'; @endphp @foreach($tabs as $t) @php $tp = $tabBase; if ($t['status'] !== 'all') { $tp['status'] = $t['status']; } else { unset($tp['status']); } $active = ($t['status'] === 'all' && ($cur === 'all' || $cur === '')) || ($t['status'] !== 'all' && $cur === $t['status']); @endphp {{ $t['label'] }} @endforeach
@if($filterProjectId ?? null) @php $fp = $projects->firstWhere('id', $filterProjectId); @endphp

Showing invoices for project {{ $fp->name ?? ('#'.$filterProjectId) }}

Clear project filter
@endif @if($filterClientId ?? null) @php $fc = $clients->firstWhere('id', $filterClientId); @endphp

Showing invoices for client {{ $fc->company_name ?? ('#'.$filterClientId) }}

Clear client filter
@endif
@if(($cur ?? 'all') !== 'all' && ($cur ?? '') !== '') @endif
Clear
@if($invoices->count() === 0)

No invoices found

Create your first invoice or adjust your filters.

@else @foreach($invoices as $i) @php $badge = $i->status === 'Paid' ? 'g' : ($i->status === 'Overdue' ? 'r' : 'a'); @endphp @endforeach
Invoice # Client Project Date Amount MRA Fiscal Code Status
{{ $i->invoice_number }} {{ $i->client?->company_name }} {{ $i->project?->name ?? '—' }} {{ $i->invoice_date?->format('M j, Y') }} {{ \App\Support\Format::mwkDecimal($i->total_amount) }} @if($i->mra_fiscal_code) {{ $i->mra_fiscal_code }} @else Not fiscalised @endif {{ $i->status }} View
{{ $invoices->withQueryString()->links() }}
@endif
@endsection @push('scripts') @include('invoices.partials.invoice-form-script') @endpush