fix for price and total price (#1057)

* fix for price and total price

* product card clarity
This commit is contained in:
kriddles
2020-10-15 12:55:58 -05:00
committed by GitHub
parent 17d296d173
commit 758a8d9708
2 changed files with 14 additions and 5 deletions

View File

@@ -95,7 +95,7 @@ Grocy.Components.ProductCard.Refresh = function(productId)
{
if (productDetails.last_qu_factor_purchase_to_stock > 1)
{
$('#productcard-product-last-price').text(Number.parseFloat(productDetails.last_price).toLocaleString() + ' ' + Grocy.Currency + ' per 1 ' + productDetails.quantity_unit_purchase.name + ' of ' + productDetails.last_qu_factor_purchase_to_stock + ' ' + productDetails.quantity_unit_stock.name_plural);
$('#productcard-product-last-price').text(Number.parseFloat(productDetails.last_price * productDetails.last_qu_factor_purchase_to_stock).toLocaleString() + ' ' + Grocy.Currency + ' per 1 ' + productDetails.quantity_unit_purchase.name + ' of ' + productDetails.last_qu_factor_purchase_to_stock + ' ' + productDetails.quantity_unit_stock.name_plural);
}
else
{
@@ -109,7 +109,7 @@ Grocy.Components.ProductCard.Refresh = function(productId)
if (productDetails.avg_price !== null)
{
$('#productcard-product-average-price').text(Number.parseFloat(productDetails.avg_price).toLocaleString() + ' ' + Grocy.Currency);
$('#productcard-product-average-price').text(Number.parseFloat(productDetails.avg_price).toLocaleString() + ' ' + Grocy.Currency + ' per ' + productDetails.quantity_unit_stock.name);
}
else
{