@extends('print.layout') @section('title', 'Proforma_Invoice_' . ($order['order_no'] ?? 'N/A') . '_' . ($order['order_date'] ?? date('d-m-Y'))) @section('content')
Proforma Invoice
{{-- Customer Information --}}
Customer Name: {{ $order['fname'] ?? 'N/A' }} {{ $order['lname'] ?? '' }}
@if(isset($order['address']) && !empty($order['address']))
Address: {{ $order['address'] }}
@endif {{-- Company info (no title) --}} @if(isset($company)) @if(!empty($company->ntn))
NTN: {{ $company->ntn }}
@endif @if(!empty($company->rex_no))
REX No: {{ $company->rex_no }}
@endif @if(isset($uom) && !empty($uom))
UOM: {{ $uom }}
@endif @endif
Invoice No: {{ $order['order_no'] ?? 'N/A' }}
Invoice Date: {{ $order['order_date'] ?? 'N/A' }}
@if(isset($order['due_date']) && !empty($order['due_date']))
Delivery Date: {{ $order['due_date'] }}
@endif @if(isset($hsCode) && !empty($hsCode))
HS Code: {{ $hsCode }}
@endif @php $totalQuantity = $orderItem->sum('quantity'); @endphp
Total Quantity: {{ $totalQuantity }}
{{-- Total Quantity Display --}} {{--
--}} {{-- Order Items Table --}} @if(isset($orderItem) && $orderItem->count() > 0)

Invoice Items

{{-- --}} @if($orderItem->count()) @php $product_id = 0; @endphp @foreach($orderItem as $item) {{-- @if($item->product_id == $product_id) @else @php $product_id = $item->product_id; @endphp @endif --}} {{-- --}} @endforeach @endif
@endif {{-- Invoice Totals --}} @php $totalOriginal = $orderItem->sum(function($item) { return $item->quantity * ($item->price ?? 0); }); $firstItem = $orderItem->first(); $currencyName = $firstItem->cname ?? 'PKR'; // Determine the total label based on selling type $totalLabel = 'Grand Total:'; if (isset($sellingType) && !empty($sellingType)) { $totalLabel = 'Total ' . $sellingType . ' Amount:'; } @endphp
{{ $totalLabel }} @if(function_exists('numberToWordsWithCurrency')) {{ numberToWordsWithCurrency($totalOriginal ?? 0) }} {{ $currencyName }} @endif {{ number_format($totalOriginal, 2) }} {{ $currencyName }}
{{-- Bank Account Details --}} @if(isset($bankDetails) && !empty($bankDetails))

Bank Account Details

@if(isset($bankDetails['iban']) && !empty($bankDetails['iban'])) @endif @if(isset($bankDetails['swift_code']) && !empty($bankDetails['swift_code'])) @endif @if(isset($bankDetails['branch_code']) && !empty($bankDetails['branch_code'])) @endif @if(isset($bankDetails['address']) && !empty($bankDetails['address'])) @endif
@endif {{-- Certification Statement --}}

CERTIFIED TO BE TRUE AND CORRECT: {{ $company->name ?? 'SAJJADSON LAB EQUIPMENT' }}

@endsection