Skip to content

Commit

Permalink
[window-reconcile] speed up by postponing account balance recalc
Browse files Browse the repository at this point in the history
Reconciliation can be sped up tremendously by postponing all account
balance recalc when modifying splits' reconcile flags.
  • Loading branch information
christopherlam committed Dec 31, 2021
1 parent 6dcb73d commit fd3ec14
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions gnucash/gnome/window-reconcile.c
Expand Up @@ -2286,14 +2286,15 @@ recnFinishCB (GtkAction *action, RecnWindow *recnData)
gnc_suspend_gui_refresh ();

recnData->delete_refresh = TRUE;
account = recn_get_account (recnData);

xaccAccountBeginEdit (account);
gnc_reconcile_view_commit(GNC_RECONCILE_VIEW(recnData->credit), date);
gnc_reconcile_view_commit(GNC_RECONCILE_VIEW(recnData->debit), date);
xaccAccountCommitEdit (account);

auto_payment = gnc_prefs_get_bool(GNC_PREFS_GROUP_RECONCILE, GNC_PREF_AUTO_CC_PAYMENT);

account = recn_get_account (recnData);

xaccAccountClearReconcilePostpone (account);
xaccAccountSetReconcileLastDate (account, date);

Expand Down Expand Up @@ -2341,11 +2342,12 @@ recnPostponeCB (GtkAction *action, gpointer data)
gnc_suspend_gui_refresh ();

recnData->delete_refresh = TRUE;
account = recn_get_account (recnData);

xaccAccountBeginEdit (account);
gnc_reconcile_view_postpone (GNC_RECONCILE_VIEW(recnData->credit));
gnc_reconcile_view_postpone (GNC_RECONCILE_VIEW(recnData->debit));

account = recn_get_account (recnData);
xaccAccountCommitEdit (account);

xaccAccountSetReconcilePostponeDate (account, recnData->statement_date);
xaccAccountSetReconcilePostponeBalance (account, recnData->new_ending);
Expand Down

0 comments on commit fd3ec14

Please sign in to comment.