beancount / beangrow

Returns calculations on portfolios in Beancount
GNU General Public License v2.0
57 stars 22 forks source link

Returns: In-kind transfers are not supported #3

Open redstreet opened 3 years ago

redstreet commented 3 years ago
plugin "beancount.plugins.auto_accounts"
plugin "beancount.plugins.implicit_prices"
2005-01-01 commodity ABCD

2019-12-01 * "Buy"
  Assets:Investments  100 ABCD {45 USD}
  Assets:Bank

2020-02-20 * "Transfer"
  Assets:Investments  -50 ABCD {45 USD}
  Assets:Bank          50 ABCD {45 USD}
investments {
  investment {
    currency: "ABCD"
    asset_account: "Assets:Investments"
    cash_accounts: "Assets:Bank"
  }
}

groups {
  group {
    name: "test"
    investment: "Assets:Investments"
    }
}

Expected: transfer out in-kind should cause a positive cashflow. It is similar to a sale. Observed:

Traceback (most recent call last):
  File "beanlabs/beanlabs/returns/compute_returns.py", line 105, in <module>
    main()
  File "beanlabs/beanlabs/returns/compute_returns.py", line 82, in main
    path.join(args.output, "investments"))
  File "beanlabs/beanlabs/returns/investments.py", line 555, in extract
    for aconfig in config.investments.investment]
  File "beanlabs/beanlabs/returns/investments.py", line 555, in <listcomp>
    for aconfig in config.investments.investment]
  File "beanlabs/beanlabs/returns/investments.py", line 376, in process_account_entries
    flows_general = produce_cash_flows_general(entry, account)
  File "beanlabs/beanlabs/returns/investments.py", line 178, in produce_cash_flows_general
    assert not posting.cost
AssertionError
shekohex commented 7 months ago

Hello, did you find a workaround to this issue?