Skip to content

Commit

Permalink
Bug 797824 - Inconsistent behavior in Loan Review
Browse files Browse the repository at this point in the history
fix the shift issue in loan review
  • Loading branch information
Genie-Liu committed Jan 28, 2025
1 parent f6c73b1 commit 228c199
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gnucash/gnome/assistant-loan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1977,10 +1977,11 @@ loan_rev_get_loan_range( LoanAssistantData *ldd, GDate *start, GDate *end )

endDateMath = g_new0( struct tm, 1 );
g_date_to_struct_tm (ldd->ld.startDate, endDateMath);
monthsTotal = ( (ldd->ld.numPer - 1)
monthsTotal = ( ldd->ld.numPer
* ( ldd->ld.perSize == GNC_MONTHS ? 1 : 12 ) );
endDateMath->tm_mon += monthsTotal;
gnc_gdate_set_time64 (end, gnc_mktime (endDateMath));
g_date_subtract_days( end, 1 );
g_free (endDateMath);
}

Expand Down Expand Up @@ -2108,13 +2109,13 @@ loan_rev_recalc_schedule( LoanAssistantData *ldd )
char *eloc;
rowNumData =
(gnc_numeric*)g_hash_table_lookup( repayment_schedule,
&curDate );
&nextDate );
if ( rowNumData == NULL)
{
int j;
GDate *dateKeyCopy = g_date_new();

*dateKeyCopy = curDate;
*dateKeyCopy = nextDate;
rowNumData = g_new0( gnc_numeric, ldd->ld.revNumPmts );
g_assert( rowNumData != NULL );
for ( j = 0; j < ldd->ld.revNumPmts; j++ )
Expand Down Expand Up @@ -2198,13 +2199,13 @@ loan_rev_recalc_schedule( LoanAssistantData *ldd )
| GNC_HOW_RND_ROUND_HALF_UP;
gnc_numeric val;
rowNumData = (gnc_numeric*)g_hash_table_lookup( repayment_schedule,
&curDate );
&nextDate );
if ( rowNumData == NULL )
{
int j;
GDate *dateKeyCopy = g_date_new();

*dateKeyCopy = curDate;
*dateKeyCopy = nextDate;
rowNumData = g_new0( gnc_numeric, ldd->ld.revNumPmts );
g_assert( rowNumData != NULL );
for ( j = 0; j < ldd->ld.revNumPmts; j++ )
Expand Down Expand Up @@ -3084,4 +3085,3 @@ gnc_ui_sx_loan_assistant_create (void)

gnc_window_adjust_for_screen (GTK_WINDOW(ldd->window));
}

0 comments on commit 228c199

Please sign in to comment.