예제 #1
0

# 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,
예제 #2
0
                        'add' : GncNumeric, 
                        'sub' : GncNumeric, 
                        'mul' : GncNumeric, 
                        'div' : GncNumeric, 
                        'neg' : GncNumeric, 
                        'abs' : GncNumeric, 
                        'add_fixed' : GncNumeric, 
                        'sub_fixed' : GncNumeric, 
                        'add_with_error' : GncNumeric, 
                        'sub_with_error' : GncNumeric, 
                        'mul_with_error' : GncNumeric, 
                        'div_with_error' : GncNumeric, 
                        'convert' : GncNumeric, 
                        'reduce' : GncNumeric 
                    }
methods_return_instance(GncNumeric, gncnumeric_dict)

# GncCommodity
GncCommodity.add_constructor_and_methods_with_prefix('gnc_commodity_', 'new')
#Functions that return GncCommodity
GncCommodity.clone = method_function_returns_instance(
    GncCommodity.clone, GncCommodity )

# GncCommodityTable
GncCommodityTable.add_methods_with_prefix('gnc_commodity_table_')
commoditytable_dict =   { 
                            'lookup' : GncCommodity, 
                            'lookup_unique' : GncCommodity, 
                            'find_full' : GncCommodity, 
                            'insert' : GncCommodity 
                        }
예제 #3
0
            GnuCashCoreClass.__init__(self, instance=instance)    

# 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,
예제 #4
0
    Definition in file gnc-pricedb.h.
    See also http://svn.gnucash.org/docs/head/gnc-pricedb_8h.html
    '''


GncPriceDB.add_methods_with_prefix('gnc_pricedb_')
PriceDB_dict = {
    'lookup_latest': GncPrice,
    'lookup_nearest_in_time': GncPrice,
    'lookup_latest_before': GncPrice,
    'convert_balance_latest_price': GncNumeric,
    'convert_balance_nearest_price': GncNumeric,
    'convert_balance_latest_before': GncNumeric,
}
methods_return_instance(GncPriceDB, PriceDB_dict)
GncPriceDB.get_prices = method_function_returns_instance_list(
    GncPriceDB.get_prices, GncPrice)


class GncCommodity(GnuCashCoreClass):
    pass


class GncCommodityTable(GnuCashCoreClass):
    """A CommodityTable provides a way to store and lookup commoditys.
    Commoditys are primarily currencies, but other tradable things such as
    stocks, mutual funds, and material substances are posible.

    Users of this library should not create thier own CommodityTable, instead
    the get_table method from the Book class should be used.
예제 #5
0
            GnuCashCoreClass.__init__(self, instance=instance)


# 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)

# Employee
Employee.add_constructor_and_methods_with_prefix('gncEmployee', 'Create')

employee_dict = {
    'GetBook': Book,
    'GetAddr': Address,
    'GetWorkday': GncNumeric,
    'GetRate': GncNumeric,
    'GetCurrency': GncCommodity
}
methods_return_instance(Employee, employee_dict)

# Vendor
Vendor.add_constructor_and_methods_with_prefix('gncVendor', 'Create')
예제 #6
0
class BillTerm(GnuCashCoreClass):
    pass


# Customer
Customer.add_constructor_and_methods_with_prefix('gncCustomer', 'Create')

customer_dict = {
    'GetAddr': Address,
    'GetShipAddr': Address,
    'GetDiscount': GncNumeric,
    'GetCredit': GncNumeric,
    'GetTerms': BillTerm,
    'GetCurrency': GncCommodity
}
methods_return_instance(Customer, customer_dict)

# Employee
Employee.add_constructor_and_methods_with_prefix('gncEmployee', 'Create')

employee_dict = {
    'GetBook': Book,
    'GetAddr': Address,
    'GetWorkday': GncNumeric,
    'GetRate': GncNumeric,
    'GetCurrency': GncCommodity
}
methods_return_instance(Employee, employee_dict)

# Vendor
Vendor.add_constructor_and_methods_with_prefix('gncVendor', 'Create')
예제 #7
0
class Address(GnuCashCoreClass): pass
    
class BillTerm(GnuCashCoreClass): pass

# Customer
Customer.add_constructor_and_methods_with_prefix('gncCustomer', 'Create')

customer_dict = {
                    'GetAddr' : Address,
                    'GetShipAddr' : Address,
                    'GetDiscount' : GncNumeric,
                    'GetCredit' : GncNumeric,
                    'GetTerms' : BillTerm,
                    'GetCurrency' : GncCommodity
                }
methods_return_instance(Customer, customer_dict)

# Employee
Employee.add_constructor_and_methods_with_prefix('gncEmployee', 'Create')

employee_dict = {
                    'GetBook' : Book,
                    'GetAddr' : Address,
                    'GetWorkday' : GncNumeric,
                    'GetRate' : GncNumeric,
                    'GetCurrency' : GncCommodity
                }
methods_return_instance(Employee, employee_dict)

# Vendor
Vendor.add_constructor_and_methods_with_prefix('gncVendor', 'Create')