@if ( !empty($company['companies_logo']) && file_exists(public_path('uploads/companies_logo/' . $company['companies_logo']))) Company Logo @else SMA @endif

Tax Invoice

{{ $company['company_name'] }}

@if ($company['address_1'])

{{ $company['address_1'] }} {{ $company['address_2'] ? ', ' . $company['address_2'] : '' }}

@endif @if ($company['city'] || $company['state'] || $company['pincode'])

{{ $company['city'] ? $company['city'] . ', ' : '' }}{{ $company['state'] ? $company['state'] : '' }}{{ $company['pincode'] ? ' - ' . $company['pincode'] : '' }}

@endif @if ($company['tax_no'] || $company['pan_no'])

{{ $company['tax_no'] ? 'GSTIN: ' . $company['tax_no'] : '' }}{{ $company['pan_no'] ? ' | PAN: ' . $company['pan_no'] : '' }}

@endif @if ($company['mobile_no'])

MO: {{ $company['mobile_no'] }}

@endif

Date: {{ $sale['date'] }}

Invoice No: {{ $sale['bill_no'] }}

Term: {{ $sale['terms'] == 1 ? 'Cash' : ($sale['terms'] == 2 ? 'Credit' : '-') }}

@php $customer = $sale['customer_details']; @endphp @if ($customer) @endif
Bill To:
{{ $sale['account']['name'] ?? '' }}
@if (!empty($sale['account']['address_1'])) {{ $sale['account']['address_1'] }} {{ !empty($sale['account']['address_2']) ? ', ' . $sale['account']['address_2'] : '' }}
@endif @if (!empty($sale['account']['city']) || !empty($sale['account']['state']) || !empty($sale['account']['pincode'])) {{ !empty($sale['account']['city']) ? $sale['account']['city'] . ', ' : '' }} {{ !empty($sale['account']['pincode']) ? ' - ' . $sale['account']['pincode'] : '' }} {{ !empty($sale['account']['state']) ? $sale['account']['state'] : '' }}
@endif @if (!empty($sale['account']['mobile'])) Contact NO. :{{ $sale['account']['mobile'] }} {{ !empty($sale['account']['mobile_numbar']) ? ', ' . $sale['account']['mobile_numbar'] : '' }}
@endif @if (!empty($sale['account']['gst_no'])) State Code: {{ $sale['account']['state_code'] ?? '' }}
GSTIN: {{ $sale['account']['gst_no'] }} @endif
Ship To:
{{ $customer['customer_name'] }}
@if ($customer['Address_1']) {{ $customer['Address_1'] }}{{ $customer['Address_2'] ? ', ' . $customer['Address_2'] : '' }}
@endif @if ($customer['village'] || $customer['pin_code']) {{ $customer['village'] }}{{ $customer['pin_code'] ? ' - ' . $customer['pin_code'] : '' }}
@endif @if ($customer['state']) {{ $customer['state'] }}
@endif @if ($customer['state_code']) State Code: {{ $customer['state_code'] }}
@endif @if ($customer['phone_no'] || $customer['mobile_no']) Contact NO. : {{ $customer['phone_no'] }}{{ $customer['mobile_no'] ? ' - ' . $customer['mobile_no'] : '' }}
@endif @if ($customer['gstin']) GSTIN: {{ $customer['gstin'] }} @endif
@foreach ($sale['bill_items'] as $index => $item) @endforeach
Sl. Material Description HSN Qty Unit MRP Rate Taxable Amt Disc% Disc Amt BOI% BOI Amt Gross Tax% Tax Amt Total
{{ $index + 1 }} {{ $item['product']['product_name'] }}
(Part No: {{ $item['product_part_no'] }})
{{ $item['barcode'] ?: 'N/A' }} {{ number_format($item['qty'], 2) }} {{ $item['unit_id'] == 2 ? 'Nos' : 'Unit' }} {{ number_format($item['mrp'], 2) }} {{ number_format($item['rate'], 2) }} {{ number_format($item['basic_amt'], 2) }} {{ number_format($item['dis_per'], 2) }}% {{ number_format($item['dis_amt'], 2) }} 0% 0.00 {{ number_format($item['basic_amt'], 2) }} {{ number_format($item['tax_per'], 2) }}% {{ number_format($item['tax_amt'], 2) }} {{ number_format($item['net_amount'], 2) }}
Tax % Wise Net Tax Summary
@php $taxableTotal = $sale['basic_amount']; $cgstTotal = $sale['tax_amount'] / 2; $sgstTotal = $sale['tax_amount'] / 2; $igstTotal = 0; @endphp
Tax % Taxable CGST SGST IGST
{{ number_format($sale['bill_items'][0]['tax_per'], 2) }}% {{ number_format($taxableTotal, 2) }} {{ number_format($cgstTotal, 2) }} {{ number_format($sgstTotal, 2) }} {{ number_format($igstTotal, 2) }}
Total {{ number_format($taxableTotal, 2) }} {{ number_format($cgstTotal, 2) }} {{ number_format($sgstTotal, 2) }} {{ number_format($igstTotal, 2) }}
Amount in Words
@php function numberToWords($number) { $words = [ 'Zero', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen', ]; $tens = [ '', '', 'Twenty', 'Thirty', 'Forty', 'Fifty', 'Sixty', 'Seventy', 'Eighty', 'Ninety', ]; $thousands = ['', 'Thousand', 'Million', 'Billion']; if ($number == 0) { return 'Zero'; } $number = round($number, 2); $integerPart = floor($number); $decimalPart = round(($number - $integerPart) * 100); $result = ''; $chunks = []; while ($integerPart > 0) { $chunks[] = $integerPart % 1000; $integerPart = floor($integerPart / 1000); } for ($i = count($chunks) - 1; $i >= 0; $i--) { $chunk = $chunks[$i]; if ($chunk == 0) { continue; } $hundreds = floor($chunk / 100); $remainder = $chunk % 100; $tensPart = floor($remainder / 10); $onesPart = $remainder % 10; if ($hundreds > 0) { $result .= $words[$hundreds] . ' Hundred '; } if ($remainder < 20 && $remainder > 0) { $result .= $words[$remainder] . ' '; } elseif ($tensPart > 0) { $result .= $tens[$tensPart] . ' '; if ($onesPart > 0) { $result .= $words[$onesPart] . ' '; } } if ($i > 0 && $chunk > 0) { $result .= $thousands[$i] . ' '; } } $result .= 'Rupees'; if ($decimalPart > 0) { $result .= ' and '; if ($decimalPart < 20) { $result .= $words[$decimalPart]; } else { $tensPart = floor($decimalPart / 10); $onesPart = $decimalPart % 10; $result .= $tens[$tensPart]; if ($onesPart > 0) { $result .= ' ' . $words[$onesPart]; } } $result .= ' Paise'; } return $result . ' Only'; } echo numberToWords($sale['total_net_amt']); @endphp
Total Payable:
Gross Amount {{ number_format($sale['gross_amount'], 2) }}
Discount {{ number_format($sale['discount_amount'], 2) }}
Tax {{ number_format($sale['tax_amount'], 2) }}
Net Amount {{ number_format($sale['total_net_amt'], 2) }}
Round Off {{ number_format($sale['bill_round_off'], 2) }}
Advance {{ number_format($sale['advance'], 2) }}
Balance {{ number_format($sale['balance'], 2) }}
@if (!empty($sale['account']['ledger_balance']))

Ledger Balance: {{ $sale['account']['ledger_balance'] }}

@endif
@if ($company['bank_detail'])
Bank Details:
@if ($company['upi_link']) @endif
Bank Details: {{ $company['bank_detail'] }}
UPI ID: {{ $company['upi_link'] }}
@endif
@if (!empty($company['upi_link']) && !empty($company['company_name']) && !empty($sale['total_net_amt']))
UPI Payment QR Code

Scan to Pay ₹{{ number_format($sale['total_net_amt'], 2) }}

{{-- ✅ Ledger Balance Show --}} @if (!empty($sale['account']['ledger_balance']))

Ledger Balance: {{ $sale['account']['ledger_balance'] }}

@endif
@endif
Payment Terms & Conditions:
  • Payment should be made within 7 days from the date of invoice.
  • Late payments may attract 1.5% interest per month.
  • UPI / NEFT / IMPS transfers are accepted.
  • Cheque payments are subject to clearance.
For {{ $company['company_name'] }}
Authorised Signatory