Use the products "Quick consume amount" optionally also on the consume page (closes #1148)

This commit is contained in:
Bernd Bestel
2020-12-04 18:16:58 +01:00
parent 8ec7e9923c
commit 2bdb6ab2d4
6 changed files with 62 additions and 4 deletions

View File

@@ -21,4 +21,22 @@ if (BoolVal(Grocy.UserSettings.show_warning_on_purchase_when_due_date_is_earlier
$("#show_warning_on_purchase_when_due_date_is_earlier_than_next").prop("checked", true);
}
if (BoolVal(Grocy.UserSettings.stock_default_consume_amount_use_quick_consume_amount))
{
$("#stock_default_consume_amount_use_quick_consume_amount").prop("checked", true);
$("#stock_default_consume_amount").attr("disabled", "");
}
RefreshLocaleNumberInput();
$("#stock_default_consume_amount_use_quick_consume_amount").on("click", function()
{
if (this.checked)
{
$("#stock_default_consume_amount").attr("disabled", "");
}
else
{
$("#stock_default_consume_amount").removeAttr("disabled");
}
});