Exemple #1
0
# GncLot
GncLot.add_constructor_and_methods_with_prefix('gnc_lot_', 'new')

gnclot_dict =   { 
                    'get_account' : Account, 
                    'get_book' : Book, 
                    'get_earliest_split' : Split, 
                    'get_latest_split' : Split, 
                    'get_balance' : GncNumeric, 
                    'lookup' : GncLot, 
                    'make_default' : GncLot 
                }
methods_return_instance(GncLot, gnclot_dict)

# Transaction
Transaction.add_methods_with_prefix('xaccTrans')
Transaction.add_method('gncTransGetGUID', 'GetGUID');

trans_dict =    {
                    'GetSplit': Split, 
                    'FindSplitByAccount': Split, 
                    'GetNthSplit': Split, 
                    'Clone': Transaction, 
                    'Reverse': Transaction, 
                    'GetReversedBy': Transaction, 
                    'GetImbalanceValue': GncNumeric, 
                    'GetAccountValue': GncNumeric, 
                    'GetAccountAmount': GncNumeric, 
                    'GetAccountConvRate': GncNumeric, 
                    'GetAccountBalance': GncNumeric, 
                    'GetCurrency': GncCommodity,
Exemple #2
0
# GncLot
GncLot.add_constructor_and_methods_with_prefix('gnc_lot_', 'new')

gnclot_dict = {
    'get_account': Account,
    'get_book': Book,
    'get_earliest_split': Split,
    'get_latest_split': Split,
    'get_balance': GncNumeric,
    'lookup': GncLot,
    'make_default': GncLot
}
methods_return_instance(GncLot, gnclot_dict)

# Transaction
Transaction.add_methods_with_prefix('xaccTrans')
Transaction.add_method('gncTransGetGUID', 'GetGUID')

trans_dict = {
    'GetSplit': Split,
    'FindSplitByAccount': Split,
    'Clone': Transaction,
    'Reverse': Transaction,
    'GetReversedBy': Transaction,
    'GetImbalanceValue': GncNumeric,
    'GetAccountValue': GncNumeric,
    'GetAccountAmount': GncNumeric,
    'GetAccountConvRate': GncNumeric,
    'GetAccountBalance': GncNumeric,
    'GetCurrency': GncCommodity,
    'GetGUID': GUID