From a6e850f8a724a0c3895afdc7f22df2f66379127f Mon Sep 17 00:00:00 2001 From: Derek Atkins Date: Thu, 6 Jun 2002 00:11:32 +0000 Subject: [PATCH] Fix a bug in the invoice-search, setup the query properly so you don't find all invoices. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6952 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/business/business-gnome/dialog-invoice.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/business/business-gnome/dialog-invoice.c b/src/business/business-gnome/dialog-invoice.c index d7eeaf8d57..cbbeba5db7 100644 --- a/src/business/business-gnome/dialog-invoice.c +++ b/src/business/business-gnome/dialog-invoice.c @@ -1535,16 +1535,19 @@ gnc_invoice_search (GncInvoice *start, GncOwner *owner, GNCBook *book) * Invoice->owner->parentGUID. */ if (owner && gncOwnerGetGUID (owner)) { - gncQueryAddGUIDMatch (q, g_slist_prepend + q2 = gncQueryCreate (); + gncQueryAddGUIDMatch (q2, g_slist_prepend (g_slist_prepend (NULL, QUERY_PARAM_GUID), INVOICE_OWNER), gncOwnerGetGUID (owner), QUERY_OR); - gncQueryAddGUIDMatch (q, g_slist_prepend + gncQueryAddGUIDMatch (q2, g_slist_prepend (g_slist_prepend (NULL, OWNER_PARENTG), INVOICE_OWNER), gncOwnerGetGUID (owner), QUERY_OR); + gncQueryMergeInPlace (q, q2, QUERY_AND); + gncQueryDestroy (q2); q2 = gncQueryCopy (q); }