0
0
Fork 0

refs #5835 refactor getTotals

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) { function getIntrastatTotals(intrastat) {
const totals = {}; const totals = {
totals.amount = intrastat.reduce((acc, cur) => acc + cur.amount, 0); amount: intrastat.reduce((acc, cur) => acc + cur.amount, 0),
totals.net = intrastat.reduce((acc, cur) => acc + cur.net, 0); net: intrastat.reduce((acc, cur) => acc + cur.net, 0),
totals.stems = intrastat.reduce((acc, cur) => acc + cur.stems, 0); stems: intrastat.reduce((acc, cur) => acc + cur.stems, 0),
};
return totals; return totals;
} }