refs #5835 refactor getTotals
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Jorge Penadés 2023-11-24 10:08:51 +01:00
parent bc2256a021
commit b00cff8b0b
1 changed files with 5 additions and 4 deletions

View File

@ -164,10 +164,11 @@ function getAmountNotMatch(totals) {
}
function getIntrastatTotals(intrastat) {
const totals = {};
totals.amount = intrastat.reduce((acc, cur) => acc + cur.amount, 0);
totals.net = intrastat.reduce((acc, cur) => acc + cur.net, 0);
totals.stems = intrastat.reduce((acc, cur) => acc + cur.stems, 0);
const totals = {
amount: intrastat.reduce((acc, cur) => acc + cur.amount, 0),
net: intrastat.reduce((acc, cur) => acc + cur.net, 0),
stems: intrastat.reduce((acc, cur) => acc + cur.stems, 0),
};
return totals;
}