summaryrefslogtreecommitdiff
path: root/src/filters.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2019-03-15 16:31:21 -0700
committerJohn Wiegley <johnw@newartisans.com>2019-03-15 17:30:48 -0700
commit720751f8d4a3fedf625a029410d791d9d4b255eb (patch)
tree4acfd15526912d82c4b35edb5bcf12a6b5441e61 /src/filters.cc
parenta1f94a06cdd89a7a0675903c604bd5dd4cc25e77 (diff)
downloadfork-ledger-720751f8d4a3fedf625a029410d791d9d4b255eb.tar.gz
fork-ledger-720751f8d4a3fedf625a029410d791d9d4b255eb.tar.bz2
fork-ledger-720751f8d4a3fedf625a029410d791d9d4b255eb.zip
Explicitly sort when creating the equity report
Diffstat (limited to 'src/filters.cc')
-rw-r--r--src/filters.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/filters.cc b/src/filters.cc
index 3dfd2327..8daf6700 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -1100,17 +1100,17 @@ void posts_as_equity::report_subtotal()
value_t value(pair.second.value.strip_annotations(report.what_to_keep()));
if (! value.is_zero()) {
if (value.is_balance()) {
- foreach (const balance_t::amounts_map::value_type& amount_pair,
- value.as_balance_lval().amounts) {
- if (! amount_pair.second.is_zero())
- handle_value(/* value= */ amount_pair.second,
- /* account= */ pair.second.account,
- /* xact= */ &xact,
- /* temps= */ temps,
- /* handler= */ handler,
- /* date= */ finish,
- /* act_date_p= */ false);
- }
+ value.as_balance_lval().map_sorted_amounts
+ ([&](const amount_t& amt) {
+ if (! amt.is_zero())
+ handle_value(/* value= */ amt,
+ /* account= */ pair.second.account,
+ /* xact= */ &xact,
+ /* temps= */ temps,
+ /* handler= */ handler,
+ /* date= */ finish,
+ /* act_date_p= */ false);
+ });
} else {
handle_value(/* value= */ value.to_amount(),
/* account= */ pair.second.account,