Ignore:
Timestamp:
7 Feb 2015, 11:26:19 (10 years ago)
Author:
Henrik Bettermann
Message:

Add new payment state 'waived'. This state can only be set by import
and is only used for the payments overview exporter to
mark sessions with waived fees.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/payments/interfaces.py

    r11450 r12568  
    2727    (_('Paid'),'paid'),
    2828    (_('Failed'),'failed'),
     29    (_('Fees waived'),'waived'),
    2930    )
    3031
  • main/waeup.kofa/trunk/src/waeup/kofa/students/export.py

    r12518 r12568  
    475475            value = 0
    476476            for ticket in context['payments'].values():
    477                 if ticket.p_state == 'paid' and \
    478                     ticket.p_category == 'schoolfee' and \
     477                if ticket.p_category == 'schoolfee' and \
    479478                    ticket.p_session == int(name):
    480                     try:
    481                         value += ticket.amount_auth
    482                     except TypeError:
    483                         pass
     479                    if ticket.p_state == 'waived':
     480                        value = 'waived'
     481                        break
     482                    if ticket.p_state == 'paid':
     483                        try:
     484                            value += ticket.amount_auth
     485                        except TypeError:
     486                            pass
    484487            if value == 0:
    485488                value = ''
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py

    r12518 r12568  
    10781078        payment_2.p_session = curr_year - 5
    10791079        payment_2.amount_auth = 13.13
    1080         payment_2.p_state = u'paid'
     1080        payment_2.p_state = 'paid'
    10811081        payment_2.p_category = u'schoolfee'
    10821082        self.student['payments']['my-2ndpayment'] = payment_2
     
    10871087        payment_3.p_session = curr_year - 5
    10881088        payment_3.amount_auth = 1.01
    1089         payment_3.p_state = u'paid'
     1089        payment_3.p_state = 'paid'
    10901090        payment_3.p_category = u'schoolfee'
    10911091        self.student['payments']['my-3rdpayment'] = payment_3
     1092        # One session school fee has been waived
     1093        payment_4 = StudentOnlinePayment()
     1094        payment_4.p_id = 'my-id_2'
     1095        payment_4.p_session = curr_year - 4
     1096        payment_4.amount_auth = 1.01
     1097        payment_4.p_state = 'waived'
     1098        payment_4.p_category = u'schoolfee'
     1099        self.student['payments']['my-4thpayment'] = payment_4
    10921100        exporter = StudentPaymentsOverviewExporter()
    10931101        exporter.export_all(self.app, self.outfile)
     
    10981106            'current_level,current_session,current_mode,'
    10991107            '%s\r\nA111111,234,Anna M. Tester,created,CERT1,NA,NA,0,'
    1100             '200,2012,ug_ft,,,,,14.14,,12.12,,,\r\n'
     1108            '200,2012,ug_ft,,,,,14.14,waived,12.12,,,\r\n'
    11011109            % year_range_str in result
    11021110            )
Note: See TracChangeset for help on using the changeset viewer.