Beispiel #1
0
 def setEventTypeId(self, eventTypeId):
     CEventEditDialog.setEventTypeId(self, eventTypeId, u'Ф.025Тр')
     showTime = getEventShowTime(eventTypeId)
     self.edtBegTime.setVisible(showTime)
     self.edtEndTime.setVisible(showTime)
     self.cmbResult.setTable('rbResult', False,
                             'eventPurpose_id=\'%d\'' % self.eventPurposeId)
Beispiel #2
0
    def setupDatesAndTimes(self):
        eventTypeId = self.cmbEventType.value()
        dateInput = getEventDateInput(eventTypeId)
        showTime = getEventShowTime(eventTypeId)

        if dateInput == 0:
            self.edtEventSetDate.setEnabled(True)
            self.edtEventSetTime.setEnabled(True)
            self.edtEventDate.setEnabled(False)
            self.edtEventTime.setEnabled(False)
            self.edtEventDate.canBeEmpty(True)
            clearEndDate = False
        elif dateInput == 1:
            self.edtEventSetDate.setEnabled(False)
            self.edtEventSetTime.setEnabled(False)
            self.edtEventDate.setEnabled(True)
            self.edtEventTime.setEnabled(True)
            self.edtEventDate.canBeEmpty(False)
            clearEndDate = False
        else:
            self.edtEventSetDate.setEnabled(True)
            self.edtEventSetTime.setEnabled(True)
            self.edtEventDate.setEnabled(True)
            self.edtEventTime.setEnabled(True)
            self.edtEventDate.canBeEmpty(True)
            clearEndDate = True

        self.edtEventSetTime.setVisible(showTime)
        self.edtEventTime.setVisible(showTime)

        zeroTime = QtCore.QTime(0, 0)
        if self.dateTime:
            setDate, setTime = self.dateTime.date(), self.dateTime.time()
            date, time = (QtCore.QDate(),
                          zeroTime) if clearEndDate else (setDate, setTime)
        else:
            now = QtCore.QDateTime.currentDateTime()
            setDate = CPreCreateEventDialog._eventSetDate if CPreCreateEventDialog._eventSetDate else now.date(
            )
            setTime = now.time(
            )  #atronah: for i1171\\ if now.date() == setDate else zeroTime
            if clearEndDate:
                date, time = QtCore.QDate(), zeroTime
            else:
                date = CPreCreateEventDialog._eventDate if CPreCreateEventDialog._eventDate else now.date(
                )
                time = now.time(
                )  #atronah: for i1171\\ if now.date() == date else zeroTime
        if isEventTypeResetSetDate(eventTypeId):
            setDate = QtCore.QDate.currentDate()
        if not self.isRecreated:
            self.edtEventSetDate.setDate(setDate)
            self.edtEventSetTime.setTime(setTime)
            self.edtEventDate.setDate(date)
            self.edtEventTime.setTime(time)
Beispiel #3
0
    def getRecord(self):
        record = CEventEditDialog.getRecord(self)
        showTime = getEventShowTime(self.eventTypeId)

        getLineEditValue(self.edtCardNo, record, 'externalId')
        getDatetimeEditValue(self.edtBegDate, self.edtBegTime, record,
                             'setDate', showTime)
        getDatetimeEditValue(self.edtEndDate, self.edtEndTime, record,
                             'execDate', showTime)
        getRBComboBoxValue(self.cmbPerson, record, 'execPerson_id')
        getRBComboBoxValue(self.cmbResult, record, 'result_id')
        # getComboBoxValue(self.cmbOrder,         record, 'order')
        record.setValue('order', toVariant(self.cmbOrder.code()))
        getCheckBoxValue(self.chkLock, record, 'locked')
        return record
Beispiel #4
0
 def setEventTypeId(self, eventTypeId):
     CEventEditDialog.setEventTypeId(self, eventTypeId, u'Ф.106')
     self.tabCash.windowTitle = self.windowTitle()
     showTime = getEventShowTime(eventTypeId)
     self.edtBegTime.setVisible(showTime)
     self.edtEndTime.setVisible(showTime)
     if self.cmbResult.value() is None:
         if self.inheritResult == True:
             self.cmbResult.setValue(
                 self.defaultEventResultId.get(self.eventPurposeId))
     self.updateResultFilter()
     self.diagnosisSetDateVisible = forceBool(
         getDiagnosisSetDateVisible(eventTypeId))
     if self.diagnosisSetDateVisible == False:
         self.tblFinalDiagnostics.setColumnHidden(2, True)
         self.tblPreliminaryDiagnostics.setColumnHidden(2, True)
Beispiel #5
0
 def eventDate(self):
     """Возвращает дату окончания события"""
     eventTypeId = self.cmbEventType.value()
     dateInput = getEventDateInput(eventTypeId)
     showTime = getEventShowTime(eventTypeId)
     if dateInput == 0:
         return QtCore.QDateTime()
     else:
         date = self.edtEventDate.date()
         time = self.edtEventTime.time()
     if date.isNull():
         return QtCore.QDateTime()
     if showTime:
         return QtCore.QDateTime(date, time)
     else:
         return QtCore.QDateTime(date)
Beispiel #6
0
 def eventSetDate(self):
     eventTypeId = self.cmbEventType.value()
     dateInput = getEventDateInput(eventTypeId)
     showTime = getEventShowTime(eventTypeId)
     if dateInput == 0:
         date = self.edtEventSetDate.date()
         time = self.edtEventSetTime.time()
     elif dateInput == 1:
         date = self.edtEventDate.date()
         time = self.edtEventTime.time()
     else:
         date = self.edtEventSetDate.date()
         time = self.edtEventSetTime.time()
     if showTime:
         return QtCore.QDateTime(date, time)
     else:
         return QtCore.QDateTime(date)
Beispiel #7
0
    def getRecord(self):
        record = CEventEditDialog.getRecord(self)
        showTime = getEventShowTime(self.eventTypeId)
        #перенести в exec_ в случае успеха или в accept?
        getRBComboBoxValue(self.cmbContract, record, 'contract_id')
        #        getDateEditValue(self.edtPrevDate,      record, 'prevEventDate')
        getLineEditValue(self.edtNumber, record, 'externalId')
        getDatetimeEditValue(self.edtEndDate, self.edtEndTime, record,
                             'setDate', showTime)
        getRBComboBoxValue(self.cmbPerson2, record, 'setPerson_id')
        getDatetimeEditValue(self.edtBegDate, self.edtBegTime, record,
                             'execDate', showTime)
        getRBComboBoxValue(self.cmbPerson, record, 'execPerson_id')
        getRBComboBoxValue(self.cmbResult, record, 'result_id')
        record.setValue('isPrimary',
                        toVariant(1 if self.chkAutopsy.isChecked() else 2))
        self.tabNotes.getNotes(record, self.eventTypeId)
        # getTextEditValue(self.edtNote,          record, 'note')
        ###  payStatus

        return record