simon-v / bean-add

A beancount transaction entry assistant (GitHub mirror)
https://simonvolpert.com/bean-add/
Apache License 2.0
31 stars 2 forks source link

Allow consuming the output of bean-report #8

Open pmarciniak opened 1 year ago

pmarciniak commented 1 year ago

This is useful when passing a concatenation of multiple Beancount files as an input to bean-add (as suggested in https://github.com/simon-v/bean-add/issues/3#issuecomment-250917599). However, in order for the statements to be sorted by date (a prerequisite for bean-add to work correctly), it's better to use "bean-report print main.bnct > merged.bnct" rather than "cat *.bnct > merged.bnct".

The output of bean-report has some features that bean-add couldn't handle:

  1. bean-report uses comma separators when printing large numbers (e.g., 12,344.50 CHF). bean-add would fail to parse such numbers.
  2. For every pad statement, bean-report inserts a padding transaction flagged with 'P', e.g.: 2019-03-09 P "(Padding inserted for Balance of 124.10 CHF for difference 15.20 CHF)" bean-add would crash on encountering such transactions.

This PR resolves the above 2 problems.