all repos

clerk @ a91ce69

missing tooling for ledger/hledger

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

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