Is it possible to undo the 'bucket' directive?

43 views
Skip to first unread message

Valentyn

unread,
Dec 6, 2019, 9:40:44 PM12/6/19
to Ledger
Hi there,

'bucket' directive allows one to set a default account to balance the transaction. Is there a way to reset the bucket setting to a default value, so that new transactions must include the account that will balance the transaction?

Example:

bucket Assets:Checking
2011/01/25 Tom's Used Cars
    Expenses:Auto                    $ 5,500.00

end bucket ; Doesn't work. Is there a correct command?
2011/01/27 Book Store                     
    Expenses:Books                       $20.00 
    ; This transaction should not balance.

Thank you!

Martin Michlmayr

unread,
Dec 7, 2019, 3:42:31 AM12/7/19
to ledge...@googlegroups.com
* Valentyn <tval...@gmail.com> [2019-12-06 18:40]:
> 'bucket' directive allows one to set a default account to balance
> the transaction. Is there a way to reset the bucket setting to a
> default value, so that new transactions must include the account
> that will balance the transaction?

I'm not 100% sure but I believe this is currently not possible.

Personally, I think "bucket" shouldn't exist at all. It makes it too
easy to mess up things. I think the real solution is to write a
script that imports your data and adds the correct accounts. (Even
if you do it manually, cut and pasting the account name isn't hard.)

That's just my personal view though.
--
Martin Michlmayr
https://www.cyrius.com/

John Wiegley

unread,
Dec 9, 2019, 4:07:58 AM12/9/19
to Martin Michlmayr, ledge...@googlegroups.com
>>>>> "MM" == Martin Michlmayr <t...@cyrius.com> writes:

MM> Personally, I think "bucket" shouldn't exist at all. It makes it too easy
MM> to mess up things. I think the real solution is to write a script that
MM> imports your data and adds the correct accounts. (Even if you do it
MM> manually, cut and pasting the account name isn't hard.)

You can also use the `--account` option during import, when using `ledger
csv`. This makes it a one-time thing for those types of conversions.

John

Valentyn

unread,
Dec 13, 2019, 12:37:53 PM12/13/19
to Ledger
Thank you, all.
Reply all
Reply to author
Forward
0 new messages