Statement
@php
$cur = $bill->currency->title_en ?? $bill->currency->title ?? '';
$grand = (float)($bill->grand_total ?? 0);
$disc = (float)($bill->discount ?? 0);
$final = (float)($bill->final_amount ?? ($grand - $disc));
$recv = (float)($bill->received ?? 0);
$bal = max($final - $recv, 0);
@endphp
Grand Total
{{ $cur }} {{ number_format($grand, 2) }}
Discount
{{ $cur }} {{ number_format($disc, 2) }}
Total
{{ $cur }} {{ number_format($final, 2) }}
Received
{{ $cur }} {{ number_format($recv, 2) }}
Balance
{{ $cur }} {{ number_format($bal, 2) }}
Totals are calculated safely (Balance never negative).