Bug #635469: Add bindings for running a qofquery on invoices.

This adds a new typedef "GncInvoiceList" with the corresponding typemap,
and adds two new functions qof_query_create_for_invoices and
qof_query_run_for_invoices, which are trivial wrappers around
qof_query_create_for and qof_query_run respectively.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19863 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2010-11-22 20:17:18 +00:00
parent d9a658ed4b
commit 32416a5d15
2 changed files with 13 additions and 0 deletions

View File

@ -76,6 +76,7 @@ static GncEmployee * gncEmployeeLookupFlip(GncGUID g, QofBook *b)
%}
GLIST_HELPER_INOUT(GncInvoiceList, SWIGTYPE_p__gncInvoice);
GLIST_HELPER_INOUT(EntryList, SWIGTYPE_p__gncEntry);
GLIST_HELPER_INOUT(GncTaxTableEntryList, SWIGTYPE_p__gncTaxTableEntry);
GLIST_HELPER_INOUT(OwnerList, SWIGTYPE_p__gncOwner);
@ -127,6 +128,7 @@ GLIST_HELPER_INOUT(OwnerList, SWIGTYPE_p__gncOwner);
%include <gncTaxTable.h>
%include <gncVendor.h>
%include <gncBusGuile.h>
%include <libqof/qof/qofquery.h>
#define URL_TYPE_CUSTOMER GNC_ID_CUSTOMER
#define URL_TYPE_VENDOR GNC_ID_VENDOR
@ -136,6 +138,16 @@ GLIST_HELPER_INOUT(OwnerList, SWIGTYPE_p__gncOwner);
// not exactly clean
#define URL_TYPE_OWNERREPORT "owner-report"
%inline %{
static QofQuery * qof_query_create_for_invoices(void) {
return qof_query_create_for(GNC_ID_INVOICE);
}
static GncInvoiceList * qof_query_run_for_invoices(QofQuery *q) {
return qof_query_run(q);
}
%}
%init {
{
char tmp[100];

View File

@ -39,6 +39,7 @@ transaction and lot for the posted invoice.
struct _gncInvoice;
typedef struct _gncInvoice GncInvoice;
typedef struct _gncInvoiceClass GncInvoiceClass;
typedef GList GncInvoiceList;
#include "gncBillTerm.h"
#include "gncEntry.h"