convert and ceil to next integer the amount to order for the recipe

This commit is contained in:
Victor 2024-01-01 01:51:24 +01:00
parent 99f448dd64
commit 0233701c04

View File

@ -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();
if ($conversion != null)
{
$toOrderAmount = $toOrderAmount * $conversion->factor;
$toOrderAmount = ceil($toOrderAmount * $conversion->factor);
}
}