Skip to content

Commit 4523cce

Browse files
author
Dong Lin
committed
Fix stale account balances and grand total during transaction import
The bug: After importing transactions from an existing account, the grand total net assets is updated to N, and the ending balance of the imported account is X. Quit and restart gnucash, the net assets changes to N+X. on_matcher_ok_clicked invokes gnc_resume_gui_refresh before the account is fully commited. xaccAccountRecomputeBalance skips an account if it has pending edits. The fix: Invoke gnc_resume_gui_refresh after all accounts have fully commited. Tests: make check reran the above test, the net assets balance is updated to N+X without restarting gnc.
1 parent 01f0d25 commit 4523cce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gnucash/import-export/import-main-matcher.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -590,11 +590,11 @@ on_matcher_ok_clicked (GtkButton *button, GNCImportMainMatcher *info)
590590

591591
gnc_gen_trans_list_delete (info);
592592

593-
/* Allow GUI refresh again. */
594-
gnc_resume_gui_refresh ();
595-
596593
/* DEBUG ("End") */
597594
g_list_free_full (accounts_modified, (GDestroyNotify)xaccAccountCommitEdit);
595+
596+
/* Allow GUI refresh again upon commit completion. */
597+
gnc_resume_gui_refresh ();
598598
}
599599

600600
void

0 commit comments

Comments
 (0)