clerk/journal/parser/testdata/transaction_with_balance_assertion.txtar (view raw)
| 1 | -- input -- |
| 2 | 2024/01/01 groceries |
| 3 | expenses:food $10.00 = $100.00 |
| 4 | assets:checking |
| 5 | |
| 6 | 2025/03/07 groceries2 |
| 7 | expenses:food $10.00 == $100.00 |
| 8 | assets:checking == $0.00 |
| 9 | |
| 10 | 2025/04/08 groceries3 |
| 11 | expenses:food $10.00 |
| 12 | assets:checking = $0.00 |
| 13 | -- expect -- |
| 14 | Journal |
| 15 | Transaction j:1:1-5:0 |
| 16 | Date: 2024/01/01 |
| 17 | Payee: "groceries" j:1:12-2:0 |
| 18 | Posting j:2:1-3:1 |
| 19 | Account j:2:2-2:15 |
| 20 | SubAccount: "expenses" j:2:2-2:10 |
| 21 | SubAccount: "food" j:2:11-2:15 |
| 22 | Amount j:2:17-2:17 |
| 23 | Quantity: 10 |
| 24 | Commodity: "$" |
| 25 | CommodityPos: Before |
| 26 | HasSpace: false |
| 27 | Precision: 2 |
| 28 | Decimal: "." |
| 29 | BalanceAssertion j:2:24-3:0 |
| 30 | IsStrict: false |
| 31 | IsInclusive: false |
| 32 | Amount j:2:26-2:26 |
| 33 | Quantity: 100 |
| 34 | Commodity: "$" |
| 35 | CommodityPos: Before |
| 36 | HasSpace: false |
| 37 | Precision: 2 |
| 38 | Decimal: "." |
| 39 | Posting j:3:1-5:0 |
| 40 | Account j:3:2-4:0 |
| 41 | SubAccount: "assets" j:3:2-3:8 |
| 42 | SubAccount: "checking" j:3:9-4:0 |
| 43 | Amount: <elided> |
| 44 | BlankLine j:5:0-5:1 |
| 45 | Transaction j:5:1-9:0 |
| 46 | Date: 2025/03/07 |
| 47 | Payee: "groceries2" j:5:12-6:0 |
| 48 | Posting j:6:1-7:1 |
| 49 | Account j:6:2-6:15 |
| 50 | SubAccount: "expenses" j:6:2-6:10 |
| 51 | SubAccount: "food" j:6:11-6:15 |
| 52 | Amount j:6:17-6:17 |
| 53 | Quantity: 10 |
| 54 | Commodity: "$" |
| 55 | CommodityPos: Before |
| 56 | HasSpace: false |
| 57 | Precision: 2 |
| 58 | Decimal: "." |
| 59 | BalanceAssertion j:6:24-7:0 |
| 60 | IsStrict: true |
| 61 | IsInclusive: false |
| 62 | Amount j:6:27-6:27 |
| 63 | Quantity: 100 |
| 64 | Commodity: "$" |
| 65 | CommodityPos: Before |
| 66 | HasSpace: false |
| 67 | Precision: 2 |
| 68 | Decimal: "." |
| 69 | Posting j:7:1-9:0 |
| 70 | Account j:7:2-7:17 |
| 71 | SubAccount: "assets" j:7:2-7:8 |
| 72 | SubAccount: "checking" j:7:9-7:17 |
| 73 | Amount: <elided> |
| 74 | BalanceAssertion j:7:19-8:0 |
| 75 | IsStrict: true |
| 76 | IsInclusive: false |
| 77 | Amount j:7:22-7:22 |
| 78 | Quantity: 0 |
| 79 | Commodity: "$" |
| 80 | CommodityPos: Before |
| 81 | HasSpace: false |
| 82 | Precision: 2 |
| 83 | Decimal: "." |
| 84 | BlankLine j:9:0-9:1 |
| 85 | Transaction j:9:1-12:1 |
| 86 | Date: 2025/04/08 |
| 87 | Payee: "groceries3" j:9:12-10:0 |
| 88 | Posting j:10:1-11:1 |
| 89 | Account j:10:2-10:15 |
| 90 | SubAccount: "expenses" j:10:2-10:10 |
| 91 | SubAccount: "food" j:10:11-10:15 |
| 92 | Amount j:10:17-10:17 |
| 93 | Quantity: 10 |
| 94 | Commodity: "$" |
| 95 | CommodityPos: Before |
| 96 | HasSpace: false |
| 97 | Precision: 2 |
| 98 | Decimal: "." |
| 99 | Posting j:11:1-12:1 |
| 100 | Account j:11:2-11:17 |
| 101 | SubAccount: "assets" j:11:2-11:8 |
| 102 | SubAccount: "checking" j:11:9-11:17 |
| 103 | Amount: <elided> |
| 104 | BalanceAssertion j:11:19-12:0 |
| 105 | IsStrict: false |
| 106 | IsInclusive: false |
| 107 | Amount j:11:21-11:21 |
| 108 | Quantity: 0 |
| 109 | Commodity: "$" |
| 110 | CommodityPos: Before |
| 111 | HasSpace: false |
| 112 | Precision: 2 |
| 113 | Decimal: "." |