Invalid reference to unknown account 'Expenses:...'

829 views
Skip to first unread message

nathanl...@gmail.com

unread,
Jul 3, 2019, 8:09:16 AM7/3/19
to Beancount
I'm trying to set up beancount (it takes a bit of work), but I'm running into a strange error and was wondering if you could tell me what I'm doing wrong:

$ cat data/simple.beancount
* Banking
2018-01-01 open Assets:UK:Barclays              GBP
2019-01-01 open Equity:Opening-Balances


2019-04-10 * "Open Barclays" ""
 
Assets:UK:Barclays           3705.81 GBP
 
Equity:Opening-Balances     -3705.81 GBP
2019-05-10 * "TFL TRAVEL CHARGE TFL.GOV.UK/CP" ""
 
Assets:UK:Barclays                                  -4.80 GBP
 
Expenses:Travel:PublicTransportation                 4.80 GBP
$ bean
-report-3.7 data/simple.beancount balsheet > /dev/null


Is there some trick I'm missing? I thought "Expenses:..." didn't require any account opening?

Nathan

Florian Lindner

unread,
Jul 3, 2019, 9:21:32 AM7/3/19
to bean...@googlegroups.com
Am 03.07.19 um 10:09 schrieb nathanl...@gmail.com:
> I'm trying to set up beancount (it takes a bit of work), but I'm running into a strange error and was wondering if you could tell me what I'm doing wrong:
>
> |
> $ cat data/simple.beancount
> *Banking
> 2018-01-01open Assets:UK:Barclays             GBP
> 2019-01-01open Equity:Opening-Balances
>
>
> 2019-04-10*"OpenBarclays"""
>   Assets:UK:Barclays          3705.81GBP
>   Equity:Opening-Balances    -3705.81GBP
> 2019-05-10*"TFL TRAVEL CHARGE TFL.GOV.UK/CP"""
>   Assets:UK:Barclays                                 -4.80GBP
>   Expenses:Travel:PublicTransportation                4.80GBP
> $ bean-report-3.7data/simple.beancount balsheet >/dev/null
>
> |
>
> Is there some trick I'm missing? I thought "Expenses:..." didn't require any account opening?

That is not the case. You also need an open statement for all Expenses accounts. Not sure if the root account "Expenses" needs an open statement, but I don't think it's wise to book directly to it.

Best,
Florian

>
> Nathan
>
> --
> You received this message because you are subscribed to the Google Groups "Beancount" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com <mailto:beancount+...@googlegroups.com>.
> To post to this group, send email to bean...@googlegroups.com <mailto:bean...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/eb270cd5-4b51-4311-b300-1b83f549c7df%40googlegroups.com <https://groups.google.com/d/msgid/beancount/eb270cd5-4b51-4311-b300-1b83f549c7df%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Nathan Clement

unread,
Jul 3, 2019, 10:36:34 AM7/3/19
to bean...@googlegroups.com
That's what I supposed as well, but in the example beancount file, the first reference to "Expenses:..." is inline (line 85):

2013-01-04 * "BANK FEES" "Monthly bank fee"
  Assets:US:BofA:Checking                           -4.00 USD
  Expenses:Financial:Fees                            4.00 USD


What's the difference between mine and theirs?

You received this message because you are subscribed to a topic in the Google Groups "Beancount" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beancount/29gfKFZjB9o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beancount+...@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/76770b6f-33f4-7710-98e2-68fd6f76b393%40xgm.de.

Martin Blais

unread,
Jul 3, 2019, 12:26:17 PM7/3/19
to Beancount
Not sure what you mean by "inline" but there are open directives here:

Keep in mind that ordering of directives in the file is not relevant, only the dates.


To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/76770b6f-33f4-7710-98e2-68fd6f76b393%40xgm.de.

Nathan Clement

unread,
Jul 3, 2019, 2:29:31 PM7/3/19
to bean...@googlegroups.com
That's exactly what I was missing. Slightly confusing that they're not in order.

Thanks!

You received this message because you are subscribed to a topic in the Google Groups "Beancount" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beancount/29gfKFZjB9o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beancount+...@googlegroups.com.

To post to this group, send email to bean...@googlegroups.com.

Martin Michlmayr

unread,
Jul 3, 2019, 8:25:16 PM7/3/19
to bean...@googlegroups.com
* Florian Lindner <mailin...@xgm.de> [2019-07-03 11:21]:
> Not sure if the root account "Expenses" needs an open statement, but
> I don't think it's wise to book directly to it.

"Expenses" alone is not a valid account name in beancount. It needs a
subaccount.

--
Martin Michlmayr
https://www.cyrius.com/
Reply all
Reply to author
Forward
0 new messages