@extends('layouts.finance') @section('title', 'Factory Expense Detail') @section('subtitle', 'Factory expenses from expense records and factory payments') @section('content') @php $displayCurrency = 'PKR'; $fmt = fn($usd) => $metrics->moneyIn($usd, 'USD', $displayCurrency); $rowCount = $rows->count(); $latestDate = $rows->max(fn($row) => $row['date']?->toDateString()); $sourceTotals = $rows ->groupBy('source') ->map(fn($items) => $items->sum('amount_usd')) ->sortDesc(); @endphp
| Date | Source | Account | Paid To | Description | Reference | Amount | PKR Equivalent | View |
|---|---|---|---|---|---|---|---|---|
| {{ $row['date']?->format('d M Y') ?: '-' }} | {{ $row['source'] }} | {{ $row['account'] ?: '-' }} | {{ $row['counterparty'] ?: '-' }} | {{ $row['description'] ?: '-' }} | {{ $row['reference'] ?: '-' }} | {{ $metrics->money($row['amount'], $row['currency']) }} | {{ $fmt($row['amount_usd']) }} | @if($row['transaction']) Open @else - @endif |
| No factory expense rows found for this period. | ||||||||