How should I define linked documents when using includes?

62 views
Skip to first unread message

Daniel Schultz

unread,
May 5, 2023, 4:13:44 PM5/5/23
to bean...@googlegroups.com
I'm trying my hand at reorganizing my books so that I have separate ledgers for each client, and finding that `document`s are not properly linking

I use fava with the plugin "fava.plugins.link_documents"

My file structure is something like this:

```
| - files
| | - Assets
| | | - MyClient
| | | | - 2022-01-01-invoice-1.pdf
| - ledgers
| | - myClient.beancount
| - ledger.beancount
```

In my `ledger.beancount` I have the documents setting set:

```
option "documents" "files"
```

In `myClient.beancount` I have a transaction:

```
2022-01-01 * "My Client" "client invoice"
  document: "files/Assets/MyClient/2022-01-01-invoice-1.pdf"
  Assets:MyClient            1234.00 USD
  Income:ClientServices -1234.00 USD
```

This setup triggers an error in the `Errors` tab of fava:

```
Document not found: 'files/Assets/MyClient/2022-01-01-invoice-1.pdf'
```

If I update the `document:` path to be relative (`../files/...`) the error goes away, but then clicking the file's link in fava's UX takes me to an error page saying:

```
Statement not found.
```

If I move the entire transaction to the base `ledger.beancount` everything works just fine (but I'd like to be able to organize my transactions)

Anybody have ideas what might be going on and how I might be able to resolve it?

Best,
  Dan
--
Daniel Schultz (he / him)
P: (215) 400-1233
T: @slifty
W: http://www.slifty.com

Vinit Khandagle

unread,
May 6, 2023, 9:32:15 PM5/6/23
to Beancount
One way I solved this problem was that after the entering the transaction I dragged and dropped the file on the Payee Entry this creates the correct linking and creates the account structure in the documents section correctly. 
Reply all
Reply to author
Forward
0 new messages