@php use App\Models\Setting; use App\Support\AddressFormatter; use App\Support\AmountInWords; $company = [ 'name' => Setting::get('company_name', config('app.name')), 'address' => Setting::get('company_address', ''), 'owner' => Setting::get('company_owner', ''), 'pincode' => Setting::get('company_pincode', ''), 'phone' => Setting::get('company_phone', ''), 'email' => Setting::get('company_email', ''), 'gstin' => Setting::get('company_gstin', ''), 'state' => Setting::get('company_state', ''), 'state_code' => Setting::get('company_state_code', ''), ]; $companyAddress = collect([ $company['owner'] ? "({$company['owner']})" : null, AddressFormatter::flow($company['address']), ])->filter()->implode(', '); if ($company['pincode']) { $companyAddress = trim($companyAddress.' - '.$company['pincode'], ' -'); } $customerAddress = AddressFormatter::flow($sale->customer->address); $bank = [ 'name' => Setting::get('bank_name', ''), 'account' => Setting::get('bank_account_number', ''), 'ifsc' => Setting::get('bank_ifsc', ''), 'branch' => Setting::get('bank_branch', ''), 'swift' => Setting::get('bank_swift', ''), ]; $terms = Setting::get('payment_terms', ''); $declaration = Setting::get('invoice_declaration', 'We declare that this invoice shows the actual price of the goods described and that all particulars are true and correct.'); $interState = $sale->isInterState(); $summary = $sale->taxSummary(); $hasBank = collect($bank)->filter()->isNotEmpty(); @endphp {{ $sale->invoice_number }} — {{ $company['name'] }} @unless ($forPdf ?? false)
← Back to sale Download PDF Download Excel
@endunless

TAX INVOICE

{{ $company['name'] }}
@if ($companyAddress)
{{ $companyAddress }}
@endif
@if ($company['gstin'])GSTIN/UIN: {{ $company['gstin'] }}@endif @if ($company['state'])  |  State: {{ $company['state'] }}@if ($company['state_code']), Code: {{ $company['state_code'] }}@endif @endif @if ($company['phone'])  |  Mob: {{ $company['phone'] }}@endif @if ($company['email'])  |  {{ $company['email'] }}@endif
Buyer (Bill to)
{{ $sale->customer->name }}
@if ($sale->customer->contact_person){{ $sale->customer->contact_person }}
@endif @if ($customerAddress){{ $customerAddress }}
@endif {{ collect([$sale->customer->city, $sale->customer->state, $sale->customer->pincode])->filter()->implode(', ') }}
@if ($sale->customer->gstin)GSTIN/UIN: {{ $sale->customer->gstin }}
@endif @if ($sale->customer->state)State Name: {{ $sale->customer->state }}@if ($sale->customer->state_code), Code: {{ $sale->customer->state_code }}@endif @endif
Invoice Details
Invoice No.: {{ $sale->invoice_number }}
Dated: {{ $sale->sale_date->format('d-M-Y') }}
@if ($sale->place_of_supply)Place of Supply: {{ $sale->place_of_supply }}
@endif Supply: {{ $interState ? 'Inter-State (IGST)' : 'Intra-State (CGST + SGST)' }}
@if ($sale->price_tier)Price tier: {{ $sale->price_tier }}
@endif @if ($terms)Terms: {{ $terms }}
@endif Dispatched from: {{ $sale->warehouse->name }}
@foreach ($sale->items as $item) @endforeach @if ($interState) @else @endif
Sl
No.
Description of Goods HSN GST
Rate
Quantity Rate per Amount
{{ $loop->iteration }} {{ $item->product->name }} {{ $item->hsn_code ?: '—' }} {{ rtrim(rtrim(number_format((float) $item->tax_rate, 2), '0'), '.') }} % {{ $item->quantity }} {{ $item->product->unit ?: 'PCS' }} {{ number_format((float) $item->unit_price, 2) }} {{ $item->product->unit ?: 'PCS' }} {{ number_format((float) $item->line_total, 2) }}
Total {{ $sale->items->sum('quantity') }} PCS {{ number_format((float) $sale->subtotal, 2) }}
IGST{{ number_format((float) $sale->igst_total, 2) }}
CGST{{ number_format((float) $sale->cgst_total, 2) }}
SGST{{ number_format((float) $sale->sgst_total, 2) }}
Round Off{{ number_format((float) $sale->round_off, 2) }}
Grand Total ₹ {{ number_format((float) $sale->total, 2) }}

Amount Chargeable (in words): {{ AmountInWords::rupees((float) $sale->total) }} E. & O.E

@if ($interState) @else @endif @foreach ($summary as $bucket) @php $tax = $bucket['cgst'] + $bucket['sgst'] + $bucket['igst']; @endphp @if ($interState) @else @endif @endforeach @if ($interState) @else @endif
GST Rate Taxable ValueIGST RateIGST AmtCGST RateCGST AmtSGST RateSGST AmtTotal Tax
{{ rtrim(rtrim(number_format($bucket['rate'], 2), '0'), '.') }}% {{ number_format($bucket['taxable'], 2) }}{{ rtrim(rtrim(number_format($bucket['rate'], 2), '0'), '.') }}% {{ number_format($bucket['igst'], 2) }}{{ rtrim(rtrim(number_format($bucket['rate'] / 2, 2), '0'), '.') }}% {{ number_format($bucket['cgst'], 2) }} {{ rtrim(rtrim(number_format($bucket['rate'] / 2, 2), '0'), '.') }}% {{ number_format($bucket['sgst'], 2) }}{{ number_format($tax, 2) }}
Total {{ number_format((float) $sale->subtotal, 2) }}{{ number_format((float) $sale->igst_total, 2) }}{{ number_format((float) $sale->cgst_total, 2) }} {{ number_format((float) $sale->sgst_total, 2) }}{{ number_format((float) $sale->tax_total, 2) }}
@if ($hasBank) Company's Bank Details
A/c Holder's Name: {{ $company['name'] }}
@if ($bank['name'])Bank Name: {{ $bank['name'] }}
@endif @if ($bank['account'])A/c No.: {{ $bank['account'] }}
@endif @if ($bank['branch'] || $bank['ifsc'])Branch & IFS Code: {{ collect([$bank['branch'], $bank['ifsc']])->filter()->implode(' & ') }}
@endif @if ($bank['swift'])SWIFT Code: {{ $bank['swift'] }}@endif @endif @if ($terms)

Terms of Payment: {{ $terms }}@endif
for {{ $company['name'] }}


Authorised Signatory
Declaration: {{ $declaration }}

This is a Computer Generated Invoice