Merge branches 'vapor/development' and 'vapor/production' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into vapor/development

This commit is contained in:
edmondlang
2025-02-17 17:44:20 +08:00
2 changed files with 82 additions and 69 deletions
@@ -9,6 +9,8 @@ use App\Classes\Modules\PackingLists\Standards\Rules\Packages\CanCreatePackage;
use App\Classes\ValueObjects\Constants\WarehouseReferences;
use App\Models\Order;
use App\Models\PackingList;
use App\Models\Segment;
use Illuminate\Support\Facades\Log;
class CreatePackageProcessor
{
@@ -53,6 +55,14 @@ class CreatePackageProcessor
if($replica->owner->owner instanceof Order){
$modificationValue = in_array( $replica->owner->owner->companyModule->id, WarehouseReferences::REPLICA_WHITE_LIST) ? 0 : 1;
// if customer in segment 'No Extra Centimeter Charged'
$segmentId = Segment::where('name', 'No Extra Centimeter Charged')->first()->id;
$companySegments = $replica->owner->owner->companyModule->connections()->first()->segments->pluck('id')->toArray();
if (in_array($segmentId, $companySegments)) {
$modificationValue = 0;
Log::info('No Extra Centimeter Charged segment working');
}
}
$packageObject = new PackageObject($object->getType(), $object->getDescription(), $object->getWidth() + $modificationValue, $object->getHeight() + $modificationValue, $object->getLength() + $modificationValue, $object->getWeight(), $object->getQuantity(), $object->getStatus());