@php
$grand_base = $grand_sgst = $grand_cgst = $grand_igst = 0;
@endphp
@foreach([5,12,18,28] as $rate)
@php
$group = $invoices->where('gst_percent', $rate);
$sub_base = $sub_sgst = $sub_cgst = $sub_igst = 0;
@endphp
@if($group->count() > 0)
| {{ $rate }}% GST |
@foreach($group as $inv)
@php
$sub_base += $inv->base_amount;
$sub_sgst += $inv->sgst;
$sub_cgst += $inv->cgst;
$sub_igst += $inv->igst;
$grand_base += $inv->base_amount;
$grand_sgst += $inv->sgst;
$grand_cgst += $inv->cgst;
$grand_igst += $inv->igst;
@endphp
| {{ \Carbon\Carbon::parse($inv->invoice_date)->format('Y-m-d') }} |
{{ $inv->invoice_no }} |
{{ $inv->customer_name }} |
{{ $rate }}% |
{{ $inv->hsn_code ?? '' }} |
{{ number_format($inv->base_amount, 2) }} |
{{ number_format($inv->sgst, 2) }} |
{{ number_format($inv->cgst, 2) }} |
{{ number_format($inv->igst, 2) }} |
{{ $inv->gst_number }} |
@endforeach
| Subtotal |
{{ number_format($sub_base, 2) }} |
{{ number_format($sub_sgst, 2) }} |
{{ number_format($sub_cgst, 2) }} |
{{ number_format($sub_igst, 2) }} |
|
@endif
@endforeach
| Grand Total |
|
{{ number_format($grand_base, 2) }} |
{{ number_format($grand_sgst, 2) }} |
{{ number_format($grand_cgst, 2) }} |
{{ number_format($grand_igst, 2) }} |
|