{{-- Company Logo --}}
Company Logo @php $companyGst = $invoice->companyGst; $customerGstin = $invoice->customerGstin; @endphp
{{ strtoupper($invoice->company->company_name ?? 'Company Name') }}
@if($companyGst) {{ $companyGst->address_line1 ?? '' }}@if($companyGst->address_line2), {{ $companyGst->address_line2 }}@endif
{{ $companyGst->city ?? '' }}@if($companyGst->state), {{ $companyGst->state->name ?? '' }}@endif {{ $companyGst->pincode ?? '' }} @else Company address not configured @endif
GSTIN: {{ $companyGst->gstin_number ?? '-' }}
State Name: {{ $companyGst && $companyGst->state ? ($companyGst->state->name ?? '-') : '-' }}, Code: {{ $companyGst && $companyGst->state ? ($companyGst->state->state_code ?? '-') : '-' }}
Contact: {{ $companyGst->email ?? ($invoice->company->email ?? '-') }} @if(!empty($companyGst?->phone) || !empty($invoice->company?->phone)) , {{ $companyGst->phone ?? $invoice->company->phone }} @endif
{{-- IRN and Ack Details (for e-invoice) --}} @if(!empty($invoice->irn))
IRN: {{ $invoice->irn }}
Ack No.: {{ $invoice->ack_no ?? 'N/A' }}
Ack Date: {{ $invoice->ack_date ? \Carbon\Carbon::parse($invoice->ack_date)->format('d-M-y') : 'N/A' }}
@endif
{{-- QR Code (for e-invoice) --}} @if(!empty($invoice->irn))
QR CODE
@endif
Tax Invoice
@php $firstIssue = $stockIssues->first(); $refNo = $firstIssue->reference_number ?? null; $refDate = $firstIssue->reference_date ?? null; if (!$refNo && isset($salesOrder) && $salesOrder) { $refNo = $salesOrder->so_number ?? null; $refDate = $salesOrder->so_date ?? null; } $deliveryNoteNos = $stockIssues->pluck('document_number')->filter()->implode(', '); $deliveryNoteDates = $stockIssues->pluck('posting_date')->filter()->map(function ($d) { try { return \Carbon\Carbon::parse($d)->format('d-M-y'); } catch (\Throwable $e) { return $d; } })->unique()->implode(', '); $buyerOrderNo = isset($salesOrder) && $salesOrder ? ($salesOrder->customer_po_number ?? null) : null; if (empty($buyerOrderNo)) { $buyerOrderNo = 'Direct'; } $termsOfDelivery = isset($salesOrder) && $salesOrder ? ($salesOrder->delivery_terms ?? null) : null; if (empty($termsOfDelivery)) { $termsOfDelivery = '-'; } $destination = '-'; if (!empty($shippingAddress)) { $destination = trim(implode(', ', array_filter([ $shippingAddress->city ?? null, $shippingAddress->state ?? null, ]))) ?: '-'; } elseif (!empty($invoice->shipping_address)) { $destination = $invoice->shipping_address; } @endphp
Invoice No. {{ $invoice->invoice_number }}
Dated {{ $invoice->invoice_date ? $invoice->invoice_date->format('d-M-y') : '-' }}
Delivery Note {{ $deliveryNoteNos !== '' ? $deliveryNoteNos : '-' }}
Mode / Terms of Payment {{ $invoice->payment_terms ?? 'As per agreement' }}
Reference No. & Date {{ $refNo ? $refNo : '-' }} @if($refDate) / {{ \Carbon\Carbon::parse($refDate)->format('d-M-y') }} @endif
Buyer's Order No. {{ $buyerOrderNo }}
Dispatch Document No. {{ $deliveryNoteNos !== '' ? $deliveryNoteNos : '-' }}
Delivery Note Date {{ $deliveryNoteDates !== '' ? $deliveryNoteDates : '-' }}
Destination {{ $destination }}
Terms of Delivery {{ $termsOfDelivery }}
Buyer (Bill to)
{{ strtoupper($invoice->customer->customer_name ?? 'Customer Name') }}
@if($billingAddress) {{ $billingAddress->address_line1 ?? '' }}@if($billingAddress->address_line2), {{ $billingAddress->address_line2 }}@endif
{{ $billingAddress->city ?? '' }}, {{ $billingAddress->state ?? '' }} {{ $billingAddress->pincode ?? '' }} @else Customer Address @endif
GSTIN/UIN: {{ $customerGstin->gstin_number ?? 'N/A' }}
State Name: {{ $customerGstin && $customerGstin->state ? ($customerGstin->state->name ?? 'State') : 'State' }}, Code: {{ $customerGstin->state_code ?? 'XX' }}
Consignee (Ship to)
{{ strtoupper($invoice->customer->customer_name ?? 'Customer Name') }}
@if($shippingAddress) {{ $shippingAddress->address_line1 ?? '' }}@if($shippingAddress->address_line2), {{ $shippingAddress->address_line2 }}@endif
{{ $shippingAddress->city ?? '' }}, {{ $shippingAddress->state ?? '' }} {{ $shippingAddress->pincode ?? '' }} @else Shipping Address @endif
GSTIN/UIN: {{ $customerGstin->gstin_number ?? 'N/A' }}
State Name: {{ $customerGstin && $customerGstin->state ? ($customerGstin->state->name ?? 'State') : 'State' }}, Code: {{ $customerGstin->state_code ?? 'XX' }}
@foreach($invoice->lines as $line) @endforeach
Sl
No
Description of Goods HSN/SAC Quantity Rate per Disc.
%
Amount
{{ $line->line_number }} {{ $line->description ?? $line->variant->variant_display_name ?? $line->variant->variant_name ?? 'Product' }} {{ $line->variant->product->hsn_code ?? '' }} {{ number_format($line->qty, 2, '.', '') }} {{ $line->uom->uom_code ?? '' }} {{ number_format($line->rate, 2) }} {{ $line->uom->uom_code ?? '' }} {{ $line->discount_percent > 0 ? number_format($line->discount_percent, 2) : '' }} {{ number_format($line->taxable_amount, 2) }}
Total {{ $stockIssues->isNotEmpty() ? $stockIssues->pluck('document_number')->filter()->implode(', ') : '' }} {{ number_format($invoice->lines->sum('qty'), 2, '.', '') }} ₹ {{ number_format($invoice->taxable_amount, 2) }}
{{-- Tax Summary Table --}} @if($invoice->tax_type === 'INTRASTATE') @else @endif @if($invoice->tax_type === 'INTRASTATE') @endif @php $taxGroups = $invoice->lines->groupBy(function($line) { return $line->variant->product->hsn_code ?? 'N/A'; }); @endphp @foreach($taxGroups as $hsn => $lines) @php $taxableValue = $lines->sum('taxable_amount'); $cgstAmount = $lines->sum('cgst_amount'); $sgstAmount = $lines->sum('sgst_amount'); $igstAmount = $lines->sum('igst_amount'); $totalTax = $cgstAmount + $sgstAmount + $igstAmount; $cgstRate = $lines->first()->cgst_rate ?? 0; $sgstRate = $lines->first()->sgst_rate ?? 0; $igstRate = $lines->first()->igst_rate ?? 0; @endphp @if($invoice->tax_type === 'INTRASTATE') @else @endif @endforeach @if($invoice->tax_type === 'INTRASTATE') @else @endif
HSN/SAC Taxable
Value
Central Tax State TaxIntegrated TaxTotal
Tax Amount
Rate AmountRate Amount
{{ $hsn }} {{ number_format($taxableValue, 2) }}{{ number_format($cgstRate, 2) }}% {{ number_format($cgstAmount, 2) }} {{ number_format($sgstRate, 2) }}% {{ number_format($sgstAmount, 2) }}{{ number_format($igstRate, 2) }}% {{ number_format($igstAmount, 2) }}{{ number_format($totalTax, 2) }}
Total {{ number_format($invoice->taxable_amount, 2) }} {{ number_format($invoice->cgst_amount, 2) }} {{ number_format($invoice->sgst_amount, 2) }} {{ number_format($invoice->igst_amount, 2) }}{{ number_format($invoice->cgst_amount + $invoice->sgst_amount + $invoice->igst_amount, 2) }}
Taxable Amount ₹ {{ \App\Helpers\NumberHelper::formatIndianNumber($invoice->taxable_amount, 2) }}
@if($invoice->tax_type === 'INTRASTATE')
CGST ₹ {{ \App\Helpers\NumberHelper::formatIndianNumber($invoice->cgst_amount, 2) }}
SGST ₹ {{ \App\Helpers\NumberHelper::formatIndianNumber($invoice->sgst_amount, 2) }}
@else
IGST ₹ {{ \App\Helpers\NumberHelper::formatIndianNumber($invoice->igst_amount, 2) }}
@endif
Total ₹ {{ \App\Helpers\NumberHelper::formatIndianNumber($invoice->total_amount, 2) }}
Amount Chargeable (in words)
INR {{ \App\Helpers\NumberHelper::amountToWords($invoice->total_amount) }}
Tax Amount (in words):
INR {{ \App\Helpers\NumberHelper::amountToWords($invoice->cgst_amount + $invoice->sgst_amount + $invoice->igst_amount) }}
for {{ strtoupper($invoice->company->company_name ?? 'Company Name') }}
Authorised Signatory
This is a Computer Generated Invoice