[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.
This commit is contained in:
@@ -99,10 +99,9 @@
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
accounts: function() {
|
accounts: function() {
|
||||||
var _this = this;
|
|
||||||
var data = this.props.p.get('operations');
|
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
|
return acc
|
||||||
.updateIn([op.get('account'), 'debit'], function (d) {
|
.updateIn([op.get('account'), 'debit'], function (d) {
|
||||||
return (d || 0) + op.get('debit', zero)(data);
|
return (d || 0) + op.get('debit', zero)(data);
|
||||||
|
|||||||
Reference in New Issue
Block a user