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.34k stars 117 forks source link

Returns for `Income:Interest:{name}` not showing up when transactions have multiple postings #121

Open rohitagarwal003 opened 7 months ago

rohitagarwal003 commented 7 months ago

Describe your Environment OS: macOS 14.2 (apple silicon) Paisa Version: 0.6.2 App Variant: Desktop

Describe the bug I have accounts like:

account Assets:Debt:1234
account Assets:Debt:5678

account Income:Interest:1234
account Income:Interest:5678

and transactions like:

2023/06/02 Interest
    Income:Interest:1234                   -4,339.00 INR
    Expenses:Tax:Income                        83.00 INR
    Assets:Debt:1234

Theses transactions don't show up as "Gain" in the UI as described in https://paisa.fyi/reference/accounts/#interest.

This seems to be because I am deducting tax in the same transaction.

It shows up as "Gain" in the UI if I make tax as a different transaction.

ananthakumaran commented 7 months ago

@rohitagarwal003 could you try if the below works? I think the current logic doesn't handle more than 2 postings well when it comes to interest calculation.

2023/06/02 Interest
    Income:Interest:1234                   -4,339.00 INR
    Assets:Debt:1234

I will look into it, there is some general ambiguity in figuring out how money goes from which account to which account when it comes to transactions with multiple postings.

rohitagarwal003 commented 7 months ago

Yeah, that works. I filed a bug because I wanted to avoid making TDS as a separate transaction. But I can update my ledger to use different transactions for TDS if this is going to be hard to fix.

ananthakumaran commented 7 months ago

What is your expectation here? Do you want to treat (interest - tax) as the gain for the debt account? This might be a little more complicated. For now suggest sticking with 2 transactions, I will fix some cases like having 2 interest postings & 1 debt posting. But having interest - tax might be more complicated and I need to think through how it will work out.

rohitagarwal003 commented 7 months ago

What is your expectation here? Do you want to treat (interest - tax) as the gain for the debt account?

No. I think I wanted to treat just the interest as gain.

My reason for keeping interest+tax in the same transaction was because that's what I was did with my salary transaction (where the single transaction has multiple postings for tax, epf, espp, bank).

So, as long as we can recognize interest in >2 posting transaction, it would fix my case.


I just started using ledger + paisa since yesterday, so I am still figuring out how to correctly use it.

ananthakumaran commented 7 months ago

With 2 transactions, you would first move money from interest account to debt, then debt to expense. The debt to expense would be considered as a withdrawal. In this way, you would be calculating the returns on pre-tax gain.

If you use 1 transaction, it technically means the amount from the interest account is split and part of it goes to the expense account and part to the debt account. In this way, you would be kind of calculating returns on post-tax gain.

Based on what you want, you can decide on the format.

I will try to fix the bug though, because it currently consider the split transaction as investment (which is wrong)

rohitagarwal003 commented 7 months ago

Makes sense. Thanks for the explanation!