@php $branch = $addedInvoice->branch ?? null; $company = $branch->company ?? null; $companyName = $settings->company_name ?? ($company->name ?? ''); $companyAddress = $settings->address ?? ($company->address ?? ''); $companyPhone = $settings->phone ?? ($company->phone ?? ''); $companyEmail = $settings->email ?? ($company->email ?? ''); $gstNo = $settings->gst_no ?? ''; $panNo = $settings->pan_no ?? ''; $bankName = $settings->bank_name ?? ''; $accountNo = $settings->account_no ?? ''; $ifscCode = $settings->ifsc_code ?? ''; $clientName = $addedInvoice->client->user->name ?? ''; $clientPhone = $addedInvoice->client->user->phone ?? ''; $clientCompany = $addedInvoice->client->company_name ?? ''; $clientAddress = $addedInvoice->client->address ?? optional(optional($addedInvoice->order)->clientAddress)->address ?? optional(optional($addedInvoice->client)->user)->location ?? ''; $clientGstin = $addedInvoice->client->gstin ?? ''; $clientPincode = $addedInvoice->client->postal_code ?? ''; $clientStateObj = $addedInvoice->client->state_id ? \App\Models\StateModel::find($addedInvoice->client->state_id) : null; $clientState = $clientStateObj->name ?? 'Tamil Nadu'; $clientStateCode = $clientStateObj->id ?? '33'; $clientCityObj = $addedInvoice->client->city_id ? \App\Models\CityModel::find($addedInvoice->client->city_id) : null; $clientCity = $clientCityObj->name ?? ''; @endphp
{{-- --}} {{-- --}} @if (isset($settings->whatsapp_config) && $settings->whatsapp_config == 'A') @endif Back
(ORIGINAL)
{{-- --}}
@if($companyPhone)
{{ $companyPhone }}
@endif
{{ strtoupper($companyName) }}
{!! nl2br(e($companyAddress)) !!}
@if($gstNo) GSTIN: {{ $gstNo }} @endif @if($panNo)     PAN NO: {{ $panNo }} @endif
{{ strtoupper($companyName) }}
{!! nl2br(e($companyAddress)) !!}

@if($gstNo) GSTIN : {{ $gstNo }}
@endif State Name : Tamil Nadu
State Code : 33
@if($companyPhone) Phone : {{ $companyPhone }}
@endif @if($companyEmail) Email : {{ $companyEmail }} @endif
Payment Terms
Credit
Bill No    : {{ $addedInvoice->invoice_id }}
Date        : {{ $addedInvoice->invoice_date ? \Carbon\Carbon::parse($addedInvoice->invoice_date)->format('d/m/Y') : '' }}
Eway Bill No : {{ $ewayBillNo ?? '' }}
Shipping Address:
@if($clientCompany) {{ strtoupper($clientCompany) }}
@endif {{ strtoupper($clientName) }}
{!! nl2br(e($clientAddress)) !!}
@if($clientCity) {{ $clientCity }}
@endif @if($clientPincode) Pin Code : {{ $clientPincode }}
@endif @if($clientPhone) Phone : {{ $clientPhone }}
@endif @if($clientGstin) GSTIN : {{ $clientGstin }}
@endif @if($clientState) State : {{ $clientState }} ({{ $clientStateCode }}) @endif
DISPATCH DOC: {{ $addedInvoice->invoice_id }} DESTINATION: {{ $destination ?? '' }}
MOTOR VEHICLE N: {{ $vehicleNo ?? '' }}
@php $totalQty = 0; $subTotal = 0; $totalTax = 0; $taxBreakdown = []; @endphp @foreach ($addedInvoice->invoiceItems as $index => $item) @php $productName = (isset($settings->native_name_flag) && $settings->native_name_flag == 'A') ? ($item->products->native_name ?? $item->product_name) : ($item->product_name ?? ''); $hsnCode = $item->products->hsn_code ?? ''; $qty = $item->quantity ?? 0; $uom = $item->products->category->unitOfMass->name ?? ''; $rate = $item->price ?? 0; $itemTotal = $item->total ?? 0; $totalQty += $qty; $subTotal += $itemTotal; $itemTaxRate = 0; $itemTaxAmount = 0; if ($addedInvoice->gst == 'Y' && $item->invoiceItemTaxes) { foreach ($item->invoiceItemTaxes as $tax) { $taxAmt = ($itemTotal * $tax->tax) / 100; $itemTaxAmount += $taxAmt; $itemTaxRate += $tax->tax; $taxName = optional($tax->taxes)->name ?? ('Tax ' . $tax->tax . '%'); if (str_contains(strtoupper($taxName), 'CGST')) { $tType = 'CGST'; } elseif (str_contains(strtoupper($taxName), 'SGST')) { $tType = 'SGST'; } elseif (str_contains(strtoupper($taxName), 'IGST')) { $tType = 'IGST'; } else { $tType = $taxName; } if (!isset($taxBreakdown[$tType])) { $taxBreakdown[$tType] = ['rate' => $tax->tax, 'amount' => 0]; } $taxBreakdown[$tType]['amount'] += $taxAmt; } } $totalTax += $itemTaxAmount; $itemTotalWithTax = $itemTotal + $itemTaxAmount; @endphp @endforeach @for ($i = count($addedInvoice->invoiceItems); $i < 10; $i++) @endfor @php $totalDiscount = 0; $grossTotal = $subTotal + $totalTax; if ($addedInvoice->discount_type == 1) { $totalDiscount = $addedInvoice->discount ?? 0; } elseif ($addedInvoice->discount_type == 2) { $totalDiscount = ($grossTotal * ($addedInvoice->discount ?? 0)) / 100; } @endphp @if($totalDiscount > 0) @endif
S.No Description HSN/
SAC
Qty Rate Tax
%
Total
Amount
{{ $index + 1 }} {{ $productName }} {{ $hsnCode }} {{ number_format($qty, 3) }} {{ $uom }} {{ number_format($rate, 2) }} {{ $itemTaxRate > 0 ? number_format($itemTaxRate, 0) : '' }} {{ number_format($itemTotalWithTax, 2) }}
 
