@props(['document', 'total' => null, 'label' => null]) {{-- What a foreign-currency document is worth in the base currency, at the rate frozen onto it when it was issued. Deliberately an app-shell strip and NOT part of the PDF template: the customer's copy should speak only in the currency they are being billed in, while internally we still want to know what the sale is worth in the money we report in. Silent on base-currency documents, where it would say nothing. --}} @php $teamId = $document->team_id; $code = $document->currency_code; $base = \App\Models\Currency::baseFor($teamId); $rate = (float) ($document->exchange_rate ?: 0); $amount = (float) ($total ?? $document->total); // Only worth showing when the document is in a different currency AND // carries a usable rate; anything else would be noise or a wrong number. $show = $base !== null && $code !== null && $code !== $base->code && $rate > 0; @endphp @if ($show)