mirror of
https://github.com/grocy/grocy.git
synced 2026-04-09 14:06:16 +02:00
convert and ceil to next integer the amount to order for the recipe
This commit is contained in:
parent
99f448dd64
commit
0233701c04
|
|
@ -41,7 +41,7 @@ class RecipesService extends BaseService
|
||||||
$conversion = $this->getDatabase()->cache__quantity_unit_conversions_resolved()->where('product_id = :1 AND from_qu_id = :2 AND to_qu_id = :3', $recipePosition->product_id, $recipePosition->qu_id, $product->qu_id_stock)->fetch();
|
$conversion = $this->getDatabase()->cache__quantity_unit_conversions_resolved()->where('product_id = :1 AND from_qu_id = :2 AND to_qu_id = :3', $recipePosition->product_id, $recipePosition->qu_id, $product->qu_id_stock)->fetch();
|
||||||
if ($conversion != null)
|
if ($conversion != null)
|
||||||
{
|
{
|
||||||
$toOrderAmount = $toOrderAmount * $conversion->factor;
|
$toOrderAmount = ceil($toOrderAmount * $conversion->factor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user