diff --git a/public/js/grocy.js b/public/js/grocy.js
index a74f2502..637e5503 100644
--- a/public/js/grocy.js
+++ b/public/js/grocy.js
@@ -528,18 +528,33 @@ $("#about-dialog-link").on("click", function()
function RefreshLocaleNumberDisplay()
{
- $(".locale-number-format[data-format='currency']").each(function()
+ $(".locale-number.locale-number-currency").each(function()
{
+ if (isNaN(parseFloat($(this).text())))
+ {
+ return;
+ }
+
$(this).text(parseFloat($(this).text()).toLocaleString(undefined, { style: "currency", currency: Grocy.Currency }));
});
- $(".locale-number-format[data-format='quantity-amount']").each(function()
+ $(".locale-number.locale-number-quantity-amount").each(function()
{
+ if (isNaN(parseFloat($(this).text())))
+ {
+ return;
+ }
+
$(this).text(parseFloat($(this).text()).toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 3 }));
});
- $(".locale-number-format[data-format='generic']").each(function ()
+ $(".locale-number.locale-number-generic").each(function ()
{
+ if (isNaN(parseFloat($(this).text())))
+ {
+ return;
+ }
+
$(this).text(parseFloat($(this).text()).toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 2 }));
});
}
diff --git a/public/viewjs/mealplan.js b/public/viewjs/mealplan.js
index 09210559..9c987d07 100644
--- a/public/viewjs/mealplan.js
+++ b/public/viewjs/mealplan.js
@@ -54,7 +54,7 @@ var calendar = $("#calendar").fullCalendar({
weekRecipeOrderMissingButtonHtml = ''
weekRecipeConsumeButtonHtml = ''
}
- $(".fc-header-toolbar .fc-center").html("
" + __t("Week costs") + ': ' + weekCosts.toString() + " " + weekRecipeOrderMissingButtonHtml + weekRecipeConsumeButtonHtml + "
");
+ $(".fc-header-toolbar .fc-center").html("" + __t("Week costs") + ': ' + weekCosts.toString() + " " + weekRecipeOrderMissingButtonHtml + weekRecipeConsumeButtonHtml + "
");
},
"eventRender": function(event, element)
{
@@ -98,7 +98,7 @@ var calendar = $("#calendar").fullCalendar({
' + recipe.name + ' \
' + __n(mealPlanEntry.servings, "%s serving", "%s servings") + '
\
' + fulfillmentIconHtml + " " + fulfillmentInfoHtml + '
\
- ' + resolvedRecipe.costs + ' ' + __t('per serving') + ' \
+ ' + resolvedRecipe.costs + ' ' + __t('per serving') + ' \
\
\
\
diff --git a/views/barcodescannertesting.blade.php b/views/barcodescannertesting.blade.php
index 60f72a5f..c68d0c1a 100644
--- a/views/barcodescannertesting.blade.php
+++ b/views/barcodescannertesting.blade.php
@@ -30,8 +30,8 @@
diff --git a/views/components/batterycard.blade.php b/views/components/batterycard.blade.php
index 80b71b63..91f2a1c0 100644
--- a/views/components/batterycard.blade.php
+++ b/views/components/batterycard.blade.php
@@ -12,7 +12,7 @@
{{ $__t('Used in') }}:
- {{ $__t('Charge cycles count') }}:
+ {{ $__t('Charge cycles count') }}:
{{ $__t('Last charged') }}:
diff --git a/views/components/chorecard.blade.php b/views/components/chorecard.blade.php
index b89f59db..fdb1ce8d 100644
--- a/views/components/chorecard.blade.php
+++ b/views/components/chorecard.blade.php
@@ -11,7 +11,7 @@
- {{ $__t('Tracked count') }}:
+ {{ $__t('Tracked count') }}:
{{ $__t('Last tracked') }}:
{{ $__t('Last done by') }}:
diff --git a/views/components/productcard.blade.php b/views/components/productcard.blade.php
index 0a5474cf..aba5b267 100644
--- a/views/components/productcard.blade.php
+++ b/views/components/productcard.blade.php
@@ -18,8 +18,8 @@
{{ $__t('Show more') }}
- {{ $__t('Stock amount') . ' / ' . $__t('Quantity unit') }}:
-
+ {{ $__t('Stock amount') . ' / ' . $__t('Quantity unit') }}:
+
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING){{ $__t('Location') }}:
@endif
{{ $__t('Last purchased') }}:
{{ $__t('Last used') }}:
diff --git a/views/locationcontentsheet.blade.php b/views/locationcontentsheet.blade.php
index 84d247ba..a1f67915 100644
--- a/views/locationcontentsheet.blade.php
+++ b/views/locationcontentsheet.blade.php
@@ -69,7 +69,7 @@
{{ FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name }}
- {{ $currentStockEntry->amount }} {{ $__n($currentStockEntry->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name_plural) }}
+ {{ $currentStockEntry->amount }} {{ $__n($currentStockEntry->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name_plural) }}
@if($currentStockEntry->amount_opened > 0){{ $__t('%s opened', $currentStockEntry->amount_opened) }}@endif
|
|
diff --git a/views/productform.blade.php b/views/productform.blade.php
index 222b999f..bedeb439 100644
--- a/views/productform.blade.php
+++ b/views/productform.blade.php
@@ -278,7 +278,7 @@
- {{ $quConversion->factor }}
+ {{ $quConversion->factor }}
|
{{ FindObjectInArrayByPropertyValue($quantityunits, 'id', $quConversion->to_qu_id)->name }}
diff --git a/views/products.blade.php b/views/products.blade.php
index 74e22829..10f6823f 100644
--- a/views/products.blade.php
+++ b/views/products.blade.php
@@ -77,7 +77,7 @@
{{ FindObjectInArrayByPropertyValue($locations, 'id', $product->location_id)->name }}
|
- {{ $product->min_stock_amount }}
+ {{ $product->min_stock_amount }}
|
{{ FindObjectInArrayByPropertyValue($quantityunits, 'id', $product->qu_id_purchase)->name }}
@@ -86,7 +86,7 @@
{{ FindObjectInArrayByPropertyValue($quantityunits, 'id', $product->qu_id_stock)->name }}
|
- {{ $product->qu_factor_purchase_to_stock }}
+ {{ $product->qu_factor_purchase_to_stock }}
|
@if(!empty($product->product_group_id)) {{ FindObjectInArrayByPropertyValue($productGroups, 'id', $product->product_group_id)->name }} @endif
diff --git a/views/recipeform.blade.php b/views/recipeform.blade.php
index 9b1d2f14..a1246f18 100644
--- a/views/recipeform.blade.php
+++ b/views/recipeform.blade.php
@@ -142,7 +142,7 @@
@if(!empty($recipePosition->variable_amount))
{{ $recipePosition->variable_amount }}
@else
- @if($recipePosition->amount == round($recipePosition->amount)){{ round($recipePosition->amount) }}@else{{ $recipePosition->amount }}@endif
+ @if($recipePosition->amount == round($recipePosition->amount)){{ round($recipePosition->amount) }}@else{{ $recipePosition->amount }}@endif
@endif
{{ $__n($recipePosition->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', $recipePosition->qu_id)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', $recipePosition->qu_id)->name_plural) }}
|
diff --git a/views/recipes.blade.php b/views/recipes.blade.php
index 82fede08..dc34377a 100644
--- a/views/recipes.blade.php
+++ b/views/recipes.blade.php
@@ -165,7 +165,7 @@
-
+
{{ $selectedRecipeTotalCalories }}
@endif
@@ -175,7 +175,7 @@
{{ $__t('Based on the prices of the last purchase per product') }}
-
+ {{ $selectedRecipeTotalCosts }}
@endif
@@ -217,7 +217,7 @@
@if(!empty($selectedRecipePosition->recipe_variable_amount))
{{ $selectedRecipePosition->recipe_variable_amount }}
@else
- @if($selectedRecipePosition->recipe_amount == round($selectedRecipePosition->recipe_amount, 2)){{ round($selectedRecipePosition->recipe_amount, 2) }}@else{{ $selectedRecipePosition->recipe_amount }}@endif
+ @if($selectedRecipePosition->recipe_amount == round($selectedRecipePosition->recipe_amount, 2)){{ round($selectedRecipePosition->recipe_amount, 2) }}@else{{ $selectedRecipePosition->recipe_amount }}@endif
@endif
{{ $__n($selectedRecipePosition->recipe_amount, FindObjectInArrayByPropertyValue($quantityUnits, 'id', $selectedRecipePosition->qu_id)->name, FindObjectInArrayByPropertyValue($quantityUnits, 'id', $selectedRecipePosition->qu_id)->name_plural) }} {{ FindObjectInArrayByPropertyValue($products, 'id', $selectedRecipePosition->product_id)->name }}
@if($selectedRecipePosition->need_fulfilled == 1)@elseif($selectedRecipePosition->need_fulfilled_with_shopping_list == 1)@else@endif
@@ -268,7 +268,7 @@
@if(!empty($selectedRecipePosition->recipe_variable_amount))
{{ $selectedRecipePosition->recipe_variable_amount }}
@else
- @if($selectedRecipePosition->recipe_amount == round($selectedRecipePosition->recipe_amount, 2)){{ round($selectedRecipePosition->recipe_amount, 2) }}@else{{ $selectedRecipePosition->recipe_amount }}@endif
+ @if($selectedRecipePosition->recipe_amount == round($selectedRecipePosition->recipe_amount, 2)){{ round($selectedRecipePosition->recipe_amount, 2) }}@else{{ $selectedRecipePosition->recipe_amount }}@endif
@endif
{{ $__n($selectedRecipePosition->recipe_amount, FindObjectInArrayByPropertyValue($quantityUnits, 'id', $selectedRecipePosition->qu_id)->name, FindObjectInArrayByPropertyValue($quantityUnits, 'id', $selectedRecipePosition->qu_id)->name_plural) }} {{ FindObjectInArrayByPropertyValue($products, 'id', $selectedRecipePosition->product_id)->name }}
@if($selectedRecipePosition->need_fulfilled == 1)@elseif($selectedRecipePosition->need_fulfilled_with_shopping_list == 1)@else@endif
diff --git a/views/shoppinglist.blade.php b/views/shoppinglist.blade.php
index d2483710..edf97320 100644
--- a/views/shoppinglist.blade.php
+++ b/views/shoppinglist.blade.php
@@ -120,7 +120,7 @@
@if(!empty($listItem->product_id)) {{ FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->name }}
@endif{!! nl2br($listItem->note) !!}
- {{ $listItem->amount }} @if(!empty($listItem->product_id)){{ $__n($listItem->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->qu_id_purchase)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->qu_id_purchase)->name_plural) }}@endif
+ {{ $listItem->amount }} @if(!empty($listItem->product_id)){{ $__n($listItem->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->qu_id_purchase)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->qu_id_purchase)->name_plural) }}@endif
|
@if(!empty(FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->product_group_id)) {{ FindObjectInArrayByPropertyValue($productGroups, 'id', FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->product_group_id)->name }} @else {{ $__t('Ungrouped') }} @endif
diff --git a/views/stockjournal.blade.php b/views/stockjournal.blade.php
index a95acf75..5704a90d 100644
--- a/views/stockjournal.blade.php
+++ b/views/stockjournal.blade.php
@@ -56,7 +56,7 @@
@endif
|
- {{ $stockLogEntry->amount }} {{ $__n($stockLogEntry->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $stockLogEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $stockLogEntry->product_id)->qu_id_stock)->name_plural) }}
+ {{ $stockLogEntry->amount }} {{ $__n($stockLogEntry->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $stockLogEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $stockLogEntry->product_id)->qu_id_stock)->name_plural) }}
|
{{ $stockLogEntry->row_created_timestamp }}
diff --git a/views/stockoverview.blade.php b/views/stockoverview.blade.php
index 1ef2b19f..5abc1ac2 100644
--- a/views/stockoverview.blade.php
+++ b/views/stockoverview.blade.php
@@ -174,11 +174,11 @@
{{ FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name }}
|
- {{ $currentStockEntry->amount }} {{ $__n($currentStockEntry->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name_plural) }}
+ {{ $currentStockEntry->amount }} {{ $__n($currentStockEntry->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name_plural) }}
@if($currentStockEntry->amount_opened > 0){{ $__t('%s opened', $currentStockEntry->amount_opened) }}@endif
@if($currentStockEntry->is_aggregated_amount == 1)
- {{ $currentStockEntry->amount_aggregated }} {{ $__n($currentStockEntry->amount_aggregated, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name_plural) }}
+ {{ $currentStockEntry->amount_aggregated }} {{ $__n($currentStockEntry->amount_aggregated, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name_plural) }}
@if($currentStockEntry->amount_opened_aggregated > 0){{ $__t('%s opened', $currentStockEntry->amount_opened_aggregated) }}@endif
@endif
|