Changeset 17345 for main/kofacustom.edocons
- Timestamp:
- 10 Mar 2023, 09:13:25 (20 months ago)
- Location:
- main/kofacustom.edocons/trunk/src/kofacustom/edocons
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.edocons/trunk/src/kofacustom/edocons/interswitch/browser.py
r17045 r17345 164 164 xmldict['institution_bank_id'] = '31' 165 165 if self.context.__parent__.__parent__.prefix.startswith('tsc'): 166 provider_amt = 2000.0167 166 midwife_amt = 0.0 168 167 xmldict['institution_acct'] = '1000907711' … … 195 194 </item_details> 196 195 </payment_item_detail>""" % xmldict 196 elif not provider_amt and midwife_amt: 197 xmltext = """<payment_item_detail> 198 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s"> 199 <item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" /> 200 <item_detail item_id="2" item_name="Nursing and Midwifery Committee" item_amt="%(midwife_amt)d" bank_id="8" acct_num="2004854377" /> 201 </item_details> 202 </payment_item_detail>""" % xmldict 197 203 else: 198 204 xmltext = """<payment_item_detail> 199 205 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s"> 200 206 <item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" /> 201 <item_detail item_id="2" item_name="Nursing and Midwifery Committee" item_amt="%(midwife_amt)d" bank_id="8" acct_num="2004854377" />202 207 </item_details> 203 208 </payment_item_detail>""" % xmldict -
main/kofacustom.edocons/trunk/src/kofacustom/edocons/students/browser.py
r17344 r17345 30 30 StudyLevelEditFormPage, StudyLevelDisplayFormPage, 31 31 StudentBasePDFFormPage, ExportPDFCourseRegistrationSlip, 32 CourseTicketDisplayFormPage, StudentTriggerTransitionFormPage, 32 CourseTicketDisplayFormPage, 33 CourseTicketManageFormPage, 34 StudyLevelDisplayFormPage, 35 StudentTriggerTransitionFormPage, 33 36 ExportPDFAdmissionSlip, StartClearancePage, PaymentsManageFormPage, 34 37 BalancePaymentAddFormPage, msave, emit_lock_message) … … 48 51 from kofacustom.edocons.students.interfaces import ( 49 52 ICustomStudentOnlinePayment, ICustomStudentStudyCourse, 50 ICustomStudentStudyLevel )53 ICustomStudentStudyLevel, ICustomCourseTicket) 51 54 from kofacustom.edocons.interfaces import MessageFactory as _ 55 56 def translated_values(view): 57 """Translate course ticket attribute values to be displayed on 58 studylevel pages. 59 """ 60 lang = view.request.cookies.get('kofa.language') 61 for value in view.context.values(): 62 # We have to unghostify (according to Tres Seaver) the __dict__ 63 # by activating the object, otherwise value_dict will be empty 64 # when calling the first time. 65 value._p_activate() 66 value_dict = dict([i for i in value.__dict__.items()]) 67 value_dict['url'] = view.url(value) 68 value_dict['removable_by_student'] = value.removable_by_student 69 value_dict['mandatory'] = translate(str(value.mandatory), 'zope', 70 target_language=lang) 71 value_dict['carry_over'] = translate(str(value.carry_over), 'zope', 72 target_language=lang) 73 value_dict['outstanding'] = translate(str(value.outstanding), 'zope', 74 target_language=lang) 75 value_dict['automatic'] = translate(str(value.automatic), 'zope', 76 target_language=lang) 77 value_dict['grade'] = value.grade 78 value_dict['weight'] = value.weight 79 value_dict['course_category'] = value.course_category 80 value_dict['total_score'] = value.total_score 81 semester_dict = getUtility(IKofaUtils).SEMESTER_DICT 82 value_dict['semester'] = semester_dict[ 83 value.semester].replace('mester', 'm.') 84 # ECNS specific 85 value_dict['carryover_score'] = value.carryover_score 86 yield value_dict 52 87 53 88 class CustomStartClearancePage(StartClearancePage): … … 118 153 class CustomBedTicketAddPage(NigeriaBedTicketAddPage): 119 154 with_ac = False 155 156 class CustomStudyLevelDisplayFormPage(StudyLevelDisplayFormPage): 157 """ Page to display student study levels 158 """ 159 @property 160 def translated_values(self): 161 return translated_values(self) 162 163 164 class CustomCourseTicketDisplayFormPage(CourseTicketDisplayFormPage): 165 """ Page to display course tickets 166 """ 167 form_fields = grok.AutoFields(ICustomCourseTicket).omit('course_category', 168 'ticket_session') 169 170 @property 171 def form_fields(self): 172 if not self.context.carry_over: 173 return grok.AutoFields(ICustomCourseTicket).omit('carryover_score') 174 return grok.AutoFields(ICustomCourseTicket) 175 176 class CustomCourseTicketManageFormPage(CourseTicketManageFormPage): 177 """ Page to manage course tickets 178 """ 179 form_fields = grok.AutoFields(ICustomCourseTicket) -
main/kofacustom.edocons/trunk/src/kofacustom/edocons/students/interfaces.py
r16639 r17345 92 92 """ 93 93 94 carryover_score = schema.Int( 95 title = _(u'Carry-over Score'), 96 default = None, 97 required = False, 98 missing_value = None, 99 max = 100, 100 ) 101 102 ICustomCourseTicket['carryover_score'].order = ICustomCourseTicket['carry_over'].order 103 94 104 class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo): 95 105 """Representation of a student. Skip regular reg_number validation.
Note: See TracChangeset for help on using the changeset viewer.