mirror of
https://github.com/grocy/grocy.git
synced 2025-08-18 19:37:12 +00:00
Make it possible to provide a different location for added product during inventory (closes #183)
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user