all repos

clerk @ 4481c7d

missing tooling for ledger/hledger

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

Oleksandr Smirnov Oleksandr Smirnov
olexsmir@gmail.com
add support of subdirectives and it's highlights, 1 month ago
1
-- input --
2
2026-05-11 testies
3
	expenses:atm  20.00 UAH @ 1 USD
4
	assets:bank
5
6
2026-05-11 testies2
7
	expenses:atm  20.00 UAH @@ 1 USD
8
	assets:bank
9
10
2026-05-12 testies3
11
	expenses:atm  20.00 UAH @ 1 USD = 20.00 UAH @ 1 USD
12
	assets:bank
13
14
2015-01-03 money exchange office
15
    assets:cash  -20 EUR @ 7.53 HRK
16
    assets:cash  150.60 HRK
17
18
-- expect --
19
Journal
20
  Transaction j:1:1-5:0
21
    Date: 2026-05-11
22
    Payee: "testies" j:1:12-2:0
23
    Posting j:2:1-3:1
24
      Account j:2:2-2:14
25
        SubAccount: "expenses" j:2:2-2:10
26
        SubAccount: "atm" j:2:11-2:14
27
      Amount j:2:16-2:25
28
        Quantity: 20
29
        Commodity: "UAH" j:2:22-2:25
30
        CommodityPos: After
31
        HasSpace: true
32
        Precision: 2
33
        Decimal: "."
34
      Cost(unit) j:2:26-3:0
35
        Amount j:2:28-3:0
36
          Quantity: 1
37
          Commodity: "USD" j:2:30-3:0
38
          CommodityPos: After
39
          HasSpace: true
40
          Precision: 0
41
    Posting j:3:1-5:0
42
      Account j:3:2-4:0
43
        SubAccount: "assets" j:3:2-3:8
44
        SubAccount: "bank" j:3:9-4:0
45
      Amount: <elided>
46
  BlankLine j:5:0-5:1
47
  Transaction j:5:1-9:0
48
    Date: 2026-05-11
49
    Payee: "testies2" j:5:12-6:0
50
    Posting j:6:1-7:1
51
      Account j:6:2-6:14
52
        SubAccount: "expenses" j:6:2-6:10
53
        SubAccount: "atm" j:6:11-6:14
54
      Amount j:6:16-6:25
55
        Quantity: 20
56
        Commodity: "UAH" j:6:22-6:25
57
        CommodityPos: After
58
        HasSpace: true
59
        Precision: 2
60
        Decimal: "."
61
      Cost(total) j:6:26-7:0
62
        Amount j:6:29-7:0
63
          Quantity: 1
64
          Commodity: "USD" j:6:31-7:0
65
          CommodityPos: After
66
          HasSpace: true
67
          Precision: 0
68
    Posting j:7:1-9:0
69
      Account j:7:2-8:0
70
        SubAccount: "assets" j:7:2-7:8
71
        SubAccount: "bank" j:7:9-8:0
72
      Amount: <elided>
73
  BlankLine j:9:0-9:1
74
  Transaction j:9:1-13:0
75
    Date: 2026-05-12
76
    Payee: "testies3" j:9:12-10:0
77
    Posting j:10:1-11:1
78
      Account j:10:2-10:14
79
        SubAccount: "expenses" j:10:2-10:10
80
        SubAccount: "atm" j:10:11-10:14
81
      Amount j:10:16-10:25
82
        Quantity: 20
83
        Commodity: "UAH" j:10:22-10:25
84
        CommodityPos: After
85
        HasSpace: true
86
        Precision: 2
87
        Decimal: "."
88
      Cost(unit) j:10:26-10:33
89
        Amount j:10:28-10:33
90
          Quantity: 1
91
          Commodity: "USD" j:10:30-10:33
92
          CommodityPos: After
93
          HasSpace: true
94
          Precision: 0
95
      BalanceAssertion j:10:34-11:0
96
        IsStrict: false
97
        IsInclusive: false
98
        IsAssignment: false
99
        Amount j:10:36-10:45
100
          Quantity: 20
101
          Commodity: "UAH" j:10:42-10:45
102
          CommodityPos: After
103
          HasSpace: true
104
          Precision: 2
105
          Decimal: "."
106
        Cost(unit) j:10:46-11:0
107
          Amount j:10:48-11:0
108
            Quantity: 1
109
            Commodity: "USD" j:10:50-11:0
110
            CommodityPos: After
111
            HasSpace: true
112
            Precision: 0
113
    Posting j:11:1-13:0
114
      Account j:11:2-12:0
115
        SubAccount: "assets" j:11:2-11:8
116
        SubAccount: "bank" j:11:9-12:0
117
      Amount: <elided>
118
  BlankLine j:13:0-13:1
119
  Transaction j:13:1-17:0
120
    Date: 2015-01-03
121
    Payee: "money exchange office" j:13:12-14:0
122
    Posting j:14:1-15:1
123
      Account j:14:5-14:16
124
        SubAccount: "assets" j:14:5-14:11
125
        SubAccount: "cash" j:14:12-14:16
126
      Amount j:14:18-14:25
127
        Quantity: -20
128
        Commodity: "EUR" j:14:22-14:25
129
        CommodityPos: After
130
        HasSpace: true
131
        Precision: 0
132
      Cost(unit) j:14:26-15:0
133
        Amount j:14:28-15:0
134
          Quantity: 7.53
135
          Commodity: "HRK" j:14:33-15:0
136
          CommodityPos: After
137
          HasSpace: true
138
          Precision: 2
139
          Decimal: "."
140
    Posting j:15:1-17:0
141
      Account j:15:5-15:16
142
        SubAccount: "assets" j:15:5-15:11
143
        SubAccount: "cash" j:15:12-15:16
144
      Amount j:15:18-16:0
145
        Quantity: 150.6
146
        Commodity: "HRK" j:15:25-16:0
147
        CommodityPos: After
148
        HasSpace: true
149
        Precision: 2
150
        Decimal: "."
151
  BlankLine j:17:0-17:1