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.
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".
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.
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.
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.
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.
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".
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
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.
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.
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.