@extends('master') @section('title', 'Shipments') @section('content')
Shipment Records
@php $totalPrice = $bookings->sum('price'); $totalWeight = $bookings->sum('weight'); $totalPaymentAmount = $bookings->sum(function ($shipment) { $payment = App\Models\Payment::where('tracking_id', $shipment->booking_no)->latest()->first(); return $payment ? $payment->payment_amount : 0; }); @endphp @foreach ($bookings as $shipment) @endforeach
{{ $company->name }} TS EXPRESS & CARGO
TOTAL SHIPMENT SHIPMENT BILL COMPANY PAIDE
SI NO DATE AGENT NAME TRACKING NO SENDER NAME RECEIVER NAME DESCRIPTION DEST SERVICE WT TAKA COMPANY BILL NAME PAYMENT DATE
{{ $loop->iteration }} {{ $shipment->date }} {{ App\Models\Agent::find($shipment->agent_id)->name ?? 'N/A' }} {{ $shipment->booking_no}} {{ $shipment->shipper }} {{ $shipment->consignee }} {{ $shipment->description_of_goods }} {{ $shipment->destination }} {{ App\Models\Service::find($shipment->service)->name ?? 'N/A' }} {{ $shipment->weight }} {{ $shipment->price }} {{ App\Models\Payment::where('tracking_id', $shipment->booking_no)->latest()->first()->payment_amount ?? 'N/A' }} {{ $company->name }} {{ App\Models\Payment::where('tracking_id', $shipment->booking_no)->latest()->first()->payment_date ?? 'N/A' }}
TOTAL {{ $totalWeight }} {{ $totalPrice }} {{ $totalPaymentAmount }}
@endsection