Changeset 11661
- Timestamp:
- 21 May 2014, 05:53:55 (11 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r11641 r11661 4 4 1.2dev (unreleased) 5 5 =================== 6 7 * Add regular school fee and balance payments when exporting payments 8 overviews. 6 9 7 10 * Add samePaymentMade method to StudentsUtils. -
main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
r11484 r11661 421 421 def mangle_value(self, value, name, context=None): 422 422 if name in self.year_range_tuple and context is not None: 423 value = ''423 value = 0 424 424 for ticket in context['payments'].values(): 425 425 if ticket.p_state == 'paid' and \ 426 426 ticket.p_category == 'schoolfee' and \ 427 427 ticket.p_session == int(name): 428 value = ticket.amount_auth 429 break 428 value += ticket.amount_auth 429 if value == 0: 430 value = '' 430 431 return super( 431 432 StudentsExporter, self).mangle_value( -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r11484 r11661 937 937 # set values we can expect in export file 938 938 self.setup_student(self.student) 939 # We add successful payments 940 payment = StudentOnlinePayment() 941 payment.p_id = 'my-id' 942 payment.p_session = 2009 943 payment.amount_auth = 13.13 944 payment.p_state = u'paid' 945 payment.p_category = u'schoolfee' 946 self.student['payments']['my-2ndpayment'] = payment 939 # We add successful payments. 940 payment_2 = StudentOnlinePayment() 941 payment_2.p_id = 'my-id' 942 payment_2.p_session = curr_year - 5 943 payment_2.amount_auth = 13.13 944 payment_2.p_state = u'paid' 945 payment_2.p_category = u'schoolfee' 946 self.student['payments']['my-2ndpayment'] = payment_2 947 # This one could be a balance payment. 948 # The amount is being added. 949 payment_3 = StudentOnlinePayment() 950 payment_3.p_id = 'my-id_2' 951 payment_3.p_session = curr_year - 5 952 payment_3.amount_auth = 1.01 953 payment_3.p_state = u'paid' 954 payment_3.p_category = u'schoolfee' 955 self.student['payments']['my-3rdpayment'] = payment_3 947 956 exporter = StudentPaymentsOverviewExporter() 948 957 exporter.export_all(self.app, self.outfile) … … 953 962 'current_level,current_session,current_mode,' 954 963 '%s\r\nA111111,234,Anna M. Tester,created,CERT1,NA,NA,0,' 955 '200,2012,ug_ft' % year_range_str in result 964 '200,2012,ug_ft,,,,,14.14,,,12.12,,\r\n' 965 % year_range_str in result 956 966 ) 957 967 return
Note: See TracChangeset for help on using the changeset viewer.