Changeset 14248


Ignore:
Timestamp:
2 Nov 2016, 11:34:48 (8 years ago)
Author:
Henrik Bettermann
Message:

Replace course_registration_allowed by course_registration_forbidden.

Add further requirement for registering courses.

Shorten setPaymentDetails.

Add further payment categories.

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

Legend:

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

    r14234 r14248  
    152152        )
    153153
     154    text_book_1_fee = schema.Float(
     155        title = _(u'Text Book Fee GST101 GST102'),
     156        default = 0.0,
     157        required = True,
     158        )
     159
     160    text_book_2_fee = schema.Float(
     161        title = _(u'Text Book Fee GST111 GST112'),
     162        default = 0.0,
     163        required = True,
     164        )
     165
     166    text_book_3_fee = schema.Float(
     167        title = _(u'Text Book Fee GST222'),
     168        default = 0.0,
     169        required = True,
     170        )
     171
     172    text_book_4_fee = schema.Float(
     173        title = _(u'Text Book Fee ENT201'),
     174        default = 0.0,
     175        required = True,
     176        )
     177
     178    registration_1_fee = schema.Float(
     179        title = _(u'Registration Fee GST101 GST102 GST111 GST112'),
     180        default = 0.0,
     181        required = True,
     182        )
     183
     184    registration_2_fee = schema.Float(
     185        title = _(u'Registration Fee GST222'),
     186        default = 0.0,
     187        required = True,
     188        )
     189
     190    registration_3_fee = schema.Float(
     191        title = _(u'Registration Fee ENT201'),
     192        default = 0.0,
     193        required = True,
     194        )
     195
     196    fac_dep_fee = schema.Float(
     197        title = _(u'Faculty Dues'),
     198        default = 0.0,
     199        required = True,
     200        )
     201
    154202    coursereg_deadline = schema.Datetime(
    155203        title = _(u'FT Course Reg. Deadline'),
  • main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py

    r14235 r14248  
    167167    site_name = SITE_NAME
    168168    currency = CURRENCY
    169     #pay_item_id = '101'
     169    pay_item_id = '000'
    170170
    171171    def update(self):
  • main/waeup.aaue/trunk/src/waeup/aaue/students/studylevel.py

    r14227 r14248  
    3535from waeup.aaue.students.interfaces import (
    3636    ICustomStudentStudyLevel, ICustomCourseTicket)
     37from waeup.aaue.interfaces import MessageFactory as _
    3738
    3839
     
    99100
    100101    @property
    101     def course_registration_allowed(self):
     102    def course_registration_forbidden(self):
     103        fac_dep_paid = False
     104        if self.student.entry_session >= 2016:
     105            for ticket in self.student['payments'].values():
     106                if ticket.p_category == 'fac_dep' and \
     107                    ticket.p_session == self.level_session and \
     108                    ticket.p_state == 'paid':
     109                        fac_dep_paid = True
     110                        continue
     111        if not fac_dep_paid:
     112            return _("Please pay faculty and departmental dues first.")
    102113        if self.student.is_fresh:
    103             return True
     114            return
    104115        try:
    105116            if self.student.is_postgrad:
     
    119130                        str(self.level_session)].coursereg_deadline
    120131        except (TypeError, KeyError):
    121             return True
     132            return
    122133        if not deadline or deadline > datetime.now(pytz.utc):
    123             return True
    124         payment_made = False
     134            return
    125135        if len(self.student['payments']):
    126136            for ticket in self.student['payments'].values():
     
    128138                    ticket.p_session == self.level_session and \
    129139                    ticket.p_state == 'paid':
    130                         payment_made = True
    131         if payment_made:
    132             return True
    133         return False
     140                        return
     141        return _("Course registration has ended. "
     142                 "Please pay the late registration fee.")
    134143
    135144    # only AAUE
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py

    r14246 r14248  
    831831        return
    832832
     833    def test_course_registration_forbidden(self):
     834        IWorkflowState(self.student).setState('school fee paid')
     835        self.student['studycourse'].entry_session = 2016
     836        self.student['studycourse'].current_session = 2016
     837        self.browser.open(self.login_path)
     838        self.browser.getControl(name="form.login").value = self.student_id
     839        self.browser.getControl(name="form.password").value = 'spwd'
     840        self.browser.getControl("Login").click()
     841        self.browser.getLink("Study Course").click()
     842        self.browser.getLink("Add course list").click()
     843        self.browser.getControl("Create course list now").click()
     844        self.browser.getLink("Edit course list").click()
     845        self.browser.getControl("Register course list").click()
     846        self.assertTrue('Please pay faculty and departmental dues first'
     847            in self.browser.contents)
     848
     849        configuration_1 = createObject('waeup.SessionConfiguration')
     850        configuration_1.academic_session = 2016
     851        configuration_1.fac_dep_fee = 9999.0
     852        self.app['configuration'].addSessionConfiguration(configuration_1)
     853
     854        self.browser.open(self.payments_path + '/addop')
     855        self.browser.getControl(name="form.p_category").value = ['fac_dep']
     856        self.browser.getControl("Create ticket").click()
     857        self.student['payments'].values()[0].approveStudentPayment()
     858        self.browser.open(self.studycourse_path + '/100/edit')
     859        self.browser.getControl("Register course list").click()
     860        self.assertTrue('Course list has been registered'
     861            in self.browser.contents)
     862        return
     863
    833864    def test_student_clearance(self):
    834865        # Student cant login if their password is not set
  • main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py

    r14246 r14248  
    200200            else:
    201201                return _(u'No bed allocated.'), None
    202         elif category == 'welfare' and not student.is_postgrad:
    203             amount = academic_session.welfare_fee
    204         elif category == 'id_card' and not student.is_postgrad:
    205             amount = academic_session.id_card_fee
    206         elif category == 'union' and not student.is_postgrad:
    207             amount = academic_session.union_fee
    208         elif category == 'lapel' and not student.is_postgrad:
    209             amount = academic_session.lapel_fee
    210         elif category == 'matric_gown' and not student.is_postgrad:
    211             amount = academic_session.matric_gown_fee
    212         elif category == 'concessional' and not student.is_postgrad:
    213             amount = academic_session.concessional_fee
    214202        elif student.current_mode == 'found' and category not in (
    215203            'schoolfee', 'clearance', 'late_registration'):
     
    327315            else:
    328316                amount += academic_session.penalty_ug
     317        elif not student.is_postgrad:
     318            fee_name = category + '_fee'
     319            amount = getattr(academic_session, fee_name, 0.0)
    329320        if amount in (0.0, None):
    330321            return _(u'Amount could not be determined.'), None
  • main/waeup.aaue/trunk/src/waeup/aaue/utils/utils.py

    r14246 r14248  
    4848        'concessional': 'Concessional Fee',
    4949        'id_card': 'Student ID Card',
     50        'text_book_1': 'Text Book Fee GST101 GST102',
     51        'text_book_2': 'Text Book Fee GST111 GST112',
     52        'text_book_3': 'Text Book Fee GST222',
     53        'text_book_4': 'Text Book Fee ENT201',
     54        'registration_1': 'Registration Fee GST101 GST102 GST111 GST112',
     55        'registration_2': 'Registration Fee GST222',
     56        'registration_3': 'Registration Fee ENT201',
     57        'fac_dep': 'Faculty and Departmental Dues',
    5058        }
    5159
     
    6977        'concessional': 'Concessional Fee',
    7078        #'id_card': 'Student ID Card',
     79        'text_book_1': 'Text Book Fee GST101 GST102',
     80        'text_book_2': 'Text Book Fee GST111 GST112',
     81        'text_book_3': 'Text Book Fee GST222',
     82        'text_book_4': 'Text Book Fee ENT201',
     83        'registration_1': 'Registration Fee GST101 GST102 GST111 GST112',
     84        'registration_2': 'Registration Fee GST222',
     85        'registration_3': 'Registration Fee ENT201',
     86        'fac_dep': 'Faculty and Departmental Dues',
    7187        }
    7288
     
    91107        'matric_gown': 'Matriculation Gown Fee',
    92108        'id_card': 'Student ID Card',
     109        'text_book_1': 'Text Book Fee GST101 GST102',
     110        'text_book_2': 'Text Book Fee GST111 GST112',
     111        'text_book_3': 'Text Book Fee GST222',
     112        'text_book_4': 'Text Book Fee ENT201',
     113        'registration_1': 'Registration Fee GST101 GST102 GST111 GST112',
     114        'registration_2': 'Registration Fee GST222',
     115        'registration_3': 'Registration Fee ENT201',
     116        'fac_dep': 'Faculty and Departmental Dues',
    93117        }
    94118
Note: See TracChangeset for help on using the changeset viewer.