コード例 #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
ファイル: gnucash_core.py プロジェクト: nizarklai/gnucash-1
                        '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
ファイル: gnucash_business.py プロジェクト: nishmu/gnucash
            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
ファイル: gnucash_business.py プロジェクト: manfredu/gnucash
            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
ファイル: gnucash_business.py プロジェクト: cstim/gnucash-svn
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')