コード例 #1
0
ファイル: gnucash_core.py プロジェクト: nizarklai/gnucash-1
# 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,
コード例 #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