Tax Invoice
@php $base64Image = base64_encode(file_get_contents(public_path('assets/images/tyres_logo.png'))); @endphp {{-- --}} Logo Tyres Planet PTY LTD

209 Mcroyle St, Wacol 4076
CALL: 07 3144 3131
CALL: 0488 413 131
E-mail: cst@tyresplanet.com.au

@if ($order->shipping_address) @php if ($shippingAddress) { // Saved Shipping Address $shippingFullAddress = $shippingAddress->address; $shippingFullAddress .= $shippingAddress->locationCity ? ', ' . $shippingAddress->locationCity->name : ''; $shippingFullAddress .= $shippingAddress->locationState ? ', ' . $shippingAddress->locationState->name : ''; $shippingFullAddress .= $shippingAddress->locationCountry ? ', ' . $shippingAddress->locationCountry->name : ''; $shippingFullAddress .= $shippingAddress->zip_code ? ', ' . $shippingAddress->zip_code : ''; } else { // JSON Shipping Address with converted names $shippingFullAddress = $shippingJson['address'] ?? ''; $shippingFullAddress .= !empty($shippingJson['city']) ? ', ' . $shippingJson['city'] : ''; $shippingFullAddress .= !empty($shippingJson['state']) ? ', ' . $shippingJson['state'] : ''; $shippingFullAddress .= !empty($shippingJson['country']) ? ', ' . $shippingJson['country'] : ''; $shippingFullAddress .= !empty($shippingJson['postal_code']) ? ', ' . $shippingJson['postal_code'] : ''; } @endphp @if ($order['user_id'] === 104) @else @endif @endif
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)) !!}
{{-- --}} @php $totalQty = 0; $totalAmount = 0; $totalTaxAmount = 0; $finalTotal = 0; $rowCount = 0; @endphp {{-- @if(isset($products)) --}} @foreach ($products as $index => $product) @php $totalQty += $product['quantity']; $subtotal = $product['amount']; $totalAmount += $subtotal; $rowCount++; $tax_percent = $product['tax_percent'] ?? 0; $tax_amount = $product['tax_amount'] ?? 0; $totalTaxAmount += $tax_amount; $finalTotal += $subtotal + $tax_amount; @endphp @endforeach {{-- @else @foreach ($order->orderProducts as $index => $detail) @php $totalQty += $detail->qty; $subtotal = $detail->amount; $totalAmount += $subtotal; $rowCount++; $tax_percent = $detail->tax_percent ?? 0; $tax_amount = $detail->tax_amount ?? 0; $totalTaxAmount += $tax_amount; $finalTotal += $subtotal + $tax_amount; @endphp @endforeach @endif --}} @php $emptyRows = 18 - $rowCount; @endphp @for ($i = 0; $i < $emptyRows; $i++) {{-- --}} @endfor
Sr Item NameHSNQty 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) }}
@php $rounded_total = round($order->sub_total); $rounding_amt = $rounded_total - ($order->sub_total); @endphp {{-- --}}
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
@if ($selectedTerms->isNotEmpty()) @endif {{-- --}}
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!