Ignore:
Timestamp:
15 Oct 2011, 05:04:19 (13 years ago)
Author:
Henrik Bettermann
Message:

In the base package we can only create payment tickets with amount = 0. Amount calculation must be done in customization packages.

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

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py

    r6877 r6898  
    877877            payment.surcharge_3)  = getPaymentDetails(
    878878            data['p_category'],self.context.__parent__)
    879         if payment.amount_auth == 0:
    880             self.flash('Payment amount could not be determined.')
    881             self.redirect(self.url(self.context, u'@@manage'))
    882             return
     879        #if payment.amount_auth == 0:
     880        #    self.flash('Payment amount could not be determined.')
     881        #    self.redirect(self.url(self.context, u'@@manage'))
     882        #    return
    883883        self.context[payment.p_id] = payment
    884884        self.flash('Payment ticket created.')
  • main/waeup.sirp/trunk/src/waeup/sirp/students/utils.py

    r6877 r6898  
    2121    return
    2222
     23# To be defined in customization packages
    2324def getPaymentDetails(category, student):
    24     p_session = student['studycourse'].current_session
     25    p_session = None
    2526    surcharge_1 = surcharge_2 = surcharge_3 = 0
    2627    p_item = u''
    27     if category == 'transfer':
    28         amount = 500
    29     elif category == 'gown':
    30         amount = 500
    31     elif category == 'hostel_maintenance':
    32         amount = 300
    33     elif category == 'schoolfee':
    34         surcharge_1 = 1500 # BT amount
    35         surcharge_2 = 300 # Interswitch amount
    36         amount = getSchoolFee(student, surcharge_1 + surcharge_2)
    37         code = student['studycourse'].certificate.code
    38         #session_string = academic_sessions_vocab.by_value[p_session + 1].title
    39         p_item = code
    40         p_session += 1
     28    amount = 0
    4129    return amount, p_item, p_session, surcharge_1, surcharge_2, surcharge_3
    42 
    43 # To be moved to the FUTMinna customization package
    44 def getSchoolFee(student, surcharge):
    45     study_mode = student['studycourse'].certificate.study_mode
    46     entry_mode = student.entry_mode
    47     state = student.state
    48     #lga = student.lga
    49     lga = 'nothing'
    50     current_level = student['studycourse'].current_level
    51     CLEARED = 'cleared'
    52 
    53     if study_mode.endswith('_ft'):
    54         # fresh remedial
    55         if current_level == 0 and state == CLEARED:
    56             if entry_mode == 'rmd_ft':
    57                 return 80200 - surcharge
    58             else:
    59                 return 74200 - surcharge
    60         # fresh
    61         elif state == CLEARED:
    62             if study_mode == 'jm_ft':
    63                 return 72700 - surcharge
    64             elif lga == 'foreigner':
    65                 return 131500 - surcharge
    66             else:
    67                 return 41500 - surcharge
    68         # returning
    69         elif state == 'returning':
    70             if study_mode == 'jm_ft':
    71                 return 32500 - surcharge
    72             elif lga == 'foreigner':
    73                 return 109500 - surcharge
    74             else:
    75                 return 19500 - surcharge
    76         else:
    77             return 0
    78     else:
    79         return 0
Note: See TracChangeset for help on using the changeset viewer.