216 lines
7.6 KiB
Text
216 lines
7.6 KiB
Text
|
|
Ledger NEWS
|
|
|
|
* 2.0
|
|
|
|
- The code base was rewritten for clarity and consistency. It is now
|
|
simpler, more robust, and faster.
|
|
|
|
- The most significant feature addition in this version is the use of
|
|
"value expressions". These are now used in many places to indicate
|
|
what to display, the sorting order, and even the output format.
|
|
|
|
A value expression is a simple string that uses one letter codes to
|
|
indicate transaction, entry and account details. Logic and math
|
|
operators are supported, as well as a few useful functions. See the
|
|
README.
|
|
|
|
- If the environment variable LEDGER is used, a binary cache of that
|
|
current ledger will be kept, to speed up later queries of the same
|
|
data. The default location is in ~/.ledger, but this can be changed
|
|
with the environment variable LEDGER_CACHE. This only happens if no
|
|
"-f" flag was seen (i.e., if the LEDGER environment variable is
|
|
used).
|
|
|
|
- New "-o FILE" option will output data to the given FILE. If FILE is
|
|
"-", the output is the same as the default (stdout).
|
|
|
|
- New -j and -J options replace the old -G (gnuplot) option. -j
|
|
reports the values column in a way gnuplot can consume, and -J
|
|
reports the totals column. An example can be found in
|
|
scripts/report.
|
|
|
|
- New "-y DATEFMT" options will change the date format used throughout
|
|
ledger. The default is "%Y/%m/%d".
|
|
|
|
- New -Y and -W options prints yearly and weekly subtotals, just as
|
|
the -M option printed monthly subtotals in the previous version.
|
|
|
|
- New "-z INTERVAL" allows for more flexible interval reporting. The
|
|
sublanguage used will probably mature over time, but for now it
|
|
supports expression like:
|
|
|
|
monthly
|
|
every week
|
|
every 3 quarters
|
|
weekly from 12/20
|
|
|
|
Note that when using the "from" date, this does not constrain the
|
|
report. It is only used for aligning report dates, for example if
|
|
you wish weekly reporting to start on Sundays.
|
|
|
|
- Regexps specified after the command name now apply to account names
|
|
only. To search on a payee, use "--" to separate the two kinds of
|
|
regexps. For example, to find a payee named "John" within all
|
|
Expenses accounts, use:
|
|
|
|
ledger register expenses -- john
|
|
|
|
FYI: The above command is identical (and internally converted) to:
|
|
|
|
ledger -l "/expenses/|//john/" register
|
|
|
|
- To include entries from a file into a specific account, use:
|
|
|
|
@ ACCOUNT
|
|
!include FILE
|
|
@@
|
|
|
|
All entries specified within the "@ ACCOUNT/@@" range will be added
|
|
under that account.
|
|
|
|
- Register reports now show the account being changed. Use the -r
|
|
option to see "other accounts" -- or the account the credit/debit
|
|
came from. (This was the old behavior in 1.x, but can lead to
|
|
confusing reports when viewing accounts with subaccounts.) The -r
|
|
option also works for balance reports, where it will show all the
|
|
account totals related to your query.
|
|
|
|
- There are several new default reporting styles, which work both in
|
|
the balance and register reports:
|
|
|
|
-O Show base values (this is the default, and old behavior)
|
|
-B Show the basis cost of commodities
|
|
-V Show the last known market value of commodities
|
|
-G Report net gain/loss (shows commodity changes only)
|
|
-A Report average value (arithmetic mean)
|
|
-D Report deviation from the average value
|
|
-Z Report the trend (average rate of change)
|
|
-W Report the trend, with older values affecting the trend less
|
|
-X Report expected amount for the next transaction
|
|
|
|
- Automated transactions now use a single value expression as a
|
|
predicate. This means the new syntax is:
|
|
|
|
= VALUE-EXPR
|
|
TRANSACTIONS...
|
|
|
|
Only one VALUE-EXPR is supported, compared to the multiple account
|
|
regexps supported before. By using a VALUE-EXPR as a predicate,
|
|
matching may now be much more comprehensive and selective.
|
|
|
|
- The use of "+" and "-" in ledger files (to specify permanent
|
|
regexps) has been removed.
|
|
|
|
- The -G switch no longer generates gnuplot-safe data. It now reports
|
|
totals in terms of net gain/loss.
|
|
|
|
- The -l flag now takes an expression string as a "predicate".
|
|
Therefore, to equal the old behavior of "-l $100", you would use:
|
|
|
|
-l AT<{$100}
|
|
|
|
- The -S flag now takes an expression string, which yields the value
|
|
that will be sorted on.
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
- Value expressions are now supported, where the totals reported can
|
|
be changed using -t and -T and an expression string composed of:
|
|
|
|
a amount
|
|
B current balance
|
|
T amount total (B + a)
|
|
c cost
|
|
C cost total
|
|
v market value(amount, date)
|
|
V total market value(amount total, date)
|
|
g net gain (v - c)
|
|
G total net gain (V - C)
|
|
d date (in seconds past the epoch)
|
|
i index (within the report)
|
|
o item age = date - report begin date
|
|
w item newness = report end date - date
|
|
|
|
b report begin date
|
|
e report end date
|
|
|
|
P(x,y) market price of x at time y (i.e., V = p(A,d))
|
|
Mx total arthmetic of x (x/n)
|
|
Bx deviation = a - x
|
|
Ax absolute (positive) value of x
|
|
{x} parse x as a ledger amount
|
|
/s/ 1 if full account name matches s
|
|
|
|
in precedence order:
|
|
-?[0-9]*.[0-9]+ numerical constants
|
|
binary operators: * /
|
|
binary operators: + -
|
|
comparison operators: = < <= > >=
|
|
logical operators: ! & |
|
|
(x) parenthetical grouping
|
|
|
|
The standard reports are therefore implemented as:
|
|
|
|
-O == -t a -T A
|
|
-B == -t c -T C
|
|
-V == -t c -T V
|
|
-G == -t g -T G
|
|
-A == -t a -T MA
|
|
-D == -t a -T DMA
|
|
-T == -t a -T MDMA
|
|
-W == -t a -T MD(MA*(d-b/e-b))
|
|
-X == -t a -T a+MD(MA*(d-b/e-b))
|
|
|
|
- User-specified format strings are supported with a -F option. The
|
|
strings are very much like printf format strings, with the following
|
|
syntax for each substitution:
|
|
|
|
%?-m.MX
|
|
|
|
Each part of the above except for X is optional, and means:
|
|
|
|
? field is blank if reporting on a "subsequent line" (within
|
|
the register report, when viewing splits)
|
|
- left justify field (default is right)
|
|
m minimum width of the field
|
|
. indicates that a maximum width is being specified
|
|
M maximum width of the field; values are truncated to fit
|
|
|
|
And where X may be any one of:
|
|
|
|
% self-insert
|
|
d same as %[%Y/%m/%d]
|
|
[datefmt] pass 'datefmt' to strftime for the entry
|
|
p the payee
|
|
a the custom account name (report dependent)
|
|
n the real account name (balance report only)
|
|
N full account name (balance report only)
|
|
t whatever the specified value expression is
|
|
T whatever the specified total expression is
|
|
(expr) insert an arbitrary style expression
|
|
|
|
The default format for the register and balance reports are:
|
|
|
|
%?10d %?-.20p %-.22a %12.66t %12.80T
|
|
%20T %-a
|
|
|
|
* 1.7
|
|
|
|
- Pricing histories are now supported, so that ledger remembers
|
|
historical pricing of all commodities, and can give register reports
|
|
based on past and present market values, as well as the original
|
|
cost basis. See README for more details on the new option switches.
|
|
|
|
* 1.6
|
|
|
|
- Can now parse timeclock files. These are simple timelogs that track
|
|
in/out events, which can be maintained using my timeclock tool. By
|
|
allowing ledger to parse these, it means that reporting can be done
|
|
on them in the same way as a ledger file (the commodities is "h",
|
|
for hours); and it means that doing things like tracking billable
|
|
hours for clients, and invoicing those clients to transfer those
|
|
hours into a dollar value via a receivable account, is now trivial.
|
|
See the docs for more on how to do this.
|
|
|
|
- Began keeping NEWS file. :)
|