@php use App\Helpers\SalesHelper; if (!empty($hide_print_amounts) || empty($delivery_note)) { return; } $dnLineTotals = SalesHelper::get_total_amount_for_delivery_not_by_id($delivery_note->id); $lineSubtotal = (float) ($dnLineTotals->amount ?? 0); $gstRate = (float) ($delivery_note->sales_tax_rate ?? 0); $furtherRate = (float) ($delivery_note->sales_tax_further_per ?? 0); $advanceRate = (float) ($delivery_note->advance_tax_rate ?? 0); $cartage = (float) ($delivery_note->cartage_amount ?? 0); $salesTaxAmount = (float) ($delivery_note->sales_tax_amount ?? 0); $furtherTaxAmount = (float) ($delivery_note->sales_tax_further ?? 0); $advanceTaxAmount = (float) ($delivery_note->advance_tax_amount ?? 0); if ($salesTaxAmount <= 0 && $gstRate > 0 && $lineSubtotal > 0) { $salesTaxAmount = $lineSubtotal / 100 * $gstRate; } if ($furtherTaxAmount <= 0 && $furtherRate > 0 && $lineSubtotal > 0) { $furtherTaxAmount = $lineSubtotal / 100 * $furtherRate; } if ($advanceTaxAmount <= 0 && $advanceRate > 0 && $lineSubtotal > 0) { $advanceTaxAmount = $lineSubtotal / 100 * $advanceRate; } $grandTotal = $lineSubtotal + $salesTaxAmount + $furtherTaxAmount + $advanceTaxAmount + $cartage; $showSummary = $lineSubtotal > 0 || $salesTaxAmount > 0 || $furtherTaxAmount > 0 || $advanceTaxAmount > 0 || $cartage > 0; @endphp @if($showSummary) @if($gstRate > 0 || $salesTaxAmount > 0) @endif @if($furtherRate > 0 || $furtherTaxAmount > 0) @endif @if($advanceRate > 0 || $advanceTaxAmount > 0) @endif @if($cartage > 0) @endif
Total Amount (excl. Tax) {{ number_format($lineSubtotal, 2) }}
Sales Tax {{ rtrim(rtrim(number_format($gstRate, 2), '0'), '.') }}% {{ number_format($salesTaxAmount, 2) }}
Further Sales Tax {{ rtrim(rtrim(number_format($furtherRate, 2), '0'), '.') }}% {{ number_format($furtherTaxAmount, 2) }}
Advance Tax {{ rtrim(rtrim(number_format($advanceRate, 2), '0'), '.') }}% {{ number_format($advanceTaxAmount, 2) }}
Cartage Amount {{ number_format($cartage, 2) }}
Grand Total (incl. Tax) {{ number_format($grandTotal, 2) }}
@endif