Fixed productcard opened amount display

This commit is contained in:
Bernd Bestel 2023-05-22 21:53:15 +02:00
parent 02fe3f2119
commit 2c0a71078f
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 4 additions and 4 deletions

View File

@ -30,7 +30,7 @@ Grocy.Components.ProductCard.Refresh = function(productId)
if (productDetails.stock_amount_opened_aggregated > 0) if (productDetails.stock_amount_opened_aggregated > 0)
{ {
$('#productcard-product-stock-opened-amount-aggregated').text(__t('%s opened', productDetails.stock_amount_opened_aggregated)); $('#productcard-product-stock-opened-amount-aggregated').text(__t('%s opened', productDetails.stock_amount_opened_aggregated.toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_amounts })));
} }
else else
{ {
@ -68,7 +68,7 @@ Grocy.Components.ProductCard.Refresh = function(productId)
if (stockAmountOpened > 0) if (stockAmountOpened > 0)
{ {
$('#productcard-product-stock-opened-amount').text(__t('%s opened', stockAmountOpened)); $('#productcard-product-stock-opened-amount').text(__t('%s opened', stockAmountOpened.toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_amounts })));
} }
else else
{ {

View File

@ -45,10 +45,10 @@
class="locale-number locale-number-quantity-amount"></span> <span id="productcard-product-stock-qu-name"></span> class="locale-number locale-number-quantity-amount"></span> <span id="productcard-product-stock-qu-name"></span>
</span> </span>
<span id="productcard-product-stock-opened-amount" <span id="productcard-product-stock-opened-amount"
class="small font-italic locale-number locale-number-quantity-amount"></span> class="small font-italic"></span>
<span id="productcard-aggregated-amounts" <span id="productcard-aggregated-amounts"
class="pl-2 text-secondary d-none"><i class="fa-solid fa-custom-sigma-sign"></i> <span id="productcard-product-stock-amount-aggregated" class="pl-2 text-secondary d-none"><i class="fa-solid fa-custom-sigma-sign"></i> <span id="productcard-product-stock-amount-aggregated"
class="locale-number locale-number-quantity-amount"></span> <span id="productcard-product-stock-qu-name-aggregated"></span> <span id="productcard-product-stock-opened-amount-aggregated locale-number locale-number-quantity-amount" class="locale-number locale-number-quantity-amount"></span> <span id="productcard-product-stock-qu-name-aggregated"></span> <span id="productcard-product-stock-opened-amount-aggregated"
class="small font-italic"></span></span><br> class="small font-italic"></span></span><br>
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) @if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)