88 lines
No EOL
3.1 KiB
Text
88 lines
No EOL
3.1 KiB
Text
{\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 Ledger has seven basic commands, but by far the most often used are\
|
|
@command\{balance\} and @command\{register\}. To see a summary balance of\
|
|
all accounts, use:\
|
|
\
|
|
@example\
|
|
ledger bal\
|
|
@end example\
|
|
\
|
|
@command\{bal\} is a short-hand for @command\{balance\}. This command\
|
|
prints out the summary totals of the five parent accounts used in\
|
|
@file\{sample.dat\}:\
|
|
\
|
|
@smallexample\
|
|
$1,480.00\
|
|
50 AAPL Assets\
|
|
$-2,500.00 Equity\
|
|
$20.00 Expenses\
|
|
$-500.00 Income\
|
|
$-2.00 Liabilities\
|
|
--------------------\
|
|
$-1,502.00\
|
|
50 AAPL \
|
|
@end smallexample\
|
|
\
|
|
None of the child accounts are shown, just the parent account totals.\
|
|
We can see that in @samp\{Assets\} there is $1,480.00, and 50 shares of\
|
|
Apple stock. There is also a negative grand total. Usually the grand\
|
|
total is zero, which means that all accounts balance@footnote\{It is\
|
|
impossible for accounts not to balance in ledger; it reports an error\
|
|
if a posting does not balance\}. In this case, since the 50 shares\
|
|
of Apple stock cost $1,500.00 dollars, then these two amounts balance\
|
|
each other in the grand total. The extra $2.00 comes from a virtual\
|
|
posting being added by the automatic transaction at the top of the file.\
|
|
The transaction is virtual because the account name was surrounded by\
|
|
parentheses in an automatic transaction. Automatic transactions will be\
|
|
discussed later, but first let's remove the virtual posting from\
|
|
the balance report by using the @option\{--real\} option:\
|
|
\
|
|
@example\
|
|
ledger --real bal\
|
|
@end example\
|
|
\
|
|
Now the report is:\
|
|
\
|
|
@smallexample\
|
|
$1,480.00\
|
|
50 AAPL Assets\
|
|
$-2,500.00 Equity\
|
|
$20.00 Expenses\
|
|
$-500.00 Income\
|
|
--------------------\
|
|
$-1,500.00\
|
|
50 AAPL \
|
|
@end smallexample\
|
|
\
|
|
Since the liability was a virtual posting, it has dropped from the\
|
|
report and we see that final total is balanced.\
|
|
\
|
|
But we only know that it balances because @file\{sample.dat\} is quite\
|
|
simple, and we happen to know that the 50 shares of Apple stock cost\
|
|
$1,500.00. We can verify that things really balance by reporting the\
|
|
Apple shares in terms of their cost, instead of their quantity. To do\
|
|
this requires the @option\{--basis\}, or @option\{-B\}, option:\
|
|
\
|
|
@example\
|
|
ledger --real -B bal\
|
|
@end example\
|
|
\
|
|
This command reports:\
|
|
\
|
|
@smallexample\
|
|
$2,980.00 Assets\
|
|
$-2,500.00 Equity\
|
|
$20.00 Expenses\
|
|
$-500.00 Income\
|
|
@end smallexample\
|
|
\
|
|
With the basis cost option, the grand total has disappeared, as it is\
|
|
now zero. The confirms that the cost of everything balances to zero,\
|
|
@emph\{which must always be true\}. Reporting the real basis cost\
|
|
should never yield a remainder@footnote\{If it ever does, then\
|
|
generated postings are involved, which can be removed using\
|
|
@option\{--actual\}\}.} |