gnucash master: Bug 639401 - Invoices Due Reminder

Geert Janssens gjanssens at code.gnucash.org
Wed Aug 10 16:01:41 EDT 2016


Updated	 via  https://github.com/Gnucash/gnucash/commit/90b7a6f6 (commit)
	from  https://github.com/Gnucash/gnucash/commit/992f3232 (commit)



commit 90b7a6f6a7db16e729fd7fb6e993333a8c71e0e0
Author: Geert Janssens <janssens-geert at telenet.be>
Date:   Wed Aug 10 21:58:37 2016 +0200

    Bug 639401 - Invoices Due Reminder

diff --git a/src/business/business-gnome/dialog-invoice.c b/src/business/business-gnome/dialog-invoice.c
index 4ad64b2..e6d4f23 100644
--- a/src/business/business-gnome/dialog-invoice.c
+++ b/src/business/business-gnome/dialog-invoice.c
@@ -111,6 +111,12 @@ FROM_STRING_DEC(InvoiceDialogType, ENUM_INVOICE_TYPE)
 FROM_STRING_FUNC(InvoiceDialogType, ENUM_INVOICE_TYPE)
 AS_STRING_FUNC(InvoiceDialogType, ENUM_INVOICE_TYPE)
 
+typedef enum
+{
+    DUE_FOR_VENDOR,     // show bills due
+    DUE_FOR_CUSTOMER,   // show invoices due
+} GncWhichDueType;
+
 struct _invoice_select_window
 {
     QofBook *	book;
@@ -201,6 +207,7 @@ struct _invoice_window
 void gnc_invoice_window_closeCB (GtkWidget *widget, gpointer data);
 void gnc_invoice_window_active_toggled_cb (GtkWidget *widget, gpointer data);
 gboolean gnc_invoice_window_leave_notes_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data);
+DialogQueryView *gnc_invoice_show_bills_due (QofBook *book, double days_in_advance, GncWhichDueType duetype);
 
 #define INV_WIDTH_PREFIX "invoice_reg"
 #define BILL_WIDTH_PREFIX "bill_reg"
@@ -3251,24 +3258,31 @@ gnc_invoice_search (GncInvoice *start, GncOwner *owner, QofBook *book)
 }
 
 DialogQueryView *
