mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
add over weight cbm to yd
This commit is contained in:
@@ -262,6 +262,15 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
$this->createPackageProcessor->execute($packageObject, $packingList);
|
||||
}
|
||||
|
||||
$weightCbm = $row->weight / 500;
|
||||
$overWeightCbm = $weightCbm - $packingList->packages()->sum(DB::raw('(width/100) * (height/100) * (length/100) * quantity'));
|
||||
|
||||
if($overWeightCbm > 0){
|
||||
$measurement = round($overWeightCbm ** (1/3) * 100, 2);
|
||||
$packageObject = new PackageObject(PackageType::OVER_WEIGHT, 'Over Weight CBM', (float) $measurement, (float) $measurement, (float) $measurement, 0, 1, ApprovalStatus::APPROVED);
|
||||
$this->createPackageProcessor->execute($packageObject, $packingList);
|
||||
}
|
||||
|
||||
DB::commit();
|
||||
|
||||
$marking = $order->companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
|
||||
|
||||
@@ -8,4 +8,6 @@ final class PackageType {
|
||||
|
||||
public const PALLET = 1;
|
||||
|
||||
public const OVER_WEIGHT = 2;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user