From d85725c080c6492e0a6eed83806e90c185a1bca0 Mon Sep 17 00:00:00 2001 From: Mike Evans Date: Thu, 15 May 2014 14:27:27 +0100 Subject: [PATCH] Python bindings. Add function gncVendorNextID, complementary to gncCustomerNextID. --- src/optional/python-bindings/gnucash_core.i | 2 ++ src/optional/python-bindings/gnucash_core.py | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/optional/python-bindings/gnucash_core.i b/src/optional/python-bindings/gnucash_core.i index 18c4f112b6..13aef43ed8 100644 --- a/src/optional/python-bindings/gnucash_core.i +++ b/src/optional/python-bindings/gnucash_core.i @@ -68,6 +68,7 @@ #include "gncCustomerP.h" #include "gncEmployee.h" #include "gncVendor.h" +#include "gncVendorP.h" #include "gncAddress.h" #include "gncBillTerm.h" #include "gncOwner.h" @@ -195,6 +196,7 @@ %include %include %include +%include %include %include %include diff --git a/src/optional/python-bindings/gnucash_core.py b/src/optional/python-bindings/gnucash_core.py index 8244c1de79..9d80a36048 100644 --- a/src/optional/python-bindings/gnucash_core.py +++ b/src/optional/python-bindings/gnucash_core.py @@ -40,8 +40,8 @@ from gnucash_core_c import gncInvoiceLookup, gncInvoiceGetInvoiceFromTxn, \ gncInvoiceGetInvoiceFromLot, gncEntryLookup, gncInvoiceLookup, \ gncCustomerLookup, gncVendorLookup, gncJobLookup, gncEmployeeLookup, \ gncTaxTableLookup, gncTaxTableLookupByName, gnc_search_invoice_on_id, \ - gnc_search_customer_on_id, gnc_search_bill_on_id , gnc_search_vendor_on_id, gncInvoiceNextID, gncCustomerNextID, \ - gncTaxTableGetTables + gnc_search_customer_on_id, gnc_search_bill_on_id , gnc_search_vendor_on_id, \ + gncInvoiceNextID, gncCustomerNextID, gncTaxTableGetTables, gncVendorNextID class GnuCashCoreClass(ClassFromFunctions): _module = gnucash_core_c @@ -243,6 +243,11 @@ class Book(GnuCashCoreClass): ''' Return the next Customer ID. ''' from gnucash.gnucash_core_c import gncCustomerNextID return gncCustomerNextID(self.get_instance()) + + def VendorNextID(self): + ''' Return the next Vendor ID. ''' + from gnucash.gnucash_core_c import gncVendorNextID + return gncVendorNextID(self.get_instance()) class GncNumeric(GnuCashCoreClass): """Object used by GnuCash to store all numbers. Always consists of a