Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paisa ignores lot prices #248

Open
abcdw opened this issue Jun 30, 2024 · 5 comments
Open

Paisa ignores lot prices #248

abcdw opened this issue Jun 30, 2024 · 5 comments

Comments

@abcdw
Copy link

abcdw commented Jun 30, 2024

Describe your Environment
OS: podman
Paisa Version: 0.6.6
App Variant: Web

Describe the bug
Reports for multi-currency transactions with lot price doesn't seem right.

I'm not very experienced ledger user, so it can be some mistake on my side, but ledger cli seems to produce right and expected for me results.

To Reproduce
Open corresponding report pages.

Expected behavior
I would expect liabilities to be fully repaid and balance amount equaled to zero, rather than 299.

Screenshots
image

But it doesn't seem that Paisa respects lot prices:
image
image

Journal

P 2024-06-20 EUR 3.0103794 GEL

2024-06-29 Friend payed for me
    Expenses:Food                               1000 GEL
    Liabilities:Debt:Friend0                   -1000 GEL

2024-06-30 Convert
    Assets:Personal:Bank:SuperBank               -33 EUR @@ 1000 GEL
    Assets:GEL                                  1000 GEL

2024-06-30 Settle up with Friend
    Liabilities:Debt:Friend0                    1000 GEL
    Assets:GEL                                 -1000 GEL

P.S. Thank you very much for working on the Paisa, it makes it much easier to understand the structure of my finances.

@ananthakumaran
Copy link
Owner

2024-06-30 Convert
    Assets:Personal:Bank:SuperBank               -33 EUR @@ 1000 GEL
    Assets:GEL                                  1000 GEL

is the EUR price here correct? Paisa internally stores everything in the default currency format, so if the conversion rate has changed on 30th, it might affect other transactions. Ledger doesn't have a concept of default currency though, that's why it's not giving incorrect answers.

@abcdw
Copy link
Author

abcdw commented Jun 30, 2024

2024-06-30 Convert
    Assets:Personal:Bank:SuperBank               -33 EUR @@ 1000 GEL
    Assets:GEL                                  1000 GEL

is the EUR price here correct?

It's not a real price, but for demonstration purpose it's correct. It has a big difference with price mentioned here: P 2024-06-20 EUR 3.0103794 GEL to make the problem more clear.

Paisa internally stores everything in the default currency format, so
if the conversion rate has changed on 30th, it might affect other
transactions.

It doesn't matter if conversation rate (price) changed on this date. I bought GEL for very different price that explicitly specified in lot price.

Ledger doesn't have a concept of default currency though, that's why
it's not giving incorrect answers.

Not sure how "having default currency" should produce incorrect calculations, because I explicitly specified all the currencies for all transactions.

The Asset:Debt (-1000 GEL) was repaid with +1000 GEL (which was bought for 33 EUR) and now should be equal to 0. But it seems it calculated this way instead: 1000 GEL -> 332 EUR, repay with 33 EUR -> the total balance becomes 299, which is wrong.

Probably Paisa ignores lot prices?

ledger cli show correct value for the account.

image

@ananthakumaran
Copy link
Owner

ananthakumaran commented Jun 30, 2024 via email

@abcdw
Copy link
Author

abcdw commented Jun 30, 2024

1000 GEL -> 332 EUR, repay with 33 EUR -> the total balance becomes 299,
which is wrong.

Unlike ledger Paisa doesn't keep track of multiple currencies when it
computes the balance. I am assuming what you suspect might be actually
happening. Have a look at the capital gains section of the docs, that might
give some clues.

BTW, why it doesn't offload balance calculation to ledger? It could
probably simplify the logic inside Paisa and make it more consistent in
behavior with ledger.

I will try to debug later if I get any time

Thank you!

@abcdw
Copy link
Author

abcdw commented Jun 30, 2024

Ok, the issue is not related to lot prices. It seems the reporting itself doesn't behave.

I made a simplier reproducer:

P 2024-06-20 EUR 3.0103794 GEL

2024-06-25 Friend payed for me
    Expenses:Food                               1000 GEL
    Liabilities:Debt:Friend0                   -1000 GEL

P 2024-06-30 EUR 33.3333333 GEL

2024-06-30 Convert
    Income:Personal:Salary                       -33 EUR
    Liabilities:Debt:Friend0                    1000 GEL

The ledger calculates balance correctly:
image

The cash flow and liabilities views are problematic. The liabilities was in GEL and must remain in GEL, but from Paisa standpoint it seems like the liability were acquired in EUR, which is not what transaction says.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants