Skip to content

Commit

Permalink
Fixe(Stock entry from donation) solve receipt rendering issue
Browse files Browse the repository at this point in the history
closes 4751
  • Loading branch information
jeremielodi committed Aug 14, 2020
1 parent 723009d commit 8c1e955
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,13 @@ async function stockEntryDonationReceipt(documentUuid, session, options) {
voucher_reference : voucherReference,
};

data.rows = rows;

// sum elements of rows by their `total` property
data.total = data.rows.reduce((aggregate, row) => {
return row.total + aggregate;
}, 0);

data.rows = rows;
return report.render(data);

}
Expand Down

0 comments on commit 8c1e955

Please sign in to comment.