-gnc_invoice_show_bills_due (QofBook *book, double days_in_advance)
+gnc_invoice_show_bills_due (QofBook *book, double days_in_advance, GncWhichDueType duetype)
 {
     QofIdType type = GNC_INVOICE_MODULE_NAME;
     Query *q;
     QofQueryPredData* pred_data;
     time64 end_date;
     GList *res;
-    gchar *message;
+    gchar *message, *title;
     DialogQueryView *dialog;
     gint len;
     Timespec ts;
+    QofQueryCompare comparetype;
     static GList *param_list = NULL;
-    static GNCDisplayViewButton buttons[] =
+    static GNCDisplayViewButton vendorbuttons[] =
     {
         { N_("View/Edit Bill"), edit_invoice_direct },
         { N_("Process Payment"), pay_invoice_direct },
         { NULL },
     };
+    static GNCDisplayViewButton customerbuttons[] =
+    {
+        { N_("View/Edit Invoice"), edit_invoice_direct },
+        { N_("Process Payment"), pay_invoice_direct },
+        { NULL },
+    };
 
     /* Create the param list (in reverse order) */
     if (param_list == NULL)
@@ -3290,7 +3304,7 @@ gnc_invoice_show_bills_due (QofBook *book, double days_in_advance)
     qof_query_search_for(q, GNC_INVOICE_MODULE_NAME);
     qof_query_set_book (q, book);
 
-    /* We want to find all invoices where:
+    /* For vendor bills we want to find all invoices where:
      *      invoice -> is_posted == TRUE
      * AND  invoice -> lot -> is_closed? == FALSE
      * AND  invoice -> type != customer invoice
@@ -3298,17 +3312,47 @@ gnc_invoice_show_bills_due (QofBook *book, double days_in_advance)
      * AND  invoice -> due <= (today + days_in_advance)
      */
 
+    /* For customer invoices we want to find all invoices where:
+     *      invoice -> is_posted == TRUE
+     * AND  invoice -> lot -> is_closed? == FALSE
+     * AND  invoice -> type != vendor bill
+     * AND  invoice -> type != vendor credit note
+     * AND  invoice -> type != employee voucher
+     * AND  invoice -> type != employee credit note
+     * AND  invoice -> due <= (today + days_in_advance)
+     * This could probably also be done by searching for customer invoices OR customer credit notes
+     * but that would make a more complicated query to compose.
+     */
+
     qof_query_add_boolean_match (q, g_slist_prepend(NULL, INVOICE_IS_POSTED), TRUE,
                                  QOF_QUERY_AND);
 
     qof_query_add_boolean_match (q, g_slist_prepend(g_slist_prepend(NULL, LOT_IS_CLOSED),
                                  INVOICE_POST_LOT), FALSE, QOF_QUERY_AND);
 
-    pred_data = qof_query_int32_predicate (QOF_COMPARE_NEQ, GNC_INVOICE_CUST_INVOICE);
-    qof_query_add_term (q, g_slist_prepend(NULL, INVOICE_TYPE), pred_data, QOF_QUERY_AND);
 
-    pred_data = qof_query_int32_predicate (QOF_COMPARE_NEQ, GNC_INVOICE_CUST_CREDIT_NOTE);
-    qof_query_add_term (q, g_slist_prepend(NULL, INVOICE_TYPE), pred_data, QOF_QUERY_AND);
+    if (duetype == DUE_FOR_VENDOR)
+    {
+        pred_data = qof_query_int32_predicate (QOF_COMPARE_NEQ, GNC_INVOICE_CUST_INVOICE);
+        qof_query_add_term (q, g_slist_prepend(NULL, INVOICE_TYPE), pred_data, QOF_QUERY_AND);
+
+        pred_data = qof_query_int32_predicate (QOF_COMPARE_NEQ, GNC_INVOICE_CUST_CREDIT_NOTE);
+        qof_query_add_term (q, g_slist_prepend(NULL, INVOICE_TYPE), pred_data, QOF_QUERY_AND);
+    }
+    else
+    {
+        pred_data = qof_query_int32_predicate (QOF_COMPARE_NEQ, GNC_INVOICE_VEND_INVOICE);
+        qof_query_add_term (q, g_slist_prepend(NULL, INVOICE_TYPE), pred_data, QOF_QUERY_AND);
+
+        pred_data = qof_query_int32_predicate (QOF_COMPARE_NEQ, GNC_INVOICE_VEND_CREDIT_NOTE);
+        qof_query_add_term (q, g_slist_prepend(NULL, INVOICE_TYPE), pred_data, QOF_QUERY_AND);
+
+        pred_data = qof_query_int32_predicate (QOF_COMPARE_NEQ, GNC_INVOICE_EMPL_INVOICE);
+        qof_query_add_term (q, g_slist_prepend(NULL, INVOICE_TYPE), pred_data, QOF_QUERY_AND);
+
+        pred_data = qof_query_int32_predicate (QOF_COMPARE_NEQ, GNC_INVOICE_EMPL_CREDIT_NOTE);
+        qof_query_add_term (q, g_slist_prepend(NULL, INVOICE_TYPE), pred_data, QOF_QUERY_AND);
+    }
 
     end_date = gnc_time (NULL);
     if (days_in_advance < 0)
@@ -3328,19 +3372,36 @@ gnc_invoice_show_bills_due (QofBook *book, double days_in_advance)
         return NULL;
     }
 
-    message = g_strdup_printf
-              (/* Translators: %d is the number of bills due. This is a
-                     ngettext(3) message. */
-                  ngettext("The following bill is due:",
-                           "The following %d bills are due:",
-                           len),
-                  len);
+    if (duetype == DUE_FOR_VENDOR)
+    {
+        message = g_strdup_printf
+                  (/* Translators: %d is the number of bills/credit notes due. This is a
+                         ngettext(3) message. */
+                      ngettext("The following vendor document is due:",
+                               "The following %d vendor documents are due:",
+                               len),
+                      len);
+        title = _("Due Bills Reminder");
+    }
+    else
+    {
+        message = g_strdup_printf
+                  (/* Translators: %d is the number of invoices/credit notes due. This is a
+                         ngettext(3) message. */
+                      ngettext("The following customer document is due:",
+                               "The following %d customer documents are due:",
+                               len),
+                      len);
+        title = _("Due Invoices Reminder");
+    }
     dialog = gnc_dialog_query_view_create(param_list, q,
-                                          _("Due Bills Reminder"),
+                                          title,
                                           message,
                                           TRUE, FALSE,
                                           1, GTK_SORT_ASCENDING,
-                                          buttons, NULL);
+                                          duetype == DUE_FOR_VENDOR ?
+                                                  vendorbuttons :
+                                                  customerbuttons, NULL);
 
     g_free(message);
     qof_query_destroy(q);
