Ignore:
Timestamp:
20 Mar 2012, 14:37:35 (13 years ago)
Author:
Henrik Bettermann
Message:

All fees must be float not int.

Location:
main/waeup.custom/trunk/src/waeup/custom/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.custom/trunk/src/waeup/custom/students/tests/test_browser.py

    r7895 r7928  
    9696    def test_manage_payments(self):
    9797        # Add missing configuration data
    98         self.app['configuration']['2004'].gown_fee = 150
    99         self.app['configuration']['2004'].transfer_fee = 90
    100         self.app['configuration']['2004'].clearance_fee = 120
    101         self.app['configuration']['2004'].maint_fee = 180
     98        self.app['configuration']['2004'].gown_fee = 150.0
     99        self.app['configuration']['2004'].transfer_fee = 90.0
     100        self.app['configuration']['2004'].clearance_fee = 120.0
     101        self.app['configuration']['2004'].maint_fee = 180.0
    102102
    103103        # Managers can add online payment tickets
  • main/waeup.custom/trunk/src/waeup/custom/students/utils.py

    r7879 r7928  
    3333        # fresh
    3434        if state == CLEARED:
    35             return 40000 - surcharge
     35            return 40000.0 - surcharge
    3636        # returning
    3737        elif state == RETURNING:
    38             return 20000 - surcharge
     38            return 20000.0 - surcharge
    3939        else:
    40             return 0
     40            return 0.0
    4141    else:
    42         return 0
     42        return 0.0
    4343
    4444class StudentsUtils(StudentsUtils):
     
    5959    def getPaymentDetails(self, category, student):
    6060        d = {}
    61         d['surcharge_1'] = d['surcharge_2'] = d['surcharge_3'] = 0
     61        d['surcharge_1'] = d['surcharge_2'] = d['surcharge_3'] = 0.0
    6262        d['p_item'] = u''
    63         d['amount'] = 0
     63        d['amount'] = 0.0
    6464        d['error'] = u''
    6565        d['p_session'] = student['studycourse'].current_session
     
    8888            d['p_item'] = code
    8989            d['p_session'] += 1
    90         if d['amount'] == 0:
     90        if d['amount'] == 0.0:
    9191            d['error'] = _(u'Amount could not be determined.')
    9292        return d
Note: See TracChangeset for help on using the changeset viewer.