Total {{ number_format($totalQty, 3) }} {{ number_format($subTotal + $totalTax, 2) }}
Discount - {{ number_format($totalDiscount, 2) }}
Net Total {{ number_format($grossTotal - $totalDiscount, 2) }}
@if($addedInvoice->gst == 'Y' && count($taxBreakdown) > 0)
@if(isset($taxBreakdown['CGST']) || isset($taxBreakdown['SGST'])) @elseif(isset($taxBreakdown['IGST'])) @endif @php $netRate = 0; $netAmount = 0; @endphp @if(isset($taxBreakdown['CGST']) || isset($taxBreakdown['SGST'])) @php if (isset($taxBreakdown['CGST'])) { $netRate += $taxBreakdown['CGST']['rate']; $netAmount += $taxBreakdown['CGST']['amount']; } if (isset($taxBreakdown['SGST'])) { $netRate += $taxBreakdown['SGST']['rate']; $netAmount += $taxBreakdown['SGST']['amount']; } @endphp @elseif(isset($taxBreakdown['IGST'])) @php $netRate += $taxBreakdown['IGST']['rate']; $netAmount += $taxBreakdown['IGST']['amount']; @endphp @endif
Taxable ValueCGST% AMT SGST% AMTIGST% AMTNET% AMT
{{ number_format($subTotal, 2) }}{{ isset($taxBreakdown['CGST']) ? number_format($taxBreakdown['CGST']['rate'], 2) : '0.00' }} {{ isset($taxBreakdown['CGST']) ? number_format($taxBreakdown['CGST']['amount'], 2) : '0.00' }} {{ isset($taxBreakdown['SGST']) ? number_format($taxBreakdown['SGST']['rate'], 2) : '0.00' }} {{ isset($taxBreakdown['SGST']) ? number_format($taxBreakdown['SGST']['amount'], 2) : '0.00' }} {{ number_format($taxBreakdown['IGST']['rate'], 2) }} {{ number_format($taxBreakdown['IGST']['amount'], 2) }}{{ number_format($netRate, 2) }} {{ number_format($netAmount, 2) }}
@endif @php $redeemValue = (isset($settings->loyalty_config) && $settings->loyalty_config == 'A') ? ($redeemed_value ?? 0) : 0; $netTotal = $grossTotal - $totalDiscount - $redeemValue; $roundedTotal = round($netTotal); $roundedOff = $roundedTotal - $netTotal; @endphp
E. & O.E. Rounded Off :  {{ $roundedOff >= 0 ? '+' : '' }}{{ number_format($roundedOff, 2) }}
Rupees {{ ucwords(amountToWords($roundedTotal)) }} Only Net Amount : {{ number_format($roundedTotal, 2) }}
@if($bankName || $accountNo || $ifscCode) Company's Bank Details:- {{ strtoupper($companyName) }}
@if($bankName) Bank Name:- {{ strtoupper($bankName) }}
@endif @if($accountNo) A/c NO-{{ $accountNo }}
@endif @if($ifscCode) Branch & IFS Code:-{{ $ifscCode }}
@endif @endif
For {{ strtoupper($companyName) }}
Authorised Signatory
@if(isset($settings->declaration))
Declaration: {{ $settings->declaration }}
@endif
{{--
--}}