From 0c939dca6ffb6738bad8f0018ebcf77359306b7a Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 19 Jul 2022 18:59:11 +0800 Subject: [PATCH] fix vt packing list api --- ...hLoadedContainersFromVTPortalProcessor.php | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app/Classes/Modules/PackingLists/Processors/FetchLoadedContainersFromVTPortalProcessor.php b/app/Classes/Modules/PackingLists/Processors/FetchLoadedContainersFromVTPortalProcessor.php index 1f3ad20b..e95bcb8c 100644 --- a/app/Classes/Modules/PackingLists/Processors/FetchLoadedContainersFromVTPortalProcessor.php +++ b/app/Classes/Modules/PackingLists/Processors/FetchLoadedContainersFromVTPortalProcessor.php @@ -240,26 +240,26 @@ class FetchLoadedContainersFromVTPortalProcessor try { $packingList = $this->fetchesPackingList->execute(['reference' => $packingListReference, 'type' => PackingListType::SHIPPING_PACKING_LIST]); } catch (ResourceNotFoundException $exception){ - if ($allow_contract) { - $appointee_id = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id; - $contract = $this->unityCreateContract->execute(); - $contractReference = $contract->hash_id; - $contractObligations = $contract->contract_obligation_list; - - $this->unityActivateContract->execute($contractReference); - - $supervisorHashId = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->unity_hash_id; - - $supervisorContractEntity = $this->unityCreateContractEntity->execute($contractReference, $supervisorHashId); - $order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->update(['entity_hash_id' => $supervisorContractEntity->hash_id, 'entity_signature' => $supervisorContractEntity->entity_signature_hash_id]); - - $importerContractEntity = $this->unityCreateContractEntity->execute($contractReference, $order->orderRoles()->where('role_id', '=', OrderRoleTypes::IMPORTER)->first()->appointee->unity_hash_id); - $order->orderRoles()->where('role_id', '=', OrderRoleTypes::IMPORTER)->first()->update(['entity_hash_id' => $importerContractEntity->hash_id, 'entity_signature' => $importerContractEntity->entity_signature_hash_id]); - - $this->unityAssignContractEntity->execute($supervisorContractEntity->hash_id, $contractObligations); - } else { - $appointee_id = 2037; - } +// if ($allow_contract) { +// $appointee_id = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id; +// $contract = $this->unityCreateContract->execute(); +// $contractReference = $contract->hash_id; +// $contractObligations = $contract->contract_obligation_list; +// +// $this->unityActivateContract->execute($contractReference); +// +// $supervisorHashId = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->unity_hash_id; +// +// $supervisorContractEntity = $this->unityCreateContractEntity->execute($contractReference, $supervisorHashId); +// $order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->update(['entity_hash_id' => $supervisorContractEntity->hash_id, 'entity_signature' => $supervisorContractEntity->entity_signature_hash_id]); +// +// $importerContractEntity = $this->unityCreateContractEntity->execute($contractReference, $order->orderRoles()->where('role_id', '=', OrderRoleTypes::IMPORTER)->first()->appointee->unity_hash_id); +// $order->orderRoles()->where('role_id', '=', OrderRoleTypes::IMPORTER)->first()->update(['entity_hash_id' => $importerContractEntity->hash_id, 'entity_signature' => $importerContractEntity->entity_signature_hash_id]); +// +// $this->unityAssignContractEntity->execute($supervisorContractEntity->hash_id, $contractObligations); +// } else { +// $appointee_id = 2037; +// } $packingListObject = new PackingListObject($packingListReference, $appointee_id, PackingListType::SHIPPING_PACKING_LIST, ApprovalStatus::SUSPENDED, !$allow_contract ? null : $contractReference);