@foreach ($accountingVouchers as $accountingVoucher)

{{ $company->name }}

{{ $company->address }}
Email: {{ $company->email }}
Phone: {{ $company->phone }}
GSTIN: {{ $company->gst }},State : {{ $company->state }}- Code: {{ $company->state_code }}
@if ($accountingVoucher->einvoice != null)
@if ($accountingVoucher->ewayBill != null) @endif
IRN :  {{ $accountingVoucher->einvoice->irn }}
Ack No :  {{ $accountingVoucher->einvoice->ack_no }}
Ack Date :  {{ date('d-m-Y', strtotime($accountingVoucher->einvoice->ack_dt)) }}
E-Way Bill No :  {{ $accountingVoucher->ewayBill ? $accountingVoucher->ewayBill->ewayBillNo : '' }}
E-Way Bill Date :  {{ $accountingVoucher->ewayBill ? $accountingVoucher->ewayBill->ewayBillDate : '' }}
E-Way Bill Valid Till :  {{ $accountingVoucher->ewayBill ? $accountingVoucher->ewayBill->validUpto : '' }}
@if ($accountingVoucher->einvoice) @php $qrCodeData = $accountingVoucher->einvoice->signed_QRCode; $qrImage = QrCode::format('svg')->size(150)->generate($qrCodeData); $qrImageBase64 = base64_encode($qrImage); @endphp QR Code @endif
@endif

Tax Invoice

Name

:  {{ $accountingVoucher->debitLedger->legal_name != null ? $accountingVoucher->debitLedger->legal_name : $accountingVoucher->debitLedger->name }}

INV No

:  {{ $accountingVoucher->voucher_number }}

Address :  {{ $accountingVoucher->debitLedger->address }} Date :  {{ $accountingVoucher->voucher_date }}
Phone No :  {{ $accountingVoucher->debitLedger->mobile_no }} SMAN :  {{ $accountingVoucher->user ? $accountingVoucher->user->name : '' }}
GSTIN
:  {{ $accountingVoucher->debitLedger->gst }} ,  {{ $accountingVoucher->debitLedger->state }} - {{ $accountingVoucher->debitLedger->state_code }}
Area :  {{ $accountingVoucher->branch->name }}
@if ($accountingVoucher->items->sum('disc_amount') > 0) @endif @foreach ($accountingVoucher->items as $item) @if ($accountingVoucher->items->sum('disc_amount') > 0) @endif @endforeach @for ($i = count($accountingVoucher->items); $i < 18; $i++) @if ($accountingVoucher->items->sum('disc_amount') > 0) @endif @endfor @if ($accountingVoucher->items->sum('disc_amount') > 0) @endif
NO DESCRIPTION HSN UNIT RATE QTY G.VALUEDIS
%
GST
%
TAXAMT NETVAL
{{ $loop->iteration }} {{ $item->stockItem->name }} {{ $item->stockItem->hsn_code }} {{ $item->unit->symbol }} {{ number_format($item->price, 2) }} {{ $item->quantity }} {{ number_format($item->gross_value, 2) }} {{ $item->disc_percentage }}{{ $item->gst_per }} {{ number_format($item->cgst + $item->sgst + +$item->igst + $item->cess, 2) }} {{ number_format($item->total, 2) }}
 

Total

{{ $accountingVoucher->items->sum('quantity') }} {{ number_format($accountingVoucher->items->sum('gross_value'), 2) }} {{ number_format($accountingVoucher->items->sum('igst') + $accountingVoucher->items->sum('cgst') + $accountingVoucher->items->sum('sgst') + $accountingVoucher->items->sum('cess'), 2) }} {{ number_format($accountingVoucher->items->sum('total'), 2) }}
@php $taxDetails = $accountingVoucher ->items() ->select( 'gst_per', \DB::raw('SUM(cgst) as cgst'), \DB::raw('SUM(sgst) as sgst'), \DB::raw('SUM(igst) as igst'), \DB::raw('SUM(taxable_value) as taxable_value'), ) ->groupBy('gst_per') ->get(); $words = new \NumberFormatter('en', \NumberFormatter::SPELLOUT); $words = $words->format($accountingVoucher->amount); @endphp
@if ($taxDetails->sum('igst') > 0) @else @endif @foreach ($taxDetails as $taxDetail) @if ($taxDetail->igst > 0) @else @endif @endforeach @if ($accountingVoucher->items->sum('igst') > 0) @else @endif
TAX VALUEIGSTCGST SGSTTOT.TAX
Taxable  {{ $taxDetail->gst_per }}% {{ number_format($taxDetail->taxable_value, 2) }}{{ number_format($taxDetail->igst, 2) }}{{ number_format($taxDetail->cgst, 2) }} {{ number_format($taxDetail->sgst, 2) }}{{ number_format($taxDetail->igst + $taxDetail->cgst + $taxDetail->sgst, 2) }}
TOTAL {{ number_format($accountingVoucher->items->sum('taxable_value'), 2) }}{{ number_format($accountingVoucher->items->sum('igst'), 2) }}{{ number_format($accountingVoucher->items->sum('cgst'), 2) }} {{ number_format($accountingVoucher->items->sum('sgst'), 2) }}{{ number_format($accountingVoucher->items->sum('igst') + $accountingVoucher->items->sum('cgst') + $accountingVoucher->items->sum('sgst'), 2) }}
Round Off : {{ number_format($accountingVoucher->round_off, 2) }}
@if ($accountingVoucher->discount != 0) Discount : {{ number_format($accountingVoucher->discount, 2) }}
@endif @if ($accountingVoucher->freight != 0) Freight : {{ number_format($accountingVoucher->freight, 2) }}
@endif
In Words : {{ $words }}

AMOUNT : {{ number_format($accountingVoucher->amount, 2) }}

@if ($company->bankLedger != null)
OUR BANK DETAILS
Name : {{ $company->bankLedger->name }}
Branch : {{ $company->bankLedger->branch }}
IFSC : {{ $company->bankLedger->ifsc_code }}
Account NO : {{ $company->bankLedger->account_number }}
@endif
DECLARATION :
Certified that the particulars given above are true and correct.
FOR: {{ $company->name }}

AUTHORIZED SIGNATORY
@if ($accountingVouchers->last() != $accountingVoucher)
@endif @endforeach