Changeset 7928 for main


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
Files:
5 edited

Legend:

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

    r7880 r7928  
    3131    # Base fees, do not remove.
    3232
    33     school_fee_base = schema.Int(
     33    school_fee_base = schema.Float(
    3434        title = _(u'School Fee (ignored)'),
    35         default = 0,
     35        default = 0.0,
    3636        required = False,
    3737        )
    3838
    39     surcharge_1 = schema.Int(
     39    surcharge_1 = schema.Float(
    4040        title = _(u'Surcharge Portal Provider'),
    41         default = 0,
     41        default = 0.0,
    4242        required = False,
    4343        )
    4444
    45     surcharge_2 = schema.Int(
     45    surcharge_2 = schema.Float(
    4646        title = _(u'Surcharge Interswitch'),
    47         default = 0,
     47        default = 0.0,
    4848        required = False,
    4949        )
    5050
    51     surcharge_3 = schema.Int(
     51    surcharge_3 = schema.Float(
    5252        title = _(u'Surcharge 3'),
    53         default = 0,
     53        default = 0.0,
    5454        required = False,
    5555        )
    5656
    57     clearance_fee = schema.Int(
     57    clearance_fee = schema.Float(
    5858        title = _(u'Clearance Fee'),
    59         default = 0,
     59        default = 0.0,
    6060        required = False,
    6161        )
    6262
    63     booking_fee = schema.Int(
     63    booking_fee = schema.Float(
    6464        title = _(u'Booking Fee'),
    65         default = 0,
     65        default = 0.0,
    6666        required = False,
    6767        )
    6868
    69     acceptance_fee = schema.Int(
     69    acceptance_fee = schema.Float(
    7070        title = _(u'Acceptance Fee'),
    71         default = 0,
     71        default = 0.0,
    7272        required = False,
    7373        )
     
    7575    # Additional fees in waeup.custom
    7676
    77     maint_fee = schema.Int(
     77    maint_fee = schema.Float(
    7878        title = _(u'Maintenance Fee'),
    79         default = 0,
     79        default = 0.0,
    8080        required = False,
    8181        )
    8282
    83     gown = schema.Int(
     83    gown = schema.Float(
    8484        title = _(u'Gown Fee'),
    85         default = 0,
     85        default = 0.0,
    8686        required = False,
    8787        )
    8888
    89     transfer = schema.Int(
     89    transfer = schema.Float(
    9090        title = _(u'Transfer Fee'),
    91         default = 0,
     91        default = 0.0,
    9292        required = False,
    9393        )
  • main/waeup.custom/trunk/src/waeup/custom/interswitch/browser.py

    r7926 r7928  
    197197        self.context.r_code = query.get('resp', None)
    198198        self.context.r_pay_reference  = query.get('payRef', None)
    199         self.context.r_amount_approved = int(query.get('apprAmt', '0')) / 100
     199        self.context.r_amount_approved = float(query.get('apprAmt', '0.0')) / 100
    200200        self.context.r_desc = query.get('desc', None)
    201201
     
    260260        self.context.r_code = wlist[0]
    261261        self.context.r_desc = wlist[1]
    262         self.context.r_amount_approved = int(wlist[2]) / 100
     262        self.context.r_amount_approved = float(wlist[2]) / 100
    263263        self.context.r_card_num = wlist[3]
    264264        self.context.r_pay_reference = wlist[5]
  • main/waeup.custom/trunk/src/waeup/custom/interswitch/tests.py

    r7926 r7928  
    5959                           self.browser.contents)
    6060        self.assertMatches(
    61             '...<input type="hidden" name="amount" value="4000000" />...',
     61            '...<input type="hidden" name="amount" value="4000000.0" />...',
    6262            self.browser.contents)
    6363
  • 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.