Changeset 15011 for main/kofacustom.edopoly
- Timestamp:
- 17 May 2018, 09:01:49 (6 years ago)
- Location:
- main/kofacustom.edopoly/trunk/src/kofacustom/edopoly
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/interfaces.py
r15000 r15011 49 49 ) 50 50 51 late_registration_fee = schema.Float( 52 title = _(u'Late Course Reg. Fee'), 51 # Additional fees in custom package add here 52 53 logbook_fee = schema.Float( 54 title = _(u'Logbook Fee'), 53 55 default = 0.0, 54 56 required = False, 55 57 ) 56 58 57 transcript_fee = schema.Float(58 title = _(u' TranscriptFee'),59 ict_entre_fee = schema.Float( 60 title = _(u'ICT & Entrepreneur Fee'), 59 61 default = 0.0, 60 62 required = False, 61 63 ) 62 63 transfer_fee = schema.Float(64 title = _(u'Transfer Fee'),65 default = 0.0,66 required = False,67 )68 69 70 # Additional fees in custom package add here71 72 64 73 65 def getSessionString(): -
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/students/utils.py
r15008 r15011 38 38 (4.5, '2nd Class Upper'), 39 39 (5, '1st Class')) 40 41 def setPaymentDetails(self, category, student, 42 previous_session, previous_level): 43 """Create a payment ticket and set the payment data of a 44 student for the payment category specified. 45 """ 46 p_item = u'' 47 amount = 0.0 48 if previous_session: 49 if previous_session < student['studycourse'].entry_session: 50 return _('The previous session must not fall below ' 51 'your entry session.'), None 52 if category == 'schoolfee': 53 # School fee is always paid for the following session 54 if previous_session > student['studycourse'].current_session: 55 return _('This is not a previous session.'), None 56 else: 57 if previous_session > student['studycourse'].current_session - 1: 58 return _('This is not a previous session.'), None 59 p_session = previous_session 60 p_level = previous_level 61 p_current = False 62 else: 63 p_session = student['studycourse'].current_session 64 p_level = student['studycourse'].current_level 65 p_current = True 66 academic_session = self._getSessionConfiguration(p_session) 67 if academic_session == None: 68 return _(u'Session configuration object is not available.'), None 69 # Determine fee. 70 if category == 'schoolfee': 71 try: 72 certificate = student['studycourse'].certificate 73 p_item = certificate.code 74 except (AttributeError, TypeError): 75 return _('Study course data are incomplete.'), None 76 if previous_session: 77 # Students can pay for previous sessions in all 78 # workflow states. Fresh students are excluded by the 79 # update method of the PreviousPaymentAddFormPage. 80 if previous_level == 100: 81 amount = getattr(certificate, 'school_fee_1', 0.0) 82 else: 83 amount = getattr(certificate, 'school_fee_2', 0.0) 84 else: 85 if student.state == CLEARED: 86 amount = getattr(certificate, 'school_fee_1', 0.0) 87 elif student.state == RETURNING: 88 # In case of returning school fee payment the 89 # payment session and level contain the values of 90 # the session the student has paid for. Payment 91 # session is always next session. 92 p_session, p_level = self.getReturningData(student) 93 academic_session = self._getSessionConfiguration(p_session) 94 if academic_session == None: 95 return _( 96 u'Session configuration object is not available.' 97 ), None 98 amount = getattr(certificate, 'school_fee_2', 0.0) 99 elif student.is_postgrad and student.state == PAID: 100 # Returning postgraduate students also pay for the 101 # next session but their level always remains the 102 # same. 103 p_session += 1 104 academic_session = self._getSessionConfiguration(p_session) 105 if academic_session == None: 106 return _( 107 u'Session configuration object is not available.' 108 ), None 109 amount = getattr(certificate, 'school_fee_2', 0.0) 110 elif category == 'clearance': 111 try: 112 p_item = student['studycourse'].certificate.code 113 except (AttributeError, TypeError): 114 return _('Study course data are incomplete.'), None 115 amount = academic_session.clearance_fee 116 elif category == 'bed_allocation': 117 p_item = self.getAccommodationDetails(student)['bt'] 118 amount = academic_session.booking_fee 119 elif category == 'hostel_maintenance': 120 amount = 0.0 121 bedticket = student['accommodation'].get( 122 str(student.current_session), None) 123 if bedticket is not None and bedticket.bed is not None: 124 p_item = bedticket.bed_coordinates 125 if bedticket.bed.__parent__.maint_fee > 0: 126 amount = bedticket.bed.__parent__.maint_fee 127 else: 128 # fallback 129 amount = academic_session.maint_fee 130 else: 131 return _(u'No bed allocated.'), None 132 elif category == 'logbook': 133 amount = academic_session.logbook_fee 134 elif category == 'ict_entre': 135 amount = academic_session.ict_entre_fee 136 if amount in (0.0, None): 137 return _('Amount could not be determined.'), None 138 if self.samePaymentMade(student, category, p_item, p_session): 139 return _('This type of payment has already been made.'), None 140 if self._isPaymentDisabled(p_session, category, student): 141 return _('This category of payments has been disabled.'), None 142 payment = createObject(u'waeup.StudentOnlinePayment') 143 timestamp = ("%d" % int(time()*10000))[1:] 144 payment.p_id = "p%s" % timestamp 145 payment.p_category = category 146 payment.p_item = p_item 147 payment.p_session = p_session 148 payment.p_level = p_level 149 payment.p_current = p_current 150 payment.amount_auth = amount 151 return None, payment -
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/utils/utils.py
r10765 r15011 18 18 """Customize general helper utilities for Kofa. 19 19 """ 20 from copy import deepcopy 20 21 from kofacustom.nigeria.utils.utils import NigeriaKofaUtils 21 22 … … 24 25 """ 25 26 27 PAYMENT_CATEGORIES = { 28 'schoolfee': 'School Fee', 29 'clearance': 'Acceptance Fee', 30 'bed_allocation': 'Accommodation Booking Fee', 31 'hostel_maintenance': 'Hostel Maintenance Fee', 32 'application': 'Application Fee', 33 'ict_entre': 'ICT & Entrepreneur Fee', 34 'logbook': 'Logbook Fee', 35 } 36 37 SELECTABLE_PAYMENT_CATEGORIES = deepcopy(PAYMENT_CATEGORIES)
Note: See TracChangeset for help on using the changeset viewer.