diff --git a/changelog/60_UNRELEASED_2020-xx-xx.md b/changelog/60_UNRELEASED_2020-xx-xx.md index 91bb5a27..0fa9ff07 100644 --- a/changelog/60_UNRELEASED_2020-xx-xx.md +++ b/changelog/60_UNRELEASED_2020-xx-xx.md @@ -28,6 +28,10 @@ - Fixed that location & product groups filter on the stock overview page did a contains search instead an exact search - Fixed that the amount on the success popup was wrong when consuming a product with "Tare weight handling" enabled + +### Shopping list improvements +- "Add products that are below defined min. stock amount" always rounded up the missing amount to an integral number, this now allows decimal numbers + ### Recipe improvements/fixes - It's now possible to print recipes (button next to the recipe title) (thanks @zsarnett) - Improved recipe card presentation (thanks @zsarnett) diff --git a/services/StockService.php b/services/StockService.php index 8350b6db..e2c50fed 100644 --- a/services/StockService.php +++ b/services/StockService.php @@ -856,7 +856,7 @@ class StockService extends BaseService foreach ($missingProducts as $missingProduct) { $product = $this->getDatabase()->products()->where('id', $missingProduct->id)->fetch(); - $amountToAdd = ceil($missingProduct->amount_missing / $product->qu_factor_purchase_to_stock); + $amountToAdd = round($missingProduct->amount_missing / $product->qu_factor_purchase_to_stock, 2); $alreadyExistingEntry = $this->getDatabase()->shopping_list()->where('product_id', $missingProduct->id)->fetch(); if ($alreadyExistingEntry) // Update