Commit graph

59 commits

Author SHA1 Message Date
John Wiegley
8bd362b5d1 Minor optimization of how non --empty is handled 2010-06-07 08:32:13 -04:00
John Wiegley
39f9854e2c Reworked the way that <Rounding> entries are shown
Fixes #188 / 53BCED29-F3B9-4E02-9A35-6C739ABB9662
2010-06-06 06:20:07 -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
a41d33fba3 Option --rounding inverted to --no-rounding 2010-05-30 02:47:40 -06:00
John Wiegley
7bddcd676b Added --rounding option, which is off by default
The purpose of this option is to add special "<Rounding>" postings, to
ensure that a regiter's running total is *always* the sum of its
postings.  Within --rounding, these adjustment postings are missing,
which was the behavior in Ledger 2.x.  It can be orders of magnitude
slower to turn it on for large reports with many commodities.
2010-05-23 15:45:51 -06:00
John Wiegley
0e34d08b8d The --pivot=X option now only matches the tag "X" 2010-03-17 00:56:21 -04:00
John Wiegley
91f839e827 Do not implicitly sort register output
The switches the default back to the same as 2.x, which is --unsorted.
2010-03-17 00:49:11 -04:00
John Wiegley
ab416f759f Updated copyrights to 2003-2010 2010-03-05 22:14:10 -05:00
John Wiegley
1413085977 Added a --pivot=TAG option
This is equivalent to the following:

  --account='"TAG:" + tag(/TAG/)'
2010-02-02 17:07:05 -05:00
John Wiegley
63fee4c837 Added an --unrealized option, for use with bal -V
When this option is on, then in balance report which show market values,
any gains or losses in value will be balanced into a pair of accounts
called Equity:Unrealized Gains and Equity:Unrealized Losses.
2009-11-19 02:00:10 -05:00
John Wiegley
0c3a6234a9 Don't auto-sort transactions for the balance report 2009-11-19 01:26:50 -05:00
John Wiegley
20965d9fa3 Changed several pointers to references in filters 2009-11-19 01:26:34 -05:00
John Wiegley
ae8b57f157 Renamed bool controlling running total calculations
It used to be "account_wise", since it only happens for non-account-wise
reports.  Now it's called just "calc_running_total", so anyone can
request it.
2009-11-18 23:25:28 -05:00
John Wiegley
539887b3fb Changed only_preliminaries to for_accounts_report 2009-11-18 23:13:33 -05:00
John Wiegley
67c9cf134d Added --date, similar to --account and --payee
This lets you do things like store a date as the value of a tag, then
run:

  ledger --date='has_tag("Foo") ? to_date(tag("Foo")) : date' reg
2009-11-11 21:32:32 -05:00
John Wiegley
c3535d06c8 Redesigned the expr_t, predicate_t, query_t classes 2009-11-09 02:06:06 -05:00
John Wiegley
a05d39b722 Renamed --set-reported-account to just --account
This fits better with the --amount and --total options, which both
change the amount and total used for calculation.  Same with --account:
it happens after filtering, but before calculation so that balance
reports look as you'd expect.
2009-11-06 02:39:30 -05:00
John Wiegley
449c7ca790 New: --set-reported-account, --set-reported-payee 2009-11-01 21:15:11 -05:00
John Wiegley
b0f12c600c Added a --forecast-years option
This sets how many years of forecasting Ledger will do before it
terminates the attempt.
2009-10-31 03:07:15 -04:00
John Wiegley
63aa8992a8 Moved ownership of master account into journal_t
The journal_t now completely represents the data part of a session.
2009-10-30 19:03:28 -04:00
John Wiegley
559566751d Sort by default unless --unsorted is selected 2009-10-28 01:17:10 -04:00
John Wiegley
588f2ef2f5 Fixed many compiler warnings from g++ 4.4 2009-10-25 05:01:39 -04:00
John Wiegley
110f0b8023 Enabled use of pre-compiled headers by default 2009-03-10 17:02:03 -04:00
John Wiegley
dd23edd5ce Implemented --unround using value expressions 2009-03-06 00:27:16 -04:00
John Wiegley
fb9af0f111 Removed the --totals option 2009-03-05 23:26:21 -04:00
John Wiegley
c11d325712 Reduced the #include dependency tree to a minimum 2009-03-04 23:53:43 -04:00
John Wiegley
eb45a0a4f4 Normalized how account totals are calculated 2009-03-03 17:08:11 -04:00
John Wiegley
c49b98fc4c Added an --unround option, to show full precision 2009-02-27 03:04:05 -04:00
John Wiegley
d58797e98c The -B, -G, -V reports now show rounding amounts
This way, if the running total is off by a penny or two due to rounding
of one or more commodities in the account, the user will see it.

