# Owner GnuCashBusinessEntity.add_methods_with_prefix('gncOwner') owner_dict = { 'GetCustomer': Customer, 'GetVendor': Vendor, 'GetEmployee': Employee, 'GetJob': Job, 'GetAddr': Address, 'GetCurrency': GncCommodity, 'GetEndOwner': GnuCashBusinessEntity, 'GetBalanceInCurrency': GncNumeric, } methods_return_instance(GnuCashBusinessEntity, owner_dict) methods_return_instance_lists(GnuCashBusinessEntity, {'GetCommoditiesList': GncCommodity}) # Customer Customer.add_constructor_and_methods_with_prefix('gncCustomer', 'Create') customer_dict = { 'GetAddr': Address, 'GetShipAddr': Address, 'GetDiscount': GncNumeric, 'GetCredit': GncNumeric, 'GetTerms': BillTerm, 'GetCurrency': GncCommodity, 'GetTaxTable': TaxTable, } methods_return_instance(Customer, customer_dict)
# GncCommodityTable GncCommodityTable.add_methods_with_prefix('gnc_commodity_table_') commoditytable_dict = { 'lookup': GncCommodity, 'lookup_unique': GncCommodity, 'find_full': GncCommodity, 'insert': GncCommodity, 'add_namespace': GncCommodityNamespace, 'find_namespace': GncCommodityNamespace, } methods_return_instance(GncCommodityTable, commoditytable_dict) methods_return_instance_lists( GncCommodityTable, { 'get_namespaces': GncCommodityNamespace, 'get_namespaces_list': GncCommodityNamespace, 'get_commodities': GncCommodity, 'get_quotable_commodities': GncCommodity, }) # GncCommodityNamespace GncCommodityNamespace.add_methods_with_prefix('gnc_commodity_namespace_') GncCommodityNamespace.get_commodity_list = \ method_function_returns_instance_list( GncCommodityNamespace.get_commodity_list, GncCommodity ) # GncLot GncLot.add_constructor_and_methods_with_prefix('gnc_lot_', 'new') gnclot_dict = { 'get_account': Account,
GnuCashBusinessEntity.add_methods_with_prefix('gncOwner') owner_dict = { 'GetCustomer' : Customer, 'GetVendor' : Vendor, 'GetEmployee' : Employee, 'GetJob' : Job, 'GetAddr' : Address, 'GetCurrency' : GncCommodity, 'GetEndOwner': GnuCashBusinessEntity, 'GetBalanceInCurrency': GncNumeric, } methods_return_instance(GnuCashBusinessEntity, owner_dict) methods_return_instance_lists( GnuCashBusinessEntity, { 'GetCommoditiesList': GncCommodity }) # Customer Customer.add_constructor_and_methods_with_prefix('gncCustomer', 'Create') customer_dict = { 'GetAddr' : Address, 'GetShipAddr' : Address, 'GetDiscount' : GncNumeric, 'GetCredit' : GncNumeric, 'GetTerms' : BillTerm, 'GetCurrency' : GncCommodity, 'GetTaxTable': TaxTable, } methods_return_instance(Customer, customer_dict)
# GncCommodityTable GncCommodityTable.add_methods_with_prefix('gnc_commodity_table_') commoditytable_dict = { 'lookup' : GncCommodity, 'lookup_unique' : GncCommodity, 'find_full' : GncCommodity, 'insert' : GncCommodity, 'add_namespace': GncCommodityNamespace, 'find_namespace': GncCommodityNamespace, } methods_return_instance(GncCommodityTable, commoditytable_dict) methods_return_instance_lists( GncCommodityTable, { 'get_namespaces': GncCommodityNamespace, 'get_namespaces_list': GncCommodityNamespace, 'get_commodities': GncCommodity, 'get_quotable_commodities': GncCommodity, } ) # GncCommodityNamespace GncCommodityNamespace.add_methods_with_prefix('gnc_commodity_namespace_') GncCommodityNamespace.get_commodity_list = \ method_function_returns_instance_list( GncCommodityNamespace.get_commodity_list, GncCommodity ) # GncLot GncLot.add_constructor_and_methods_with_prefix('gnc_lot_', 'new') gnclot_dict = { 'get_account' : Account,
# GncCommodityTable GncCommodityTable.add_methods_with_prefix('gnc_commodity_table_') commoditytable_dict = { 'lookup' : GncCommodity, 'lookup_unique' : GncCommodity, 'find_full' : GncCommodity, 'insert' : GncCommodity, 'add_namespace': GncCommodityNamespace, 'find_namespace': GncCommodityNamespace, } methods_return_instance(GncCommodityTable, commoditytable_dict) methods_return_instance_lists( GncCommodityTable, { 'get_namespaces': GncCommodityNamespace, 'get_namespaces_list': GncCommodityNamespace, 'get_commodities': GncCommodity, 'get_quotable_commodities': GncCommodity, } ) # GncCommodityNamespace GncCommodityNamespace.add_methods_with_prefix('gnc_commodity_namespace_') GncCommodityNamespace.get_commodity_list = \ method_function_returns_instance_list( GncCommodityNamespace.get_commodity_list, GncCommodity ) # GncLot GncLot.add_constructor_and_methods_with_prefix('gnc_lot_', 'new') gnclot_dict = { 'get_account' : Account,
# GncCommodityTable GncCommodityTable.add_methods_with_prefix('gnc_commodity_table_') commoditytable_dict = { 'lookup': GncCommodity, 'lookup_unique': GncCommodity, 'find_full': GncCommodity, 'insert': GncCommodity, 'add_namespace': GncCommodityNamespace, 'find_namespace': GncCommodityNamespace, } methods_return_instance(GncCommodityTable, commoditytable_dict) methods_return_instance_lists( GncCommodityTable, { 'get_namespaces': GncCommodityNamespace, 'get_namespaces_list': GncCommodityNamespace, 'get_commodities': GncCommodity, 'get_quotable_commodities': GncCommodity, }) # GncCommodityNamespace GncCommodityNamespace.add_methods_with_prefix('gnc_commodity_namespace_') GncCommodityNamespace.get_commodity_list = \ method_function_returns_instance_list( GncCommodityNamespace.get_commodity_list, GncCommodity ) # GncLot GncLot.add_constructor_and_methods_with_prefix('gnc_lot_', 'new') gnclot_dict = { 'get_account': Account,
'GetParent': TaxTable, } methods_return_instance(TaxTable, taxtable_dict) # TaxTableEntry TaxTableEntry.add_constructor_and_methods_with_prefix('gncTaxTableEntry', 'Create') taxtableentry_dict = { 'GetAccount': Account, 'GetAmount': GncNumeric, } # Invoice Invoice.add_constructor_and_methods_with_prefix('gncInvoice', 'Create') methods_return_instance_lists(Invoice, {'GetEntries': Entry}) # Bill Bill.add_methods_with_prefix('gncBill') invoice_dict = { 'GetTerms': BillTerm, 'GetCurrency': GncCommodity, 'GetToChargeAmount': GncNumeric, 'GetPostedLot': GncLot, 'GetPostedTxn': Transaction, 'GetPostedAcc': Account, 'GetTotal': GncNumeric, 'GetTotalOf': GncNumeric, 'GetTotalSubtotal': GncNumeric, 'GetTotalTax': GncNumeric,
'GetParent': TaxTable, } methods_return_instance(TaxTable, taxtable_dict) # TaxTableEntry TaxTableEntry.add_constructor_and_methods_with_prefix( 'gncTaxTableEntry', 'Create') taxtableentry_dict = { 'GetAccount': Account, 'GetAmount': GncNumeric, } # Invoice Invoice.add_constructor_and_methods_with_prefix('gncInvoice', 'Create') methods_return_instance_lists( Invoice, { 'GetEntries': Entry }) # Bill Bill.add_methods_with_prefix('gncBill') invoice_dict = { 'GetTerms': BillTerm, 'GetCurrency': GncCommodity, 'GetToChargeAmount': GncNumeric, 'GetPostedLot': GncLot, 'GetPostedTxn': Transaction, 'GetPostedAcc': Account, 'GetTotal': GncNumeric, 'GetTotalOf': GncNumeric, 'GetTotalSubtotal': GncNumeric, 'GetTotalTax': GncNumeric,