blob: 339e90d4bd84891a5b009ddbe8c6d46dc3075c0b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf460
{\fonttbl\f0\fmodern\fcharset0 Courier;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\sl264\slmult1\ql\qnatural\pardirnatural
\f0\fs28 \cf0 The @command\{xact\} commands simplifies the creation of new transactions.\
It works on the principle that 80% of all postings are variants of\
earlier postings. Here's how it works:\
\
Say you currently have this posting in your ledger file:\
\
@smallexample\
2004/03/15 * Viva Italiano\
Expenses:Food $12.45\
Expenses:Tips $2.55\
Liabilities:MasterCard $-15.00\
@end smallexample\
\
Now it's @samp\{2004/4/9\}, and you've just eating at @samp\{Viva\
Italiano\} again. The epost amounts are different, but the overall\
form is the same. With the @command\{xact\} command you can type:\
\
@example\
ledger xact 2004/4/9 viva food 11 tips 2.50\
@end example\
\
This produces the following output:\
\
@smallexample\
2004/04/09 Viva Italiano\
Expenses:Food $11.00\
Expenses:Tips $2.50\
Liabilities:MasterCard $-13.50\
@end smallexample\
\
It works by finding a past posting matching the regular expression\
@samp\{viva\}, and assuming that any accounts or amounts specified will\
be similar to that earlier posting. If Ledger does not succeed in\
generating a new transaction, an error is printed and the exit code is set\
to @samp\{1\}.\
\
There is a shell script in the distribution's @file\{scripts\} directory\
called @file\{xact\}, which simplifies the task of adding a new transaction\
to your ledger. It launches @command\{vi\} to confirm that the transaction\
looks appropriate.\
\
Here are a few more examples of the @command\{xact\} command, assuming\
the above journal transaction:\
\
@example\
ledger xact 4/9 viva 11.50\
ledger xact 4/9 viva 11.50 checking # (from `checking')\
ledger xact 4/9 viva food 11.50 tips 8\
ledger xact 4/9 viva food 11.50 tips 8 cash\
ledger xact 4/9 viva food $11.50 tips $8 cash\
ledger xact 4/9 viva dining "DM 11.50"\
@end example}
|