mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
@@ -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
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user