mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
Fixes and changelog for #767
This commit is contained in:
@@ -360,18 +360,16 @@ function refreshPriceHint()
|
||||
|
||||
if ($("input[name='price-type']:checked").val() == "total-price")
|
||||
{
|
||||
var priceTypeUnitPrice = $("#price-type-unit-price");
|
||||
var priceTypeUnitPriceLabel = $("[for=" + priceTypeUnitPrice.attr("id") + "]");
|
||||
var price = $('#price').val() / $('#amount').val();
|
||||
var price = parseFloat($('#price').val()) / parseFloat($('#amount').val());
|
||||
|
||||
$('#price-hint').text('(will result with ' + priceTypeUnitPriceLabel.text() + ' cost of ' + price.toFixed(2) + ')');
|
||||
$('#price-hint').text(__t('means %1$s per %2$s', price.toLocaleString({ minimumFractionDigits: 2, maximumFractionDigits: 2 }), document.getElementById("amount_qu_unit").getAttribute("quantity-unit-stock-name")));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (document.getElementById("amount_qu_unit").getAttribute("qu-factor-purchase-to-stock") > 1)
|
||||
{
|
||||
var price = $('#price').val() / document.getElementById("amount_qu_unit").getAttribute("qu-factor-purchase-to-stock");
|
||||
$('#price-hint').text('(will result with ' + document.getElementById("amount_qu_unit").getAttribute("quantity-unit-stock-name") + ' cost of ' + price.toFixed(2) + ')');
|
||||
$('#price-hint').text(__t('means %1$s per %2$s', price.toLocaleString({ minimumFractionDigits: 2, maximumFractionDigits: 2 }), document.getElementById("amount_qu_unit").getAttribute("quantity-unit-stock-name")));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user