| SL No |
Inv Date |
Inv No |
Party Name |
GSTR No |
Total Qty |
None Taxable |
@foreach($gstPercentages as $gstPercentage)
{{$gstPercentage->gst}}% Sales |
IGST Amt |
CGST Amt |
SGST Amt |
@endforeach
Total Tax |
Cess Amt |
Round Off |
Bill Amt |
@foreach ($accountingVouchers as $accountingVoucher )
| {{$loop->iteration}} |
{{date('d/m/Y', strtotime($accountingVoucher->voucher_date))}} |
@php
$totalGroupedAmount = 0;
$firstVoucher = \App\Models\AccountingVoucher::where('voucher_type_id', $accountingVoucher->voucher_type_id)->where('voucher_date', $accountingVoucher->voucher_date)->where('status', 1)->orderBy('id', 'asc')->first();
$lastVoucher = \App\Models\AccountingVoucher::where('voucher_type_id', $accountingVoucher->voucher_type_id)->where('voucher_date', $accountingVoucher->voucher_date)->where('status', 1)->orderBy('id', 'desc')->first();
$totalTax = 0;
$nonTaxable = \App\Models\AccountingVoucherItem::whereHas('accountingVoucher', function ($query) use ($accountingVoucher,$cashAndBankLedgerId) {
$query->where('accounting_vouchers.voucher_type_id', $accountingVoucher->voucher_type_id)->where('accounting_vouchers.voucher_date', $accountingVoucher->voucher_date)->where('status', 1)
->whereHas('debitLedger',function ($q) use ($cashAndBankLedgerId) {
$q->whereIn('group_id', $cashAndBankLedgerId);
});
})->where(function ($query) { $query->where('gst_per', 0)->orWhere('gst_per', null); })->sum('taxable_value');
$nonTaxable = round($nonTaxable, 2);
$totalGroupedAmount += $nonTaxable;
$totalQty = \App\Models\AccountingVoucherItem::whereHas('accountingVoucher', function ($query) use ($accountingVoucher,$cashAndBankLedgerId) {
$query->where('accounting_vouchers.voucher_type_id', $accountingVoucher->voucher_type_id)->where('accounting_vouchers.voucher_date', $accountingVoucher->voucher_date)->where('status', 1)
->whereHas('debitLedger',function ($q) use ($cashAndBankLedgerId) {
$q->whereIn('group_id', $cashAndBankLedgerId);
});
})->sum('base_qty');
@endphp
{{ $firstVoucher->voucher_number }} - {{ $lastVoucher->voucher_number }} |
Cash |
|
{{ $totalQty }} |
{{ $nonTaxable }} |
@foreach ($gstPercentages as $gstPercentage)
@php
$gst = $gstPercentage->gst;
$acVoucherItems = \App\Models\AccountingVoucherItem::whereHas('accountingVoucher', function ($query) use ($accountingVoucher,$cashAndBankLedgerId) {
$query->where('voucher_type_id', $accountingVoucher->voucher_type_id)->where('voucher_date', $accountingVoucher->voucher_date)->where('status', 1)
->whereHas('debitLedger',function ($q) use ($cashAndBankLedgerId) {
$q->whereIn('group_id', $cashAndBankLedgerId);
});
})->where('gst_per', $gst)->get();
$igst = round($acVoucherItems->sum('igst'),2);
$cgst = round($acVoucherItems->sum('cgst'),2);
$sgst = round($acVoucherItems->sum('sgst'),2);
$totalTax += $igst + $cgst + $sgst;
$taxableValue = round($acVoucherItems->sum('taxable_value'),2);
$totalGroupedAmount += $taxableValue;
@endphp
{{ $taxableValue }} |
{{ $igst }} |
{{ $cgst }} |
{{ $sgst }} |
@endforeach
{{ round($totalTax ,2)}} |
@php
$cess = \App\Models\AccountingVoucherItem::whereHas('accountingVoucher', function ($query) use ($accountingVoucher,$cashAndBankLedgerId) {
$query->where('voucher_type_id', $accountingVoucher->voucher_type_id)->where('voucher_date', $accountingVoucher->voucher_date)->where('status', 1)
->whereHas('debitLedger',function ($q) use ($cashAndBankLedgerId) {
$q->whereIn('group_id', $cashAndBankLedgerId);
});
})->sum('cess');
$cess = round($cess,2);
$totalGroupedAmount += $cess;
$totalGroupedAmount += $totalTax;
@endphp
{{ $cess }} |
@php
$round_off = round($totalGroupedAmount) - $totalGroupedAmount;
$amount = $totalGroupedAmount + $round_off;
@endphp
{{ $round_off }} |
{{ round($amount) }} |
@endforeach