mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 04:12:59 +00:00
Allow decimal amounts in general for the shopping list
This commit is contained in:
@@ -38,10 +38,10 @@ class RecipesService extends BaseService
|
||||
{
|
||||
$product = $this->getDataBase()->products($recipePosition->product_id);
|
||||
|
||||
$toOrderAmount = ceil(($recipePosition->missing_amount - $recipePosition->amount_on_shopping_list) / $product->qu_factor_purchase_to_stock);
|
||||
$toOrderAmount = round(($recipePosition->missing_amount - $recipePosition->amount_on_shopping_list) / $product->qu_factor_purchase_to_stock, 2);
|
||||
if ($recipe->not_check_shoppinglist == 1)
|
||||
{
|
||||
$toOrderAmount = ceil($recipePosition->missing_amount / $product->qu_factor_purchase_to_stock);
|
||||
$toOrderAmount = round($recipePosition->missing_amount / $product->qu_factor_purchase_to_stock, 2);
|
||||
}
|
||||
|
||||
if($toOrderAmount > 0)
|
||||
|
@@ -905,7 +905,7 @@ class StockService extends BaseService
|
||||
if ($productRow != null && !empty($productRow))
|
||||
{
|
||||
$newAmount = $productRow->amount - $amount;
|
||||
if ($newAmount < 1)
|
||||
if ($newAmount < 0.01)
|
||||
{
|
||||
$productRow->delete();
|
||||
}
|
||||
|
Reference in New Issue
Block a user