Add tax tables lookup to python bindings.

Add function to lookup tax tables to Book and add taxtable conversion
to base typemap.

Author: Hendrik van Antwerpen <hendrik@van-antwerpen.net>

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22805 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens
2013-02-22 18:15:28 +00:00
parent a261c17e0b
commit 432632fa73
2 changed files with 8 additions and 1 deletions

View File

@@ -195,6 +195,8 @@ typedef char gchar;
PyList_Append(list, SWIG_NewPointerObj(data, SWIGTYPE_p__gncEmployee, 0));
else if (GNC_IS_JOB(data))
PyList_Append(list, SWIG_NewPointerObj(data, SWIGTYPE_p__gncJob, 0));
else if (GNC_IS_TAXTABLE(data))
PyList_Append(list, SWIG_NewPointerObj(data, SWIGTYPE_p__gncTaxTable, 0));
else if ($1_descriptor == $descriptor(MonetaryList *))
PyList_Append(list, SWIG_NewPointerObj(data, $descriptor(gnc_monetary *), 0));
else

View File

@@ -40,7 +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
gnc_search_customer_on_id, gnc_search_bill_on_id , gnc_search_vendor_on_id, gncInvoiceNextID, \
gncTaxTableGetTables
class GnuCashCoreClass(ClassFromFunctions):
_module = gnucash_core_c
@@ -204,6 +205,10 @@ class Book(GnuCashCoreClass):
return self.do_lookup_create_oo_instance(
gncTaxTableLookupByName, TaxTable, name)
def TaxTableGetTables(self):
from gnucash_business import TaxTable
return [ TaxTable(instance=item) for item in gncTaxTableGetTables(self.instance) ]
def BillLoookupByID(self, id):
from gnucash_business import Bill
return self.do_lookup_create_oo_instance(