all repos

clerk @ master

missing tooling for ledger/hledger

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

Oleksandr Smirnov Oleksandr Smirnov
olexsmir@gmail.com
tests: switch to txtar, 3 days ago
1
-- input --
2
3
~ monthly
4
    expenses:rent          $2000
5
    assets:bank:checking
6
7
~ monthly from 2023-04-15 to 2023-06-16
8
    expenses:utilities          $400
9
    assets:bank:checking
10
11
~ every 2 months  in 2023, we will review
12
    expenses:utilities          $400
13
    assets:bank:checking
14
15
~ monthly  Next year blah blah
16
    expenses:food  $100
17
    assets:checking
18
19
~ monthly from 2018/6 ;In 2019 we will change this
20
    expenses:food  $100
21
    assets:checking
22
-- expect --
23
Journal
24
  BlankLine j:2:0-2:1
25
  PeriodicTransaction j:2:1-6:0
26
    Period: "monthly"
27
    Status: "*"
28
    Posting j:3:1-4:1
29
      Account j:3:5-3:18
30
        SubAccount: "expenses" j:3:5-3:13
31
        SubAccount: "rent" j:3:14-3:18
32
      Amount j:3:28-3:28
33
        Quantity: 2000
34
        Commodity: "$"
35
        CommodityPos: Before
36
        HasSpace: false
37
        Precision: 0
38
        Decimal: "."
39
    Posting j:4:1-6:0
40
      Account j:4:5-5:0
41
        SubAccount: "assets" j:4:5-4:11
42
        SubAccount: "bank" j:4:12-4:16
43
        SubAccount: "checking" j:4:17-5:0
44
      Amount: <elided>
45
  BlankLine j:6:0-6:1
46
  PeriodicTransaction j:6:1-10:0
47
    Period: "monthly from 2023-04-15 to 2023-06-16"
48
    From: 2023-04-15
49
    To: 2023-06-16
50
    Status: "*"
51
    Posting j:7:1-8:1
52
      Account j:7:5-7:23
53
        SubAccount: "expenses" j:7:5-7:13
54
        SubAccount: "utilities" j:7:14-7:23
55
      Amount j:7:33-7:33
56
        Quantity: 400
57
        Commodity: "$"
58
        CommodityPos: Before
59
        HasSpace: false
60
        Precision: 0
61
        Decimal: "."
62
    Posting j:8:1-10:0
63
      Account j:8:5-9:0
64
        SubAccount: "assets" j:8:5-8:11
65
        SubAccount: "bank" j:8:12-8:16
66
        SubAccount: "checking" j:8:17-9:0
67
      Amount: <elided>
68
  BlankLine j:10:0-10:1
69
  PeriodicTransaction j:10:1-14:0
70
    Period: "every 2 months"
71
    Status: "*"
72
    Description: "in 2023, we will review"
73
    Posting j:11:1-12:1
74
      Account j:11:5-11:23
75
        SubAccount: "expenses" j:11:5-11:13
76
        SubAccount: "utilities" j:11:14-11:23
77
      Amount j:11:33-11:33
78
        Quantity: 400
79
        Commodity: "$"
80
        CommodityPos: Before
81
        HasSpace: false
82
        Precision: 0
83
        Decimal: "."
84
    Posting j:12:1-14:0
85
      Account j:12:5-13:0
86
        SubAccount: "assets" j:12:5-12:11
87
        SubAccount: "bank" j:12:12-12:16
88
        SubAccount: "checking" j:12:17-13:0
89
      Amount: <elided>
90
  BlankLine j:14:0-14:1
91
  PeriodicTransaction j:14:1-18:0
92
    Period: "monthly"
93
    Status: "*"
94
    Description: "Next year blah blah"
95
    Posting j:15:1-16:1
96
      Account j:15:5-15:18
97
        SubAccount: "expenses" j:15:5-15:13
98
        SubAccount: "food" j:15:14-15:18
99
      Amount j:15:20-15:20
100
        Quantity: 100
101
        Commodity: "$"
102
        CommodityPos: Before
103
        HasSpace: false
104
        Precision: 0
105
        Decimal: "."
106
    Posting j:16:1-18:0
107
      Account j:16:5-17:0
108
        SubAccount: "assets" j:16:5-16:11
109
        SubAccount: "checking" j:16:12-17:0
110
      Amount: <elided>
111
  BlankLine j:18:0-18:1
112
  PeriodicTransaction j:18:1-21:1
113
    Period: "monthly from 2018/6"
114
    Status: "*"
115
    Comment j:18:23-19:0
116
      Marker: ";"
117
      Text: "In 2019 we will change this"
118
    Posting j:19:1-20:1
119
      Account j:19:5-19:18
120
        SubAccount: "expenses" j:19:5-19:13
121
        SubAccount: "food" j:19:14-19:18
122
      Amount j:19:20-19:20
123
        Quantity: 100
124
        Commodity: "$"
125
        CommodityPos: Before
126
        HasSpace: false
127
        Precision: 0
128
        Decimal: "."
129
    Posting j:20:1-21:1
130
      Account j:20:5-21:0
131
        SubAccount: "assets" j:20:5-20:11
132
        SubAccount: "checking" j:20:12-21:0
133
      Amount: <elided>