Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: support include directives - included beancount ledgers yield Invalid reference errors #98

Open
jaanli opened this issue Mar 10, 2024 · 1 comment

Comments

@jaanli
Copy link

jaanli commented Mar 10, 2024

Minimal working example:

Contents of transactions.beancount:

include "accounts.beancount"
include "transactions/bankname/type/institution_start=YYYY-MM-DD_end=YYYY-MM-DD.beancount"

Contents of accounts.beancount:

1970-01-01 open Assets:Checking:Bank
1970-01-01 open Expenses:Utility-Payment

Contents of institution_start=YYYY-MM-DD_end=YYYY-MM-DD.beancount:

2024-02-28 * "COMPANY"
  Expenses:Utility-Payment        12.99 USD
  Assets:Checking:Bank

Result when opening this file in beancount:
image

It seems to not respect the include statement that correctly defines these accounts.

I'm likely missing something basic as I had GPT-4 teach me about beancount yesterday (details: https://gist.github.com/jaanli/1f735ce0ddec4aa4d1fccb4535f3843f).

Please let me know if this is already supported - if not, would love to see how hard this would be to implement as it could lead to an easy to maintain sharded folder structure. (We have a few decades of accounts spread out over multiple countries and currencies to track.)

The extension is amazing!! Thank you for making this 🙏

@mengqi92
Copy link
Contributor

mengqi92 commented Apr 18, 2024

Please make sure you have configured mainBeanFile in the .vscode/settings.json (see this readme).

{
  "beancount.mainBeanFile": "accounts.beancount"
}

I reproed the issue and the errors are now gone after I added the mainBeanFile setting.

Without mainBeanFile

without mainBeanFile configured

With mainBeanFile

issue fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants