Changeset 16223 for main/kofacustom.iuokada/trunk
- Timestamp:
- 1 Sep 2020, 17:52:36 (4 years ago)
- Location:
- main/kofacustom.iuokada/trunk/src/kofacustom/iuokada
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/tests/test_utils.py
r16222 r16223 51 51 error, payment = utils.setPaymentDetails('schoolfee',self.student) 52 52 self.assertEqual(error, 53 'Registration Fee, Book Deposit, Development Fee, Municipal Fee, '53 'Registration Fee, Book Deposit, Development Fee, Fresh Students Municipal Fee, ' 54 54 'Parents Consultative Forum (PCF) Fee must be paid before Tution Fee. ' 55 55 'Make either single payments or make a \'Required Combi Payment\'.') … … 67 67 error, payment = utils.setPaymentDetails('schoolfee',self.student) 68 68 self.assertEqual(error, 69 'Book Deposit, Development Fee, Municipal Fee, Parents Consultative '69 'Book Deposit, Development Fee, Fresh Students Municipal Fee, Parents Consultative ' 70 70 'Forum (PCF) Fee must be paid before Tution Fee. ' 71 71 'Make either single payments or make a \'Required Combi Payment\'.') … … 77 77 error, payment = utils.setPaymentDetails('schoolfee',self.student) 78 78 self.assertEqual(error, 79 'Registration Fee, Book Deposit, Development Fee, Municipal Fee, '79 'Registration Fee, Book Deposit, Development Fee, Fresh Students Municipal Fee, ' 80 80 'Parents Consultative Forum (PCF) Fee must be paid before Tution Fee. ' 81 81 'Make either single payments or make a \'Required Combi Payment\'.') … … 83 83 error, payment = utils.setPaymentDetails('schoolfee',self.student) 84 84 self.assertEqual(error, 85 'Book Deposit, Development Fee, Municipal Fee, Parents Consultative '85 'Book Deposit, Development Fee, Fresh Students Municipal Fee, Parents Consultative ' 86 86 'Forum (PCF) Fee must be paid before Tution Fee. ' 87 87 'Make either single payments or make a \'Required Combi Payment\'.') … … 94 94 error, payment = utils.setPaymentDetails('schoolfee',self.student) 95 95 self.assertEqual(error, 96 'Book Deposit, Development Fee, Municipal Fee must be paid before Tution Fee. '96 'Book Deposit, Development Fee, Fresh Students Municipal Fee must be paid before Tution Fee. ' 97 97 'Make either single payments or make a \'Required Combi Payment\'.') 98 98 munic_payment = createObject('waeup.StudentOnlinePayment') -
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/utils.py
r16222 r16223 45 45 PORTRAIT_CHANGE_STATES = (ADMITTED, CLEARANCE,) 46 46 47 REQUIRED_PAYMENTS = {47 REQUIRED_PAYMENTS_FRESH = { 48 48 'registration': 'Registration Fee', 49 49 'book': 'Book Deposit', 50 50 'develop': 'Development Fee', 51 51 'parentsconsult': 'Parents Consultative Forum (PCF) Fee', 52 'municipal': 'Municipal Fee', 52 'municipal_fresh': 'Fresh Students Municipal Fee', 53 } 54 55 REQUIRED_PAYMENTS_RETURNING = { 56 'registration': 'Registration Fee', 57 'book': 'Book Deposit', 58 'develop': 'Development Fee', 59 'parentsconsult': 'Parents Consultative Forum (PCF) Fee', 60 'municipal_returning': 'Returning Students Municipal Fee', 53 61 } 54 62 … … 64 72 65 73 def _requiredPaymentsMissing(self, student, session): 66 cats_missing = deepcopy(self.REQUIRED_PAYMENTS) 74 if student.is_fresh: 75 rp = self.REQUIRED_PAYMENTS_FRESH 76 else: 77 rp = self.REQUIRED_PAYMENTS_RETURNING 78 for ticket in student['payments'].values(): 79 if ticket.p_category == 'required_combi'and \ 80 ticket.p_session == session and \ 81 ticket.p_state == 'paid': 82 return 83 cats_missing = deepcopy(rp) 67 84 if len(student['payments']): 68 for category in self.REQUIRED_PAYMENTS.keys():85 for category in rp.keys(): 69 86 for ticket in student['payments'].values(): 70 if ticket.p_category == 'required_combi' and \71 ticket.p_session == session and \72 ticket.p_state == 'paid':73 cats_missing = None74 break75 87 if ticket.p_state == 'paid' and \ 76 ticket.p_category .startswith(category)and \88 ticket.p_category == category and \ 77 89 ticket.p_session == session: 78 90 del cats_missing[category] … … 107 119 p_level = student['studycourse'].current_level 108 120 p_current = True 109 if category in self.REQUIRED_PAYMENTS.keys() + [ 110 'schoolfee','schoolfee40','secondinstal'] \ 121 if category in self.REQUIRED_PAYMENTS_FRESH.keys() \ 122 + self.REQUIRED_PAYMENTS_RETURNING.keys() \ 123 + ['schoolfee','schoolfee40','secondinstal'] \ 111 124 and student.state == RETURNING: 112 125 # In case of school fee or required sundry fee payments the … … 200 213 p_item = p_item.strip(' + ') 201 214 elif category == 'required_combi': 202 rp = deepcopy(self.REQUIRED_PAYMENTS) 215 if student.is_fresh: 216 rp = deepcopy(self.REQUIRED_PAYMENTS_FRESH) 217 else: 218 rp = deepcopy(self.REQUIRED_PAYMENTS_RETURNING) 203 219 for cat in rp: 204 220 fee_name = cat + '_fee' -
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/utils/utils.py
r16222 r16223 46 46 'clinical': 'Clinical Fee (Medical Students)', 47 47 'develop': 'Development Fee', 48 'municipal_fresh': 'Municipal Fee Fresh)',49 'municipal_returning': 'Municipal Fee Returning)',48 'municipal_fresh': 'Municipal Fee (Fresh Students)', 49 'municipal_returning': 'Municipal Fee (Returning Students)', 50 50 'alumni': 'Alumni Fee', 51 51 'conv': 'Convocation Fee',
Note: See TracChangeset for help on using the changeset viewer.