mirror of
https://github.com/grocy/grocy.git
synced 2026-04-08 13:46:14 +02:00
changeable forced input consume amount
you can now choose, if you are get forced to input a Amount on consume or you prefill the given Standard Amount per Product.
This commit is contained in:
parent
349a70e418
commit
f9a74c0db5
|
|
@ -116,6 +116,7 @@ DefaultUserSetting('stock_decimal_places_prices', 2); // Default decimal places
|
||||||
DefaultUserSetting('stock_due_soon_days', 5);
|
DefaultUserSetting('stock_due_soon_days', 5);
|
||||||
DefaultUserSetting('stock_default_purchase_amount', 0);
|
DefaultUserSetting('stock_default_purchase_amount', 0);
|
||||||
DefaultUserSetting('stock_default_consume_amount', 1);
|
DefaultUserSetting('stock_default_consume_amount', 1);
|
||||||
|
DefaultUserSetting('use_product_specify_amount', 1);
|
||||||
DefaultUserSetting('scan_mode_consume_enabled', false);
|
DefaultUserSetting('scan_mode_consume_enabled', false);
|
||||||
DefaultUserSetting('scan_mode_purchase_enabled', false);
|
DefaultUserSetting('scan_mode_purchase_enabled', false);
|
||||||
DefaultUserSetting('show_icon_on_stock_overview_page_when_product_is_on_shopping_list', true);
|
DefaultUserSetting('show_icon_on_stock_overview_page_when_product_is_on_shopping_list', true);
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,15 @@ msgid_plural "%s Products"
|
||||||
msgstr[0] "%s Produkt"
|
msgstr[0] "%s Produkt"
|
||||||
msgstr[1] "%s Produkte"
|
msgstr[1] "%s Produkte"
|
||||||
|
|
||||||
|
msgid "Standard Consume-Amount for this Product"
|
||||||
|
msgstr "Standard Verbrauchsmenge für dieses Produkt"
|
||||||
|
|
||||||
|
msgid "This amount is used as the Standard Amount for Consuming"
|
||||||
|
msgstr "Dieser Betrag wird als Standardmenge für den Verbrauch genommen (inkl. dem Schnellverbrauch)."
|
||||||
|
|
||||||
|
msgid "Otherwise you will be forced to make an entry before you can save"
|
||||||
|
msgstr "Sonst wird man zu einer Eingabe gezwungen bevor man speichern kann"
|
||||||
|
|
||||||
msgid "Amount"
|
msgid "Amount"
|
||||||
msgstr "Menge"
|
msgstr "Menge"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,11 @@
|
||||||
Grocy.Components.ProductAmountPicker.Reset();
|
Grocy.Components.ProductAmountPicker.Reset();
|
||||||
$("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
|
$("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
|
||||||
$("#display_amount").removeAttr("max");
|
$("#display_amount").removeAttr("max");
|
||||||
$('#display_amount').val(parseFloat(productDetails.product.quick_consume_amount));
|
if (Grocy.UserSettings.use_product_specify_amount == 1) {
|
||||||
|
$('#display_amount').val(parseFloat(productDetails.product.quick_consume_amount));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('#display_amount').val(parseFloat(0));
|
||||||
RefreshLocaleNumberInput();
|
RefreshLocaleNumberInput();
|
||||||
$(".input-group-productamountpicker").trigger("change");
|
$(".input-group-productamountpicker").trigger("change");
|
||||||
$("#tare-weight-handling-info").addClass("d-none");
|
$("#tare-weight-handling-info").addClass("d-none");
|
||||||
|
|
@ -160,7 +164,12 @@ $('#save-mark-as-open-button').on('click', function(e)
|
||||||
Grocy.FrontendHelpers.EndUiBusy("consume-form");
|
Grocy.FrontendHelpers.EndUiBusy("consume-form");
|
||||||
toastr.success(__t('Marked %1$s of %2$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="UndoStockTransaction(\'' + result.transaction_id + '\')"><i class="fas fa-undo"></i> ' + __t("Undo") + '</a>');
|
toastr.success(__t('Marked %1$s of %2$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="UndoStockTransaction(\'' + result.transaction_id + '\')"><i class="fas fa-undo"></i> ' + __t("Undo") + '</a>');
|
||||||
|
|
||||||
$('#display_amount').val(parseFloat(productDetails.product.quick_consume_amount));
|
if (Grocy.UserSettings.use_product_specify_amount == 1) {
|
||||||
|
$('#display_amount').val(parseFloat(productDetails.product.quick_consume_amount));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('#display_amount').val(parseFloat(0));
|
||||||
|
}
|
||||||
RefreshLocaleNumberInput();
|
RefreshLocaleNumberInput();
|
||||||
$(".input-group-productamountpicker").trigger("change");
|
$(".input-group-productamountpicker").trigger("change");
|
||||||
Grocy.Components.ProductPicker.Clear();
|
Grocy.Components.ProductPicker.Clear();
|
||||||
|
|
@ -276,7 +285,12 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
|
||||||
|
|
||||||
Grocy.Components.ProductAmountPicker.Reload(productDetails.product.id, productDetails.quantity_unit_stock.id);
|
Grocy.Components.ProductAmountPicker.Reload(productDetails.product.id, productDetails.quantity_unit_stock.id);
|
||||||
Grocy.Components.ProductAmountPicker.SetQuantityUnit(productDetails.quantity_unit_stock.id);
|
Grocy.Components.ProductAmountPicker.SetQuantityUnit(productDetails.quantity_unit_stock.id);
|
||||||
$('#display_amount').val(parseFloat(productDetails.product.quick_consume_amount));
|
if (Grocy.UserSettings.use_product_specify_amount == 1) {
|
||||||
|
$('#display_amount').val(parseFloat(productDetails.product.quick_consume_amount));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('#display_amount').val(parseFloat(0));
|
||||||
|
}
|
||||||
RefreshLocaleNumberInput();
|
RefreshLocaleNumberInput();
|
||||||
$(".input-group-productamountpicker").trigger("change");
|
$(".input-group-productamountpicker").trigger("change");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ $("#stock_default_purchase_amount").val(Grocy.UserSettings.stock_default_purchas
|
||||||
$("#stock_default_consume_amount").val(Grocy.UserSettings.stock_default_consume_amount);
|
$("#stock_default_consume_amount").val(Grocy.UserSettings.stock_default_consume_amount);
|
||||||
$("#stock_decimal_places_amounts").val(Grocy.UserSettings.stock_decimal_places_amounts);
|
$("#stock_decimal_places_amounts").val(Grocy.UserSettings.stock_decimal_places_amounts);
|
||||||
$("#stock_decimal_places_prices").val(Grocy.UserSettings.stock_decimal_places_prices);
|
$("#stock_decimal_places_prices").val(Grocy.UserSettings.stock_decimal_places_prices);
|
||||||
|
$("#use_product_specify_amount").val(Grocy.UserSettings.use_product_specify_amount);
|
||||||
|
|
||||||
if (BoolVal(Grocy.UserSettings.show_icon_on_stock_overview_page_when_product_is_on_shopping_list))
|
if (BoolVal(Grocy.UserSettings.show_icon_on_stock_overview_page_when_product_is_on_shopping_list))
|
||||||
{
|
{
|
||||||
|
|
@ -21,4 +22,9 @@ 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);
|
$("#show_warning_on_purchase_when_due_date_is_earlier_than_next").prop("checked", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (BoolVal(Grocy.UserSettings.use_product_specify_amount))
|
||||||
|
{
|
||||||
|
$("#use_product_specify_amount").prop("checked", true);
|
||||||
|
}
|
||||||
|
|
||||||
RefreshLocaleNumberInput();
|
RefreshLocaleNumberInput();
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,24 @@
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<h4 class="mt-2">{{ $__t('Consume') }}</h4>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="custom-control custom-checkbox">
|
||||||
|
<input type="checkbox"
|
||||||
|
class="form-check-input custom-control-input user-setting-control"
|
||||||
|
id="use_product_specify_amount"
|
||||||
|
data-setting-key="use_product_specify_amount">
|
||||||
|
<label class="form-check-label custom-control-label"
|
||||||
|
for="use_product_specify_amount">
|
||||||
|
{{ $__t('Use Product Specific Standard Amount') }}
|
||||||
|
<i class="fas fa-question-circle text-muted"
|
||||||
|
data-toggle="tooltip"
|
||||||
|
title="{{ $__t('Otherwise you will be forced to make an entry before you can save') }}"></i>
|
||||||
|
</label>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<?php /*
|
<?php /*
|
||||||
<h4 class="mt-2">{{ $__t('Consume') }}</h4>
|
<h4 class="mt-2">{{ $__t('Consume') }}</h4>
|
||||||
@include('components.numberpicker', array(
|
@include('components.numberpicker', array(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user