- Timestamp:
- 1 Sep 2020, 17:52:36 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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'
Note: See TracChangeset for help on using the changeset viewer.