mirror of
https://github.com/grocy/grocy.git
synced 2025-08-29 01:14:24 +00:00
Add purchased date to inventory (#1102)
* Add purchased date to inventory * Clarify stock settings label Co-authored-by: Bernd Bestel <bernd@berrnd.de>
This commit is contained in:
@@ -677,7 +677,7 @@ class StockService extends BaseService
|
||||
return $this->getDatabase()->stock()->where('id', $entryId)->fetch();
|
||||
}
|
||||
|
||||
public function InventoryProduct(int $productId, float $newAmount, $bestBeforeDate, $locationId = null, $price = null, $shoppingLocationId = null)
|
||||
public function InventoryProduct(int $productId, float $newAmount, $bestBeforeDate, $locationId = null, $price = null, $shoppingLocationId = null, $purchasedDate)
|
||||
{
|
||||
if (!$this->ProductExists($productId))
|
||||
{
|
||||
@@ -720,7 +720,7 @@ class StockService extends BaseService
|
||||
$bookingAmount = $newAmount;
|
||||
}
|
||||
|
||||
return $this->AddProduct($productId, $bookingAmount, $bestBeforeDate, self::TRANSACTION_TYPE_INVENTORY_CORRECTION, date('Y-m-d'), $price, null, $locationId, $shoppingLocationId);
|
||||
return $this->AddProduct($productId, $bookingAmount, $bestBeforeDate, self::TRANSACTION_TYPE_INVENTORY_CORRECTION, $purchasedDate, $price, null, $locationId, $shoppingLocationId);
|
||||
}
|
||||
elseif ($newAmount < $productDetails->stock_amount + $containerWeight)
|
||||
{
|
||||
|
Reference in New Issue
Block a user