@@ -3357,7 +3418,20 @@ gnc_invoice_remind_bills_due (void)
     book = qof_session_get_book(gnc_get_current_session());
     days = gnc_prefs_get_float(GNC_PREFS_GROUP_BILL, GNC_PREF_DAYS_IN_ADVANCE);
 
-    gnc_invoice_show_bills_due(book, days);
+    gnc_invoice_show_bills_due(book, days, DUE_FOR_VENDOR);
+}
+
+void
+gnc_invoice_remind_invoices_due (void)
+{
+    QofBook *book;
+    gint days;
+
+    if (!gnc_current_session_exist()) return;
+    book = qof_session_get_book(gnc_get_current_session());
+    days = gnc_prefs_get_float(GNC_PREFS_GROUP_INVOICE, GNC_PREF_DAYS_IN_ADVANCE);
+
+    gnc_invoice_show_bills_due(book, days, DUE_FOR_CUSTOMER);
 }
 
 void
@@ -3368,3 +3442,12 @@ gnc_invoice_remind_bills_due_cb (void)
 
     gnc_invoice_remind_bills_due();
 }
+
+void
+gnc_invoice_remind_invoices_due_cb (void)
+{
+    if (!gnc_prefs_get_bool(GNC_PREFS_GROUP_INVOICE, GNC_PREF_NOTIFY_WHEN_DUE))
+        return;
+
+    gnc_invoice_remind_invoices_due();
+}
diff --git a/src/business/business-gnome/dialog-invoice.h b/src/business/business-gnome/dialog-invoice.h
index fef6bbd..9823904 100644
--- a/src/business/business-gnome/dialog-invoice.h
+++ b/src/business/business-gnome/dialog-invoice.h
@@ -85,8 +85,6 @@ void gnc_invoice_save_page (InvoiceWindow *iw, GKeyFile *key_file, const gchar *
 
 GtkWidget * gnc_invoice_create_page (InvoiceWindow *iw, gpointer page);
 
-DialogQueryView *gnc_invoice_show_bills_due (QofBook *book, double days_in_advance);
-
 GtkWidget *gnc_invoice_get_register(InvoiceWindow *iw);
 
 /* definitions for CB functions */
diff --git a/src/business/business-gnome/gnc-plugin-business.c b/src/business/business-gnome/gnc-plugin-business.c
index b82a747..422e3ea 100644
--- a/src/business/business-gnome/gnc-plugin-business.c
+++ b/src/business/business-gnome/gnc-plugin-business.c
@@ -119,6 +119,8 @@ static void gnc_plugin_business_cmd_billing_terms      (GtkAction *action,
         GncMainWindowActionData *data);
 static void gnc_plugin_business_cmd_bills_due_reminder (GtkAction *action,
         GncMainWindowActionData *data);
+static void gnc_plugin_business_cmd_invoices_due_reminder (GtkAction *action,
+        GncMainWindowActionData *data);
 
 static void gnc_plugin_business_cmd_test_search (GtkAction *action,
         GncMainWindowActionData *data);
@@ -284,6 +286,11 @@ static GtkActionEntry gnc_plugin_actions [] =
         N_("Open the Bills Due Reminder dialog"),
         G_CALLBACK (gnc_plugin_business_cmd_bills_due_reminder)
     },
+    {
+        "InvoicesDueReminderOpenAction", NULL, N_("Invoices _Due Reminder"), NULL,
+        N_("Open the Invoices Due Reminder dialog"),
+        G_CALLBACK (gnc_plugin_business_cmd_invoices_due_reminder)
+    },
     { "ExportMenuAction", NULL, N_("E_xport"), NULL, NULL, NULL },
 
     /* Extensions Menu */
