Merge branch 'null_order_packing_list' into 'development'

bug

See merge request CIEFWorldwideSdnBhd/shipping-portal!103
This commit is contained in:
Leong Chee Siong
2022-02-08 14:16:32 +00:00
@@ -208,7 +208,14 @@ class FetchOrderListsFromYdPortalProcessor
try{
$packingList = $this->fetchesPackingList->execute(['reference' => $row->expressno]);
} catch (ResourceNotFoundException $exception){
$appointee_id = !$allow_contract ? 2037 : $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id;
if (!$allow_contract) {
$appointee_id = 2037;
}
else {
$appointee_id = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id;
}
$warehouseReceiveObject = new PackingListObject($packingListReference, $appointee_id, PackingListType::WAREHOUSE_RECEIVE_LIST, $allow_contract ? ApprovalStatus::APPROVED : ApprovalStatus::REJECTED);
/** @var PackingList $warehouseReceiveList */
@@ -261,7 +268,16 @@ class FetchOrderListsFromYdPortalProcessor
try {
$container = $this->fetchesContainer->execute(['reference' => $containerReference]);
} catch (ResourceNotFoundException $exception){
$originWarehouse = $this->fetchesCompanyModule->execute(['id' => $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->appointee->id]);
if (!$allow_contract) {
$appointee_id = 2037;
}
else {
$appointee_id = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->appointee->id;
}
$originWarehouse = $this->fetchesCompanyModule->execute(['id' => $appointee_id]);
$containerObject = new ContainerObject($containerReference, '', '', ContainerTypes::FORTY_FEET_DRY_CONTAINER, $loadingDate, ApprovalStatus::PENDING_VERIFICATION);
/** @var Container $container */
$container = $this->createContainerProcessor->execute($containerObject, $originWarehouse);