mirror of
https://github.com/grocy/grocy.git
synced 2026-04-08 13:46:14 +02:00
viewjs stockoverview: add total value to stock overview
This commit is contained in:
parent
a66a4d0c22
commit
cb9a319996
|
|
@ -204,7 +204,19 @@ function RefreshStatistics()
|
||||||
{
|
{
|
||||||
amountSum += parseInt(element.amount);
|
amountSum += parseInt(element.amount);
|
||||||
});
|
});
|
||||||
$("#info-current-stock").text(__n(result.length, '%s Product', '%s Products'));
|
|
||||||
|
if (!Grocy.FeatureFlags.GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
|
||||||
|
{
|
||||||
|
$("#info-current-stock").text(__n(result.length, '%s Product', '%s Products'));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var valueSum = 0;
|
||||||
|
result.forEach(element => {
|
||||||
|
valueSum += parseInt(element.value);
|
||||||
|
});
|
||||||
|
$("#info-current-stock").text(__n(result.length, '%s Product', '%s Products') + ", " + __n(amountSum, '%s Unit', '%s Units') + ", " + __n(valueSum, '%s Value', '%s Value'));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
function(xhr)
|
function(xhr)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user