From 6e842f5fa5ee7d42ffbb210f5aaef897e5613495 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Fri, 7 May 2010 10:32:07 +0000 Subject: [PATCH] Bug #357696 - Billable items appear in more than one invoice git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19132 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/business/business-ledger/gncEntryLedger.c | 2 +- src/libqof/qof/qofquerycore.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/business/business-ledger/gncEntryLedger.c b/src/business/business-ledger/gncEntryLedger.c index f80231d112..ba9dbced3c 100644 --- a/src/business/business-ledger/gncEntryLedger.c +++ b/src/business/business-ledger/gncEntryLedger.c @@ -426,7 +426,7 @@ static void create_invoice_query (GncEntryLedger *ledger) * ( Entry->Billable == TRUE AND * Entry->Bill->Is-Posted? == TRUE AND * ( Entry->BillTo == Invoice->parent OR - * Entry->Bill->BillTo == Invoice->parent ) ) + * ( Entry->BillTo == NULL AND Entry->Bill->BillTo == Invoice->parent ) ) ) * OR * ( Entry->Order->real-parent == Invoice->parent ) ) * #endif diff --git a/src/libqof/qof/qofquerycore.c b/src/libqof/qof/qofquerycore.c index 97be12c2ab..8fa2109e73 100644 --- a/src/libqof/qof/qofquerycore.c +++ b/src/libqof/qof/qofquerycore.c @@ -730,7 +730,9 @@ qof_query_guid_predicate (QofGuidMatch options, GList *guid_list) query_guid_t pdata; GList *node; - if (NULL == guid_list) return NULL; + /* An empty list of guids is only valid when testing for a null GUID value */ + if (!guid_list) + g_return_val_if_fail (options == QOF_GUID_MATCH_NULL, NULL); pdata = g_new0 (query_guid_def, 1); pdata->pd.how = QOF_COMPARE_EQUAL;