fix yd fetch

This commit is contained in:
omair saleh
2022-04-13 13:22:23 +08:00
parent ac0a90c168
commit da1b6b1b6d
@@ -7,6 +7,7 @@ use App\Classes\Modules\PackingLists\DataTransferObjects\PackageObject;
use App\Classes\Modules\PackingLists\Services\Packages\CreatesPackage;
use App\Classes\Modules\PackingLists\Standards\Rules\Packages\CanCreatePackage;
use App\Classes\ValueObjects\Constants\WarehouseReferences;
use App\Models\Order;
use App\Models\PackingList;
class CreatePackageProcessor
@@ -48,7 +49,12 @@ class CreatePackageProcessor
$replica = $packingList->packingLists()->first();
if($replica) {
$modificationValue = in_array( $replica->owner->owner->companyModule->id, WarehouseReferences::REPLICA_WHITE_LIST) ? 0 : 1;
$modificationValue = 1;
if($replica->owner->owner instanceof Order){
$modificationValue = in_array( $replica->owner->owner->companyModule->id, WarehouseReferences::REPLICA_WHITE_LIST) ? 0 : 1;
}
$packageObject = new PackageObject($object->getType(), $object->getDescription(), $object->getWidth() + $modificationValue, $object->getHeight() + $modificationValue, $object->getLength() + $modificationValue, $object->getWeight(), $object->getQuantity(), $object->getStatus());
$package = $this->createsPackage->execute($packageObject, $replica);
}