mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 12:26:15 +02:00
viewjs stockoverview: add total value to stock overview
This commit is contained in:
parent
6c9b04ac1a
commit
b647a1626b
|
|
@ -185,7 +185,11 @@ function RefreshStatistics()
|
|||
result.forEach(element => {
|
||||
amountSum += parseInt(element.amount);
|
||||
});
|
||||
$("#info-current-stock").text(__n(result.length, '%s Product', '%s Products') + ", " + __n(amountSum, '%s Unit', '%s Units'));
|
||||
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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user