Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

automated transaction refer to balancing account

35 views
Skip to first unread message

Dimitar Dimitrov

unread,
Apr 11, 2025, 2:38:15 PMApr 11
to Ledger
Consider a transaction
```
2025/04/09 * Invoice
    My:Bank
    Expenses:Accessories                     €100.00
    Expenses:Business:Tax                     €20.00
```

If I define
```
= /Expenses:?/ & %/\\bTVA20\\b/
    My:Bank                                     -0.2
    Expenses:Business:Tax                        0.2
```
The above transaction can be written as:
```
2025/04/09 * Invoice  ; TVA20:
    My:Bank
    Expenses:Accessories                     €100.00
```
But I don't want to hard-code `My:Bank ` in the automated transaction (what if in another transaction I want to use `My:Other:Bank` instead). It would be nice if in the automated transaction I could access the account that balances the transaction and subtract from it an additional 20%. Can this be done?

Thanks

John Wiegley

unread,
Apr 12, 2025, 5:53:51 AMApr 12
to Dimitar Dimitrov, Ledger
>>>>> "DD" == Dimitar Dimitrov <mail....@gmail.com> writes:

DD> But I don't want to hard-code `My:Bank ` in the automated transaction
DD> (what if in another transaction I want to use `My:Other:Bank` instead). It
DD> would be nice if in the automated transaction I could access the account
DD> that balances the transaction and subtract from it an additional 20%. Can
DD> this be done?

Try using the account name “$account” instead of “My:Bank”… Does this help?

John
Reply all
Reply to author
Forward
0 new messages