@php $currency_symbol = !empty($receipt_details->currency['symbol']) ? $receipt_details->currency['symbol'] : (!empty($receipt_details->currency_symbol) ? $receipt_details->currency_symbol : 'Rs'); if (trim($currency_symbol) != '') { $currency_symbol = trim($currency_symbol); } else { $currency_symbol = 'Rs'; } $item_lines = []; $service_lines = []; $total_item_discount = 0; $spare_parts_total = 0; $service_total = 0; if (!empty($receipt_details->lines)) { foreach ($receipt_details->lines as $line) { $is_stock = isset($line['enable_stock']) && $line['enable_stock'] == 1; // Calculate line discount $line_disc = 0; if (!empty($line['line_discount_uf'])) { $line_disc = (float)$line['line_discount_uf'] * (float)($line['quantity_uf'] ?? 1); } elseif (!empty($line['total_line_discount'])) { $line_disc = (float)str_replace(',', '', preg_replace('/[^0-9.]/', '', $line['total_line_discount'])); } $total_item_discount += $line_disc; // Calculate line subtotal $line_subtotal = 0; if (!empty($line['line_total_uf'])) { $line_subtotal = (float)$line['line_total_uf']; } elseif (!empty($line['line_total'])) { $line_subtotal = (float)str_replace(',', '', preg_replace('/[^0-9.]/', '', $line['line_total'])); } else { $line_subtotal = (float)($line['quantity_uf'] ?? 1) * (float)($line['unit_price_inc_tax_uf'] ?? $line['unit_price_uf'] ?? 0); } if ($is_stock) { $item_lines[] = $line; $spare_parts_total += $line_subtotal; } else { $service_lines[] = $line; $service_total += $line_subtotal; } } } @endphp
|
Invoice No. {{ $receipt_details->invoice_no }}
Customer {{ $receipt_details->customer_name ?? '' }}
@if(!empty($receipt_details->repair_serial_no))
Vehicle Number : {{ $receipt_details->repair_serial_no }}
@endif
@if(!empty($receipt_details->current_mileage) || !empty($receipt_details->next_mileage))
@if(!empty($receipt_details->current_mileage))
Current Mileage: {{ $receipt_details->current_mileage }}
@endif
@if(!empty($receipt_details->next_mileage))
Next Mileage: {{ $receipt_details->next_mileage }}
@endif
@endif
|
Date {{ $receipt_details->invoice_date }}
@if(!empty($receipt_details->repair_brand))
V/C {{ $receipt_details->repair_brand }}
@endif
@if(!empty($receipt_details->repair_device))
{{ $receipt_details->repair_device }}
@endif
@if(!empty($receipt_details->repair_model_no))
V/M {{ $receipt_details->repair_model_no }}
@endif
|
| Items | ||||
|---|---|---|---|---|
| Product | Quantity | Unit Price | Discount | Subtotal |
|
{{ $line['name'] }}
@if(!empty($line['variation']) && $line['variation'] != 'DUMMY')
{{ $line['variation'] }}
@endif
@if(!empty($line['sub_sku']))
({{ $line['sub_sku'] }})
@endif
@if(!empty($line['sell_line_note']))
{{ $line['sell_line_note'] }} @endif @if(!empty($line['lot_number'])) {{ $line['lot_number_label'] ?? 'Lot' }}: {{ $line['lot_number'] }} @endif @if(!empty($line['product_expiry'])) {{ $line['product_expiry_label'] ?? 'Exp' }}: {{ $line['product_expiry'] }} @endif |
{{ $line['quantity'] }} {{ $line['units'] ?? '' }} | {{ number_format($unit_p, 2) }} | {{ number_format($disc, 2) }} | {{ number_format($sub, 2) }} |
| Services | ||||
|---|---|---|---|---|
| Product | Quantity | Unit Price | Discount | Subtotal |
|
{{ $line['name'] }}
@if(!empty($line['variation']) && $line['variation'] != 'DUMMY')
{{ $line['variation'] }}
@endif
@if(!empty($line['sell_line_note']))
{{ $line['sell_line_note'] }} @endif |
{{ $line['quantity'] }} {{ $line['units'] ?? '' }} | {{ number_format($unit_p, 2) }} | {{ number_format($disc, 2) }} | {{ number_format($sub, 2) }} |