r18317 - gnucash/trunk/src - Fix bug 590386 - Always use today for reconciliation statement date

Phil Longstaff plongstaff at code.gnucash.org
Mon Sep 14 19:58:07 EDT 2009


Author: plongstaff
Date: 2009-09-14 19:58:07 -0400 (Mon, 14 Sep 2009)
New Revision: 18317
Trac: http://svn.gnucash.org/trac/changeset/18317

Modified:
   gnucash/trunk/src/gnome-utils/glade/preferences.glade
   gnucash/trunk/src/gnome/schemas/apps_gnucash_dialog_reconcile.schemas.in
   gnucash/trunk/src/gnome/window-reconcile.c
Log:
Fix bug 590386 -  Always use today for reconciliation statement date

Patch by Simon Arlott


Modified: gnucash/trunk/src/gnome/schemas/apps_gnucash_dialog_reconcile.schemas.in
===================================================================
--- gnucash/trunk/src/gnome/schemas/apps_gnucash_dialog_reconcile.schemas.in	2009-09-14 23:52:56 UTC (rev 18316)
+++ gnucash/trunk/src/gnome/schemas/apps_gnucash_dialog_reconcile.schemas.in	2009-09-14 23:58:07 UTC (rev 18317)
@@ -53,5 +53,21 @@
       </locale>
     </schema>
 
+    <schema>
+      <key>/schemas/apps/gnucash/dialogs/reconcile/always_reconcile_to_today</key>
+      <applyto>/apps/gnucash/dialogs/reconcile/always_reconcile_to_today</applyto>
+      <owner>gnucash</owner>
+      <type>bool</type>
+      <default>FALSE</default>
+      <locale name="C">
+        <short>Always reconcile to today</short>
+        <long>
+	  If active, always open the reconcile dialog using today's
+	  date for the statement date, regardless of previous
+	  reconciliations.
+	</long>
+      </locale>
+    </schema>
+
   </schemalist>
 </gconfschemafile>

Modified: gnucash/trunk/src/gnome/window-reconcile.c
===================================================================
--- gnucash/trunk/src/gnome/window-reconcile.c	2009-09-14 23:52:56 UTC (rev 18316)
+++ gnucash/trunk/src/gnome/window-reconcile.c	2009-09-14 23:58:07 UTC (rev 18317)
@@ -1329,13 +1329,18 @@
                         gnc_numeric *new_ending,
                         time_t *statement_date)
 {
+  gboolean always_today;
   GDate date;
   time_t today;
   struct tm tm;
 
   g_date_clear(&date, 1);
 
-  if (xaccAccountGetReconcileLastDate (account, statement_date))
+  always_today = gnc_gconf_get_bool(GCONF_RECONCILE_SECTION,
+                    "always_reconcile_to_today", NULL);
+
+  if (!always_today &&
+      xaccAccountGetReconcileLastDate (account, statement_date))
   {
     int months = 1, days = 0;
 

Modified: gnucash/trunk/src/gnome-utils/glade/preferences.glade
===================================================================
--- gnucash/trunk/src/gnome-utils/glade/preferences.glade	2009-09-14 23:52:56 UTC (rev 18316)
+++ gnucash/trunk/src/gnome-utils/glade/preferences.glade	2009-09-14 23:58:07 UTC (rev 18317)
@@ -2535,7 +2535,7 @@
 	    <widget class="GtkTable" id="table3">
 	      <property name="border_width">6</property>
 	      <property name="visible">True</property>
-	      <property name="n_rows">14</property>
+	      <property name="n_rows">15</property>
 	      <property name="n_columns">4</property>
 	      <property name="homogeneous">False</property>
 	      <property name="row_spacing">0</property>
@@ -2694,8 +2694,8 @@
 		<packing>
 		  <property name="left_attach">0</property>
 		  <property name="right_attach">1</property>
-		  <property name="top_attach">8</property>
-		  <property name="bottom_attach">9</property>
+		  <property name="top_attach">9</property>
+		  <property name="bottom_attach">10</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
 		</packing>
@@ -2774,6 +2774,30 @@
 	      </child>
 
 	      <child>
+		<widget class="GtkCheckButton" id="gconf/dialogs/reconcile/always_reconcile_to_today">
+		  <property name="visible">True</property>
+		  <property name="tooltip" translatable="yes">Always open the reconcile dialog using today's date for the statement date, regardless of previous reconciliations.</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">Always reconcile to t_oday</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">False</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">4</property>
+		  <property name="top_attach">8</property>
+		  <property name="bottom_attach">9</property>
+		  <property name="x_padding">12</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
 		<widget class="GtkCheckButton" id="gconf/general/register/draw_vertical_lines">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Show vertical borders on the cells.</property>
@@ -2789,8 +2813,8 @@
 		<packing>
 		  <property name="left_attach">0</property>
 		  <property name="right_attach">4</property>
-		  <property name="top_attach">13</property>
-		  <property name="bottom_attach">14</property>
+		  <property name="top_attach">14</property>
+		  <property name="bottom_attach">15</property>
 		  <property name="x_padding">12</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
@@ -2813,8 +2837,8 @@
 		<packing>
 		  <property name="left_attach">0</property>
 		  <property name="right_attach">4</property>
-		  <property name="top_attach">12</property>
-		  <property name="bottom_attach">13</property>
+		  <property name="top_attach">13</property>
+		  <property name="bottom_attach">14</property>
 		  <property name="x_padding">12</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
@@ -2837,8 +2861,8 @@
 		<packing>
 		  <property name="left_attach">0</property>
 		  <property name="right_attach">4</property>
-		  <property name="top_attach">11</property>
-		  <property name="bottom_attach">12</property>
+		  <property name="top_attach">12</property>
+		  <property name="bottom_attach">13</property>
 		  <property name="x_padding">12</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
@@ -2861,8 +2885,8 @@
 		<packing>
 		  <property name="left_attach">0</property>
 		  <property name="right_attach">4</property>
-		  <property name="top_attach">10</property>
-		  <property name="bottom_attach">11</property>
+		  <property name="top_attach">11</property>
+		  <property name="bottom_attach">12</property>
 		  <property name="x_padding">12</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
@@ -2890,8 +2914,8 @@
 		<packing>
 		  <property name="left_attach">0</property>
 		  <property name="right_attach">2</property>
-		  <property name="top_attach">9</property>
-		  <property name="bottom_attach">10</property>
+		  <property name="top_attach">10</property>
+		  <property name="bottom_attach">11</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
 		</packing>



More information about the gnucash-changes mailing list