all repos

clerk @ e2e9e2b

missing tooling for ledger/hledger

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

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