Changeset 10296 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 12 Jun 2013, 10:16:01 (11 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
r10236 r10296 96 96 return payments 97 97 98 def get_paid_payments(students): 99 """Get all paid payments of `students`. 100 """ 101 payments = [] 102 for student in students: 103 for payment in student.get('payments', {}).values(): 104 if payment.p_state == 'paid': 105 payments.append(payment) 106 return payments 107 98 108 def get_bedtickets(students): 99 109 """Get all bedtickets of `students`. … … 319 329 grok.name('bursary') 320 330 331 def filter_func(self, x, **kw): 332 return get_paid_payments(x) 333 321 334 #: Fieldnames considered by this exporter 322 335 fields = tuple( -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
r10016 r10296 276 276 payment.creation_date = datetime.datetime(2012, 4, 1, 13, 12, 1) 277 277 payment.p_id = 'my-id' 278 payment.p_state = 'paid' 278 279 payment.ac = u'666' 279 280 payment.p_item = u'p-item' … … 281 282 payment.p_session = 2012 282 283 payment.payment_date = datetime.datetime(2012, 4, 1, 14, 12, 1) 284 payment.amount_auth = 12.12 283 285 payment.r_amount_approved = 12.12 284 286 payment.r_code = u'r-code' -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r10276 r10296 651 651 'r_code,r_desc,student_id,state,current_session\r\n' 652 652 653 '666, 0.0,2012-04-01 13:12:01,schoolfee,1,my-id,'654 'p-item,100,2012, unpaid,2012-04-01 14:12:01,12.12,'653 '666,12.12,2012-04-01 13:12:01,schoolfee,1,my-id,' 654 'p-item,100,2012,paid,2012-04-01 14:12:01,12.12,' 655 655 'r-code,,A111111,created,2012\r\n' 656 656 ) … … 670 670 'r_code,r_desc,student_id,state,current_session\r\n' 671 671 672 '666, 0.0,2012-04-01 13:12:01,schoolfee,1,my-id,'673 'p-item,100,2012, unpaid,2012-04-01 14:12:01,12.12,'672 '666,12.12,2012-04-01 13:12:01,schoolfee,1,my-id,' 673 'p-item,100,2012,paid,2012-04-01 14:12:01,12.12,' 674 674 'r-code,,A111111,created,2012\r\n' 675 675 ) … … 689 689 'r_code,r_desc,student_id,state,current_session\r\n' 690 690 691 '666, 0.0,2012-04-01 13:12:01,schoolfee,1,my-id,'692 'p-item,100,2012, unpaid,2012-04-01 14:12:01,12.12,'691 '666,12.12,2012-04-01 13:12:01,schoolfee,1,my-id,' 692 'p-item,100,2012,paid,2012-04-01 14:12:01,12.12,' 693 693 'r-code,,A111111,created,2012\r\n' 694 694 ) … … 711 711 'r_code,r_desc,student_id,state,current_session\r\n' 712 712 713 '666, 0.0,2012-04-01 13:12:01,schoolfee,1,my-id,'714 'p-item,100,2012, unpaid,2012-04-01 14:12:01,12.12,'713 '666,12.12,2012-04-01 13:12:01,schoolfee,1,my-id,' 714 'p-item,100,2012,paid,2012-04-01 14:12:01,12.12,' 715 715 'r-code,,A111111,created,2012\r\n' 716 716 ) … … 740 740 'state,current_session,entry_session,entry_mode,faccode,depcode\r\n' 741 741 742 '666, 0.0,2012-04-01 13:12:01,schoolfee,1,my-id,p-item,100,2012,'743 ' unpaid,2012-04-01 14:12:01,12.12,r-code,,A111111,234,'742 '666,12.12,2012-04-01 13:12:01,schoolfee,1,my-id,p-item,100,2012,' 743 'paid,2012-04-01 14:12:01,12.12,r-code,,A111111,234,' 744 744 'Anna,M.,Tester,created,2012,2010,ug_ft,NA,NA\r\n' 745 745 ) … … 885 885 '%s\r\n' 886 886 'A111111,234,Anna M. Tester,created,CERT1,NA,NA,0,200,2012,ug_ft,' 887 ',,,,,,,, ,\r\n' % year_range_str,887 ',,,,,,,,12.12,\r\n' % year_range_str, 888 888 result 889 889 ) … … 898 898 payment.p_id = 'my-id' 899 899 payment.p_session = 2009 900 payment.amount_auth = 1 2.12900 payment.amount_auth = 13.13 901 901 payment.p_state = u'paid' 902 902 self.student['payments']['my-2ndpayment'] = payment … … 909 909 'current_level,current_session,current_mode,' 910 910 '%s\r\nA111111,234,Anna M. Tester,created,CERT1,NA,NA,0,' 911 '200,2012,ug_ft,,,,,,1 2.12,,,,\r\n' % year_range_str,911 '200,2012,ug_ft,,,,,,13.13,,,12.12,\r\n' % year_range_str, 912 912 result 913 913 )
Note: See TracChangeset for help on using the changeset viewer.