Show to amount of "Label per unit" stock entry labels (closes #2241)

This commit is contained in:
Bernd Bestel
2023-05-22 21:23:19 +02:00
parent 55adc140b2
commit 02fe3f2119
8 changed files with 54 additions and 7 deletions

View File

@@ -340,6 +340,7 @@ if (Grocy.Components.ProductPicker !== undefined)
if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_LABEL_PRINTER)
{
$("#stock_label_type").val(productDetails.product.default_stock_label_type);
$("#stock_label_type").trigger("change");
}
$("#display_amount").focus();
@@ -719,3 +720,15 @@ function ScanModeSubmit(singleUnit = true)
}
}
}
$("#stock_label_type, #amount").on("change", function(e)
{
if ($("#stock_label_type").val() == 2)
{
$("#stock-entry-label-info").text(__n(Number.parseFloat($("#amount").val()), "This means 1 label will be printed", "This means %1$s labels will be printed"));
}
else
{
$("#stock-entry-label-info").text("");
}
});