mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Fixed tare weight handling min. amount on purchase was not calculated based on the products qu_factor_purchase_to_stock (fixes #457)
This commit is contained in:
parent
8e26bd2c31
commit
6345e69922
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
### Stock fixes
|
### Stock fixes
|
||||||
- Fixed that entering partial amounts was not possible on the inventory page (only applies if the product option "Allow partial units in stock" is enabled)
|
- Fixed that entering partial amounts was not possible on the inventory page (only applies if the product option "Allow partial units in stock" is enabled)
|
||||||
|
- Fixed that on purchase a wrong minimum amount was enforced for products with enabled tare weight handling in combination with different purchase/stock quantity units
|
||||||
|
|
||||||
### Shopping list fixes
|
### Shopping list fixes
|
||||||
- Fixed that when `FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS` was set to `false`, the shopping list appeared empty after some actions
|
- Fixed that when `FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS` was set to `false`, the shopping list appeared empty after some actions
|
||||||
|
@ -160,8 +160,9 @@ if (Grocy.Components.ProductPicker !== undefined)
|
|||||||
|
|
||||||
if (productDetails.product.enable_tare_weight_handling == 1)
|
if (productDetails.product.enable_tare_weight_handling == 1)
|
||||||
{
|
{
|
||||||
var minAmount = parseFloat(productDetails.product.tare_weight) + parseFloat(productDetails.stock_amount) + 1;
|
var minAmount = parseFloat(productDetails.product.tare_weight) / productDetails.product.qu_factor_purchase_to_stock + parseFloat(productDetails.stock_amount);
|
||||||
$("#amount").attr("min", minAmount);
|
$("#amount").attr("min", minAmount);
|
||||||
|
$("#amount").attr("step", "0.0001");
|
||||||
$("#amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %s', minAmount.toLocaleString()));
|
$("#amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %s', minAmount.toLocaleString()));
|
||||||
$("#tare-weight-handling-info").removeClass("d-none");
|
$("#tare-weight-handling-info").removeClass("d-none");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user