From 4ae0fd613d4d615a3b811ad4d0acfcf0b6a82439 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 15 Apr 2015 17:06:16 +0200 Subject: [PATCH] [FIX] remove unnecessary local, convert set to indexedseq By default "iterating" a set will use a setseq which may still uniquify information if it finds duplicates (but it may not as it's lazy & al). #flatten conserves the seq type, so if there are two equal operation items amongst all selected operations they may get deduplicated, with the end result of operations disappearing in the final formatted result. --- _static/chart-of-accounts.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/_static/chart-of-accounts.js b/_static/chart-of-accounts.js index 8d79f0f02..b4a42dd2e 100644 --- a/_static/chart-of-accounts.js +++ b/_static/chart-of-accounts.js @@ -99,10 +99,9 @@ ); }, accounts: function() { - var _this = this; var data = this.props.p.get('operations'); - var totals = data.flatten(true).reduce(function (acc, op) { + var totals = data.toIndexedSeq().flatten(true).reduce(function (acc, op) { return acc .updateIn([op.get('account'), 'debit'], function (d) { return (d || 0) + op.get('debit', zero)(data);