Make it possible to customize the default amount for purchase/consume (closes #215)

This commit is contained in:
Bernd Bestel
2019-05-04 13:19:34 +02:00
parent bcd6dd4b20
commit 0eb974bd92
7 changed files with 39 additions and 5 deletions

View File

@@ -69,7 +69,7 @@
$("#amount").attr("min", "1");
$("#amount").attr("step", "1");
$("#amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %s', '1'));
$('#amount').val(0);
$('#amount').val(Grocy.UserSettings.stock_default_purchase_amount);
$('#price').val('');
$('#amount_qu_unit').text("");
$("#tare-weight-handling-info").addClass("d-none");
@@ -177,7 +177,7 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
}
});
$('#amount').val(0);
$('#amount').val(Grocy.UserSettings.stock_default_purchase_amount);
Grocy.FrontendHelpers.ValidateForm('purchase-form');
if (Grocy.Components.ProductPicker.InProductAddWorkflow() === false)