diff options
author | John Wiegley <johnw@newartisans.com> | 2010-05-30 02:28:58 -0600 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-05-30 02:47:40 -0600 |
commit | 647d4aac2fa474085d01f7ea1cebdc34fafd64a6 (patch) | |
tree | c17157d73c3a9d5dd182a4b7b0896e4f31e318be /src/chain.h | |
parent | a41d33fba37460587f59ea0349ac4947a4de9f3c (diff) | |
download | fork-ledger-647d4aac2fa474085d01f7ea1cebdc34fafd64a6.tar.gz fork-ledger-647d4aac2fa474085d01f7ea1cebdc34fafd64a6.tar.bz2 fork-ledger-647d4aac2fa474085d01f7ea1cebdc34fafd64a6.zip |
New: --group-by=EXPR and --group-title-format=FMT
The --group-by option allows for most reports to be split up into
sections based on the varying value of EXPR. For example, to see
register subtotals by payee, use:
ledger reg --group-by=payee -s
This works for separated balances too:
ledger bal --group-by=payee
Another interesting possibility is seeing a register of all the accounts
affected by a related account:
ledger reg -r --group-by=payee
The option --group-title-format can be used to add a separator bar to
the group titles. The option --no-titles can be used to drop titles
altogether.
Diffstat (limited to 'src/chain.h')
-rw-r--r-- | src/chain.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/chain.h b/src/chain.h index 935f2935..59b04eb8 100644 --- a/src/chain.h +++ b/src/chain.h @@ -91,11 +91,25 @@ typedef shared_ptr<item_handler<post_t> > post_handler_ptr; typedef shared_ptr<item_handler<account_t> > acct_handler_ptr; class report_t; + +post_handler_ptr +chain_pre_post_handlers(report_t& report, + post_handler_ptr base_handler); + post_handler_ptr chain_post_handlers(report_t& report, post_handler_ptr base_handler, bool for_accounts_report = false); +inline post_handler_ptr +chain_handlers(report_t& report, + post_handler_ptr handler, + bool for_accounts_report = false) { + handler = chain_post_handlers(report, handler, for_accounts_report); + handler = chain_pre_post_handlers(report, handler); + return handler; +} + } // namespace ledger #endif // _CHAIN_H |