Changeset 16296 for main/kofacustom.iuokada
- Timestamp:
- 2 Nov 2020, 18:08:34 (4 years ago)
- Location:
- main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/browser.py
r16292 r16296 174 174 ) 175 175 176 @property 177 def tabletitle(self): 178 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 179 tabletitle = [] 180 tabletitle.append(translate(_('_PB_Successful Current Session Payments'), 'waeup.kofa', 181 target_language=portal_language)) 182 return tabletitle 183 176 184 def render(self): 177 185 studentview = StudentBasePDFFormPage(self.context.student, 178 186 self.request, self.omit_fields) 179 187 students_utils = getUtility(IStudentsUtils) 188 189 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 190 P_ID = translate(_('Payment Id'), 'waeup.kofa', target_language=portal_language) 191 #CD = translate(_('Creation Date'), 'waeup.kofa', target_language=portal_language) 192 PD = translate(_('Payment Date'), 'waeup.kofa', target_language=portal_language) 193 CAT = translate(_('Payment Category'), 'waeup.kofa', target_language=portal_language) 194 ITEM = translate(_('Payment Item'), 'waeup.kofa', target_language=portal_language) 195 AMT = translate(_('Amount (Naira)'), 'waeup.kofa', target_language=portal_language) 196 SSS = translate(_('Payment Session'), 'waeup.kofa', target_language=portal_language) 197 tabledata = [] 198 tableheader = [] 199 tabledata.append(sorted( 200 [value for value in self.context['payments'].values() 201 if value.p_state in ('paid', 'waived', 'scholarship') 202 and value.p_session >= value.student.current_session], 203 key=lambda value: value.p_session)) 204 tableheader.append([(P_ID,'p_id', 4.2), 205 #(CD,'creation_date', 3), 206 (PD,'formatted_p_date', 3), 207 (CAT,'category', 3), 208 (ITEM, 'p_item', 3), 209 (AMT, 'amount_auth', 2), 210 (SSS, 'p_session', 2), 211 ]) 180 212 181 213 #watermark_path = os.path.join( … … 192 224 omit_fields=self.omit_fields, 193 225 signatures=self._signatures(), 226 227 tableheader=tableheader, 228 tabledata=tabledata, 229 194 230 pagebreak=True, 195 231 # mergefiles=mergefiles, -
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/tests/test_browser.py
r16292 r16296 19 19 import shutil 20 20 import tempfile 21 from time import time 22 from datetime import datetime, timedelta 21 23 from StringIO import StringIO 22 24 from hurry.workflow.interfaces import IWorkflowState, IWorkflowInfo … … 151 153 152 154 def test_student_personal_slip(self): 155 payment1 = createObject(u'waeup.StudentOnlinePayment') 156 timestamp = ("%d" % int(time()*10000))[1:] 157 payment1.p_id = "LSCNEW-2-4153206270" # the longest possible p_id 158 payment1.p_category = 'schoolfee' 159 payment1.p_item = u'My School Fee' 160 payment1.p_session = 2015 161 payment1.p_level = 100 162 payment1.p_current = True 163 payment1.amount_auth = 23456.9 164 payment1.approve() 165 payment2 = createObject(u'waeup.StudentOnlinePayment') 166 timestamp = ("%d" % int(time()*10000))[1:] 167 payment2.p_id = "p%s" % timestamp 168 payment2.p_category = 'clearance' 169 payment2.p_item = u'My Clearance Fee' 170 payment2.p_session = 2015 171 payment2.p_level = 100 172 payment2.p_current = True 173 payment2.amount_auth = 5678.6 174 payment2.approve() 175 self.student['payments'][payment1.p_id] = payment1 176 self.student['payments'][payment2.p_id] = payment2 153 177 IWorkflowState(self.student).setState('school fee paid') 154 178 self.browser.open(self.login_path)
Note: See TracChangeset for help on using the changeset viewer.