@php
$subTotal = 0;
$totalTax = 0;
$grandTotal = 0;
foreach ($products as $product) {
$subTotal += floatval($product['price_subtotal']);
if (
isset($amountTax)
&& $amountTax > 0
) {
$totalTax = $amountTax;
} else {
$totalTax += $product['price_tax'] ?? 0;
}
$grandTotal += floatval($product['price_total']);
}
@endphp
Untaxed Amount
{{ money($subTotal, $currency?->name) }}
@if ($totalTax > 0)
Tax
{{ money($totalTax, $currency?->name) }}
@endif
Total
{{ money($grandTotal, $currency?->name) }}