update vt new warehouselist

This commit is contained in:
omair saleh
2022-05-26 10:11:55 +08:00
parent 8e0d23a208
commit c4eec73803
2 changed files with 10 additions and 11 deletions
@@ -134,13 +134,12 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
foreach ($response->Rows as $parcel){
$marking = preg_split('(-|\(|\)|\/)', str_replace("/YW","", $parcel[5]));
$marking = preg_split('(-|\(|\)|\/)', str_replace("/YW","", $parcel[29]));
$orderNumber = $marking[array_key_last($marking)];
if(!$parcel[9]){
if(!$parcel[3]){
continue;
}
try {
$order = $this->fetchesOrder->execute(['reference' => $orderNumber]);
} catch (ResourceNotFoundException $exception) {
@@ -176,7 +175,7 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
}
$warehouseId = $parcel[0];
$warehouseId = $parcel[44];
$originWarehouse = $this->fetchesCompanyModule->execute(['id' => $warehouseId === 11 ? 3 : 4]);
$order = $this->createOrderProcessor->execute($companyModule->company, $originWarehouse, $address, $orderNumber);
@@ -186,11 +185,11 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
}
$packingListReference = $parcel[17];
$quantity = $parcel[9];
$measurement = round(($parcel[10]/$quantity) ** (1/3) * 100, 2);
$description = $parcel[7];
$tracking = $parcel[6];
$packingListReference = $parcel[0];
$quantity = $parcel[3];
// $measurement = round(($parcel[10]/$quantity) ** (1/3) * 100, 2);
$description = $parcel[31];
$tracking = $parcel[38];
$receiveDate = $parcel[1];
$packingListObject = new PackingListObject($packingListReference, $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->appointee->id, PackingListType::WAREHOUSE_RECEIVE_LIST, ApprovalStatus::APPROVED);
@@ -216,7 +215,7 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
$packingList->packages()->delete();
if($replica) $replica->packages()->delete();
$packageObject = new PackageObject(PackageType::CARTON, $description, $measurement, $measurement, $measurement, 0, $quantity, ApprovalStatus::APPROVED);
$packageObject = new PackageObject(PackageType::CARTON, $description, $parcel[10], $parcel[9], $parcel[8], 0, $quantity, ApprovalStatus::APPROVED);
$this->createPackageProcessor->execute($packageObject, $packingList);
}
} catch (\Exception $exception){
+1 -1
View File
@@ -153,7 +153,7 @@ Route::get('/orders/refresh', function(){
Route::get('/containers/refresh', function(){
(App()->make(\App\Classes\Modules\PackingLists\Processors\FetchWarehouseReceiveListFromVTPortalProcessor::class))->execute();
dd((App()->make(\App\Classes\Modules\PackingLists\Processors\FetchWarehouseReceiveListFromVTPortalProcessor::class))->execute());
// FetchLoadedContainersFromVTPortalJob::dispatch();
// FetchContainersStatusUpdateFromVTPortalJob::dispatch();