mirror of
https://github.com/grocy/grocy.git
synced 2025-04-30 10:05:45 +00:00
Use qu_id_purchase when adding products to the shopping list (closes #1355)
This commit is contained in:
parent
bc78359dba
commit
f3effc5a60
@ -23,6 +23,7 @@
|
|||||||
- Added a new product option "Can't be opened"
|
- Added a new product option "Can't be opened"
|
||||||
- When enabled the product open functionality for that product is disabled
|
- When enabled the product open functionality for that product is disabled
|
||||||
- Defaults to disabled, so no changed behavior when not configured
|
- Defaults to disabled, so no changed behavior when not configured
|
||||||
|
- When products are automatically added to the shopping list (e.g. by the "below defined min. stock amount"-functionality or when adding missing recipe ingredients) the product's "Default quantity unit purchase" is now used (instead of the product's "Quantity unit stock")
|
||||||
- Product barcode matching is now case-insensitive
|
- Product barcode matching is now case-insensitive
|
||||||
- Added a new column "Product picture" on the products list (master data) page (hidden by default)
|
- Added a new column "Product picture" on the products list (master data) page (hidden by default)
|
||||||
- Optimized that when navigation between the different "Group by"-variants on the stock report "Spendings", the selected date range now remains persistent
|
- Optimized that when navigation between the different "Group by"-variants on the stock report "Spendings", the selected date range now remains persistent
|
||||||
|
@ -27,7 +27,7 @@ class RecipesService extends BaseService
|
|||||||
{
|
{
|
||||||
$product = $this->getDataBase()->products($recipePosition->product_id);
|
$product = $this->getDataBase()->products($recipePosition->product_id);
|
||||||
$toOrderAmount = round(($recipePosition->missing_amount - $recipePosition->amount_on_shopping_list), 2);
|
$toOrderAmount = round(($recipePosition->missing_amount - $recipePosition->amount_on_shopping_list), 2);
|
||||||
$quId = $product->qu_id_stock;
|
$quId = $product->qu_id_purchase;
|
||||||
|
|
||||||
if ($recipe->not_check_shoppinglist == 1)
|
if ($recipe->not_check_shoppinglist == 1)
|
||||||
{
|
{
|
||||||
|
@ -50,7 +50,8 @@ class StockService extends BaseService
|
|||||||
$shoppinglistRow = $this->getDatabase()->shopping_list()->createRow([
|
$shoppinglistRow = $this->getDatabase()->shopping_list()->createRow([
|
||||||
'product_id' => $missingProduct->id,
|
'product_id' => $missingProduct->id,
|
||||||
'amount' => $amountToAdd,
|
'amount' => $amountToAdd,
|
||||||
'shopping_list_id' => $listId
|
'shopping_list_id' => $listId,
|
||||||
|
'qu_id' => $product->qu_id_purchase
|
||||||
]);
|
]);
|
||||||
$shoppinglistRow->save();
|
$shoppinglistRow->save();
|
||||||
}
|
}
|
||||||
@ -75,7 +76,8 @@ class StockService extends BaseService
|
|||||||
$shoppinglistRow = $this->getDatabase()->shopping_list()->createRow([
|
$shoppinglistRow = $this->getDatabase()->shopping_list()->createRow([
|
||||||
'product_id' => $overdueProduct->product_id,
|
'product_id' => $overdueProduct->product_id,
|
||||||
'amount' => 1,
|
'amount' => 1,
|
||||||
'shopping_list_id' => $listId
|
'shopping_list_id' => $listId,
|
||||||
|
'qu_id' => $product->qu_id_purchase
|
||||||
]);
|
]);
|
||||||
$shoppinglistRow->save();
|
$shoppinglistRow->save();
|
||||||
}
|
}
|
||||||
@ -100,7 +102,8 @@ class StockService extends BaseService
|
|||||||
$shoppinglistRow = $this->getDatabase()->shopping_list()->createRow([
|
$shoppinglistRow = $this->getDatabase()->shopping_list()->createRow([
|
||||||
'product_id' => $expiredProduct->product_id,
|
'product_id' => $expiredProduct->product_id,
|
||||||
'amount' => 1,
|
'amount' => 1,
|
||||||
'shopping_list_id' => $listId
|
'shopping_list_id' => $listId,
|
||||||
|
'qu_id' => $product->qu_id_purchase
|
||||||
]);
|
]);
|
||||||
$shoppinglistRow->save();
|
$shoppinglistRow->save();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user