Order Detail
{{-- --}}Assign Agent
@endif @if($disable == 0) @else {{--Processed Order Detail
--}} {{-- --}} @php $mailDisable = 0; $groupedData = []; //dd($assinged); foreach ($assinged as $assignedItem) { foreach ($assigned_agent_product_map as $assigned_agent_product_maps) { if ($assignedItem->id == $assigned_agent_product_maps->agent_assinged_id) { $agent = $agents->firstWhere('id', $assignedItem->agent_id); $productItem = $product->firstWhere('id', $assigned_agent_product_maps->product_id); $productMapedItem = $agent_product_list->firstWhere('id', $assigned_agent_product_maps->product_id); $productQty = $assigned_agent_product_map ->where('product_id', $assigned_agent_product_maps->product_id) ->where('agent_assinged_id', $assigned_agent_product_maps->agent_assinged_id) ->first(); if ($productItem && $agent) { // ✅ Use agent_order_id as the grouping key $orderKey = $assignedItem->agent_order_id; if (!isset($groupedData[$orderKey])) { $groupedData[$orderKey] = [ 'products' => [], 'mapped_details' => [], 'qty' => [], 'OrderID' => $assignedItem->id, 'agent_order_id' => $assignedItem->agent_order_id, 'delivery_date' => $assignedItem->delivery_date, 'agent_id' => $assignedItem->agent_id, 'totalPrice' => $assignedItem->totalPrice, 'status' => $assignedItem->status, 'agent_name' => $agent->name, 'extra' => $assignedItem->extra, 'Deliver_charge' => $assignedItem->Deliver_charge, 'reason' => $assignedItem->reason, 'track_no' => $assignedItem->track_no, 'isConfirmCl' => $assignedItem->isConfirmCl ]; } $groupedData[$orderKey]['products'][] = $productItem->product_name; $groupedData[$orderKey]['mapped_details'][] = $productMapedItem->fnid; $groupedData[$orderKey]['qty'][] = $productQty->qty; } } } } @endphp| Sl No | Order Id | Product Name & Qty | {{--Qty | --}}Assigned Agent | Price | Delivery Charge | Extra | Reason | Track No | Status | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ $i++ }} |
{{ $data['agent_order_id'] }}
{{ date('jS M, Y' , strtotime($data['delivery_date'])) }} |
{{--
{!! implode(' ', $data['mapped_details']) !!} |
{!! implode(' ', $data['qty']) !!} | --}}
@foreach($data['mapped_details'] as $index => $detail)
{{ $detail }} [Qty:{{ $data['qty'][$index] ?? 0 }}]
@if (!$loop->last) @endif @endforeach |
{{ ucwords($data['agent_name']) }} | {{ $data['totalPrice'] }} | {{ $data['Deliver_charge'] }} | {{ $data['extra'] }} | {{ $data['reason'] }} | {{ $data['track_no'] }} |
@if($data['status'] == 'P')
PENDING@elseif($data['status'] == 'PC') @php $mailDisable++; @endphpPROGRESS@elseif($data['status'] == 'CL')CANCEL@elseif($data['status'] == 'H')HOLD@elseif($data['status'] == 'S') @php $mailDisable++; @endphpSHIPPED@elseif($data['status'] == 'D') @php $mailDisable++; @endphpDELIVERED@endif |
@if($data['isConfirmCl'] == 0 && $data['status'] == "CL") @endif |
Customer Email
@php $count = 0; $buttonEnable = count($agentasGroupBy) + 1; $buttonCount = 1; @endphp @foreach($agentasGroupBy as $assign) @if($assign->status != 'P') @php $count++; $buttonCount++; @endphp @endif @endforeach| @endif | @if($buttonCount == $buttonEnable) | @endif |
Paid To Agent : {{$total}}
@endif @if($order->order_delivery_status == 'PC') @endif @endif