@extends('layouts.master') @push('css') @endpush @section('content')

Purchase Register — خرید رجسٹر

{{-- ── Filter Form ── --}}
@if($reportData && count($reportData['purchasers'])) Print @endif

@if($reportData !== null) @if(empty($reportData['purchasers']))
No records found.
@else {{-- ── Summary Cards ── --}}
Total Bori (بوری) {{ number_format($reportData['grandBori'], 0) }}
Total Weight (وزن) {{ number_format($reportData['grandWeight'], 0) }}
Total Amount (قیمت) {{ number_format($reportData['grandAmount'], 0) }}
Total Orders (گاڑی) {{ $reportData['grandOrders'] }}
{{-- ── Purchase Register Table ── --}}
{{-- Report Header --}}
M.D.S
Purchase Register   خرید رجسٹر
From: {{ \Carbon\Carbon::parse($fromDate)->format('d/m/y') }}, To: {{ \Carbon\Carbon::parse($toDate)->format('d/m/y') }} @if($selectedPurchaser) , Client: {{ $selectedPurchaser->purchaser_name }} @endif
@foreach($reportData['purchasers'] as $purchaserName => $purchaserData) {{-- Purchaser Group Header --}} @foreach($purchaserData['orders'] as $order) {{-- Items within this order --}} @foreach($order['details'] as $i => $detail) @endforeach {{-- Order sub-line (labour/mzdoori if exists) --}} @if($order['labour_charges'] > 0) @endif {{-- Order total line --}} @endforeach {{-- Sub Total (dashed line) --}} @endforeach {{-- Grand Total --}}
تاریخ گاڑی نمبر مال بوری وزن ریٹ قیمت
{{ $purchaserData['urdu_name'] ?: $purchaserName }}
{{ $i === 0 ? $order['order_date'] : '' }} {{ $i === 0 ? $order['po_number'] : '' }} {{ $detail['name'] }} {{ $detail['bori'] ?: '' }} {{ $detail['weight'] ? number_format($detail['weight'], 0) : '' }} {{ $detail['rate'] ? number_format($detail['rate'], 0) : '' }} {{ $detail['amount'] ? number_format($detail['amount'], 0) : '' }}
{{ $order['order_date'] }} مزدوری {{ number_format($order['labour_charges'], 0) }}
{{ number_format($order['total_weight'], 0) }} {{ $order['total_bori'] }} {{ number_format($order['grand_total'], 0) }}
کُل {{ number_format($purchaserData['subWeight'], 0) }} {{ $purchaserData['subBori'] }} {{ number_format($purchaserData['subAmount'], 0) }}
Grand Total => {{ number_format($reportData['grandWeight'], 0) }} {{ $reportData['grandBori'] }} {{ number_format($reportData['grandAmount'], 0) }}
{{-- ── Summary Box (bottom right, like in image) ── --}}
کُل
بوری {{ number_format($reportData['grandBori'], 0) }}
وزن {{ number_format($reportData['grandWeight'], 0) }}
قیمت {{ number_format($reportData['grandAmount'], 0) }}
گاڑی {{ $reportData['grandOrders'] }}
{{-- .purchase-wrap --}} @endif @endif
@endsection