203 lines
7 KiB
Text
203 lines
7 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 (or LEDGER_FILE) is used, a
|
|
binary cache of that ledger will be kept in ~/.ledger (or
|
|
LEDGER_CACHE), to speed up later queries of the same data. This
|
|
happens only when "-f" or "--file" is not used.
|
|
|
|
- New options:
|
|
|
|
"-o FILE" outputs data to the given FILE. If "-", the output is the
|
|
same as the default (stdout).
|
|
|
|
-j and -J options replace previous -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.
|
|
|
|
"-y DATEFMT" changes the date format used in register reports. The
|
|
default is "%Y/%m/%d".
|
|
|
|
-Y and -W print yearly and weekly subtotals, just as the -M option
|
|
printed monthly subtotals in the previous version.
|
|
-w shows cumulative totals for each of the days of the week.
|
|
|
|
"-z INTERVAL" allows 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
|
|
|
|
-O shows base values (this is the default, and old behavior)
|
|
-B shows basis cost of commodities
|
|
-V show market value of commodities
|
|
-G reports net gain/loss (shows commodity changes only)
|
|
-A reports average value (arithmetic mean)
|
|
-D reports deviation from the average value
|
|
-X reports the trend (average rate of change)
|
|
-Z reports the trend, with older values affecting the trend less
|
|
|
|
- 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.
|
|
|
|
- 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.
|
|
|
|
- -l now takes a value expression as the "calculation predicate".
|
|
To mimic the old behavior of "-l \$100", use: -d "AT<{\$100}"
|
|
|
|
- The -S flag takes a value 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. :)
|