ananthakumaran / paisa

Paisa – Personal Finance Manager. https://paisa.fyi demo: https://demo.paisa.fyi
https://paisa.fyi
GNU Affero General Public License v3.0
2.4k stars 124 forks source link

Error calculating Market value in Asset->Balance #18

Closed sdhawade closed 1 year ago

sdhawade commented 1 year ago

Getting an error in the Market value calculation in Asset->balance

To Reproduce Steps to reproduce the behavior:

  1. Create 2 transactions as below 2018/03/28 Purchase-NFO Purchase Assets:Debt:MF:HDFC_Mutual_Fund:FMP_XXXIX_1177D 50000.0000 "HDFC_FMP_XXXIX_1177D" @ 10.0000 INR Assets:Checking:HDFC

2021/06/16 Redeem-Direct Credit - HDFC Assets:Debt:MF:HDFC_Mutual_Fund:FMP_XXXIX_1177D -50000.000 "HDFC_FMP_XXXIX_1177D" @ 12.9390 INR Assets:Checking:HDFC

  1. Ledger shows correct balance INR146950 Assets:Checking:HDFC

4.Navigating to Assets-Balance shows wrong value for market value (-1,46,950) correct value should zero as there is no asset held

  1. Checking application log shows WARN xirr cannot be calculated

Screenshots If applicable, add screenshots to help explain your problem. Screenshot 2023-08-19 215855

ananthakumaran commented 1 year ago

Thanks for reporting the issue with a clear example. I am able to reproduce and the issue was due to the double quotes in the commodity name. It was not handled properly, I pushed a fix for it to the master branch.

image

Would you be able to build master? if not, let me know. I will release a new version soon.

ananthakumaran commented 1 year ago

I created a pre-release https://github.com/ananthakumaran/paisa/releases/tag/v0.4.8-rc1 with the bug fix.

sdhawade commented 1 year ago

Thanks for reporting the issue with a clear example. I am able to reproduce and the issue was due to the double quotes in the commodity name. It was not handled properly, I pushed a fix for it to the master branch.

image

Would you be able to build master? if not, let me know. I will release a new version soon.

Thanks !! will pull and build, let you know how it goes

sdhawade commented 1 year ago

Thanks for the fix, that issue got fixed, however for another case the xirr is not getting calculated (see attached) for the following transactions 2006/11/01 Switch In-Switch-In - From HDFC Floating Rate IF-Short Term(Growth) Assets:Equity:MF:HDFC_Mutual_Fund:HDFC_Core_and_Satellite_Fund_Growth 581.5980 "HDFC_Core_and_Satellite_Fund_Growth" @ 25.7910 INR Assets:Checking:HDFC

2006/12/01 Switch In-Switch-In - From HDFC Floating Rate IF-Short Term(Growth) Assets:Equity:MF:HDFC_Mutual_Fund:HDFC_Core_and_Satellite_Fund_Growth 560.9150 "HDFC_Core_and_Satellite_Fund_Growth" @ 26.7420 INR Assets:Checking:HDFC

2007/01/02 Switch In-Switch-In - From HDFC Floating Rate IF-Short Term(Growth) Assets:Equity:MF:HDFC_Mutual_Fund:HDFC_Core_and_Satellite_Fund_Growth 560.3920 "HDFC_Core_and_Satellite_Fund_Growth" @ 26.7670 INR Assets:Checking:HDFC

2007/02/01 Switch In-Switch-In - From HDFC Floating Rate IF-Short Term(Growth) Assets:Equity:MF:HDFC_Mutual_Fund:HDFC_Core_and_Satellite_Fund_Growth 561.0620 "HDFC_Core_and_Satellite_Fund_Growth" @ 26.7350 INR Assets:Checking:HDFC

2007/03/01 Switch In-Switch-In - From HDFC Floating Rate IF-Short Term(Growth) Assets:Equity:MF:HDFC_Mutual_Fund:HDFC_Core_and_Satellite_Fund_Growth 607.4600 "HDFC_Core_and_Satellite_Fund_Growth" @ 24.6930 INR Assets:Checking:HDFC

2007/04/02 Switch In-Switch-In - From HDFC Floating Rate IF-Short Term(Growth) Assets:Equity:MF:HDFC_Mutual_Fund:HDFC_Core_and_Satellite_Fund_Growth 638.8690 "HDFC_Core_and_Satellite_Fund_Growth" @ 23.4790 INR Assets:Checking:HDFC

2007/05/03 Switch In-Switch-In - From HDFC Floating Rate IF-Short Term(Growth) Assets:Equity:MF:HDFC_Mutual_Fund:HDFC_Core_and_Satellite_Fund_Growth 73.4460 "HDFC_Core_and_Satellite_Fund_Growth" @ 26.1010 INR Assets:Checking:HDFC

2016/10/24 Redeem-Redemption - Direct Credit - HDFC , less STT Assets:Equity:MF:HDFC_Mutual_Fund:HDFC_Core_and_Satellite_Fund_Growth -3583.742 "HDFC_Core_and_Satellite_Fund_Growth" @ 66.7720 INR Assets:Checking:HDFC

Screenshot 2023-08-20 133059

ananthakumaran commented 1 year ago

I have pushed another fix to master, give it a try.

sdhawade commented 1 year ago

I have pushed another fix to master, give it a try.

Works like a charm, thanks again closing the issue.