Commit graph

67 commits

Author SHA1 Message Date
John Wiegley
afe3a899c6 Fixed the operation of --head and --tail 2009-02-27 14:10:28 -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
238bd7f8a5 Marked all strings needing internationalization
These strings are now collected automagically in the file po/ledger.pot.
If you'd like to produce a translation, just run this command after
building Ledger:

    msginit -l LOCALE -o LANG.po -i po/ledger.pot

Where LOCALE is a string like de or en_GB, and LANG is a short
descriptive word for your language.

Then send me this .po file so I can commit it to the Ledger sources
(alternatively, you could maintain the file in a fork on GitHub), and
setup the build script to format and install your new message catalog
during a "make install".
2009-02-25 03:51:42 -04:00
John Wiegley
625b94cf04 Switched from using POST_AUTO to ITEM_GENERATED 2009-02-24 02:23:20 -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
17fe4b752c If handle_value sees a sequence, make it compound 2009-02-23 15:39:18 -04:00
John Wiegley
4ab50df564 Don't report collapsed subtotal if no xacts seen 2009-02-23 14:44:10 -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
6548da04cd Fixed another memory bug in by_payee_xacts 2009-02-21 04:12:10 -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
fc349389e3 Restored the --budget option 2009-02-20 23:12:23 -04:00
John Wiegley
8ed4f3562f Added more option baseline tests, enabled --dow 2009-02-20 19:36:28 -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
7d1f125fa2 Renamed a debug category to be consistent 2009-02-19 14:21:00 -04:00
John Wiegley
33786a5c8a Moved an exception, so the report is more general 2009-02-19 13:26:22 -04:00
John Wiegley
4414fddb00 Fixed use of the -p flag without an interval
That is, -p 2004/01 is equivalent to "-b 2004/01/01 -e 2004/01/31"
again.
2009-02-17 22:57:02 -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
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
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
e3b40f5bb6 Fixed how subtotal date ranges are computed 2009-02-16 02:31:21 -04:00
John Wiegley
4dbd124e22 Revert "Propagate xact effective date in two places"
This reverts commit 17a0ab8407.
2009-02-16 02:16:34 -04:00
John Wiegley
17a0ab8407 Propagate xact effective date in two places 2009-02-16 01:19:59 -04:00
John Wiegley
be208ef260 Report collapsed xacts using earliest date 2009-02-16 01:14:23 -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
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
e199e3863c Fixed a call to value_t::cast to use in_place_cast 2009-02-15 19:44:45 -04:00
John Wiegley
a1e1133c80 Whitespace fixes 2009-02-15 19:43:46 -04:00
John Wiegley
03219d910f Added xact_t::count member
This allows reports to access the "whicheth" index of the reported
transaction.  It's used mainly by the --average report, which divides
the running total by this count to get the arithmetic mean.
2009-02-15 15:41:24 -04:00
John Wiegley
36b96c47ac Have interval_xacts construct temps on a list 2009-02-14 23:38:14 -04:00
John Wiegley
50f434a5e3 Generate null transactions for empty periods
For example, if one uses -M to generate a monthly report for an entire
year, and there are no transaction in the month of February, ordinarily
Ledger would report nothing for that month, even if -E were used.  Now
"null transactions" are generated for periods without any activity, in
order to make certain reports -- such as running monthly averages --
more accurate.

For example, instead of -MA being just a monthly running average of
months with activity, it is now a true average among all months during
the reported period.
2009-02-14 05:55:09 -04:00
John Wiegley
7fb55eedef Re-enabled periodic reporting options (-M, etc) 2009-02-14 04:31:15 -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
6ca01af594 Fixed the use of --effective and --date-format (-y). 2009-02-09 17:27:54 -04:00
John Wiegley
37a1989ca0 Added a new --collapse-if-zero option. 2009-02-09 15:07:28 -04:00
John Wiegley
3f7104e9be Removed the balance_pair_t type, since it's now an unneeded abstraction.
This type was a holdback from the days before the amount_expr was used
everywhere to determine a transaction's value.
2009-02-09 14:54:42 -04:00
John Wiegley
02110394b4 Use the report's amount_expr everywhere that computes an xact's amount. 2009-02-09 14:53:29 -04:00
John Wiegley
4d8fba5fad Always calculate transaction totals based on the expression for the amount. 2009-02-09 01:33:45 -04:00
John Wiegley
391300aea2 Had to step back from a change that was breaking regular reports. 2009-02-09 00:57:56 -04:00
John Wiegley
0cb8049c41 Pass amount expression to calc_xacts, to be used for computing the total. 2009-02-08 23:57:30 -04:00
John Wiegley
02bd9d29cf Improved an error message that was trying to show transaction context. 2009-02-08 20:05:56 -04:00
John Wiegley
1de748fc13 Removed an unnecessary boolean test. 2009-02-07 18:41:52 -04:00
John Wiegley
589eabd8e6 Threw away the "multiple parser" infrastructure. 2009-02-07 17:45:48 -04:00
John Wiegley
cdcd52dbaf Removed the nearly unknown --descend and --descend-if options. 2009-02-06 23:36:32 -04:00
John Wiegley
04ac5ffcb4 Whitespace fix. 2009-02-04 20:45:43 -04:00
John Wiegley
2d941730b1 Largely removed all of Ledger's use of global variables, for the REPL's sake. 2009-02-04 19:55:27 -04:00
John Wiegley
24ef163ba5 Removed unneeded member variables. 2009-02-04 00:35:02 -04:00