summaryrefslogtreecommitdiff
path: root/src/filters.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-09 02:25:53 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-09 02:25:53 -0400
commit659741ac47cf6aaf9c275fe7825885b38910d2eb (patch)
tree181e58873c246685d682e043c8f7cf182c1fb04c /src/filters.cc
parentfc09b69fb765dc934be10d0544b1366f86f21ee2 (diff)
downloadfork-ledger-659741ac47cf6aaf9c275fe7825885b38910d2eb.tar.gz
fork-ledger-659741ac47cf6aaf9c275fe7825885b38910d2eb.tar.bz2
fork-ledger-659741ac47cf6aaf9c275fe7825885b38910d2eb.zip
Insert <Rounding> posts within the affected xact
Diffstat (limited to 'src/filters.cc')
-rw-r--r--src/filters.cc18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/filters.cc b/src/filters.cc
index ebe70181..1385a3f0 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -499,6 +499,11 @@ bool display_filter_posts::output_rounding(post_t& post)
"rounding.new_display_total = " << new_display_total);
}
+ // Allow the posting to be displayed if:
+ // 1. It's display_amount would display as non-zero
+ // 2. The --empty option was specified
+ // 3. The account of the posting is <Revalued>
+
if (post.account == &revalued_account) {
if (show_rounding)
last_display_total = new_display_total;
@@ -522,30 +527,21 @@ bool display_filter_posts::output_rounding(post_t& post)
DEBUG("filters.changed_value.rounding",
"rounding.diff = " << diff);
- xact_t& xact = temps.create_xact();
- xact.payee = _("Commodity rounding");
- xact._date = post.date();
-
handle_value(/* value= */ diff,
/* account= */ &rounding_account,
- /* xact= */ &xact,
+ /* xact= */ post.xact,
/* temps= */ temps,
/* handler= */ handler,
- /* date= */ *xact._date,
+ /* date= */ date_t(),
/* act_date_p= */ true,
/* total= */ precise_display_total,
/* direct_amount= */ true);
}
}
-
if (show_rounding)
last_display_total = new_display_total;
return true;
} else {
- // Allow the posting to be displayed if:
- // 1. It's display_amount would display as non-zero
- // 2. The --empty option was specified
- // 3. The account of the posting is <Revalued>
return report.HANDLED(empty);
}
}