From 82dd0da42dc766ee419073bc06bba4e83cd3534a Mon Sep 17 00:00:00 2001 From: Dave Peticolas Date: Mon, 9 Oct 2000 07:45:18 +0000 Subject: [PATCH] Kevin Finn's patch to make the reconcile window re-use the last statement date. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3036 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/gnome/window-reconcile.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/gnome/window-reconcile.c b/src/gnome/window-reconcile.c index 17e5fc8787..8f56187a9f 100644 --- a/src/gnome/window-reconcile.c +++ b/src/gnome/window-reconcile.c @@ -1267,6 +1267,7 @@ recnWindow(GtkWidget *parent, Account *account) GtkWidget *dock; double new_ending; time_t statement_date; + static time_t last_statement_date = 0; GNCAccountType type; if (account == NULL) @@ -1283,7 +1284,20 @@ recnWindow(GtkWidget *parent, Account *account) else new_ending = xaccAccountGetBalance(account); - statement_date = time(NULL); + /* The last time reconciliation was attempted during the current + * execution of gnucash, the date was stored. Use that date if + * possible. This helps with balancing multiple accounts for + * which statements are issued at the same time, like multiple + * bank accounts on a single statement. + */ + if( !last_statement_date ) + { + statement_date = time(NULL); + } + else + { + statement_date = last_statement_date; + } /* Popup a little window to prompt the user to enter the * ending balance for his/her bank statement */ @@ -1294,6 +1308,8 @@ recnWindow(GtkWidget *parent, Account *account) return NULL; } + last_statement_date = statement_date; + recnData->new_ending = new_ending; recnData->statement_date = statement_date; recnData->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);