|
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: {{ $orderData['order_number'] }} | Payment Mode: {{ $orderData['payment_method'] }} |
| Invoice Date: {{ $orderData['order_date'] }} | Payment Status: {{ ucwords(str_replace('_', ' ', $orderData['payment_status'])) }} |
| Customer: Cash Sale | |
| Bill To | Ship To |
|
@php
// 1) Choose source (billing → shipping → JSON)
$billSource = $billingAddress ?: $shippingAddress ?: null;
// 2) JSON Address fallback ONLY if no saved billing
$billJson = (!$billingAddress && $shippingJson) ? $shippingJson : [];
// 3) Build full address
if ($billSource) {
// Address from DB
$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 {
// Address from JSON
// Convert IDs to names
$jsonCity = !empty($billJson['city']) ? \Botble\Location\Models\City::find($billJson['city']) : null;
$jsonState = !empty($billJson['state']) ? \Botble\Location\Models\State::find($billJson['state']) : null;
$jsonCountry = !empty($billJson['country']) ? \Botble\Location\Models\Country::find($billJson['country']) : null;
$billFullAddress = $billJson['address'] ?? '';
$billFullAddress .= $jsonCity ? ', ' . $jsonCity->name : '';
$billFullAddress .= $jsonState ? ', ' . $jsonState->name : '';
$billFullAddress .= $jsonCountry ? ', ' . $jsonCountry->name : '';
$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)
@php
$shippingFullAddress = $shippingAddress->address;
if ($shippingAddress->locationCity) {
$shippingFullAddress .= ', ' . $shippingAddress->locationCity->name;
}
if ($shippingAddress->locationState) {
$shippingFullAddress .= ', ' . $shippingAddress->locationState->name;
}
if ($shippingAddress->locationCountry) {
$shippingFullAddress .= ', ' . $shippingAddress->locationCountry->name;
}
if ($shippingAddress->zip_code) {
$shippingFullAddress .= ', ' . $shippingAddress->zip_code;
}
@endphp
Name: {{ $shippingAddress->name ?? '-' }} Phone: {{ $shippingAddress->phone ?? '-' }} Email: {{ $shippingAddress->email ?? '-' }} Address: {!! nl2br(e($shippingFullAddress)) !!} @else Name: {{ $orderData['shipping_first_name'] ?? '-' }} {{ $orderData['shipping_last_name'] ?? '' }} Phone: {{ $orderData['shipping_phone'] ?? '-' }} Email: {{ $orderData['shipping_email'] ?? '-' }} Address: {{ $orderData['shipping_address_1'] ?? '' }} @endif |
| Sr | Item Name | {{--HSN | --}}Qty | Rate | Subtotal | Tax | Total | |
| % | Amount | |||||||
| {{ $index + 1 }} | {{ $product['name'] }} | {{--{{ $product['hsn'] ?? '-' }} | --}}{{ $product['quantity'] }} | ${{ number_format($product['price'], 2) }} | ${{ number_format($subtotal, 2) }} | {{ $taxPercent > 0 ? $taxPercent . '%' : '0%' }} | ${{ number_format($taxAmount, 2) }} | ${{ number_format($lineTotal, 2) }} |
| {{-- | --}} | |||||||
| Sub-Total | {{ $totalQty }} | - | ${{ number_format($totalAmount, 2) }} | - | ${{ number_format($totalTaxAmount, 2) }} | ${{ number_format($finalTotal, 2) }} | ||
| Summary | Amount | |
| Tax Amount: | ${{ number_format($orderData['tax_amount'], 2) }} | |
| Discount Amount: | ${{ number_format($orderData['discount_amount'], 2) }} | |
| Charges Amount: | ${{ number_format($orderData['total_charges_amount'], 2) }} | |
| Shipping Amount: | ${{ number_format($orderData['shipping_amount'], 2) }} | |
| Round Off : | ${{ number_format($rounding_amt, 2) }} |
| Invoice Total in Word | Total Amount: | ${{ number_format($orderData['total'], 2) }} |
| {{ ucwords(numberToWords($orderData['total'])) }} Only | ||
|
Terms and Conditions:
@foreach ($terms as $term)
@if (!empty($term['description']))
@php
// Decode HTML entities and remove tags
$description = html_entity_decode(strip_tags($term['description']));
// Split by new lines or line breaks, not periods
$lines = array_values(array_filter(
array_map('trim', preg_split("/\r\n|\n|\r/", $description))
));
@endphp
{{-- Loop through each line and print bullet point --}}
@foreach ($lines as $line)
• {{ ltrim($line, '-• ') }}
@endforeach
@endif
@endforeach
|
||
| Receive Signature | Authorised Signature | |
| Thank You For Business With Us! | ||