@extends('layouts.admin.app') @section('content')

Order Id : {{$order->unique_order_id}}

Purchase Date : {{$order->created_at}}

@if($order->order_delivery_status=='P')

@elseif($order->order_delivery_status=='PC') @elseif($order->order_delivery_status=='CL') @elseif($order->order_delivery_status=='H') @elseif($order->order_delivery_status=='D') @elseif($order->order_delivery_status=='S') @endif

@php $i=0 @endphp @php $grandtotal = 0 @endphp @foreach($order_details as $order_detail) @if($order->id == $order_detail->order_id) @foreach($product as $products) @if($order_detail->product_id == $products->id) @php $i++; @endphp @php $grandtotal += $order_detail->total_price @endphp @endif @endforeach @endif @endforeach
Sr No Product Name Send to Price Quantity Total
{{$i}} {{$products->product_name}} {{$order->delivery_address}} {{$order_detail->total_price}} {{$order_detail->qty}} {{$order_detail->qty * $order_detail->unit_price}}

Grand Total :{{$grandtotal}}

@if($disable >= 1) @else

Assign Agent

@csrf {{--
Agent Details
Product Price Action
Delivery Type Price
--}}
{{--
@csrf
Agent Details
Product Price Action
Delivery Type Price
@csrf
--}} @endif @if($disable == 0) @else

Processed Order

@php $groupedData = []; 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); if ($productItem && $agent) { $agentId = $assignedItem->agent_id; if (!isset($groupedData[$agentId])) { $groupedData[$agentId] = [ 'products' => [], 'mapped_details' => [], 'OrderID' => $assignedItem->id, 'agent_order_id' => $assignedItem->agent_order_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[$agentId]['products'][] = $productItem->product_name; $groupedData[$agentId]['mapped_details'][] = $productMapedItem->item; } } } } @endphp @php $i = 1; @endphp @php $Delivery_Price = 0; $Extra = 0; $Delivery = 0; $total = 0; @endphp @foreach($groupedData as $data) @endforeach
Sr No Order Id Product Name (Mapped Details) Assigned Agent Name Delivery Price Extra Delivery Charge Reason Track No Status
{{ $i++ }} {{ $data['agent_order_id'] }} {!! implode('
', $data['mapped_details']) !!}
{{ $data['agent_name'] }} {{ $data['totalPrice'] }} {{ $data['extra'] }} {{ $data['Deliver_charge'] }} {{ $data['reason'] }} {{ $data['track_no'] }} @if($data['status'] == 'P') @elseif($data['status'] == 'PC') @elseif($data['status'] == 'CL') @elseif($data['status'] == 'H') @elseif($data['status'] == 'S') @elseif($data['status'] == 'D') @endif @if($data['isConfirmCl'] == 0 && $data['status'] == "CL") @endif
@foreach($groupedData as $amount) @if($amount['isConfirmCl'] != 1 && $amount['status'] != "CL") @php $total +=$amount['totalPrice'] + $amount['extra'] + $amount['Deliver_charge']; @endphp @endif @endforeach

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 @if($count > 0) @endif @if($buttonCount == $buttonEnable) @endif
@php $grandTotal = 0 @endphp @if($order->order_delivery_status == 'D') @php $grandTotal = $Delivery_Price+$Extra+$Delivery+$total;@endphp

Paid To AgentL : {{$total}}

@endif @if($order->order_delivery_status == 'PC') @foreach($agentasGroupBy as $assignItems) @if($assignItems->status == "CL") @else @endif @endforeach @endif @endif
@endsection