@extends('layouts.finance') @section('title', 'In Transit Detail') @section('subtitle', 'Supplier invoices currently marked as transit') @section('content') @php $displayCurrency = 'PKR'; $fmt = fn($usd) => $metrics->moneyIn($usd, 'USD', $displayCurrency); $breakdownLabels = array_keys($breakdown); $breakdownValues = array_values($breakdown); $largestSupplier = $breakdownLabels[0] ?? 'No supplier'; $largestAmount = count($breakdownValues) ? max($breakdownValues) : 0; $paidCurrencyRates = $effectiveRatesByPaidCurrency ?? []; $selectedPaidCurrency = $selectedPaidCurrency ?? null; $paidCurrencyCards = $paidCurrencyCards ?? []; @endphp
Back to Dashboard
Total In Transit
{{ $fmt($total) }}
{{ $transitInvoices->count() }} transit invoice{{ $transitInvoices->count() === 1 ? '' : 's' }}
@foreach(['USD' => 'ico-bg-green', 'AUD' => 'ico-bg-teal'] as $currency => $iconClass) @php $card = $paidCurrencyCards[$currency] ?? ['count' => 0, 'paid_amount' => 0, 'pkr_amount' => 0, 'rate' => null]; $isActiveCurrency = $selectedPaidCurrency === $currency; @endphp
{{ $currency }} Transit
{{ $metrics->money($card['paid_amount'], $currency) }}
{{ number_format($card['count']) }} invoice{{ $card['count'] === 1 ? '' : 's' }}{{ $card['rate'] ? ' - '.$currency.'->PKR '.number_format($card['rate'], 4) : '' }}
@endforeach
{{ $selectedPaidCurrency ? $selectedPaidCurrency.' Invoice Count' : 'Invoice Count' }}
{{ number_format($transitInvoices->count()) }}
Status: transit

Breakdown

By supplier
@if($total > 0)
@else
No transit invoices.
@endif

Revenue vs. Expenses Trend

6 months

{{ $selectedPaidCurrency ? $selectedPaidCurrency.' Transit Invoices' : 'Transit Invoices' }}

@forelse($transitInvoices as $invoice) @php $invoiceTotal = $metrics->invoiceTotal($invoice); $invoicePkrEquivalent = $metrics->invoicePkrEquivalent($invoice); $rate = $metrics->invoiceAppliedRate($invoice); $paidCurrency = $metrics->invoicePaidCurrency($invoice); $paidCurrencyRate = $metrics->invoicePaidCurrencyRate($invoice); @endphp @empty @endforelse
Invoice Supplier Bank Amount Paid Rate Effective Rate PKR Equivalent Status
{{ $invoice->invoice_number }} {{ $invoice->supplier_name ?: $invoice->client_name }} {{ $invoice->bankAccount ? trim($invoice->bankAccount->name.' - '.$invoice->bankAccount->bank_name) : '-' }} {{ $metrics->money($invoiceTotal, $invoice->currency) }} {{ $paidCurrency && $paidCurrencyRate ? $paidCurrency.'->PKR '.number_format($paidCurrencyRate, 4) : '-' }} {{ $rate ? number_format($rate, 4) : '-' }} {{ $invoicePkrEquivalent !== null ? $metrics->money($invoicePkrEquivalent, 'PKR') : 'Missing paid rate' }} In Transit
No transit invoices.
Total In Transit {{ $fmt($total) }}

Insights

Paid FX Rate
{{ ! $selectedPaidCurrency && count($paidCurrencyRates) > 1 ? 'Mixed' : ($effectiveRate !== null ? number_format($effectiveRate, 4) : '-') }}
@if($selectedPaidCurrency) {{ $selectedPaidCurrency }}->PKR weighted rate @elseif(count($paidCurrencyRates) > 1) @foreach($paidCurrencyRates as $currency => $currencyRate) {{ $currency }}->PKR {{ number_format($currencyRate, 4) }}{{ ! $loop->last ? ' ยท ' : '' }} @endforeach @else Weighted from paid invoice currency @endif
Largest Share
{{ $total > 0 && $largestAmount > 0 ? number_format(($largestAmount / $total) * 100, 1) : '0.0' }}%
Largest supplier share
Transit Records
{{ number_format($transitInvoices->count()) }}
Invoices awaiting stock upload

Transit amounts come from supplier invoices whose database status is transit.

@push('scripts') @endpush @endsection