Changeset 16386


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
Files:
5 edited

Legend:

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

    r15106 r16386  
    130130        )
    131131
     132    medical_quest_fee = schema.Float(
     133        title = _(u'Medical Questionnaire Fee'),
     134        default = 0.0,
     135        required = False,
     136        )
     137
    132138    remita_enabled = schema.Bool(
    133139        title = _(u'Remita integration enabled'),
  • 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':
  • main/waeup.uniben/trunk/src/waeup/uniben/utils/utils.py

    r16374 r16386  
    9292        'carryover':'School Fee (carry over from previous sessions)',
    9393        'foreign':'School Fee (paid in foreign currency)',
     94        'medical_quest':'Medical Questionnaire Fee',
    9495        }
    9596
     
    112113        'pharmd_2':'PharmD Module 1 Fee (school fee prepayment)',
    113114        #'develop':'Development Fee',
     115        'medical_quest':'Medical Questionnaire Fee',
    114116        }
    115117
Note: See TracChangeset for help on using the changeset viewer.