gnucash maint: Multiple changes pushed

Mike Evans mikee at code.gnucash.org
Wed May 1 06:47:40 EDT 2019


Updated	 via  https://github.com/Gnucash/gnucash/commit/29416292 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/c28196fb (commit)
	 via  https://github.com/Gnucash/gnucash/commit/126dc3a7 (commit)
	from  https://github.com/Gnucash/gnucash/commit/bfbb89f6 (commit)



commit 29416292a939b8354226aff2bd4a4395ea3c9859
Author: Mike Evans <mikee at saxicola.co.uk>
Date:   Wed May 1 11:46:42 2019 +0100

    Remove FIX ME
    
    Since it works fine and I can't remember why I put it in.

diff --git a/bindings/python/gnucash_core.py b/bindings/python/gnucash_core.py
index 38415abe8..80dcbf678 100644
--- a/bindings/python/gnucash_core.py
+++ b/bindings/python/gnucash_core.py
@@ -239,7 +239,7 @@ class Book(GnuCashCoreClass):
 
     def InvoiceNextID(self, customer):
       ''' Return the next invoice ID.
-      This works but I'm not entirely happy with it.  FIX ME'''
+      '''
       from gnucash.gnucash_core_c import gncInvoiceNextID
       return gncInvoiceNextID(self.get_instance(),customer.GetEndOwner().get_instance()[1])
 

commit c28196fb066b61ca63eab96406d4c84e20a45720
Author: Mike Evans <mikee at saxicola.co.uk>
Date:   Wed Apr 17 11:46:52 2019 +0100

    Fix indents,

diff --git a/gnucash/gnome/dialog-invoice.c b/gnucash/gnome/dialog-invoice.c
index d939167ee..610f71372 100644
--- a/gnucash/gnome/dialog-invoice.c
+++ b/gnucash/gnome/dialog-invoice.c
@@ -760,12 +760,12 @@ gnc_dialog_post_invoice(InvoiceWindow *iw, char *message,
     *ddue = *postdate;
     *memo = NULL;
     {
-    GncGUID *guid = NULL;
-    owner_inst = qofOwnerGetOwner (gncOwnerGetEndOwner (&(iw->owner)));
-    qof_instance_get (owner_inst,
-              "invoice-last-posted-account", &guid,
-              NULL);
-    *acc = xaccAccountLookup (guid, iw->book);
+        GncGUID *guid = NULL;
+        owner_inst = qofOwnerGetOwner (gncOwnerGetEndOwner (&(iw->owner)));
+        qof_instance_get (owner_inst,
+                  "invoice-last-posted-account", &guid,
+                  NULL);
+        *acc = xaccAccountLookup (guid, iw->book);
     }
     /* Get the default for the accumulate option */
     *accumulate = gnc_prefs_get_bool(GNC_PREFS_GROUP_INVOICE, GNC_PREF_ACCUM_SPLITS);
@@ -957,12 +957,12 @@ gnc_invoice_post(InvoiceWindow *iw, struct post_invoice_params *post_params)
      */
     owner_inst = qofOwnerGetOwner (gncOwnerGetEndOwner (&(iw->owner)));
     {
-    const GncGUID *guid = qof_instance_get_guid (QOF_INSTANCE (acc));
-    qof_begin_edit (owner_inst);
-    qof_instance_set (owner_inst,
-              "invoice-last-posted-account", guid,
-              NULL);
-    qof_commit_edit (owner_inst);
+        const GncGUID *guid = qof_instance_get_guid (QOF_INSTANCE (acc));
+        qof_begin_edit (owner_inst);
+        qof_instance_set (owner_inst,
+                  "invoice-last-posted-account", guid,
+                  NULL);
+        qof_commit_edit (owner_inst);
     }
 
     /* ... post it ... */

commit 126dc3a79088fbb5a376afb0f7f08bd2f1a8bccb
Author: Mike Evans <mikee at saxicola.co.uk>
Date:   Sun Apr 14 14:13:25 2019 +0100

    Bug-797168 Proposed fix.

diff --git a/gnucash/gnome/dialog-invoice.c b/gnucash/gnome/dialog-invoice.c
index 49094daad..d939167ee 100644
--- a/gnucash/gnome/dialog-invoice.c
+++ b/gnucash/gnome/dialog-invoice.c
@@ -760,12 +760,12 @@ gnc_dialog_post_invoice(InvoiceWindow *iw, char *message,
     *ddue = *postdate;
     *memo = NULL;
     {
-	GncGUID *guid = NULL;
-	owner_inst = qofOwnerGetOwner (gncOwnerGetEndOwner (&(iw->owner)));
-	qof_instance_get (owner_inst,
-			  "invoice-last-posted-account", &guid,
-			  NULL);
-	*acc = xaccAccountLookup (guid, iw->book);
+    GncGUID *guid = NULL;
+    owner_inst = qofOwnerGetOwner (gncOwnerGetEndOwner (&(iw->owner)));
+    qof_instance_get (owner_inst,
+              "invoice-last-posted-account", &guid,
+              NULL);
+    *acc = xaccAccountLookup (guid, iw->book);
     }
     /* Get the default for the accumulate option */
     *accumulate = gnc_prefs_get_bool(GNC_PREFS_GROUP_INVOICE, GNC_PREF_ACCUM_SPLITS);
@@ -957,12 +957,12 @@ gnc_invoice_post(InvoiceWindow *iw, struct post_invoice_params *post_params)
      */
     owner_inst = qofOwnerGetOwner (gncOwnerGetEndOwner (&(iw->owner)));
     {
-	const GncGUID *guid = qof_instance_get_guid (QOF_INSTANCE (acc));
-	qof_begin_edit (owner_inst);
-	qof_instance_set (owner_inst,
-			  "invoice-last-posted-account", guid,
-			  NULL);
-	qof_commit_edit (owner_inst);
+    const GncGUID *guid = qof_instance_get_guid (QOF_INSTANCE (acc));
+    qof_begin_edit (owner_inst);
+    qof_instance_set (owner_inst,
+              "invoice-last-posted-account", guid,
+              NULL);
+    qof_commit_edit (owner_inst);
     }
 
     /* ... post it ... */
@@ -1931,10 +1931,22 @@ gnc_invoice_update_window (InvoiceWindow *iw, GtkWidget *widget)
         //    GtkWidget *hide;
 
         /* Setup viewer for read-only access */
-        /*
+        gtk_widget_set_sensitive (acct_entry, FALSE);
         gtk_widget_set_sensitive (iw->id_entry, FALSE);
         gtk_widget_set_sensitive (iw->terms_menu, FALSE);
-        gtk_widget_set_sensitive (iw->notes_text, FALSE); *//* XXX: should notes remain writable? */
+        gtk_widget_set_sensitive (iw->owner_box, FALSE);
+        gtk_widget_set_sensitive (iw->job_box, FALSE);
+        gtk_widget_set_sensitive (iw->billing_id_entry, FALSE);
+        gtk_widget_set_sensitive (iw->notes_text, FALSE); /* XXX: should notes remain writable?*/
+    }
+    else           /* ! posted */
+    {
+        gtk_widget_set_sensitive (acct_entry, TRUE);
+        gtk_widget_set_sensitive (iw->terms_menu, TRUE);
+        gtk_widget_set_sensitive (iw->owner_box, TRUE);
+        gtk_widget_set_sensitive (iw->job_box, TRUE);
+        gtk_widget_set_sensitive (iw->billing_id_entry, TRUE);
+        gtk_widget_set_sensitive (iw->notes_text, TRUE);
     }
 
     if (widget)
@@ -2351,6 +2363,8 @@ gnc_invoice_create_page (InvoiceWindow *iw, gpointer page)
     /* Make the opened and posted dates insensitive in this window */
     gtk_widget_set_sensitive (iw->opened_date, FALSE);
     gtk_widget_set_sensitive (iw->posted_date, FALSE);
+    /* Also the invoice ID */
+    gtk_widget_set_sensitive (iw->id_entry, FALSE);
 
     /* Build the ledger */
     ledger_type = GNCENTRY_INVOICE_VIEWER;
@@ -3344,7 +3358,7 @@ gnc_invoice_show_docs_due (GtkWindow *parent, QofBook *book, double days_in_adva
     if (param_list == NULL)
     {
         /* Translators: This abbreviation is the column heading for
-	   the condition "Is this invoice a Credit Note?" */
+       the condition "Is this invoice a Credit Note?" */
         param_list = gnc_search_param_prepend (param_list, _("CN?"), NULL, type,
                                                INVOICE_IS_CN, NULL);
         param_list = gnc_search_param_prepend (param_list, _("Amount"), NULL, type,



Summary of changes:
 bindings/python/gnucash_core.py |  2 +-
 gnucash/gnome/dialog-invoice.c  | 44 +++++++++++++++++++++++++++--------------
 2 files changed, 30 insertions(+), 16 deletions(-)



More information about the gnucash-changes mailing list