Exemple #1
0
 def __init__(self, db):
     self.db = db
     self.current = []
     self.current_seq = -1
     self.balances_view = None
     self.holdings_view = None
     self.balance_active_only = 1
     self.balance_currency = None
     self.balance_date = QDateTime.currentSecsSinceEpoch()
     self.holdings_date = QDateTime.currentSecsSinceEpoch()
     self.holdings_currency = None
Exemple #2
0
 def prepareNewOperation(self,
                         operation_type,
                         new_operation_record,
                         copy_mode=False):
     init_values = self.operations[operation_type][self.OP_INIT]
     for field in init_values:
         if copy_mode and init_values[field][IV_COPY]:
             continue
         if init_values[field][IV_TYPE] == INIT_NULL:
             new_operation_record.setNull(field)
         if init_values[field][IV_TYPE] == INIT_TIMESTAMP:
             new_operation_record.setValue(
                 field, QDateTime.currentSecsSinceEpoch())
         if init_values[field][IV_TYPE] == INIT_ACCOUNT:
             new_operation_record.setValue(field, self.p_account_id)
         if init_values[field][IV_TYPE] == INIT_VALUE:
             new_operation_record.setValue(field,
                                           init_values[field][IV_VALUE])
     return new_operation_record