|
Tax Invoice
|
|
@php
$base64Image = base64_encode(file_get_contents(public_path('assets/images/tyres_logo.png')));
@endphp
{{-- |
Tyres Planet PTY LTD
209 Mcroyle St, Wacol 4076 CALL: 07 3144 3131 CALL: 0488 413 131 E-mail: cst@tyresplanet.com.au |
||||||||||
| Invoice No : {{ $order->code }} | Payment Mode: {{ $order->payment_method ?? '-' }} |
| Invoice Date : {{ \Carbon\Carbon::parse($order->created_at)->format('d-m-Y') }} | Payment Status: {{ ucwords(str_replace('_', ' ', $order->payment_status)) }} |
| Customer: Cash Sale | |
| Bill To | Ship To |
|
@php
// If billing doesn't exist → use shipping as billing
$billSource = $billingAddress ?: $shippingAddress ?: null;
$billJson = !$billingAddress ? ($shippingJson ?? []) : [];
if ($billSource) {
// Saved DB Address
$billFullAddress = $billSource->address;
$billFullAddress .= $billSource->locationCity ? ', ' . $billSource->locationCity->name : '';
$billFullAddress .= $billSource->locationState ? ', ' . $billSource->locationState->name : '';
$billFullAddress .= $billSource->locationCountry ? ', ' . $billSource->locationCountry->name : '';
$billFullAddress .= $billSource->zip_code ? ', ' . $billSource->zip_code : '';
} else {
// JSON address (shipping used as fallback)
$billFullAddress = $billJson['address'] ?? '';
$billFullAddress .= !empty($billJson['city']) ? ', ' . $billJson['city'] : '';
$billFullAddress .= !empty($billJson['state']) ? ', ' . $billJson['state'] : '';
$billFullAddress .= !empty($billJson['country']) ? ', ' . $billJson['country'] : '';
$billFullAddress .= !empty($billJson['postal_code']) ? ', ' . $billJson['postal_code'] : '';
}
@endphp
@if( $customer['company_name'] )
Company: {{ $customer['company_name'] ?? '-' }} @else {{-- Bill To Details --}} Name: {{ $billSource->name ?? ($billJson['name'] ?? '-') }} @endif Phone: {{ $billSource->phone ?? ($billJson['phone'] ?? '-') }} Email: {{ $billSource->email ?? ($billJson['email'] ?? '-') }} Address: {!! nl2br(e($billFullAddress)) !!} |
@if($shippingAddress)
Name: {{ $shippingAddress->name }} Phone: {{ $shippingAddress->phone }} Email: {{ $shippingAddress->email }} @else Name: {{ $shippingJson['name'] }} Phone: {{ $shippingJson['phone'] }} Email: {{ $shippingJson['email'] }} @endif Address: {!! nl2br(e($shippingFullAddress)) !!} |
| Sr | Item Name | {{--HSN | --}}Qty | Rate | Subtotal | Tax | Total | |
| % | Amount | |||||||
| {{ $index + 1 }} | {{ $product['name'] ?? '-' }} | {{ $product['quantity'] }} | ${{ number_format($product['price'], 2) }} | ${{ number_format($subtotal, 2) }} | {{ $tax_percent > 0 ? $tax_percent . '%' : '0%' }} | ${{ number_format($tax_amount, 2) }} | ${{ number_format($subtotal + $tax_amount, 2) }} | |
| {{ $index + 1 }} | {{ $detail->product_name ?? '-' }} | {{ $detail->qty }} | ${{ number_format($detail->price, 2) }} | ${{ number_format($subtotal, 2) }} | {{ $tax_percent > 0 ? $tax_percent . '%' : '0%' }} | ${{ number_format($tax_amount, 2) }} | ${{ number_format($subtotal + $tax_amount, 2) }} | |
| {{-- | --}} | |||||||
| Sub-Total | {{ $totalQty }} | - | ${{ number_format($totalAmount, 2) }} | - | ${{ number_format($finalTotal, 2) }} | |||
| Summary | Amount | |
| Tax Amount : | ${{ number_format($totalTaxAmount ?? $order->tax_amount ?? 0, 2) }} | |
| Discount Amount : | ${{ number_format($order->discount_total_amount ?? 0, 2) }} | |
| Charges Amount: | ${{ number_format($order->charges_totalamount ?? 0, 2) }} | |
| Shipping Amount: | ${{ number_format($order->shipping_amount ?? 0, 2) }} | |
| Round Off : | ${{ number_format($rounding_amt, 2) }} |
| Invoice Total in Word | Total Amount : | ${{ number_format($order->sub_total, 2) }} |
| {{ convert_number_to_words($rounded_total) }} Only |
|
Terms and Conditions:
@foreach ($selectedTerms as $term)
@php
// Split each line properly, remove empty lines
$lines = array_values(array_filter(
array_map('trim', preg_split("/\r\n|\n|\r/", strip_tags($term->description)))
));
@endphp
{{-- Print all lines equally aligned --}}
@foreach ($lines as $line)
• {{ ltrim($line, '-• ') }}
@endforeach
@endforeach
|
|||||||||||
| Receive Signature | Authorised Signature | ||||||||||
| Thank You For Business With Us! | |||||||||||