@@ -791,6 +798,17 @@ gnc_plugin_business_cmd_bills_due_reminder (GtkAction *action,
     gnc_invoice_remind_bills_due();
 }
 
+
+static void
+gnc_plugin_business_cmd_invoices_due_reminder (GtkAction *action,
+        GncMainWindowActionData *mw)
+{
+    g_return_if_fail (mw != NULL);
+    g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
+
+    gnc_invoice_remind_invoices_due();
+}
+
 static void
 gnc_plugin_business_cmd_test_search (GtkAction *action,
                                      GncMainWindowActionData *data)
diff --git a/src/business/business-gnome/gnc-plugin-business.h b/src/business/business-gnome/gnc-plugin-business.h
index 3769a5f..fe7f9d5 100644
--- a/src/business/business-gnome/gnc-plugin-business.h
+++ b/src/business/business-gnome/gnc-plugin-business.h
@@ -61,7 +61,9 @@ G_END_DECLS
 
 GncMainWindow *gnc_plugin_business_get_window (void);
 void gnc_invoice_remind_bills_due (void);
+void gnc_invoice_remind_invoices_due (void);
 void gnc_invoice_remind_bills_due_cb (void);
+void gnc_invoice_remind_invoices_due_cb (void);
 const char *gnc_plugin_business_get_invoice_printreport(void);
 
 #endif /* __GNC_PLUGIN_BUSINESS_H */
diff --git a/src/business/business-gnome/gncmod-business-gnome.c b/src/business/business-gnome/gncmod-business-gnome.c
index 92d90cc..2ca3b98 100644
--- a/src/business/business-gnome/gncmod-business-gnome.c
+++ b/src/business/business-gnome/gncmod-business-gnome.c
@@ -110,6 +110,8 @@ libgncmod_business_gnome_gnc_module_init(int refcount)
 
         gnc_hook_add_dangler(HOOK_BOOK_OPENED,
                              (GFunc)gnc_invoice_remind_bills_due_cb, NULL);
+        gnc_hook_add_dangler(HOOK_BOOK_OPENED,
+                             (GFunc)gnc_invoice_remind_invoices_due_cb, NULL);
 
         /* Add to preferences under Business */
         /* The parameters are; glade file, items to add from glade file - last being the dialog, preference tab name */
diff --git a/src/business/business-gnome/gschemas/org.gnucash.dialogs.business.gschema.xml.in.in b/src/business/business-gnome/gschemas/org.gnucash.dialogs.business.gschema.xml.in.in
index a48d2ba..78480bb 100644
--- a/src/business/business-gnome/gschemas/org.gnucash.dialogs.business.gschema.xml.in.in
+++ b/src/business/business-gnome/gschemas/org.gnucash.dialogs.business.gschema.xml.in.in
@@ -112,6 +112,16 @@
       <summary>Auto pay when posting.</summary>
       <description>At post time, automatically attempt to pay customer documents with outstanding pre-payments and counter documents. The pre-payments and documents obviously have to be against the same customer. Counter documents are documents with opposite sign. For example for an invoice, customer credit notes and negative invoices are considered counter documents.</description>
     </key>
+    <key name="notify-when-due" type="b">
+      <default>true</default>
+      <summary>Show invoices due reminder at startup</summary>
+      <description>If active, at startup GnuCash will check to see whether any invoices will become due soon. If so, it will present the user with a reminder dialog. The definition of "soon" is controlled by the "Days in Advance" setting. Otherwise GnuCash does not check for due invoices.</description>
+    </key>
+    <key name="days-in-advance" type="d">
+      <default>7.0</default>
+      <summary>Show invoices due within this many days</summary>
+      <description>This field defines the number of days in advance that GnuCash will check for due invoices. Its value is only used if the "Notify when due" setting is active.</description>
+    </key>
     <key name="enable-toolbuttons" type="b">
       <default>false</default>
       <summary>Enable extra toolbar buttons for business</summary>
diff --git a/src/business/business-gnome/gtkbuilder/business-prefs.glade b/src/business/business-gnome/gtkbuilder/business-prefs.glade
index de8e96f..c01ee55 100644
--- a/src/business/business-gnome/gtkbuilder/business-prefs.glade
+++ b/src/business/business-gnome/gtkbuilder/business-prefs.glade
@@ -2,6 +2,13 @@
 <interface>
   <requires lib="gtk+" version="2.16"/>
   <!-- interface-naming-policy project-wide -->
