@php use App\Helpers\SalesHelper; use App\Helpers\ReuseableCode; $stiInv = $stiInv ?? null; $stiGstRate = $stiGstRate ?? SalesHelper::resolveDefaultGstTaxPercent(17); if ($stiInv && !empty($stiInv->id) && (float) ($stiInv->sales_tax ?? 0) > 0) { $lineGstRate = DB::connection('mysql2')->table('sales_tax_invoice_data') ->where('master_id', $stiInv->id) ->where('tax', '>', 0) ->value('tax'); if ($lineGstRate) { $stiGstRate = (float) $lineGstRate; } else { $stiGstRate = SalesHelper::resolveDefaultGstTaxPercent($stiGstRate); } } $savedFurtherPer = null; if ($stiInv && !empty($stiInv->id)) { $savedFurtherPer = DB::connection('mysql2')->table('sales_tax_invoice_data') ->where('master_id', $stiInv->id) ->where('sales_tax_further_per', '>', 0) ->value('sales_tax_further_per'); } $stiFurtherRate = SalesHelper::resolveFurtherSalesTaxPercent($savedFurtherPer); $stiAdvanceRate = $stiAdvanceRate ?? ($stiInv->advance_tax_rate ?? 0); $stiSalesTaxVal = $stiInv->sales_tax ?? 0; $stiFurtherTaxVal = $stiInv->sales_tax_further ?? 0; $stiAdvanceTaxVal = $stiInv->advance_tax_amount ?? 0; $stiGstApplicable = $stiInv && (float) ($stiInv->sales_tax ?? 0) > 0; $stiFurtherApplicable = $stiInv && (float) ($stiInv->sales_tax_further ?? 0) > 0; @endphp

Tax Summary

Subtotal (before tax)
Sales Tax (GST) %
Further Sales Tax %
Advance Tax %
Total Sales Tax
Grand Total