gnucash maint: Multiple changes pushed

Mike Alexander mta at code.gnucash.org
Sun Aug 31 19:03:24 EDT 2014


Updated	 via  https://github.com/Gnucash/gnucash/commit/483302ab (commit)
	 via  https://github.com/Gnucash/gnucash/commit/67f84774 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/a028ae0f (commit)
	 via  https://github.com/Gnucash/gnucash/commit/95816477 (commit)
	from  https://github.com/Gnucash/gnucash/commit/c9af8269 (commit)



commit 483302aba0d73526c43a518ab0b152722a3da9e6
Author: Mike Alexander <mta at umich.edu>
Date:   Tue Jul 1 22:40:45 2014 -0400

    Use guint64 instead of uint64_t with G_GUINT64_FORMAT to avoid warnings.

diff --git a/src/libqof/qof/guid.c b/src/libqof/qof/guid.c
index 6ffed52..22a5cf5 100644
--- a/src/libqof/qof/guid.c
+++ b/src/libqof/qof/guid.c
@@ -249,7 +249,7 @@ init_from_file(const char *filename, size_t max_size)
 
 #ifdef HAVE_SCANF_LLD
     PINFO ("guid_init got %" G_GUINT64_FORMAT " bytes from %s",
-	   (uint64_t) file_bytes,
+	   (guint64) file_bytes,
            filename);
 #else
     PINFO ("guid_init got %lu bytes from %s", (unsigned long int) file_bytes,
@@ -515,12 +515,12 @@ guid_init(void)
     /* time in secs and clock ticks */
     bytes += init_from_time();
 
-    PINFO ("got %" G_GUINT64_FORMAT " bytes", (uint64_t) bytes);
+    PINFO ("got %" G_GUINT64_FORMAT " bytes", (guint64) bytes);
 
     if (bytes < THRESHOLD)
         PWARN("only got %" G_GUINT64_FORMAT " bytes.\n"
               "The identifiers might not be very random.\n",
-              (uint64_t)bytes);
+              (guint64)bytes);
 
     guid_initialized = TRUE;
     LEAVE();

commit 67f84774e975db6dd187a065329bf40b392bd8a1
Author: Mike Alexander <mta at umich.edu>
Date:   Sun Aug 31 02:36:59 2014 -0400

    Change gncOwnerGetBalanceInCurrency to only cosider lots that contain an invoice.
    This function is currently only used in the owner tree code and this change
    will cause payments not properly linked to invoices to be ignored when computing
    owner balances.

diff --git a/src/engine/gncOwner.c b/src/engine/gncOwner.c
index 8a1d0bf..6301fba 100644
--- a/src/engine/gncOwner.c
+++ b/src/engine/gncOwner.c
@@ -1133,8 +1133,10 @@ gncOwnerGetBalanceInCurrency (const GncOwner *owner,
         {
             GNCLot *lot = lot_node->data;
             gnc_numeric lot_balance = gnc_lot_get_balance (lot);
-            balance = gnc_numeric_add (balance, lot_balance,
-                                       gnc_commodity_get_fraction (owner_currency), GNC_HOW_RND_ROUND_HALF_UP);
+            GncInvoice *invoice = gncInvoiceGetInvoiceFromLot(lot);
+            if (invoice)
+               balance = gnc_numeric_add (balance, lot_balance,
+                                          gnc_commodity_get_fraction (owner_currency), GNC_HOW_RND_ROUND_HALF_UP);
         }
     }
 

commit a028ae0f985f37399e86bdd40e9a6cdfd6fb15bb
Author: Mike Alexander <mta at umich.edu>
Date:   Sun Aug 31 01:56:49 2014 -0400

    Finish implementing the "Show zero balance owners" filter option.
    It always showed nothing before.

diff --git a/src/gnome-utils/gnc-tree-view-owner.c b/src/gnome-utils/gnc-tree-view-owner.c
index 7f93770..51d3cac 100644
--- a/src/gnome-utils/gnc-tree-view-owner.c
+++ b/src/gnome-utils/gnc-tree-view-owner.c
@@ -1069,13 +1069,7 @@ gnc_plugin_page_owner_tree_filter_owners (GncOwner *owner,
 
     if (!fd->show_zero_total)
     {
-        /* FIXME I'm not aware of any functions to get an owner's "balance" yet.
-         *       This should be implemented before this function does anything useful.
-         *       The code below is copied from the tree-view-account source to serve
-         *       as an example.
-        total = gncOwnerGetBalanceInCurrency (owner, NULL, TRUE);
-        */
-        total = gnc_numeric_zero();
+        total = gncOwnerGetBalanceInCurrency (owner, NULL);
         if (gnc_numeric_zero_p(total))
         {
             LEAVE(" hide: zero balance");

commit 95816477e4b3f6062ed7bd3d2595e7876433f1f9
Author: Mike Alexander <mta at umich.edu>
Date:   Sun Aug 31 01:24:01 2014 -0400

    The sense of the "Only show active customers" checkbox was inverted.

diff --git a/src/gnome-utils/gnc-tree-view-owner.c b/src/gnome-utils/gnc-tree-view-owner.c
index 091f42a..7f93770 100644
--- a/src/gnome-utils/gnc-tree-view-owner.c
+++ b/src/gnome-utils/gnc-tree-view-owner.c
@@ -1099,7 +1099,7 @@ gppot_filter_show_inactive_toggled_cb (GtkToggleButton *button,
     g_return_if_fail(GTK_IS_TOGGLE_BUTTON(button));
 
     ENTER("button %p", button);
-    fd->show_inactive = gtk_toggle_button_get_active(button);
+    fd->show_inactive = !gtk_toggle_button_get_active(button);
     gnc_tree_view_owner_refilter(fd->tree_view);
     LEAVE("show_inactive %d", fd->show_inactive);
 }
@@ -1194,7 +1194,7 @@ owner_filter_dialog_create(OwnerFilterDialog *fd, GncPluginPage *page)
     /* Update the dialog widgets for the current state */
     button = GTK_WIDGET(gtk_builder_get_object (builder, "show_inactive"));
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button),
-                                  fd->show_inactive);
+                                  !fd->show_inactive);
     button = GTK_WIDGET(gtk_builder_get_object (builder, "show_zero"));
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button),
                                   fd->show_zero_total);



Summary of changes:
 src/engine/gncOwner.c                 |  6 ++++--
 src/gnome-utils/gnc-tree-view-owner.c | 12 +++---------
 src/libqof/qof/guid.c                 |  6 +++---
 3 files changed, 10 insertions(+), 14 deletions(-)



More information about the gnucash-changes mailing list