Changeset 14375 for main


Ignore:
Timestamp:
7 Jan 2017, 07:25:14 (8 years ago)
Author:
Henrik Bettermann
Message:

Add restitution fee payment category and conditions additional for course registration.

Location:
main/waeup.aaue/trunk/src/waeup/aaue
Files:
4 edited

Legend:

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

    r14355 r14375  
    212212        )
    213213
     214    restitution_fee = schema.Float(
     215        title = _(u'Restitution Fee'),
     216        default = 0.0,
     217        required = True,
     218        )
     219
    214220    coursereg_deadline = schema.Datetime(
    215221        title = _(u'FT Course Reg. Deadline'),
  • main/waeup.aaue/trunk/src/waeup/aaue/students/studylevel.py

    r14370 r14375  
    127127        if not fac_dep_paid:
    128128            return _("Please pay faculty and departmental dues first.")
     129        restitution_paid = True
     130        if self.student.entry_session < 2016 \
     131            and self.student.current_mode == 'ug_ft':
     132            restitution_paid = False
     133            for ticket in self.student['payments'].values():
     134                if ticket.p_category == 'restitution' and \
     135                    ticket.p_session == self.level_session and \
     136                    ticket.p_state == 'paid':
     137                        restitution_paid = True
     138                        continue
     139        if not restitution_paid:
     140            return _("Please pay restitution fee first.")
    129141        if self.student.is_fresh:
    130142            return
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py

    r14362 r14375  
    588588
    589589    def test_late_registration(self):
    590         # Login
     590        self.app['configuration']['2004'].restitution_fee = 9999.0
    591591        delta = timedelta(days=10)
    592592        self.app['configuration'][
     
    596596        # returning students.
    597597        self.student['studycourse'].entry_session = 2003
    598         self.browser.open(self.login_path)
    599         self.browser.getControl(name="form.login").value = self.student_id
    600         self.browser.getControl(name="form.password").value = 'spwd'
    601         self.browser.getControl("Login").click()
    602         self.browser.open(self.payments_path)
     598        # Login
     599        self.browser.open(self.login_path)
     600        self.browser.getControl(name="form.login").value = self.student_id
     601        self.browser.getControl(name="form.password").value = 'spwd'
     602        self.browser.getControl("Login").click()
     603        # Make restitution fee payment
     604        self.browser.open(self.payments_path + '/addop')
     605        self.browser.getControl(name="form.p_category").value = ['restitution']
     606        self.browser.getControl("Create ticket").click()
     607        self.student['payments'].values()[0].approveStudentPayment()
     608        # Make late registration fee fee payment
    603609        self.browser.open(self.payments_path + '/addop')
    604610        self.browser.getControl(name="form.p_category").value = ['late_registration']
     
    619625        self.browser.getControl("Register course list").click()
    620626        self.assertTrue('Course registration has ended. Please pay' in self.browser.contents)
    621         self.student['payments'].values()[0].approve()
     627        self.student['payments'].values()[1].approve()
    622628        self.browser.getControl("Register course list").click()
    623629        self.assertTrue('Course list has been registered' in self.browser.contents)
     
    626632        # register courses.
    627633        self.student['studycourse'].entry_session = 2004
    628         del self.student['payments'][self.student['payments'].keys()[0]]
     634        del self.student['payments'][self.student['payments'].keys()[1]]
    629635        IWorkflowState(self.student).setState('school fee paid')
    630636        self.browser.open(self.studycourse_path + '/100/edit')
     
    932938        self.assertTrue('Please pay faculty and departmental dues first'
    933939            in self.browser.contents)
    934 
    935940        configuration_1 = createObject('waeup.SessionConfiguration')
    936941        configuration_1.academic_session = 2016
    937942        configuration_1.fac_dep_fee = 9999.0
    938943        self.app['configuration'].addSessionConfiguration(configuration_1)
    939 
    940944        self.browser.open(self.payments_path + '/addop')
    941945        self.browser.getControl(name="form.p_category").value = ['fac_dep']
     946        self.browser.getControl("Create ticket").click()
     947        self.student['payments'].values()[0].approveStudentPayment()
     948        self.browser.open(self.studycourse_path + '/100/edit')
     949        self.browser.getControl("Register course list").click()
     950        self.assertTrue('Course list has been registered'
     951            in self.browser.contents)
     952        return
     953
     954    def test_course_registration_forbidden_2(self):
     955        IWorkflowState(self.student).setState('school fee paid')
     956        self.student['studycourse'].entry_session = 2004
     957        self.student['studycourse'].current_session = 2004
     958        self.browser.open(self.login_path)
     959        self.browser.getControl(name="form.login").value = self.student_id
     960        self.browser.getControl(name="form.password").value = 'spwd'
     961        self.browser.getControl("Login").click()
     962        self.browser.getLink("Study Course").click()
     963        self.browser.getLink("Add course list").click()
     964        self.browser.getControl("Create course list now").click()
     965        self.browser.getLink("Edit course list").click()
     966        self.browser.getControl("Register course list").click()
     967        self.assertTrue('Please pay restitution fee first'
     968            in self.browser.contents)
     969        self.app['configuration']['2004'].restitution_fee = 9999.0
     970        self.browser.open(self.payments_path + '/addop')
     971        self.browser.getControl(name="form.p_category").value = ['restitution']
    942972        self.browser.getControl("Create ticket").click()
    943973        self.student['payments'].values()[0].approveStudentPayment()
  • main/waeup.aaue/trunk/src/waeup/aaue/utils/utils.py

    r14355 r14375  
    5858        'ent_registration_3': 'Registration Fee ENT201',
    5959        'fac_dep': 'Faculty and Departmental Dues',
     60        'restitution': 'Restitution Fee',
    6061        }
    6162
     
    8990        'ent_registration_3': 'Registration Fee ENT201',
    9091        'fac_dep': 'Faculty and Departmental Dues',
     92        'restitution': 'Restitution Fee',
    9193        }
    9294
     
    119121        'ent_registration_3': 'Registration Fee ENT201',
    120122        'fac_dep': 'Faculty and Departmental Dues',
     123        'restitution': 'Restitution Fee',
    121124        }
    122125
Note: See TracChangeset for help on using the changeset viewer.