andreasgerstmayr / fava-portfolio-returns

fava-portfolio-returns shows portfolio returns in Fava
GNU General Public License v2.0
38 stars 2 forks source link

In-Item Exchanges taken into account? #17

Open fdw opened 5 months ago

fdw commented 5 months ago

Hey, I have another question: Is it possible that transactions which should have a net-0-balance are wrongly taken into account as cash flows? I have a stock which was merged with another (so the value didn't change), but the relative value halved at that date. If the exchange transaction is understood as an influx of money, this makes sense, but it's still wrong. Have you seen this behavior before?

andreasgerstmayr commented 5 months ago

To be honest I never tested it with a stock merge (never occurred in my private ledger so far), only with stock splits. Does beangrow handle this properly?

fdw commented 5 months ago

Good question... How would I test that? I'm running everything in Docker and couldn't find a way to interact with beangrow directly.

andreasgerstmayr commented 5 months ago
beangrow-returns ledger.beancount beangrow.pbtxt output

should generate PDF reports and save them in the output folder. If you've installed it in docker, maybe try docker exec <container> beangrow-returns ...

fdw commented 5 months ago

Unfortunately, that crashes with an error:

Traceback (most recent call last):
  File "/app/bin/beangrow-returns", line 8, in <module>
    sys.exit(main())
  File "/app/lib/python3.9/site-packages/beangrow/compute_returns.py", line 100, in main
    reports.write_price_directives(path.join(output_prices, "prices.beancount"),
  File "/app/lib/python3.9/site-packages/beangrow/reports.py", line 411, in write_price_directives
    days_late = (required_date - actual_date).days
TypeError: unsupported operand type(s) for -: 'datetime.date' and 'NoneType'

Do I need to set more parameters?

andreasgerstmayr commented 4 months ago

That sounds like an error in beangrow or a malformed ledger, maybe you can open an issue for beangrow.

fdw commented 4 months ago

fava-portfolio-returns works fine with this ledger, however. Is this expected?