Changeset 10044 for main/waeup.kofa/trunk
- Timestamp:
- 22 Mar 2013, 12:59:13 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_webservices.py
r10043 r10044 171 171 self.assertEqual(result, None) 172 172 result = server.get_students_by_course('CRS1', '2012') 173 self.assertEqual(result, [['K1000000', '234', 'my adviser' ],])173 self.assertEqual(result, [['K1000000', '234', 'my adviser', 0],]) 174 174 result = server.get_students_by_course('CRS1') 175 self.assertEqual(result, [['K1000000', '234', 'my adviser'],]) 175 self.assertEqual(result, [['K1000000', '234', 'my adviser', 0],]) 176 payment = StudentOnlinePayment() 177 payment.p_id = 'my-id' 178 payment.p_session = 2012 179 payment.amount_auth = 12.12 180 payment.p_state = u'paid' 181 self.student['payments']['my-payment'] = payment 182 result = server.get_students_by_course('CRS1') 183 self.assertEqual(result, [['K1000000', '234', 'my adviser', 12.12],]) 176 184 REQUEST_XML="""\ 177 185 <?xml version="1.0"?> … … 195 203 <value><string>234</string></value> 196 204 <value><string>my adviser</string></value> 205 <value><double>12.12</double></value> 197 206 </data></array></value> 198 207 </data></array></value> -
main/waeup.kofa/trunk/src/waeup/kofa/students/webservices.py
r10043 r10044 109 109 def get_students_by_course(self, course=None, session=None): 110 110 """2. What STUDENTS registered (student id / matric no) 111 for course Z in session Y ?111 for course Z in session Y and did they pay school fee? 112 112 113 113 """ … … 130 130 return None 131 131 hitlist = [] 132 for ticket in coursetickets: 132 for c_ticket in coursetickets: 133 amount = 0 134 for p_ticket in c_ticket.student['payments'].values(): 135 if p_ticket.p_state == 'paid' and \ 136 p_ticket.p_category == 'schoolfee' and \ 137 p_ticket.p_session == c_ticket.__parent__.level_session: 138 amount = p_ticket.amount_auth 133 139 hitlist.append(( 134 ticket.student.student_id, 135 ticket.student.matric_number, 136 ticket.__parent__.validated_by)) 140 c_ticket.student.student_id, 141 c_ticket.student.matric_number, 142 c_ticket.__parent__.validated_by, 143 amount 144 )) 137 145 return list(set(hitlist)) 138 146
Note: See TracChangeset for help on using the changeset viewer.