This commit also reorganizes the testing code a bit, which I did after
adding the ninth test series (ConfirmTests), to validate the new
rounding code.
2009-02-26 03:16:39 -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
a576842865 Added --revalued-total option, used by --gain
This option sets the total by which revalued transactions are
determined.  Only needed if the display total is not appropriate.
2009-02-23 15:37:39 -04:00
John Wiegley
9f53efbf5f Many fixes to both --market and --exchange 2009-02-23 01:51:23 -04:00
John Wiegley
cebc1da256 Restored the --invert option 2009-02-22 04:51:08 -04:00
John Wiegley
d0ac3a2e4e Added a new --exact option
The purpose of this option is that usually when you do a --monthly
periodic report, you see dates ranges from the first day of each month,
to the last day.  With --exact, the first day of each range will be the
date of the first transaction found in that range, and likewise with the
end of the range.  Essentially it "contracts" the reported period dates
to reflect the exact begin and end dates.
2009-02-21 02:14:53 -04:00
John Wiegley
23725ffafb Restored --forecast, now also --forecast-while 2009-02-21 00:12:22 -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
26ddb8343c Don't sort or subtotal xacts for account reports 2009-02-19 15:47:54 -04:00
John Wiegley
e1c37aeee8 Improved the --collapse filter
It now takes the --display and --only predicates into account, so that
it never appears to be collapsing single transactions.

There are cases where there are multiple transactions, but the display
or only predicate filters them out, so that if collapse didn't consider
this, the user would wonder why a single transaction was being collapsed
-- since they'd never see that collapse saw more than two.
2009-02-17 05:22:59 -04:00
John Wiegley
72cdb41727 Added new --set-acount and --set-payee options
These fully generalize the previous --payee-as-account and such options,
which, for example, is now implemented to be the same as saying,
"--set-account payee".
2009-02-16 20:50:20 -04:00
John Wiegley
15bfeb3cb1 Added several new reporting options
To help with gathering specific reports:

 - --payee-as-account copies the entry's payee field to the account,
   allowing the subtotal report to show unique payees for each period.
 - --comm-as-account copies the transaction's amount's commodity to the
   account.
 - --code-as-account copies the entry's code to the account

Also created aliases for some of these options, for conistency's sake:

 - --commodity-as-payee is now an alias for --comm-as-payee
 - --commodity-as-account is now an alias for --comm-as-account
2009-02-16 18:11:23 -04:00
John Wiegley
275da22752 Fixed the --head and --tail options 2009-02-16 17:17:57 -04:00
John Wiegley
8c2a70e197 Made several of the filters more context aware
This resolves certain issues where value expressions were not being
looked up within their full context.
2009-02-15 23:00:16 -04:00
John Wiegley
14ffc2b31a Don't apply all filters for account-wise reports
This creates its own problems; instead, only most are used.
2009-02-15 22:57:23 -04:00
John Wiegley
bfa6a643a1 Improved handling of --empty option
For example, in period reports null transactions are only generated for
empty periods if --empty is used.  Otherwise, the presence of such
transactions can get confusing.
2009-02-15 20:59:13 -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
5d4ac67920 chain_xact_handlers now always operators the same
Previously, account-wise reports used a subset of the total number of
transaction filters, but this could cause confusing results, and made
some reports immpossible (such as account-wise monthly averages).
2009-02-15 20:45:09 -04:00
John Wiegley
36b96c47ac Have interval_xacts construct temps on a list 2009-02-14 23:38:14 -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
ba95808ab0 Sort period transactions by "date", not by "d". 2009-02-10 05:05:36 -04:00
John Wiegley
37a1989ca0 Added a new --collapse-if-zero option. 2009-02-09 15:07:28 -04:00