Make it possible to provide a different location for added product during inventory (closes #183)

This commit is contained in:
Bernd Bestel
2019-04-05 21:26:44 +02:00
parent 886e272c03
commit b6e80580ed
6 changed files with 25 additions and 4 deletions

View File

@@ -292,7 +292,7 @@ class StockService extends BaseService
}
}
public function InventoryProduct(int $productId, int $newAmount, string $bestBeforeDate)
public function InventoryProduct(int $productId, int $newAmount, string $bestBeforeDate, $locationId = null)
{
if (!$this->ProductExists($productId))
{
@@ -318,7 +318,7 @@ class StockService extends BaseService
$bookingAmount = $newAmount;
}
$this->AddProduct($productId, $bookingAmount, $bestBeforeDate, self::TRANSACTION_TYPE_INVENTORY_CORRECTION, date('Y-m-d'), $productDetails->last_price);
$this->AddProduct($productId, $bookingAmount, $bestBeforeDate, self::TRANSACTION_TYPE_INVENTORY_CORRECTION, date('Y-m-d'), $productDetails->last_price, $locationId);
}
else if ($newAmount < $productDetails->stock_amount + $containerWeight)
{