Commit graph

44 commits

Author SHA1 Message Date
John Wiegley
e2afc783db Increased file copyrights to 2012 2012-02-29 22:32:23 -06:00
John Wiegley
dea2aed0b5 Untabified all source files 2010-06-11 17:02:25 -04:00
John Wiegley
647d4aac2f 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.
2010-05-30 02:47:40 -06:00
John Wiegley
8f17d01f5e Added new required item_handler_t::clear() method 2010-05-30 02:38:30 -06:00
John Wiegley
a7c28aa200 Added new option --prepend-width
This is useful for making sure that the column containing the results of
--prepend-format is a consistent width throughout the report (including
those lines where it is not applied).

Fixes 64F9D913-75E1-4830-A3D9-29B72442E68B
2010-05-22 21:35:03 -04:00
John Wiegley
02e7825516 Option --count sums payees, account, commodities 2010-05-22 21:35:02 -04:00
John Wiegley
de3803d027 Added new commands: acounts, payees, commodities
These three reports simply dump an unordered list (with the exception of
payees) shows all accounts, payees, and commodities represented in a
given report.  This can be used to easily generate per-entity report,
for example:

  ledger payees | \
  while read payee; do \
    echo ; echo $payee ; \
    ledger reg payee "$payee" ; \
  done
2010-05-22 21:35:02 -04:00
John Wiegley
75b7294a6d Rewrite the "print" command as a custom function
There ended up being too many corner cases for the generalized formatter
to handle.
2010-03-08 01:11:48 -05:00
John Wiegley
ab416f759f Updated copyrights to 2003-2010 2010-03-05 22:14:10 -05:00
John Wiegley
a4b1e7c5ab Added a --prepend-format option
This lets you, for example, debug registers that cull data from many
different sources, without having to change the basic formatting
string.  You can locate each posting's location with this:

  ledger reg --prepend-format='%-25(filename + ":" + beg_line)'
2009-11-11 02:01:24 -05:00
John Wiegley
c3535d06c8 Redesigned the expr_t, predicate_t, query_t classes 2009-11-09 02:06:06 -05:00
John Wiegley
394c7bd8df Removed a bunch of empty comments 2009-11-08 14:59:11 -05:00
John Wiegley
151a8d87ee Fixed sorting in bal reports when --flat is used
Note that sorting on the "total" is not the same thing as sorting on the
"display_total" when multiple commodities are in use and the -X flag is
selected!  One should always sort on display_total, since that's the
value which is shown in the report.  'T' is a synonym for display_total.
2009-10-26 18:52:26 -04:00
John Wiegley
16c77af9c9 If 2+ child accounts are shown, show the parent
Also, also show a final balance if there are multiple accounts
displayed, even if that final balance is zero.
2009-03-15 21:31:06 -04:00
John Wiegley
77faaa926f Rewrote the balance report again, to fix --depth 2009-03-08 04:15:48 -04:00
John Wiegley
f340d50362 Revised the ways statistics are computed
It is no longer done in calc_posts, but recursively on each account.
This allows value expressions to ask statistical questions, like
"earliest cleared posting?" (TBD) from any specific account, computed
lazily.
2009-03-06 04:07:25 -04:00
John Wiegley
c11d325712 Reduced the #include dependency tree to a minimum 2009-03-04 23:53:43 -04:00
John Wiegley
56693fab9b Separator in "balance" now part of format string 2009-02-27 16:23:36 -04:00
John Wiegley
944c63e6f2 The Great Renaming, Part II
The last commit did not contain the majority of changes because of a
slight mishap.  This contains the real changeset.
2009-02-23 19:07:30 -04:00
John Wiegley
a577e8c48e Added a new --raw option, for use with print 2009-02-21 19:45:13 -04:00
John Wiegley
dc63429785 Removed an unused class: format_entries 2009-02-21 19:22:55 -04:00
John Wiegley
31feaad105 Added --no-total option
This simply omits the final total in the balance report, nothing more.
2009-02-20 15:41:49 -04:00
John Wiegley
c1b25fcf86 Rewrote the equity command, which is working again
The old implementation used an account formatter, and was very
specialized.  The new is done as a transaction filter, and works along
with everything else, eliminating bugs special to the equity report.
2009-02-20 02:53:54 -04:00
John Wiegley
9805abbf2b Allow for sorting of the balance report
Sorting is repeated at each level of the hierarchy, unless --flat was
specified in which case it applies to the entire applicable accounts
list.
2009-02-19 16:53:25 -04:00
John Wiegley
4ec2dfeef1 Added --flat option, to flatten the balance report 2009-02-17 21:19:31 -04:00
John Wiegley
93d195f1d9 Only display a final balance total if necessary
In the case where only one top-level account is being reported, there is
no reason to duplicate the total balance shown.
2009-02-17 19:48:42 -04:00
John Wiegley
ce8442a30d Rewrote how the balance command displays accounts
The previous method bent over backwards to try and avoid multiple passes
through the account tree, but the result was a horribly complicated mess
that never ceased to dredge up obscure bugs.  The new scheme is a very,
very simple two-pass algorithm, with multiple subpasses during the
second pass for refining the output based on the report options.
2009-02-17 04:49:10 -04:00
John Wiegley
e3b44038b3 Moved format_accounts::should_display out of line 2009-02-16 21:00:30 -04:00
John Wiegley
32e2d58d43 Simplified the stats command 2009-02-16 05:03:04 -04:00
John Wiegley
479ac0ce36 Fleshed out the "stats" command 2009-02-16 04:50:11 -04:00
John Wiegley
e861c312ac The "xact" variable now returns null for accounts 2009-02-15 21:05:59 -04:00
John Wiegley
78e57ac4cf item_predicate now operates on scope_t
This means item_predicate is no longer a template.
2009-02-15 20:56:48 -04:00
John Wiegley
c8cd2c468e Re-enabled some code, and removed a bunch of deadwood. 2009-02-12 03:30:41 -04:00
John Wiegley
af3be5f964 Wrote the beginnings of a new "stats" command. 2009-02-10 15:57:34 -04:00
John Wiegley
cf6babcf90 Restored all the option handlers from 2.6.2, but not the options themselves. 2009-02-06 03:31:41 -04:00
John Wiegley
408b819c6e Greatly simplified the way option and command handlers are defined. 2009-02-05 21:20:09 -04:00
John Wiegley
1ece3f8b1c Added documentation stubs for all include files and classes. 2009-01-31 15:28:23 -04:00
John Wiegley
cdb123974c Created a new stream.h file for dealing with output streaming. 2009-01-30 00:40:46 -04:00
John Wiegley
887828a40c Increased copyright range to include 2009. 2009-01-20 01:53:31 -04:00
John Wiegley
e4be662c51 Don't try to parse a display predicate if none has been set. 2008-09-18 11:42:32 -04:00
John Wiegley
1b083919c0 Restored the 'print' command. 2008-09-17 21:09:15 -04:00
John Wiegley
6432d7c594 Added back a lot of hacktastic logic from 2.6.1 that made the "bal" command
somewhat smart about how it interpreted certain options.  Beware, code, for
your days are not long-lived.
2008-08-14 04:14:48 -04:00
John Wiegley
3231e380bb The balance output now includes the final total. 2008-08-13 05:48:32 -04:00
John Wiegley
f6f4a46cf5 Moved around most of the files so that source code is in src/, documentation
is in doc/, etc.
2008-08-05 18:05:49 -04:00
Renamed from output.h (Browse further)