@if (!$freightDatas->isEmpty())
@php $rowNum = 1; @endphp @foreach ($freightDatas as $freight) @php $items = $freight->items ?? collect(); $itemCount = $items->count() > 0 ? $items->count() : 1; @endphp @forelse($items as $itemIndex => $item) {{-- Freight Details (Rowspan for all items) --}} @if ($itemIndex === 0) @endif {{-- Item Details --}} {{-- --}} {{-- --}} {{-- @php $totalMaterialAmount = $freight->items->sum('amount'); @endphp --}} {{-- Charges (Only on first item row) --}} @if ($itemIndex === 0) @endif @empty {{-- No items, show freight row with minimal data --}} @endforelse @php $rowNum++; @endphp @endforeach
S.no GR No Dispatch Date Truck No. Party Name From To Sub Total + Halting + Extra charge Any Deduction Net Amount
{{ $rowNum }} {{ $freight->lr_no }} {{ date('d-M-Y', strtotime($freight->date)) }} {{ $freight->vehicle->vehicle_no ?? '' }} @php $partyName = \App\Http\Helpers\CommonHelper::getPartyByFreightPaidBy( $freight->id, $freight->paid_by, ); @endphp {{ $partyName }} {{ $freight->from_location }} {{ $freight->to_location }} {{ $item->material_name ?? '-' }} {{ $item->hsn_code ?? '-' }} {{ $item->actual_weight ?? '-' }}
{{ $rowNum }} {{ $freight->lr_no }} {{ date('d-M-Y', strtotime($freight->date)) }} {{ $freight->vehicle->vehicle_no ?? '' }} @php $partyName = \App\Http\Helpers\CommonHelper::getPartyByFreightPaidBy( $freight->id, $freight->paid_by, ); @endphp {{ $partyName }} {{ $freight->from_location }} {{ $freight->to_location }} @php $partyId = match ($freight->paid_by) { 'Consignor' => $freight->consignor_id, 'Consignee' => $freight->consignee_id, 'Transporter' => $freight->party_id, }; @endphp
{{-- ================= JS ================= --}} @else

Data Not Found

@endif