summaryrefslogtreecommitdiff
path: root/doc/Ledger.scriv/156.rtfd/TXT.rtf
blob: e158cd8e804d67eb59b77472695ba9c5c2138cce (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 totals reported by the balance command are only the topmost parent\
accounts.  To see the totals of all child accounts as well, use the\
@option\{-s\} option:\
\
@example\
ledger --real -B -s bal\
@end example\
\
This reports:\
\
@smallexample\
           $2,980.00  Assets\
           $1,480.00    Bank:Checking\
           $1,500.00    Brokerage\
          $-2,500.00  Equity:Opening Balances\
              $20.00  Expenses:Books\
            $-500.00  Income:Salary\
@end smallexample\
\
This shows that the @samp\{Assets\} total is made up from two child\
account, but that the total for each of the other accounts comes from\
one child account.\
\
Sometimes you may have a lot of children, nested very deeply, but only\
want to report the first two levels.  This can be done with a display\
predicate, using a value expression.  In the value expression,\
@code\{T\} represents the reported total, and @code\{l\} is the display\
level for the account:\
\
@example\
ledger --real -B -d "T&l<=2" bal\
@end example\
\
This reports:\
\
@smallexample\
           $2,980.00  Assets\
           $1,480.00    Bank\
           $1,500.00    Brokerage\
          $-2,500.00  Equity:Opening Balances\
              $20.00  Expenses:Books\
            $-500.00  Income:Salary\
@end smallexample\
\
Instead of reporting @samp\{Bank:Checking\} as a child of @samp\{Assets\},\
it report only @samp\{Bank\}, since that account is a nesting level of\
2, while @samp\{Checking\} is at level 3.\
\
To review the display predicate used---@code\{T&l<=2\}---this rather\
terse expression means: Display an account only if it has a non-zero\
total (@code\{T\}), and its nesting level is less than or equal to 2\
(@code\{l<=2\}).}