mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Use total price for product_barcodes.last_price (references #1131)
This commit is contained in:
parent
2b4d8a7cc5
commit
bbdc372dcf
@ -57,7 +57,7 @@ $('#save-purchase-button').on('click', function(e)
|
|||||||
{
|
{
|
||||||
if ($("#purchase-form").hasAttr("data-used-barcode"))
|
if ($("#purchase-form").hasAttr("data-used-barcode"))
|
||||||
{
|
{
|
||||||
Grocy.Api.Put('objects/product_barcodes/' + $("#purchase-form").attr("data-used-barcode"), { last_price: $("#price").val() / $("#display_amount").val() },
|
Grocy.Api.Put('objects/product_barcodes/' + $("#purchase-form").attr("data-used-barcode"), { last_price: $("#price").val() },
|
||||||
function(result)
|
function(result)
|
||||||
{ },
|
{ },
|
||||||
function(xhr)
|
function(xhr)
|
||||||
@ -220,7 +220,6 @@ if (Grocy.Components.ProductPicker !== undefined)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$('#price').val(parseFloat(productDetails.last_price / $("#qu_id option:selected").attr("data-qu-factor")));
|
$('#price').val(parseFloat(productDetails.last_price / $("#qu_id option:selected").attr("data-qu-factor")));
|
||||||
RefreshLocaleNumberInput();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var priceTypeUnitPrice = $("#price-type-unit-price");
|
var priceTypeUnitPrice = $("#price-type-unit-price");
|
||||||
@ -270,7 +269,6 @@ if (Grocy.Components.ProductPicker !== undefined)
|
|||||||
if (BoolVal(Grocy.UserSettings.scan_mode_purchase_enabled))
|
if (BoolVal(Grocy.UserSettings.scan_mode_purchase_enabled))
|
||||||
{
|
{
|
||||||
$("#display_amount").val(1);
|
$("#display_amount").val(1);
|
||||||
RefreshLocaleNumberInput();
|
|
||||||
$(".input-group-productamountpicker").trigger("change");
|
$(".input-group-productamountpicker").trigger("change");
|
||||||
|
|
||||||
Grocy.FrontendHelpers.ValidateForm("purchase-form");
|
Grocy.FrontendHelpers.ValidateForm("purchase-form");
|
||||||
@ -285,6 +283,8 @@ if (Grocy.Components.ProductPicker !== undefined)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RefreshLocaleNumberInput();
|
||||||
|
|
||||||
if (document.getElementById("product_id").getAttribute("barcode") != "null")
|
if (document.getElementById("product_id").getAttribute("barcode") != "null")
|
||||||
{
|
{
|
||||||
Grocy.Api.Get('objects/product_barcodes?query[]=barcode=' + document.getElementById("product_id").getAttribute("barcode"),
|
Grocy.Api.Get('objects/product_barcodes?query[]=barcode=' + document.getElementById("product_id").getAttribute("barcode"),
|
||||||
@ -321,6 +321,7 @@ if (Grocy.Components.ProductPicker !== undefined)
|
|||||||
|
|
||||||
$(".input-group-productamountpicker").trigger("change");
|
$(".input-group-productamountpicker").trigger("change");
|
||||||
Grocy.FrontendHelpers.ValidateForm('purchase-form');
|
Grocy.FrontendHelpers.ValidateForm('purchase-form');
|
||||||
|
RefreshLocaleNumberInput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user