niknetniko/intellij-beancount

Transaction does not balance when one amount omited

hoshsadiq opened this issue · 2 comments

Seems when leaving out one of the amounts in a simple transaction causes an error of "Transaction does not balance" when it is valid. For example, below transaction causes error underline for "self" "Deposit/Withdrawal" though it is perfectly valid.

2021-08-04 * "self" "Deposit/Withdrawal"
  Assets:Investment   100.00 GBP
  Assets:Current

Yeah, the short term solution will probably be to allow disabling this check, as it is currently very basic: it sums up all numbers in the transaction and requires that sum to be zero. It doesn't account for currency, nor prices or any of the other "advanced" stuff, and does also not account for interpolation, as you've noticed.

This built-in check is mostly an experiment, since I found calling bean-check from the plugin to be a bit slow, but I think that's the way to go, since it would be a lot of work to reimplement whole parts of beancount in the plugin.

Aah okay, that makes sense.

I wonder if running bean-check through Jython would be faster than invoking it directly. Only supports Python 2.7 so not sure if it would be work but if beancount is backwards compatible it might be worth trying.