@@ -1977,10 +1977,11 @@ loan_rev_get_loan_range( LoanAssistantData *ldd, GDate *start, GDate *end )
19771977
19781978 endDateMath = g_new0 ( struct tm , 1 );
19791979 g_date_to_struct_tm (ldd->ld .startDate , endDateMath);
1980- monthsTotal = ( ( ldd->ld .numPer - 1 )
1980+ monthsTotal = ( ldd->ld .numPer
19811981 * ( ldd->ld .perSize == GNC_MONTHS ? 1 : 12 ) );
19821982 endDateMath->tm_mon += monthsTotal;
19831983 gnc_gdate_set_time64 (end, gnc_mktime (endDateMath));
1984+ g_date_subtract_days ( end, 1 );
19841985 g_free (endDateMath);
19851986}
19861987
@@ -2108,13 +2109,13 @@ loan_rev_recalc_schedule( LoanAssistantData *ldd )
21082109 char *eloc;
21092110 rowNumData =
21102111 (gnc_numeric*)g_hash_table_lookup ( repayment_schedule,
2111- &curDate );
2112+ &nextDate );
21122113 if ( rowNumData == NULL )
21132114 {
21142115 int j;
21152116 GDate *dateKeyCopy = g_date_new ();
21162117
2117- *dateKeyCopy = curDate ;
2118+ *dateKeyCopy = nextDate ;
21182119 rowNumData = g_new0 ( gnc_numeric, ldd->ld .revNumPmts );
21192120 g_assert ( rowNumData != NULL );
21202121 for ( j = 0 ; j < ldd->ld .revNumPmts ; j++ )
@@ -2198,13 +2199,13 @@ loan_rev_recalc_schedule( LoanAssistantData *ldd )
21982199 | GNC_HOW_RND_ROUND_HALF_UP;
21992200 gnc_numeric val;
22002201 rowNumData = (gnc_numeric*)g_hash_table_lookup ( repayment_schedule,
2201- &curDate );
2202+ &nextDate );
22022203 if ( rowNumData == NULL )
22032204 {
22042205 int j;
22052206 GDate *dateKeyCopy = g_date_new ();
22062207
2207- *dateKeyCopy = curDate ;
2208+ *dateKeyCopy = nextDate ;
22082209 rowNumData = g_new0 ( gnc_numeric, ldd->ld .revNumPmts );
22092210 g_assert ( rowNumData != NULL );
22102211 for ( j = 0 ; j < ldd->ld .revNumPmts ; j++ )
@@ -3084,4 +3085,3 @@ gnc_ui_sx_loan_assistant_create (void)
30843085
30853086 gnc_window_adjust_for_screen (GTK_WINDOW (ldd->window ));
30863087}
3087-
0 commit comments