mirror of
https://github.com/grocy/grocy.git
synced 2025-08-18 03:25:50 +00:00
Test/review/rework (and hopefully finalized) new price handling
This commit is contained in:
@@ -11,7 +11,7 @@ Grocy.Components.ProductAmountPicker.Reload = function(productId, destinationQuI
|
||||
$("#qu_id").attr("data-destination-qu-name", FindObjectInArrayByPropertyValue(Grocy.QuantityUnits, 'id', destinationQuId).name);
|
||||
conversionsForProduct.forEach(conversion =>
|
||||
{
|
||||
var factor = conversion.factor;
|
||||
var factor = parseFloat(conversion.factor);
|
||||
if (conversion.to_qu_id == destinationQuId)
|
||||
{
|
||||
factor = 1;
|
||||
@@ -39,6 +39,15 @@ Grocy.Components.ProductAmountPicker.Reload = function(productId, destinationQuI
|
||||
$("#qu_id").val($("#qu_id option:first").val());
|
||||
}
|
||||
|
||||
if ($('#qu_id option').length == 1)
|
||||
{
|
||||
$("#qu_id").attr("disabled", "");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#qu_id").removeAttr("disabled");
|
||||
}
|
||||
|
||||
$(".input-group-productamountpicker").trigger("change");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user