+  <object class="GtkAdjustment" id="cust_days_in_adj">
+    <property name="lower">1</property>
+    <property name="upper">180</property>
+    <property name="value">7</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
   <object class="GtkAdjustment" id="days_in_adj">
     <property name="lower">1</property>
     <property name="upper">180</property>
@@ -38,13 +45,52 @@
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="border_width">6</property>
-        <property name="n_rows">14</property>
+        <property name="n_rows">15</property>
         <property name="n_columns">4</property>
         <property name="column_spacing">12</property>
         <child>
           <placeholder/>
         </child>
         <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
           <object class="GtkLabel" id="label53">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
@@ -87,8 +133,8 @@
             <property name="draw_indicator">True</property>
           </object>
           <packing>
-            <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_options">GTK_FILL</property>
             <property name="y_options"/>
             <property name="x_padding">12</property>
@@ -114,8 +160,8 @@
           <packing>
             <property name="left_attach">3</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_options"/>
             <property name="y_options"/>
           </packing>
@@ -132,8 +178,8 @@
           <packing>
             <property name="left_attach">2</property>
             <property name="right_attach">3</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_options">GTK_FILL</property>
             <property name="y_options"/>
           </packing>
@@ -152,8 +198,8 @@
           </object>
           <packing>
             <property name="right_attach">2</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_options">GTK_FILL</property>
             <property name="y_options"/>
             <property name="x_padding">12</property>
@@ -169,8 +215,8 @@
           </object>
           <packing>
             <property name="right_attach">2</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_options">GTK_FILL</property>
             <property name="y_options"/>
           </packing>
@@ -183,8 +229,8 @@
           </object>
           <packing>
             <property name="right_attach">4</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">GTK_FILL</property>
             <property name="y_options"/>
           </packing>
@@ -206,8 +252,8 @@
           </object>
           <packing>
             <property name="right_attach">2</property>
-            <property name="top_attach">7</property>
-            <property name="bottom_attach">8</property>
+            <property name="top_attach">8</property>
+            <property name="bottom_attach">9</property>
             <property name="x_options">GTK_FILL</property>
             <property name="y_options"/>
             <property name="x_padding">12</property>
@@ -308,8 +354,8 @@
           <packing>
             <property name="left_attach">1</property>
             <property name="right_attach">3</property>
-            <property name="top_attach">6</property>
-            <property name="bottom_attach">7</property>
+            <property name="top_attach">7</property>
+            <property name="bottom_attach">8</property>
             <property name="x_options">GTK_FILL</property>
             <property name="y_options"/>
           </packing>
@@ -318,6 +364,9 @@
           <placeholder/>
         </child>
         <child>
+          <placeholder/>
+        </child>
+        <child>
           <object class="GtkLabel" id="label2">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
@@ -326,8 +375,8 @@
             <property name="label" translatable="yes">Report for printing:</property>
           </object>
           <packing>
-            <property name="top_attach">6</property>
-            <property name="bottom_attach">7</property>
+            <property name="top_attach">7</property>
+            <property name="bottom_attach">8</property>
             <property name="x_options">GTK_FILL</property>
             <property name="y_options"/>
           </packing>
@@ -343,8 +392,8 @@
             <property name="draw_indicator">True</property>
           </object>
           <packing>
-            <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">GTK_FILL</property>
             <property name="y_options"/>
             <property name="x_padding">12</property>
@@ -361,13 +410,104 @@
             <property name="draw_indicator">True</property>
           </object>
           <packing>
-            <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_options">GTK_FILL</property>
+            <property name="y_options"/>
+            <property name="x_padding">12</property>
+          </packing>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <object class="GtkCheckButton" id="pref/dialogs.business.invoice/notify-when-due">
+            <property name="label" translatable="yes">Not_ify when due</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="has_tooltip">True</property>
+            <property name="tooltip_markup">Whether to display the list of Invoices Due at startup.</property>
+            <property name="tooltip_text" translatable="yes">Whether to display the list of Invoices Due at startup.</property>
+            <property name="use_underline">True</property>
+            <property name="draw_indicator">True</property>
+          </object>
+          <packing>
+            <property name="top_attach">6</property>
+            <property name="bottom_attach">7</property>
             <property name="x_options">GTK_FILL</property>
             <property name="y_options"/>
             <property name="x_padding">12</property>
           </packing>
         </child>
