Use correct amount for the success popup on the consume page (fixes #766)

This commit is contained in:
Bernd Bestel
2020-08-24 19:06:33 +02:00
parent 5c62377ba6
commit 9d04d81744
2 changed files with 2 additions and 1 deletions

View File

@@ -26,6 +26,7 @@
- Fixed that the shopping cart icon on the stock overview page was also shown if the product was on an already deleted shopping list (if enabled) (thanks @fipwmaqzufheoxq92ebc) - Fixed that the shopping cart icon on the stock overview page was also shown if the product was on an already deleted shopping list (if enabled) (thanks @fipwmaqzufheoxq92ebc)
- Fixed that when editing a stock entry without a price, the price field was prefilled with `1` - Fixed that when editing a stock entry without a price, the price field was prefilled with `1`
- Fixed that location & product groups filter on the stock overview page did a contains search instead an exact search - 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
### Recipe improvements/fixes ### Recipe improvements/fixes
- It's now possible to print recipes (button next to the recipe title) (thanks @zsarnett) - It's now possible to print recipes (button next to the recipe title) (thanks @zsarnett)

View File

@@ -72,7 +72,7 @@
if (productDetails.product.enable_tare_weight_handling == 1) if (productDetails.product.enable_tare_weight_handling == 1)
{ {
var successMessage = __t('Removed %1$s of %2$s from stock', Math.abs(jsonForm.amount - parseFloat(productDetails.product.tare_weight)) + " " + __n(jsonForm.amount, productDetails.quantity_unit_stock.name, productDetails.quantity_unit_stock.name_plural), productDetails.product.name) + '<br><a class="btn btn-secondary btn-sm mt-2" href="#" onclick="UndoStockTransaction(\'' + bookingResponse.transaction_id + '\')"><i class="fas fa-undo"></i> ' + __t("Undo") + '</a>'; var successMessage = __t('Removed %1$s of %2$s from stock', Math.abs(jsonForm.amount - (parseFloat(productDetails.product.tare_weight) + parseFloat(productDetails.stock_amount))) + " " + __n(jsonForm.amount, productDetails.quantity_unit_stock.name, productDetails.quantity_unit_stock.name_plural), productDetails.product.name) + '<br><a class="btn btn-secondary btn-sm mt-2" href="#" onclick="UndoStockTransaction(\'' + bookingResponse.transaction_id + '\')"><i class="fas fa-undo"></i> ' + __t("Undo") + '</a>';
} }
else else
{ {