summaryrefslogtreecommitdiff
path: root/src/report.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-06-16 18:49:27 +0100
committerJohn Wiegley <johnw@newartisans.com>2009-06-16 18:49:27 +0100
commit3a926da4cbffe903d138f8df9f5cb33332ff1030 (patch)
treeb090a19c1d59b339c17b65e6d322889d3d76e9c8 /src/report.h
parent849e4b2fbbfc08f62550145b61d3e2b442777c86 (diff)
downloadfork-ledger-3a926da4cbffe903d138f8df9f5cb33332ff1030.tar.gz
fork-ledger-3a926da4cbffe903d138f8df9f5cb33332ff1030.tar.bz2
fork-ledger-3a926da4cbffe903d138f8df9f5cb33332ff1030.zip
When --end is used, set a "terminus" date
This means that final balance valuations (with -V or -X) will be done in terms of the date given to --end, rather than based on the current day. Fixes 647D5DB9-DBBB-47C8-80CE-F3F70E3B0253
Diffstat (limited to 'src/report.h')
-rw-r--r--src/report.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/report.h b/src/report.h
index a1c93c39..d48b5a78 100644
--- a/src/report.h
+++ b/src/report.h
@@ -119,10 +119,12 @@ public:
#define BUDGET_BUDGETED 0x01
#define BUDGET_UNBUDGETED 0x02
+ date_t terminus;
uint_least8_t budget_flags;
explicit report_t(session_t& _session)
- : session(_session), budget_flags(BUDGET_NO_BUDGET) {}
+ : session(_session), terminus(CURRENT_DATE()),
+ budget_flags(BUDGET_NO_BUDGET) {}
virtual ~report_t() {
output_stream.close();
@@ -154,6 +156,15 @@ public:
value_t fn_format_date(call_scope_t& scope);
value_t fn_ansify_if(call_scope_t& scope);
+#if 0
+ value_t fn_now(call_scope_t&) {
+ return CURRENT_TIME();
+ }
+#endif
+ value_t fn_today(call_scope_t&) {
+ return terminus;
+ }
+
value_t fn_options(call_scope_t&) {
return value_t(static_cast<scope_t *>(this));
}
@@ -476,9 +487,8 @@ public:
string predicate =
"date<[" + to_iso_extended_string(*interval.start) + "]";
parent->HANDLER(limit_).on(string("--end"), predicate);
-#if 0
- terminus = interval.begin;
-#endif
+
+ parent->terminus = *interval.start;
});
OPTION(report_t, equity);