Don't round up missing amounts and allow decimal numbers (fixes #758)

This commit is contained in:
Bernd Bestel
2020-08-24 20:16:21 +02:00
parent 9d04d81744
commit ece880ea44
2 changed files with 5 additions and 1 deletions

View File

@@ -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