forked from verdnatura/salix-front
refs #5835 refactor getTotals
This commit is contained in:
parent
bc2256a021
commit
b00cff8b0b
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue