@foreach($gstPercentages as $gstPercentage) @endforeach @foreach ($accountingVouchers as $accountingVoucher) @php $totalTaxable = 0; $totalTax = 0; $nonTaxable = $accountingVoucher->items()->where(function ($query) { $query->where('gst_per', 0)->orWhere('gst_per', null); })->sum('taxable_value'); $nonTaxable = round($nonTaxable, 2); $totalTaxable += $nonTaxable; @endphp @foreach($gstPercentages as $gstPercentage) @php $gst = $gstPercentage->gst; $acVoucherItems = $accountingVoucher->items()->where('gst_per', $gst)->get(); $taxableValue = round($acVoucherItems->sum('taxable_value'),2); $igst = round($acVoucherItems->sum('igst'),2); $cgst = round($acVoucherItems->sum('cgst'),2); $sgst = round($acVoucherItems->sum('sgst'),2); $totalTaxable += $taxableValue; $totalTax += $igst + $cgst + $sgst; @endphp @endforeach @php $cess = round($accountingVoucher->items()->sum('cess'),2); $totalAmount = $totalTaxable + $totalTax + $cess; $round_off = round($totalAmount) - $totalAmount; $amount = $totalAmount + $round_off; @endphp @endforeach
Sl No Inv Date Inv No Party Name GSTR No Total Qty Non Taxable{{$gstPercentage->gst}} % Sales IGST Amt CGST Amt SGST AmtTotal Tax Cess Amt Round Off Bill Amt
{{ $loop->iteration }} {{ date('d/m/Y', strtotime($accountingVoucher->voucher_date)) }} {{ $accountingVoucher->voucher_number }} {{ $accountingVoucher->debitLedger ? $accountingVoucher->debitLedger->name : '' }} {{ $accountingVoucher->debitLedger ? $accountingVoucher->debitLedger->gst : '' }} {{ $accountingVoucher->items()->sum('base_qty') }}{{ $nonTaxable }}{{ $taxableValue }} {{ $igst }} {{ $cgst }} {{ $sgst }}{{ $totalTax }} {{$cess }} {{ $round_off }} {{ $amount }}