Added --actual-dates, for overriding --effective
This is so that if someone has --effective in their .ledgerrc, they can force the use of actual dates.
This commit is contained in:
parent
07cca71893
commit
828a1e8bf9
3 changed files with 7 additions and 1 deletions
|
|
@ -419,7 +419,9 @@ void global_scope_t::normalize_report_options(const string& verb)
|
||||||
report_t& rep(report());
|
report_t& rep(report());
|
||||||
|
|
||||||
// jww (2009-02-09): These globals are a hack, but hard to avoid.
|
// jww (2009-02-09): These globals are a hack, but hard to avoid.
|
||||||
item_t::use_effective_date = rep.HANDLED(effective);
|
item_t::use_effective_date = (rep.HANDLED(effective) &&
|
||||||
|
! rep.HANDLED(actual_dates));
|
||||||
|
|
||||||
rep.session.commodity_pool->keep_base = rep.HANDLED(base);
|
rep.session.commodity_pool->keep_base = rep.HANDLED(base);
|
||||||
rep.session.commodity_pool->get_quotes = rep.session.HANDLED(download);
|
rep.session.commodity_pool->get_quotes = rep.session.HANDLED(download);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -506,6 +506,7 @@ option_t<report_t> * report_t::lookup_option(const char * p)
|
||||||
OPT(abbrev_len_);
|
OPT(abbrev_len_);
|
||||||
else OPT(account_);
|
else OPT(account_);
|
||||||
else OPT(actual);
|
else OPT(actual);
|
||||||
|
else OPT(actual_dates);
|
||||||
else OPT(add_budget);
|
else OPT(add_budget);
|
||||||
else OPT(amount_);
|
else OPT(amount_);
|
||||||
else OPT(amount_data);
|
else OPT(amount_data);
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,7 @@ public:
|
||||||
HANDLER(abbrev_len_).report(out);
|
HANDLER(abbrev_len_).report(out);
|
||||||
HANDLER(account_).report(out);
|
HANDLER(account_).report(out);
|
||||||
HANDLER(actual).report(out);
|
HANDLER(actual).report(out);
|
||||||
|
HANDLER(actual_dates).report(out);
|
||||||
HANDLER(add_budget).report(out);
|
HANDLER(add_budget).report(out);
|
||||||
HANDLER(amount_).report(out);
|
HANDLER(amount_).report(out);
|
||||||
HANDLER(amount_data).report(out);
|
HANDLER(amount_data).report(out);
|
||||||
|
|
@ -317,6 +318,8 @@ public:
|
||||||
parent->HANDLER(limit_).on(string("--actual"), "actual");
|
parent->HANDLER(limit_).on(string("--actual"), "actual");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
OPTION(report_t, actual_dates);
|
||||||
|
|
||||||
OPTION_(report_t, add_budget, DO() {
|
OPTION_(report_t, add_budget, DO() {
|
||||||
parent->budget_flags |= BUDGET_BUDGETED | BUDGET_UNBUDGETED;
|
parent->budget_flags |= BUDGET_BUDGETED | BUDGET_UNBUDGETED;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue