all repos

clerk @ a1448b5

missing tooling for ledger/hledger

clerk/journal/parser/testdata/automated_transaction.txtar (view raw)

Oleksandr Smirnov Oleksandr Smirnov
olexsmir@gmail.com
tests: switch to txtar, 3 days ago
1
-- input --
2
= ^income
3
    (liabilities:tax)  *.33
4
5
= expenses:gifts
6
    budget:gifts  *-1
7
    assets:budget  *1
8
9
= income:salary
10
    budget:savings  (amount * 0.5)
11
-- expect --
12
Journal
13
  AutomatedTransaction j:1:1-4:0
14
    Expr: "^income"
15
    Posting j:2:1-4:0
16
      Type: unbalanced virtual
17
      Account j:2:6-2:21
18
        SubAccount: "liabilities" j:2:6-2:17
19
        SubAccount: "tax" j:2:18-2:21
20
      Amount j:2:25-2:25
21
        Quantity: 0.33
22
        Commodity: ""
23
        CommodityPos: Before
24
        HasSpace: false
25
        IsExpr: true
26
        Precision: 2
27
        Decimal: "."
28
  BlankLine j:4:0-4:1
29
  AutomatedTransaction j:4:1-8:0
30
    Expr: "expenses:gifts"
31
    Posting j:5:1-6:1
32
      Account j:5:5-5:17
33
        SubAccount: "budget" j:5:5-5:11
34
        SubAccount: "gifts" j:5:12-5:17
35
      Amount j:5:20-5:20
36
        Quantity: -1
37
        Commodity: ""
38
        CommodityPos: Before
39
        HasSpace: false
40
        IsExpr: true
41
        Precision: 0
42
        Decimal: "."
43
    Posting j:6:1-8:0
44
      Account j:6:5-6:18
45
        SubAccount: "assets" j:6:5-6:11
46
        SubAccount: "budget" j:6:12-6:18
47
      Amount j:6:21-6:21
48
        Quantity: 1
49
        Commodity: ""
50
        CommodityPos: Before
51
        HasSpace: false
52
        IsExpr: true
53
        Precision: 0
54
        Decimal: "."
55
  BlankLine j:8:0-8:1
56
  AutomatedTransaction j:8:1-10:1
57
    Expr: "income:salary"
58
    Posting j:9:1-10:1
59
      Account j:9:5-9:19
60
        SubAccount: "budget" j:9:5-9:11
61
        SubAccount: "savings" j:9:12-9:19
62
      Amount j:9:21-10:0
63
        Quantity: 0
64
        Commodity: ""
65
        CommodityPos: Before
66
        HasSpace: false
67
        IsExpr: true
68
        Expr: "amount * 0.5"
69
        Precision: 0
70
        Decimal: "."