gnucash stable: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Tue Jan 28 11:49:11 EST 2025


Updated	 via  https://github.com/Gnucash/gnucash/commit/57df6c2b (commit)
	 via  https://github.com/Gnucash/gnucash/commit/228c199f (commit)
	from  https://github.com/Gnucash/gnucash/commit/55465e88 (commit)



commit 57df6c2b472d3b404ec63966aa8b240fef09af1b
Merge: 55465e88ed 228c199f5d
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Jan 28 08:45:24 2025 -0800

    Merge Jianshi Liu's 'bug797824' into stable.


commit 228c199f5d6698d19218ea9d0c75991f4d70ad92
Author: Jianshi Liu <genie_liu at outlook.com>
Date:   Fri Jan 24 10:19:22 2025 +0800

    Bug 797824 - Inconsistent behavior in Loan Review
    
    fix the shift issue in loan review

diff --git a/gnucash/gnome/assistant-loan.cpp b/gnucash/gnome/assistant-loan.cpp
index 456c2e8a0c..7f7d8f2d83 100644
--- a/gnucash/gnome/assistant-loan.cpp
+++ b/gnucash/gnome/assistant-loan.cpp
@@ -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);
 }
 
@@ -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++ )
@@ -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++ )
@@ -3084,4 +3085,3 @@ gnc_ui_sx_loan_assistant_create (void)
 
     gnc_window_adjust_for_screen (GTK_WINDOW(ldd->window));
 }
-



Summary of changes:
 gnucash/gnome/assistant-loan.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)



More information about the gnucash-changes mailing list