diff options
author | John Wiegley <johnw@newartisans.com> | 2010-03-07 22:47:07 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-03-08 01:11:48 -0500 |
commit | 75b7294a6db10e7f7b18b6aeef1aa0f568124a1d (patch) | |
tree | 0fecbc12acaacb33cf3c241c536de3347d2742ed /src/report.h | |
parent | 7e79cd82cd4ad5f87f40e6beebdb53e65bb11168 (diff) | |
download | fork-ledger-75b7294a6db10e7f7b18b6aeef1aa0f568124a1d.tar.gz fork-ledger-75b7294a6db10e7f7b18b6aeef1aa0f568124a1d.tar.bz2 fork-ledger-75b7294a6db10e7f7b18b6aeef1aa0f568124a1d.zip |
Rewrite the "print" command as a custom function
There ended up being too many corner cases for the generalized formatter
to handle.
Diffstat (limited to 'src/report.h')
-rw-r--r-- | src/report.h | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/src/report.h b/src/report.h index 893ee3ae..682c2414 100644 --- a/src/report.h +++ b/src/report.h @@ -144,6 +144,7 @@ public: value_t fn_is_seq(call_scope_t& scope); value_t fn_strip(call_scope_t& scope); value_t fn_trim(call_scope_t& scope); + value_t scrub(value_t val); value_t fn_scrub(call_scope_t& scope); value_t fn_quantity(call_scope_t& scope); value_t fn_rounded(call_scope_t& scope); @@ -280,7 +281,7 @@ public: HANDLER(price).report(out); HANDLER(prices_format_).report(out); HANDLER(pricedb_format_).report(out); - HANDLER(print_format_).report(out); + HANDLER(print_virtual).report(out); HANDLER(quantity).report(out); HANDLER(quarterly).report(out); HANDLER(raw).report(out); @@ -748,23 +749,7 @@ public: "P %(datetime) %(account) %(scrub(display_amount))\n"); }); - OPTION__(report_t, print_format_, CTOR(report_t, print_format_) { - on(none, - "%(xact.date)" - "%(!effective & xact.effective_date ?" - " \"=\" + xact.effective_date : \"\")" - "%(xact.cleared ? \" *\" : (xact.pending ? \" !\" : \"\"))" - "%(code ? \" (\" + code + \")\" :" - " \"\") %(payee)%(xact.comment)\n" - " %(xact.uncleared ?" - " (cleared ? \"* \" : (pending ? \"! \" : \"\")) : \"\")" - "%(calculated ? account : justify(account, 34, -1, false))" - "%(calculated ? \"\" : \" \" + justify(scrub(amount), 12, -1, true))" - "%(has_cost & !cost_calculated ?" - " \" @ \" + justify(scrub(abs(cost / amount)), 0) : \"\")" - "%(comment)\n%/" - " %$7%$8%$9%$A%$B\n%/\n"); - }); + OPTION(report_t, print_virtual); OPTION_(report_t, quantity, DO() { // -O parent->HANDLER(revalued).off(); |