@php $fmtT = fn($v) => $v == 0 ? '' : ($v < 0 ? '(' . number_format(abs($v), 0) . ')' : number_format($v, 0)); $fmtZ = fn($v) => $v == 0 ? '0' : ($v < 0 ? '(' . number_format(abs($v), 0) . ')' : number_format($v, 0)); $vehicles = $reportData['vehicles']; $grandTotal = $reportData['grandTotal']; $fromFmt = \Carbon\Carbon::parse($dateFrom)->format('d/m/y'); $toFmt = \Carbon\Carbon::parse($dateTo)->format('d/m/y'); $clientStr = isset($supplierName) && $supplierName ? strtoupper($supplierName) : 'ALL SUPPLIERS'; // count of distinct vehicles for کُل گاڑی $totalVehicles = count($vehicles); @endphp {{-- ─── Header ─────────────────────────────────────── --}}
M.D.S
Purchase Billing Vehicle Register   گاڑی بیچک رجسٹر
From : {{ $fromFmt }}, To : {{ $toFmt }}, Client: {{ $clientStr }}{{ isset($vehicleNo) && $vehicleNo ? ', Vehicle: ' . $vehicleNo : '' }}
{{-- ─── Main Table ─────────────────────────────────── --}} @foreach($vehicles as $vehicle) {{-- Vehicle heading --}} @foreach($vehicle['bilties'] as $bilty) @php $itemCount = max(count($bilty['items']), 1); @endphp @if(count($bilty['items']) > 0) @foreach($bilty['items'] as $idx => $item) @if($idx === 0) @endif @if($idx === 0) @endif @endforeach @else @endif @endforeach {{-- Vehicle subtotal --}} @endforeach
تاریخ بلٹی نمبر گاڑی نمبر سپلار مال بوری وزن قیمت کرایہ
محصول
مزدوری
محصول
مارکیٹ
فیس
ڈاک خرچ
متفرقات
نقد کمیشن کل خرچہ بختہ بکری
گاڑی نمبر : {{ $vehicle['truck_no'] ?? $vehicle['pb_no'] }}
{{ \Carbon\Carbon::parse($bilty['date'])->format('d/m/y') }} {{ $bilty['bilty_no'] }} {{ $vehicle['truck_no'] ?? $vehicle['pb_no'] }} {{ $bilty['supplier_name'] }}{{ $item->child_cate_name ?? '' }} {{ $item->bori ? number_format($item->bori) : '' }} {{ $item->weight ? number_format($item->weight) : '' }} {{ $item->amount ? number_format($item->amount, 0) : '' }}{{ $fmtT($bilty['detail']['rent_recieve_amount']) }} {{ $fmtT($bilty['detail']['labour_amount']) }} {{ $fmtT($bilty['detail']['market_fees_amount']) }} {{ $fmtT($bilty['detail']['post_expense_amount']) }} {{ $fmtT($bilty['detail']['cash_amount']) }} {{ $fmtT($bilty['detail']['commission_amount']) }} {{ $fmtT($bilty['detail']['total_expanse_amount']) }} {{ $fmtT($bilty['detail']['save_amount']) }}
{{ \Carbon\Carbon::parse($bilty['date'])->format('d/m/y') }} {{ $bilty['bilty_no'] }} {{ $vehicle['truck_no'] ?? $vehicle['pb_no'] }} {{ $bilty['supplier_name'] }} {{ $fmtT($bilty['detail']['rent_recieve_amount']) }} {{ $fmtT($bilty['detail']['labour_amount']) }} {{ $fmtT($bilty['detail']['market_fees_amount']) }} {{ $fmtT($bilty['detail']['post_expense_amount']) }} {{ $fmtT($bilty['detail']['cash_amount']) }} {{ $fmtT($bilty['detail']['commission_amount']) }} {{ $fmtT($bilty['detail']['total_expanse_amount']) }} {{ $fmtT($bilty['detail']['save_amount']) }}
{{ $vehicle['vehicleTotals']['total_bori'] > 0 ? number_format($vehicle['vehicleTotals']['total_bori']) : '' }} {{ $vehicle['vehicleTotals']['total_weight'] > 0 ? number_format($vehicle['vehicleTotals']['total_weight']) : '' }} {{ $fmtT($vehicle['vehicleTotals']['total_amount']) }} {{ $fmtT($vehicle['vehicleTotals']['rent_recieve_amount']) }} {{ $fmtT($vehicle['vehicleTotals']['labour_amount']) }} {{ $fmtT($vehicle['vehicleTotals']['market_fees_amount']) }} {{ $fmtT($vehicle['vehicleTotals']['post_expense_amount']) }} {{ $fmtT($vehicle['vehicleTotals']['cash_amount']) }} {{ $fmtT($vehicle['vehicleTotals']['commission_amount']) }} {{ $fmtT($vehicle['vehicleTotals']['total_expanse_amount']) }} {{ $fmtT($vehicle['vehicleTotals']['save_amount']) }}
{{-- ═══════════════════════════════════════════════════════════ GRAND TOTALS BOX — matches screenshot exactly Layout (RTL, 7 visual columns right→left): Col1: کُل label Col2: گاڑی count Col3: بوری / وزن Col4: قیمت (total_amount) Col5: کرایہ / مزدوری / مارکیٹ / ڈاک / خرچہ متفرقات Col6: نقد / کمیشن / کل خرچہ Col7: بختہ بکری ═══════════════════════════════════════════════════════════ --}} {{-- Col 1: کُل label --}} {{-- Col 2: گاڑی count --}} {{-- Col 3: بوری --}} {{-- Col 4: قیمت --}} {{-- Col 5: کرایہ محصول --}} {{-- Col 6: نقد --}} {{-- Col 7: بختہ بکری --}} {{-- Col 2: empty --}} {{-- Col 3: وزن --}} {{-- Col 4: empty --}} {{-- Col 5: مزدوری --}} {{-- Col 6: کمیشن --}} {{-- Col 7: empty --}} {{-- Col 2: empty --}} {{-- Col 3: empty --}} {{-- Col 4: empty --}} {{-- Col 5: مارکیٹ فیس --}} {{-- Col 6: کل خرچہ --}} {{-- Col 7: empty --}} {{-- Col 5: ڈاک خرچہ --}} {{-- Col 5: خرچہ متفرقات --}}
کُل گاڑی {{ $totalVehicles }} بوری {{ number_format($grandTotal['total_bori']) }} قیمت {{ number_format($grandTotal['total_amount']) }} کرایہ محصول {{ number_format($grandTotal['rent_recieve_amount']) }} نقد {{ $fmtZ($grandTotal['cash_amount']) }} بختہ بکری {{ number_format($grandTotal['save_amount']) }}
وزن {{ number_format($grandTotal['total_weight']) }} مزدوری {{ number_format($grandTotal['labour_amount']) }} کمیشن {{ number_format($grandTotal['commission_amount']) }}
مارکیٹ فیس {{ number_format($grandTotal['market_fees_amount']) }} کل خرچہ {{ number_format($grandTotal['total_expanse_amount']) }}
ڈاک خرچہ {{ number_format($grandTotal['post_expense_amount']) }}
خرچہ متفرقات {{ number_format($grandTotal['miscellaneous_expense_amount']) }}