Skip to content

Commit

Permalink
Explicitly sort when creating the equity report
Browse files Browse the repository at this point in the history
  • Loading branch information
jwiegley committed Mar 16, 2019
1 parent a1f94a0 commit 720751f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/filters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 720751f

Please sign in to comment.