Changeset 9143 for main/waeup.fceokene/trunk/src/waeup/fceokene
- Timestamp:
- 1 Sep 2012, 15:16:10 (12 years ago)
- Location:
- main/waeup.fceokene/trunk/src/waeup/fceokene
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.fceokene/trunk/src/waeup/fceokene/browser/pages.py
r8460 r9143 18 18 import grok 19 19 from waeup.kofa.browser.pages import ( 20 SessionConfigurationAddFormPage, SessionConfigurationManageFormPage) 20 SessionConfigurationAddFormPage, SessionConfigurationManageFormPage, 21 CertificatePage, CertificateManageFormPage) 22 from waeup.kofa.university.interfaces import ICertificate 21 23 from waeup.fceokene.interfaces import ( 22 24 ICustomSessionConfiguration, ICustomSessionConfigurationAdd) … … 31 33 """ 32 34 form_fields = grok.AutoFields(ICustomSessionConfiguration) 35 36 class CustomCertificatePage(CertificatePage): 37 """Index page for certificates. 38 """ 39 form_fields = grok.AutoFields(ICertificate).omit( 40 'school_fee_1', 'school_fee_2', 'school_fee_3', 'school_fee_4') 41 42 class CustomCertificateManageFormPage(CertificateManageFormPage): 43 """Manage the properties of a `Certificate` instance. 44 """ 45 form_fields = grok.AutoFields(ICertificate).omit( 46 'school_fee_1', 'school_fee_2', 'school_fee_3', 'school_fee_4') -
main/waeup.fceokene/trunk/src/waeup/fceokene/interfaces.py
r8834 r9143 45 45 46 46 clearance_fee = schema.Float( 47 title = _(u'Clearance Fee (ignored)'),47 title = _(u'Clearance Fee'), 48 48 default = 0.0, 49 49 required = False, -
main/waeup.fceokene/trunk/src/waeup/fceokene/interswitch/tests.py
r9129 r9143 59 59 self.browser.contents) 60 60 self.assertMatches( 61 '...<span> 40000.0</span>...',61 '...<span>12495.0</span>...', 62 62 self.browser.contents) 63 63 self.payment_url = self.browser.url … … 82 82 self.browser.contents) 83 83 self.assertMatches( 84 '...<input type="hidden" name="amount" value=" 4000000.0" />...',84 '...<input type="hidden" name="amount" value="1249500.0" />...', 85 85 self.browser.contents) 86 86 self.assertMatches( 87 '...item_name="schoolfee" item_amt=" 3795000" bank_id="117" acct_num="6216801033"...',87 '...item_name="schoolfee" item_amt="1044500" bank_id="117" acct_num="6216801033"...', 88 88 self.browser.contents) 89 89 self.assertMatches( -
main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests/test_browser.py
r8908 r9143 74 74 self.app['configuration']['2004'].gown_fee = 150.0 75 75 self.app['configuration']['2004'].transfer_fee = 90.0 76 #self.app['configuration']['2004'].clearance_fee = 120.076 self.app['configuration']['2004'].clearance_fee = 120.0 77 77 self.app['configuration']['2004'].booking_fee = 150.0 78 78 self.app['configuration']['2004'].maint_fee = 180.0 … … 186 186 self.app['configuration']['2004'].booking_fee = 150.0 187 187 self.app['configuration']['2004'].maint_fee = 180.0 188 self.app['configuration']['2004'].clearance_fee = 120.0 188 189 utils = getUtility(IStudentsUtils) 189 190 … … 196 197 self.assertEqual(payment.p_level, 100) 197 198 self.assertEqual(payment.p_session, 2004) 198 self.assertEqual(payment.amount_auth, 40000.0)199 self.assertEqual(payment.amount_auth, 12495.0) 199 200 self.assertEqual(payment.p_item, u'CERT1') 200 201 self.assertEqual(error, None) … … 202 203 IWorkflowState(self.student).setState('returning') 203 204 error, payment = utils.setPaymentDetails('schoolfee',self.student) 204 self.assertEqual(payment.p_level, 200)205 self.assertEqual(payment.p_session, 200 5)206 self.assertEqual(payment.amount_auth, 20000.0)205 self.assertEqual(payment.p_level, 100) 206 self.assertEqual(payment.p_session, 2004) 207 self.assertEqual(payment.amount_auth, 11545.0) 207 208 self.assertEqual(payment.p_item, u'CERT1') 208 209 self.assertEqual(error, None) … … 211 212 self.assertEqual(payment.p_level, 100) 212 213 self.assertEqual(payment.p_session, 2004) 213 self.assertEqual(payment.amount_auth, 34250.0)214 self.assertEqual(payment.amount_auth, 120.0) 214 215 self.assertEqual(payment.p_item, u'CERT1') 215 216 self.assertEqual(error, None) -
main/waeup.fceokene/trunk/src/waeup/fceokene/students/utils.py
r8953 r9143 22 22 from kofacustom.nigeria.students.utils import NigeriaStudentsUtils 23 23 from waeup.kofa.accesscodes import create_accesscode 24 from waeup.kofa.interfaces import CLEARED, RETURNING 24 25 from waeup.fceokene.interfaces import MessageFactory as _ 25 26 … … 73 74 amount = academic_session.maint_fee 74 75 elif category == 'clearance': 76 amount = academic_session.clearance_fee 75 77 try: 76 78 p_item = student['studycourse'].certificate.code 77 79 except (AttributeError, TypeError): 78 80 return _('Study course data are incomplete.'), None 79 if p_item in ('BEDCET', 'BIOEDCET', 'CHMEDCET', 'ISEDCET',80 'MTHEDCET', 'PHYEDCET', 'ITECET', 'AGREDCET', 'HEEDCET'):81 amount = 17250.082 else:83 amount = 34250.084 81 elif category == 'schoolfee': 85 82 try: … … 88 85 except (AttributeError, TypeError): 89 86 return _('Study course data are incomplete.'), None 90 if student.state == CLEARED: 91 amount = getattr(certificate, 'school_fee_1', 0.0) 92 elif student.state == RETURNING: 93 # In case of returning school fee payment the payment session 94 # and level contain the values of the session the student 95 # has paid for. 96 p_session, p_level = self.getReturningData(student) 97 amount = getattr(certificate, 'school_fee_2', 0.0) 98 elif student.is_postgrad and student.state == PAID: 99 # Returning postgraduate students also pay for the next session 100 # but their level always remains the same. 101 p_session += 1 102 amount = getattr(certificate, 'school_fee_2', 0.0) 87 88 # Very special school fee configuration, should be moved to 89 # a seperate file. 90 91 ARTS = ('CRS','ISS','HIS','MUS','ECO','GEO','POL','SOS','CCA','ECU', 92 'THA','GED','GSE','PES','SPC','ENG','FRE','ARB','HAU','IGB', 93 'YOR','NCRS','NISS','NHIS','NMUS','NECO','NGEO','NPOL', 94 'NCCA','NECU','NTHA','NGED','NGSE','NPES','NSPC','NENG', 95 'NFRE','NARB','NHAU','NIGB','NYOR','NSOS') 96 97 #PDE Students 98 if student.current_mode == 'pd_ft': 99 amount = 35000 100 elif not student.current_mode.endswith('_sw'): 101 # PRENCE 102 if student.current_level == 10 and student.state == CLEARED: 103 if student.depcode in ARTS: 104 amount = 14900 105 else: 106 amount = 15400 107 # NCE I fresh 108 elif student.current_level == 100 and student.state == CLEARED: 109 if student.depcode in ARTS: 110 amount = 12020 111 else: 112 amount = 12495 113 # NCE II 114 elif student.current_level in (100, 110, 120) and \ 115 student.state == RETURNING: 116 if student.depcode in ARTS: 117 amount = 11070 118 else: 119 amount = 11545 120 # NCE III 121 elif student.current_level in (200, 210, 220): 122 if student.depcode in ARTS: 123 amount = 11070 124 else: 125 amount = 11545 126 # NCE III repeater 127 elif student.current_level in (300, 310, 320) and \ 128 student.current_verdict == 'O': 129 if student.depcode in ARTS: 130 amount = 6535 131 else: 132 amount = 6773 133 # NCE III spillover 134 elif student.current_level in (300, 310, 320) and \ 135 student.current_verdict == 'B': 136 if student.depcode in ARTS: 137 amount = 9170 138 else: 139 amount = 9645 140 # NCE III second spillover 141 elif student.current_level in (400, 410, 420) and \ 142 student.current_verdict == 'B': 143 if student.depcode in ARTS: 144 amount = 9170 145 else: 146 amount = 9645 147 else: 148 if student.current_level == 100 and student.state == CLEARED: 149 if student.depcode in ARTS: 150 amount = 21900 151 else: 152 amount = 22400 153 # NCE II 154 elif student.current_level in (100, 110, 120) and \ 155 student.state == RETURNING: 156 if student.depcode in ARTS: 157 amount = 18400 158 else: 159 amount = 18900 160 # NCE III 161 elif student.current_level in (200, 210, 220): 162 if student.depcode in ARTS: 163 amount = 20400 164 else: 165 amount = 20900 166 # NCE IV 167 elif student.current_level in (300, 310, 320): 168 if student.depcode in ARTS: 169 amount = 18400 170 else: 171 amount = 18900 172 # NCE V 173 elif student.current_level in (400, 410, 420): 174 if student.depcode in ARTS: 175 amount = 18400 176 else: 177 amount = 18900 178 # NCE V spillover 179 elif student.current_level in (500, 510, 520) and \ 180 student.current_verdict == 'B': 181 if student.depcode in ARTS: 182 amount = 16900 183 else: 184 amount = 17400 185 # NCE V second spillover 186 elif student.current_level in (600, 610, 620) and \ 187 student.current_verdict == 'B': 188 if student.depcode in ARTS: 189 amount = 16900 190 else: 191 amount = 17400 192 103 193 if amount in (0.0, None): 104 194 return _(u'Amount could not be determined.'), None … … 117 207 payment.p_session = p_session 118 208 payment.p_level = p_level 119 payment.amount_auth = amount209 payment.amount_auth = float(amount) 120 210 return None, payment 121 211
Note: See TracChangeset for help on using the changeset viewer.