Loan entries as income #638
Replies: 3 comments
|
You've found a real bug, and your instinct about it is right. Thanks for asking rather than assuming it was intentional. What actually happens A recorded instalment is written to the budget as a positive amount in the category Why it was built that way The loans feature originally tracked money you had lent out: you lend a friend 500, they pay you back in instalments, and each repayment genuinely is income arriving in your household. The very first test fixture in that commit is a repayment from a person, not to a bank. On that reading the category and the sign were both correct. Then the interest features arrived (#569): loan amount, initial repayment rate, fixed-rate period, follow-up rate, outstanding balance. Those describe a German-style annuity, which is a loan you have taken out. The module quietly gained a second meaning, and the booking logic stayed on the old one. So the answer to your question is: it counts as income because the feature used to mean the opposite of what it now also means. One correction to your description The payment isn't actually taken from an account. The generated entry has no account assigned, so your account balances and net worth are untouched. Only the income/expenses statistics and the category breakdown are wrong. That is a smaller blast radius than it sounds like, but it also means there's currently no way to have a loan instalment reduce the balance of the account it's paid from, which is the second half of what you'd expect. Where this goes The fix isn't just flipping the sign, because that would break everyone tracking money they lent out. A loan needs to know its direction: money you lent versus money you borrowed. The direction then decides the sign and the category, and existing loans keep today's behaviour until their owner says otherwise. Assigning the instalment to an account belongs in the same change. I'm keeping this open and treating it as a confirmed bug rather than a question. Good catch. |
|
You are right, and the reason is simpler than net worth: the loan module was originally built for money the household lends out, not for loans it takes on. The first version of the tracker modelled one case only, you lend someone money and they pay you back in installments. For that, a positive amount under an income category is correct. The interest fields added later (principal, fixed rate, initial repayment rate, remaining debt, v1.45.10) made it possible to enter a mortgage, but the booking logic never followed. So every installment kept being written as a positive amount under an income category, and the monthly balance counted it as income. Your second point was correct too: the generated budget entry carried no account reference at all, so an installment could not be charged to an account either. What changesA loan now has a direction:
You pick the direction in the loan dialog, and the field for the other party is relabelled accordingly (borrower when you lend, lender when you borrow). A loan can also be assigned an account now, so each installment charges it and the account balance follows. Existing loansThe migration sets every existing loan to "lent out", so nothing changes on its own. If one of yours is actually a loan you took on, switching it to "borrowed" also re-books the installments you already recorded, including their category. You do not have to delete and re-enter them. The fix is implemented and covered by tests, including one that asserts the sign of the generated budget entry, which no test did before. It will ship with the next release. Thanks for reporting this with such a precise description. |
|
Fixed in v1.77.0. A loan now records its direction: money you lent out, or money you took on. Instalments on a loan you took on are booked as an expense under Financial Services and Other / Loans / Interest. Instalments on money you lent out stay income, as they should. The dialog asks for the direction first and renames the name field to match, so it is clear whose name belongs there: the borrower when you lend, the lender when you borrow. What you need to do with the loan you already have Existing loans keep counting as lent out, because guessing would have silently rewritten people's history. Open your loan, switch it to borrowed, and the instalments you have already recorded are re-booked along with it. You do not have to delete and re-enter anything. The amounts are mirrored rather than recalculated, so a fixed exchange rate on a foreign-currency loan survives the switch. The second half of your observation You wrote that the payment is taken from the account. It wasn't: the budget entry written for an instalment carried no account at all, which is why your balances never moved. A loan can now be assigned an account, and every instalment booked from then on charges it. Thanks for asking this instead of assuming it was deliberate. The booking side had no test covering the sign, which is how a mortgage payment could raise the monthly balance for as long as it did. |
Uh oh!
There was an error while loading. Please reload this page.
Can somebody explain why loan entries, when paid, count as income?
My only possible explanation would be that your net worth rises but it feels off if a payment is taken from the account it should be an expense - while total loan number goes down.
All reactions