ananthakumaran/paisa

[Bug] Possibly incorrect Net Investment value on main page

Opened this issue · 5 comments

Describe your Environment
OS: Ubuntu
Paisa Version: 0.5.4
App Variant: CLI

Describe the bug
Net Investment value on main page seems to be incorrect

To Reproduce
Steps to reproduce the behavior:

  1. Use ledger file in Journal
  2. Open paisa
  3. Check Net Investment value

Expected behavior
Correct value

Screenshots

2023-10-09_04-20-01_screenshot

Journal

2023/10/01 Init
    Assets:Checking                 1000 INR
    Income:Salary:Acme

As can be seen from the journal file, the only transaction is to Assets:Checking, which is not to be considered an investment account. Then, the Net investment value on the opening page shows 1000, but should be 0.

I had a fix ready for this, but realized that would break the Asset > Networth page because the graph assumes Net Investment + Gain = Net Worth. I have to fix both places.

I have also incorrect investment values:

Net worth
116,502.59

Net Investment
125,363.08

Gain / Loss
-8,860.50

XIRR
-4.14

This is somehow connected to the multiple currencies I use. The gain/loss started to grow immediately after the first currency exchange transaction. And I'm still struggling to get the logic behind the numbers

@pashagolub could you share a minimal example? I know about the issue related to the checking account, but yours seems like a different case.

Sure, something like this shows the issue:

2022/01/29 Opening Balance
    Assets:Checking:AnotherBank:FirstUser             4,132.67 UAH
    Assets:Checking:AnotherBank:SecondUser               506.00 UAH
    Assets:Checking:UABank:FirstUser               4,263.01 UAH  
    Assets:Checking:Cash                     3,430.00 USD
    Equity:Opening Balances

P 2022/01/29 00:50:00 UAH 0.026 EUR
P 2022/01/29 00:50:00 USD 0.95 EUR


So it seems like it is price related issue. If there are no prices before the opening transaction, the sum of foreign currencies amounts is going under Loss.

Net worth
3,489.94

Net Investment
12,331.68

Gain / Loss
-8,841.74

XIRR
-51.10

My guess is before first price all currencies are equal, meaning 1 EUR = 1 UAH = 1 USD.

@pashagolub could you try to convert the 00:50:00 to 00:00:00. Paisa doesn't handle non-zero time correctly

Edit: looking into the issue a bit more, since you are specifying the time as 00:50, and the transaction is recorded at 00:00, ledger won't use it (the price is for a future date)