From 73b2c29692f764670956cbd33f12b4db10e80ccd Mon Sep 17 00:00:00 2001 From: Derek Atkins Date: Sun, 12 Feb 2006 22:09:08 +0000 Subject: [PATCH] Mike Alexander's reconcile preselection patch (#112653). * src/gnome/window-reconcile.c (gnc_reconcile_window_create_list_box): * src/gnome/reconcile-list.c (gnc_reconcile_list_new): * src/gnome/reconcile-list.h (gnc_reconcile_list_new): Don't pre-select the reconciled status for transactions after the statement date. Fixes #112653. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13245 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 8 ++++++++ src/gnome/reconcile-list.c | 7 +++++-- src/gnome/reconcile-list.h | 3 ++- src/gnome/window-reconcile.c | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 71c126ee94..2b4c4bdd9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -63,6 +63,14 @@ Use price nearest to noon on the day specified. Fixes bug #314554. + Mike Alexander's reconcile preselection patch (#112653). + * src/gnome/window-reconcile.c (gnc_reconcile_window_create_list_box): + * src/gnome/reconcile-list.c (gnc_reconcile_list_new): + * src/gnome/reconcile-list.h (gnc_reconcile_list_new): + Don't pre-select the reconciled status for transactions after the + statement date. + Fixes #112653. + 2006-02-11 Derek Atkins * src/report/report-gnome/gnc-plugin-page-report.c: diff --git a/src/gnome/reconcile-list.c b/src/gnome/reconcile-list.c index bbbb553c99..da88ae4ca9 100644 --- a/src/gnome/reconcile-list.c +++ b/src/gnome/reconcile-list.c @@ -119,7 +119,8 @@ gnc_reconcile_list_construct(GNCReconcileList *list, Query *query) } GtkWidget * -gnc_reconcile_list_new(Account *account, GNCReconcileListType type) +gnc_reconcile_list_new(Account *account, GNCReconcileListType type, + time_t statement_date) { GNCReconcileList *list; gboolean include_children, auto_check; @@ -176,11 +177,13 @@ gnc_reconcile_list_new(Account *account, GNCReconcileListType type) for (splits = xaccQueryGetSplits(query); splits; splits = splits->next) { Split *split = splits->data; char recn = xaccSplitGetReconcile(split); + time_t trans_date = xaccTransGetDate(xaccSplitGetParent(split)); /* Just an extra verification that our query is correct ;) */ g_assert (recn == NREC || recn == CREC); - if (recn == CREC) + if (recn == CREC && + difftime(trans_date, statement_date) >= 0) g_hash_table_insert (list->reconciled, split, split); } } diff --git a/src/gnome/reconcile-list.h b/src/gnome/reconcile-list.h index afc787df97..5e56e959fd 100644 --- a/src/gnome/reconcile-list.h +++ b/src/gnome/reconcile-list.h @@ -72,7 +72,8 @@ typedef struct { GType gnc_reconcile_list_get_type (void); GtkWidget * gnc_reconcile_list_new (Account * account, - GNCReconcileListType type); + GNCReconcileListType type, + time_t date); gint gnc_reconcile_list_get_needed_height(GNCReconcileList *list, gint num_rows); diff --git a/src/gnome/window-reconcile.c b/src/gnome/window-reconcile.c index 91c48094df..e57a24dbbc 100644 --- a/src/gnome/window-reconcile.c +++ b/src/gnome/window-reconcile.c @@ -933,7 +933,7 @@ gnc_reconcile_window_create_list_box(Account *account, vbox = gtk_vbox_new(FALSE, 5); - list = gnc_reconcile_list_new(account, type); + list = gnc_reconcile_list_new(account, type, recnData->statement_date); *list_save = list; g_signal_connect(list, "toggle_reconciled",