Ignore:
Timestamp:
25 Jan 2021, 15:35:20 (4 years ago)
Author:
Henrik Bettermann
Message:

Implement medical questionnaire fee.

Location:
main/waeup.uniben/trunk/src/waeup/uniben/students
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py

    r16385 r16386  
    802802    pnav = 4
    803803
     804    def _medicalQuestPaymentMade(self, student, session):
     805        if len(student['payments']):
     806            for ticket in student['payments'].values():
     807                if ticket.p_state == 'paid' and \
     808                    ticket.p_category == 'medical_quest' and \
     809                    ticket.p_session == session:
     810                    return True
     811        return False
     812
     813    def update(self):
     814        if not self._medicalQuestPaymentMade(
     815            self.context, self.context.current_session):
     816            self.flash('Please pay medical questionnaire payment first.',
     817                type="warning")
     818            self.redirect(self.url(self.context))
     819            return
     820        return super(StudentMedicalHistoryEditFormPage, self).update()
     821
    804822    @property
    805823    def form_fields(self):
  • main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py

    r16385 r16386  
    11701170
    11711171    def test_student_medical_questionnaire(self):
     1172        self.app['configuration']['2004'].medical_quest_fee = 1000.0
    11721173        IWorkflowInfo(self.student).fireTransition('admit')
    11731174        self.browser.open(self.login_path)
     
    11791180        self.browser.getLink("Base Data").click()
    11801181        self.browser.getLink("Medical Questionnaire").click()
     1182        self.assertTrue('Please pay medical questionnaire payment first' in
     1183            self.browser.contents)
     1184        self.assertEqual(self.browser.url, self.student_path)
     1185        self.browser.open(self.payments_path)
     1186        self.browser.getLink("Add current session payment ticket").click()
     1187        self.browser.getControl(name="form.p_category").value = ['medical_quest']
     1188        self.browser.getControl("Create ticket").click()
     1189        p_ticket = self.student['payments'].values()[0]
     1190        p_ticket.approveStudentPayment()
     1191        self.browser.getLink("Base Data").click()
     1192        self.browser.getLink("Medical Questionnaire").click()
    11811193        self.browser.getLink("Download medical questionnaire slip").click()
    11821194        self.assertEqual(self.browser.headers['Status'], '200 Ok')
  • main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py

    r16382 r16386  
    275275        elif category == 'clinexam':
    276276            amount = academic_session.clinexam_fee
     277        elif category == 'medical_quest':
     278            amount = academic_session.medical_quest_fee
    277279        elif category.startswith('pharmd') \
    278280            and student.current_mode == 'special_ft':
Note: See TracChangeset for help on using the changeset viewer.