redstreet / fava_investor

Comprehensive set of reports, analyses, and tools for investments, for Beancount and Fava (plain text, double entry accounting software). Includes Fava plugins, command line tools, and libraries for each module.
GNU General Public License v3.0
136 stars 20 forks source link

Postive amounts of non-monetary commodities crash aa_class #64

Closed nils-werner closed 2 years ago

nils-werner commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

redstreet commented 3 years ago

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 commented 2 years ago

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