diff --git a/src/engine/gncInvoiceP.h b/src/engine/gncInvoiceP.h index 88e8bcfc7d..537dc2e453 100644 --- a/src/engine/gncInvoiceP.h +++ b/src/engine/gncInvoiceP.h @@ -39,7 +39,7 @@ gchar *gncInvoiceNextID (QofBook *book, const GncOwner *owner); void gncInvoiceSetPostedAcc (GncInvoice *invoice, Account *acc); void gncInvoiceSetPostedTxn (GncInvoice *invoice, Transaction *txn); void gncInvoiceSetPostedLot (GncInvoice *invoice, GNCLot *lot); -void gncInvoiceSetPaidTxn (GncInvoice *invoice, Transaction *txn); +//void gncInvoiceSetPaidTxn (GncInvoice *invoice, Transaction *txn); #define gncInvoiceSetGUID(I,G) qof_instance_set_guid(QOF_INSTANCE(I),(G)) #endif /* GNC_INVOICEP_H_ */ diff --git a/src/optional/python-bindings/Makefile.am b/src/optional/python-bindings/Makefile.am index 157221d85c..83406a0bef 100644 --- a/src/optional/python-bindings/Makefile.am +++ b/src/optional/python-bindings/Makefile.am @@ -124,7 +124,7 @@ endif noinst_DATA = .py-links -CLEANFILES = $(BUILT_SOURCES) .py-links +CLEANFILES = $(BUILT_SOURCES) .py-links gnucash_core.c gnucash_core.c.py clean-local: rm -rf gnucash diff --git a/src/optional/python-bindings/gnucash_core.i b/src/optional/python-bindings/gnucash_core.i index 14d5c91a80..d87a965830 100644 --- a/src/optional/python-bindings/gnucash_core.i +++ b/src/optional/python-bindings/gnucash_core.i @@ -71,6 +71,7 @@ #include "gncBillTerm.h" #include "gncOwner.h" #include "gncInvoice.h" +#include "gncInvoiceP.h" #include "gncJob.h" #include "gncEntry.h" #include "gncTaxTable.h" @@ -194,6 +195,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 f1a03da153..2237261ca3 100644 --- a/src/optional/python-bindings/gnucash_core.py +++ b/src/optional/python-bindings/gnucash_core.py @@ -40,7 +40,7 @@ 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 + gnc_search_customer_on_id, gnc_search_bill_on_id , gnc_search_vendor_on_id, gncInvoiceNextID class GnuCashCoreClass(ClassFromFunctions): _module = gnucash_core_c @@ -223,6 +223,18 @@ class Book(GnuCashCoreClass): from gnucash_business import Vendor return self.do_lookup_create_oo_instance( gnc_search_vendor_on_id, Vendor, id) + + def InvoiceNextID(self, customer): + ''' Return the next invoice ID. + This works but I'm not entirely happy with it. FIX ME''' + from gnucash.gnucash_core_c import gncInvoiceNextID + return gncInvoiceNextID(self.get_instance(),customer.GetEndOwner().get_instance()[1]) + + def BillNextID(self, vendor): + ''' Return the next Bill ID. ''' + from gnucash.gnucash_core_c import gncInvoiceNextID + return gncInvoiceNextID(self.get_instance(),vendor.GetEndOwner().get_instance()[1]) + class GncNumeric(GnuCashCoreClass): """Object used by GnuCash to store all numbers. Always consists of a @@ -466,6 +478,7 @@ Book.add_method('gnc_book_get_root_account', 'get_root_account') Book.add_method('gnc_book_set_root_account', 'set_root_account') Book.add_method('gnc_commodity_table_get_table', 'get_table') Book.add_method('gnc_pricedb_get_db', 'get_price_db') +Book.add_method('qof_book_increment_and_format_counter', 'increment_and_format_counter') #Functions that return Account Book.get_root_account = method_function_returns_instance(