diff --git a/app/Classes/Modules/Orders/Processors/UpdateDoFromYDPortalProcessor.php b/app/Classes/Modules/Orders/Processors/UpdateDoFromYDPortalProcessor.php index 1b839803..e48b1d33 100644 --- a/app/Classes/Modules/Orders/Processors/UpdateDoFromYDPortalProcessor.php +++ b/app/Classes/Modules/Orders/Processors/UpdateDoFromYDPortalProcessor.php @@ -54,14 +54,7 @@ class UpdateDoFromYDPortalProcessor $phone = $contact ? $contact->phone : null; $reference = $contact ? $contact->reference : null; $remark = $remark ? $remark->content : null; -dd([ - 'expressno' => $row->reference, - 'customers_name' => $reference, - 'cellphone' => $phone, - 'postcode' => $address->postcode, - 'streetAddress' => $address->street_one . ' ' . $address->street_two . ' '. $address->district->name.' '. $address->post_code.' '.$address->state->name.' '.$address->country->name.' '.$address->postcode.' || '.$remark -]); $this->fetchesDataFRomYDPortal->clientRequest( 'http://www.yd-wl.com/api/UpdateOrderAddress.ashx', 'POST', diff --git a/app/Classes/Modules/PackingLists/ControllersLogic/UpdatePackingListStatusLogic.php b/app/Classes/Modules/PackingLists/ControllersLogic/UpdatePackingListStatusLogic.php index 3c6986ac..4eb67646 100644 --- a/app/Classes/Modules/PackingLists/ControllersLogic/UpdatePackingListStatusLogic.php +++ b/app/Classes/Modules/PackingLists/ControllersLogic/UpdatePackingListStatusLogic.php @@ -11,6 +11,7 @@ use App\Classes\Modules\PackingLists\Services\UpdatesPackingListStatus; use App\Classes\Modules\PackingLists\Standards\Rules\CanUpdatePackingList; use App\Classes\Modules\PackingLists\DataTransferObjects\PackingListObject; use App\Classes\Modules\Orders\Processors\UpdateDoFromVTPortalProcessor; +use App\Classes\ValueObjects\Constants\ApprovalStatus; use App\Classes\ValueObjects\Constants\OrderRoleTypes; use App\Http\Resources\PackingListResource; use ErrorException; @@ -70,8 +71,8 @@ class UpdatePackingListStatusLogic extends AbstractControllerLogic $packingList = $this->fetchesPackingList->execute(['id' => $request->route('id')]); $packing_list = $this->updatesPackingListStatus->execute($packingList, $request->route('status')); - $address = $packing_list->owner()->first()->addresses()->first(); - dd($address->contacts); + $address = $packing_list->owner()->first()->addresses()->where('status', ApprovalStatus::APPROVED)->first(); + $appointee = $address->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id; $appointee === 2 ? $this->updateDoFromVTPortalProcessor->execute($address) : $this->updateDoFromYDPortalProcessor->execute($address);