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

FIX: loan summary zero values after navigation #1650

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MrTob
Copy link
Contributor

@MrTob MrTob commented Jan 21, 2025

Issue (#1645)

After creating a loan, the "original principal" and "monthly payment" fields display correct values initially. However, after navigating away and returning to the overview tab, these values incorrectly show as 0.00.

Root Cause

The original_balance method in the Account model was prioritizing the first chronological balance record even when it had a zero value, instead of falling back to the current balance. This caused the loan calculations to use 0 as the base value after the initial page load.

Solution

Modified the original_balance method in the Account model to handle zero-value balance records more appropriately.
The change ensures that:

  • If the first balance record exists but is zero, use the current balance
  • If the first balance record has a non-zero value, use that
  • If no balance record exists, fall back to current balance

Copy link
Collaborator

@zachgoll zachgoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tackling this! I think your solution here would fix the summary card, but it will create inconsistencies with the historical graph.

In this case, a user will see a "start balance" of say, "$50,000", but then on the graph, the first value will still show as $0 leading to potential confusion.

I outlined a potential solution here that would make the initial values more appropriate for a loan-type account: #1612 (comment)

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

Successfully merging this pull request may close these issues.

2 participants