summaryrefslogtreecommitdiff
path: root/src/chain.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-04 19:55:27 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-04 19:55:27 -0400
commit2d941730b1c60342be5b108d2d654723b3b7c2cb (patch)
tree6a3f4b7305857e85d2684670492007bafc3668d0 /src/chain.cc
parent73cf3b01fbd50c3a8a4fd96ff69643c28394d8fe (diff)
downloadfork-ledger-2d941730b1c60342be5b108d2d654723b3b7c2cb.tar.gz
fork-ledger-2d941730b1c60342be5b108d2d654723b3b7c2cb.tar.bz2
fork-ledger-2d941730b1c60342be5b108d2d654723b3b7c2cb.zip
Largely removed all of Ledger's use of global variables, for the REPL's sake.
Diffstat (limited to 'src/chain.cc')
-rw-r--r--src/chain.cc18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/chain.cc b/src/chain.cc
index d3ccf11c..f79da543 100644
--- a/src/chain.cc
+++ b/src/chain.cc
@@ -55,7 +55,9 @@ xact_handler_ptr chain_xact_handlers(report_t& report,
// filter_xacts will only pass through xacts matching the
// `display_predicate'.
if (! report.display_predicate.empty())
- handler.reset(new filter_xacts(handler, report.display_predicate));
+ handler.reset(new filter_xacts
+ (handler, item_predicate<xact_t>(report.display_predicate,
+ report.what_to_keep)));
// calc_xacts computes the running total. When this
// appears will determine, for example, whether filtered
@@ -81,7 +83,9 @@ xact_handler_ptr chain_xact_handlers(report_t& report,
descend_exprs.rbegin();
i != descend_exprs.rend();
i++)
- handler.reset(new component_xacts(handler, *i));
+ handler.reset(new component_xacts
+ (handler,
+ item_predicate<xact_t>(*i, report.what_to_keep)));
remember_components = true;
}
@@ -90,7 +94,7 @@ xact_handler_ptr chain_xact_handlers(report_t& report,
// xacts which can be reconciled to a given balance
// (calculated against the xacts which it receives).
if (! report.reconcile_balance.empty()) {
- date_t cutoff = current_date;
+ date_t cutoff = CURRENT_DATE();
if (! report.reconcile_date.empty())
cutoff = parse_date(report.reconcile_date);
handler.reset(new reconcile_xacts
@@ -100,7 +104,9 @@ xact_handler_ptr chain_xact_handlers(report_t& report,
// filter_xacts will only pass through xacts
// matching the `secondary_predicate'.
if (! report.secondary_predicate.empty())
- handler.reset(new filter_xacts(handler, report.secondary_predicate));
+ handler.reset(new filter_xacts
+ (handler, item_predicate<xact_t>(report.secondary_predicate,
+ report.what_to_keep)));
// sort_xacts will sort all the xacts it sees, based
// on the `sort_order' value expression.
@@ -176,7 +182,9 @@ xact_handler_ptr chain_xact_handlers(report_t& report,
if (! report.predicate.empty()) {
DEBUG("report.predicate",
"Report predicate expression = " << report.predicate);
- handler.reset(new filter_xacts(handler, report.predicate));
+ handler.reset(new filter_xacts
+ (handler, item_predicate<xact_t>(report.predicate,
+ report.what_to_keep)));
}
#if 0