mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-20 13:04:11 +00:00
fix order status count
This commit is contained in:
@@ -43,7 +43,7 @@ class OrderResource extends JsonResource
|
||||
'delivered_packages' => PackingListResource::collection(
|
||||
$this->deliveredPackages()->get()
|
||||
),
|
||||
'received_packages' => PackingListResource::collection($this->packingLists()->where('type', PackingListType::WAREHOUSE_RECEIVE_LIST)->get()),
|
||||
'received_packages' => PackingListResource::collection($this->packingLists()->where('type', PackingListType::WAREHOUSE_RECEIVE_LIST)->whereHas('packages')->get()),
|
||||
];
|
||||
}),
|
||||
'remarks' => RemarkResource::collection($this->remarks),
|
||||
|
||||
@@ -107,7 +107,7 @@ class Order extends AbstractModel implements Addressable, Packable, Remarkable
|
||||
return $schedule->dispatched()
|
||||
->whereIn('schedules.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]);
|
||||
}
|
||||
);
|
||||
)->whereHas('packages');
|
||||
}
|
||||
|
||||
public function inTransitPackages()
|
||||
@@ -122,7 +122,7 @@ class Order extends AbstractModel implements Addressable, Packable, Remarkable
|
||||
->whereDoesntHave('containers', function($container) {
|
||||
return $container->where('containers.status', ApprovalStatus::COMPLETED);
|
||||
}
|
||||
);
|
||||
)->whereHas('packages');
|
||||
}
|
||||
|
||||
public function destinationWarehousePackages()
|
||||
@@ -137,7 +137,7 @@ class Order extends AbstractModel implements Addressable, Packable, Remarkable
|
||||
function($schedule) {
|
||||
return $schedule->dispatched()->whereIn('schedules.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]);
|
||||
}
|
||||
);
|
||||
)->whereHas('packages');
|
||||
}
|
||||
|
||||
public function deliveredPackages()
|
||||
|
||||
Reference in New Issue
Block a user