diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-23 01:51:23 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-23 01:51:23 -0400 |
commit | 9f53efbf5f8e49b9c4dbe8c3ff595e99903b3aab (patch) | |
tree | acf41ff447a8d2adac68c51f40f0a50e846133c8 /src/report.cc | |
parent | de6de07bac1337b0dd87b41c853369dc8432c2af (diff) | |
download | fork-ledger-9f53efbf5f8e49b9c4dbe8c3ff595e99903b3aab.tar.gz fork-ledger-9f53efbf5f8e49b9c4dbe8c3ff595e99903b3aab.tar.bz2 fork-ledger-9f53efbf5f8e49b9c4dbe8c3ff595e99903b3aab.zip |
Many fixes to both --market and --exchange
Diffstat (limited to 'src/report.cc')
-rw-r--r-- | src/report.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/report.cc b/src/report.cc index 22ed926c..b8eecdfa 100644 --- a/src/report.cc +++ b/src/report.cc @@ -120,7 +120,7 @@ value_t report_t::fn_display_total(call_scope_t& scope) return HANDLER(display_total_).expr.calc(scope); } -value_t report_t::fn_market_value(call_scope_t& scope) +value_t report_t::fn_market(call_scope_t& scope) { interactive_t args(scope, "a&ts"); @@ -132,12 +132,16 @@ value_t report_t::fn_market_value(call_scope_t& scope) p; p = std::strtok(NULL, ",")) { if (commodity_t * commodity = amount_t::current_pool->find(trim_ws(p))) { + DEBUG("report.market", "Searching for value of " << args.value_at(0) + << " in terms of commodity " << commodity->symbol()); value_t result = args.value_at(0).value(false, args.has(1) ? args.get<datetime_t>(1) : optional<datetime_t>(), *commodity); - if (! result.is_null()) + if (! result.is_null()) { + DEBUG("report.market", "Market value is = " << result); return result; + } } } } else { @@ -621,7 +625,7 @@ expr_t::ptr_op_t report_t::lookup(const string& name) case 'm': if (is_eq(p, "market")) - return MAKE_FUNCTOR(report_t::fn_market_value); + return MAKE_FUNCTOR(report_t::fn_market); break; case 'o': |