From a59039ff11ddb7fc347c2bd96d3426f77c95dba8 Mon Sep 17 00:00:00 2001 From: Damien Riegel Date: Tue, 10 Sep 2024 09:48:08 -0400 Subject: [PATCH] consider ASSET_DIVIDEND transactions when computing return When computing the returns of an asset, transactions of type ASSET_DIVIDEND are not considered. That makes the return rate computed by beangrow substantially different to rates reported by fund managers. I could not find any justification as to why these transactions are ignored when computing the return rates, and this seems to confuse me as well as other users. See beancount/beangrow#23 and beancount/beangrow#26 At least with this small patch, users get a chance to try and see if they get the result they expected. --- beangrow/investments.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/beangrow/investments.py b/beangrow/investments.py index 76cac9c..5878dda 100644 --- a/beangrow/investments.py +++ b/beangrow/investments.py @@ -188,6 +188,12 @@ def produce_cash_flows_general(entry: data.Directive, posting.meta["flow"] = cf flows.append(cf) + elif category == Cat.ASSET and has_dividend: + cf = CashFlow(entry.date, convert.get_weight(posting), has_dividend, + "dividend", account) + posting.meta["flow"] = cf + flows.append(cf) + return flows