mirror of
https://github.com/grocy/grocy.git
synced 2025-08-16 02:34:44 +00:00
Make it possible to customize the default amount for purchase/consume (closes #215)
This commit is contained in:
@@ -72,7 +72,7 @@
|
||||
$("#amount").attr("max", "999999");
|
||||
$("#amount").attr("step", "1");
|
||||
$("#amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %s', '1'));
|
||||
$('#amount').val(1);
|
||||
$('#amount').val(Grocy.UserSettings.stock_default_consume_amount);
|
||||
$('#amount_qu_unit').text("");
|
||||
$("#tare-weight-handling-info").addClass("d-none");
|
||||
Grocy.Components.ProductPicker.Clear();
|
||||
@@ -135,7 +135,7 @@ $('#save-mark-as-open-button').on('click', function(e)
|
||||
Grocy.FrontendHelpers.EndUiBusy("consume-form");
|
||||
toastr.success(__t('Marked %s %s of %s as opened', jsonForm.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="UndoStockBooking(' + result.id + ')"><i class="fas fa-undo"></i> ' + __t("Undo") + '</a>');
|
||||
|
||||
$('#amount').val(1);
|
||||
$('#amount').val(Grocy.UserSettings.stock_default_consume_amount);
|
||||
Grocy.Components.ProductPicker.Clear();
|
||||
Grocy.Components.ProductPicker.GetInputElement().focus();
|
||||
Grocy.FrontendHelpers.ValidateForm('consume-form');
|
||||
@@ -257,7 +257,7 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
|
||||
}
|
||||
});
|
||||
|
||||
$('#amount').val(1);
|
||||
$('#amount').val(Grocy.UserSettings.stock_default_consume_amount);
|
||||
Grocy.Components.ProductPicker.GetInputElement().focus();
|
||||
Grocy.FrontendHelpers.ValidateForm('consume-form');
|
||||
|
||||
|
Reference in New Issue
Block a user