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

Postive amounts of non-monetary commodities crash aa_class #64

Closed
nils-werner opened this issue Aug 19, 2021 · 5 comments
Closed

Postive amounts of non-monetary commodities crash aa_class #64

nils-werner opened this issue Aug 19, 2021 · 5 comments

Comments

@nils-werner
Copy link

I have an issue with my vacation hours VACHR commodity and fava_investor: Whenever I have a positive balance of vacation hours, aa_class stops working with the message

Error: unable to convert 15 VACHR to base currency USD (Missing price directive?)

Steps to reproduce:

  1. Remove lines 3742-3744 from huge-example.beancount to produce a positive balance
  2. Open aa_class module

I would expect fava_investor to completely ignore this commodity, as it holds no monetary value.

@redstreet
Copy link
Owner

redstreet commented Aug 20, 2021

Agreed, it should be ignored. However, there's no safe way aa_class can automatically infer this. Hence, this is done via configuration. Have you tried to configure the plugin, and if so, I'd be interested if you ran into issues.

@redstreet
Copy link
Owner

It would be good for the example to exclude Assets:US:Hooli:Vacation in its configuration regex to illustrate this case. PR welcome.

@nils-werner
Copy link
Author

Can't the plugin simply ignore commodities that don't have an asset class configured?

@redstreet
Copy link
Owner

redstreet commented Aug 20, 2021

It could, but that would risk ignoring assets where one has simply forgotten to configure the asset class. Everything would seem fine, and there's no way to tell that the result being shown is incorrect.

I've run into this enough myself and decided explicit is better than implicit.

@redstreet
Copy link
Owner

Closing. Feel free to open if there are further thoughts.

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