@extends('WarehouseDashboard.header.header') @section('content')
{{__('ID')}} | {{__('Warehouse')}} | {{__('Total Orders')}} | {{__('Driver')}} | {{__('Status')}} | {{__('Created at')}} | {{__('Show')}} | |
---|---|---|---|---|---|---|---|
{{$consignment->id}} | {{$consignment->warehouse->{"name_".\Illuminate\Support\Facades\App::getLocale()} }} | {{count($consignment->consignmentOrders)}} | @if($consignment->driver_id != null) {{$consignment->driver ? $consignment->driver->name : null }} @else | @php $consignmentOrders = $consignment->consignmentOrders->pluck("order_shipment_id"); $count = count($consignmentOrders); $ordersShipmentAll = \App\Models\OrderShipment::whereIn("id", $consignmentOrders); $ordersShipment = $ordersShipmentAll->get(); $pluckStatuses = $ordersShipmentAll->pluck("status"); //dd(array_search(3,[1,2,3,3,3,4],true)); $values = array_count_values($pluckStatuses->toArray()); $isComplete = $values[5] ?? 0; //if ($isComplete > 0 && $isComplete < $count ) $status = "In Progress"; if ($isComplete > 0 && $isComplete == $count) $status = "Complete"; @endphp{{$status}} | {{$consignment->created_at}} |