@extends('layouts.finance') @section('title', $card->issuer . ' · ' . $card->card_name) @section('subtitle', 'Invoices charged to this credit card') @section('content') @php $statusLabel = fn($status) => match($status) { 'paid' => 'Paid', 'transit' => 'Transit', 'release_on_credit' => 'On Credit', 'debt' => 'Debt', 'overdue' => 'Overdue', 'cancelled' => 'Cancelled', default => 'Unpaid', }; $statusClass = fn($status) => match($status) { 'paid' => 'pill-green', 'transit' => 'pill-cyan', 'release_on_credit' => 'pill-purple', 'debt' => 'pill-blue', 'overdue' => 'pill-red', 'cancelled' => 'pill-rose', default => 'pill-amber', }; // Sum of what each non-cancelled invoice contributed to the card (card currency). $chargedTotal = $invoices ->where('status', '!=', 'cancelled') ->sum(fn($i) => (float) $i->credit_card_charge_amount); $cardUtil = (float) $card->credit_limit > 0 ? ((float) $card->payable_balance / (float) $card->credit_limit) * 100 : 0; @endphp
← Back to Credit & Debt
Payable Balance
{{ $metrics->money($card->payable_balance, $card->currency) }}
Charged by Invoices
{{ $metrics->money($chargedTotal, $card->currency) }}
Credit Limit
{{ $metrics->money($card->credit_limit, $card->currency) }}
Utilization
{{ number_format($cardUtil, 1) }}%
@if(abs($chargedTotal - (float) $card->payable_balance) >= 0.01)
The payable balance ({{ $metrics->money($card->payable_balance, $card->currency) }}) differs from the sum of invoice charges ({{ $metrics->money($chargedTotal, $card->currency) }}) by {{ $metrics->money((float) $card->payable_balance - $chargedTotal, $card->currency) }}. This is the portion from manual adjustments or payments recorded directly against the card.
@endif

Invoices on this card

{{ $invoices->count() }} total
@forelse($invoices as $invoice) @php $invoiceTotal = (float) $invoice->amount + (float) ($invoice->fee_amount ?? 0); @endphp @empty @endforelse
Invoice # Supplier Product Status Amount + Fee Charged to Card Issue Date Due Date
{{ $invoice->invoice_number }} {{ $invoice->supplier_name ?: $invoice->client_name }} {{ $invoice->product_name }} {{ $statusLabel($invoice->status) }} {{ $metrics->money($invoiceTotal, $invoice->currency) }} @if($invoice->status === 'cancelled') @else {{ $metrics->money($invoice->credit_card_charge_amount, $card->currency) }} @endif {{ optional($invoice->issue_date)->format('d M Y') }} {{ optional($invoice->due_date)->format('d M Y') }}
No invoices are charged to this card yet.
@endsection