+        <child>
+          <object class="GtkSpinButton" id="pref/dialogs.business.invoice/days-in-advance">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="has_tooltip">True</property>
+            <property name="tooltip_markup">How many days in the future to warn about Bills coming due.</property>
+            <property name="tooltip_text" translatable="yes">How many days in the future to warn about Bills coming due.</property>
+            <property name="invisible_char">●</property>
+            <property name="invisible_char_set">True</property>
+            <property name="primary_icon_activatable">False</property>
+            <property name="secondary_icon_activatable">False</property>
+            <property name="primary_icon_sensitive">True</property>
+            <property name="secondary_icon_sensitive">True</property>
+            <property name="adjustment">cust_days_in_adj</property>
+            <property name="climb_rate">1</property>
+            <property name="numeric">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">3</property>
+            <property name="right_attach">4</property>
+            <property name="top_attach">6</property>
+            <property name="bottom_attach">7</property>
+            <property name="x_options"/>
+            <property name="y_options"/>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="label3">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">Days in ad_vance:</property>
+            <property name="use_underline">True</property>
+            <property name="mnemonic_widget">pref/dialogs.business.invoice/days-in-advance</property>
+          </object>
+          <packing>
+            <property name="left_attach">2</property>
+            <property name="right_attach">3</property>
+            <property name="top_attach">6</property>
+            <property name="bottom_attach">7</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"/>
+          </packing>
+        </child>
       </object>
     </child>
   </object>
diff --git a/src/business/business-gnome/ui/gnc-plugin-business-ui.xml b/src/business/business-gnome/ui/gnc-plugin-business-ui.xml
index bf45ea1..313b23f 100644
--- a/src/business/business-gnome/ui/gnc-plugin-business-ui.xml
+++ b/src/business/business-gnome/ui/gnc-plugin-business-ui.xml
@@ -17,6 +17,7 @@
 	  <menuitem name="CustomerNewJobOpen"       action="CustomerNewJobOpenAction"/>
 	  <menuitem name="CustomerFindJobOpen"      action="CustomerFindJobOpenAction"/>
 	  <menuitem name="CustomerProcessPayment"   action="CustomerProcessPaymentAction"/>
+          <menuitem name="InvoicesDueReminderOpen" action="InvoicesDueReminderOpenAction"/>
 	</menu>
 
 	<menu name="VendorMenu" action="VendorMenuAction">
@@ -28,6 +29,7 @@
 	  <menuitem name="VendorNewJobOpen"     action="VendorNewJobOpenAction"/>
 	  <menuitem name="VendorFindJobOpen"    action="VendorFindJobOpenAction"/>
 	  <menuitem name="VendorProcessPayment" action="VendorProcessPaymentAction"/>
+          <menuitem name="BillsDueReminderOpen" action="BillsDueReminderOpenAction"/>
 	</menu>
 
 	<menu name="EmployeeMenu" action="EmployeeMenuAction">
@@ -44,7 +46,6 @@
 
 	<menuitem name="TaxTablesOpen" action="TaxTablesOpenAction"/>
 	<menuitem name="BillingTermsOpen" action="BillingTermsOpenAction"/>
-	<menuitem name="BillsDueReminderOpen" action="BillsDueReminderOpenAction"/>
 
         <placeholder name="BusinessPlaceholderMiddle"/>
         <placeholder name="BusinessPlaceholderBottom"/>



Summary of changes:
 src/business/business-gnome/dialog-invoice.c       | 119 +++++++++++--
 src/business/business-gnome/dialog-invoice.h       |   2 -
 src/business/business-gnome/gnc-plugin-business.c  |  18 ++
 src/business/business-gnome/gnc-plugin-business.h  |   2 +
 .../business-gnome/gncmod-business-gnome.c         |   2 +
 .../org.gnucash.dialogs.business.gschema.xml.in.in |  10 ++
 .../business-gnome/gtkbuilder/business-prefs.glade | 186 ++++++++++++++++++---
 .../business-gnome/ui/gnc-plugin-business-ui.xml   |   3 +-
 8 files changed, 298 insertions(+), 44 deletions(-)



More information about the gnucash-changes mailing list