Changeset 9409


Ignore:
Timestamp:
24 Oct 2012, 22:01:59 (12 years ago)
Author:
Henrik Bettermann
Message:

Add payment category 'block_h_payment'.

The interswitch module has still to be configured. Bank details and pay_item_id is missing.

Location:
main/waeup.futminna/trunk/src/waeup/futminna
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.futminna/trunk/src/waeup/futminna/interswitch/browser.py

    r9386 r9409  
    2828from waeup.kofa.students.viewlets import ApprovePaymentActionButton as APABStudent
    2929from waeup.kofa.applicants.viewlets import ApprovePaymentActionButton as APABApplicant
    30 from waeup.kofa.payments.interfaces import payment_categories
    3130from waeup.futminna.students.interfaces import ICustomStudentOnlinePayment
    3231from waeup.futminna.applicants.interfaces import ICustomApplicantOnlinePayment
     
    177176            xmldict['department'] = None
    178177            xmldict['faculty'] = None
    179         self.category = payment_categories.getTermByToken(
    180             self.context.p_category).title
     178        self.category = getUtility(IKofaUtils).PAYMENT_CATEGORIES[self.context.p_category]
    181179        tz = getUtility(IKofaUtils).tzinfo
    182180        self.local_date_time = to_timezone(
     
    265263            self.pay_item_id = "11706"
    266264
     265        elif self.context.p_category == 'hostel_maintenance':
     266            xmldict['institution_amt'] = 100 * (
     267                self.context.amount_auth - 300)
     268            xmldict['institution_acct'] = "0000000000000"
     269            xmldict['institution_bank_id'] = '00'
     270            self.pay_item_id = "0000"
     271
     272        elif self.context.p_category == 'block_h_maintenance':
     273            xmldict['institution_amt'] = 100 * (
     274                self.context.amount_auth - 300)
     275            xmldict['institution_acct'] = "0000000000000"
     276            xmldict['institution_bank_id'] = '00'
     277            self.pay_item_id = "0000"
     278
    267279        xmldict['institution_name'] = INSTITUTION_NAME
    268280        # Interswitch amount is not part of the xml data
     
    275287</item_details>
    276288</payment_item_detail>""" % xmldict
     289
    277290        elif self.context.p_category == 'clearance':
    278291            xmltext = """<payment_item_detail>
     
    281294</item_details>
    282295</payment_item_detail>""" % xmldict
     296
     297        elif 'maintenance' in self.context.p_category:
     298            xmltext = """<payment_item_detail>
     299<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
     300<item_detail item_id="1" item_name="Maintenance Fee" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
     301</item_details>
     302</payment_item_detail>""" % xmldict
     303
     304
    283305        self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
    284306        return
  • main/waeup.futminna/trunk/src/waeup/futminna/students/tests/test_browser.py

    r9404 r9409  
    162162        self.assertEqual(payment.p_level, 100)
    163163        self.assertEqual(payment.p_session, 2004)
    164         self.assertEqual(payment.amount_auth, 15000.0)
     164        self.assertEqual(payment.amount_auth, 10000.0)
    165165        self.assertEqual(payment.p_item, u'sse_male_fr')
    166166        self.assertEqual(error, None)
     
    171171        self.assertEqual(payment.p_session, 2004)
    172172        self.assertEqual(payment.amount_auth, 10000.0)
     173        self.assertEqual(payment.p_item, u'regular_male_fr')
     174        self.assertEqual(error, None)
     175
     176        error, payment = utils.setPaymentDetails('block_h_maintenance',self.student)
     177        self.assertEqual(payment.p_level, 100)
     178        self.assertEqual(payment.p_session, 2004)
     179        self.assertEqual(payment.amount_auth, 15000.0)
    173180        self.assertEqual(payment.p_item, u'regular_male_fr')
    174181        self.assertEqual(error, None)
  • main/waeup.futminna/trunk/src/waeup/futminna/students/utils.py

    r9404 r9409  
    120120                'booking_session']:
    121121                return _(u'Current session does not match accommodation session.'), None
    122             if student.faccode == 'SSE':
    123                 amount = 15000.0
    124             elif student.current_level  in ('100','200','300','400','500') and \
     122            if student.current_level  in ('100','200','300','400','500') and \
    125123                student.faccode in ('EET','SET','AAT','ICT','EMT'):
    126124                amount = 12000.0
    127125            else:
    128126                amount = 10000.0
     127            p_item = acc_details['bt']
     128        elif category == 'block_h_maintenance':
     129            acc_details = self.getAccommodationDetails(student)
     130            if student['studycourse'].current_session != acc_details[
     131                'booking_session']:
     132                return _(u'Current session does not match accommodation session.'), None
     133            amount = 15000.0
    129134            p_item = acc_details['bt']
    130135        elif category == 'bed_allocation':
  • main/waeup.futminna/trunk/src/waeup/futminna/utils/utils.py

    r9402 r9409  
    3232        'sse': 'SSE Hostel'
    3333        }
     34
     35    PAYMENT_CATEGORIES = {
     36        'schoolfee': 'School Fee',
     37        'clearance': 'Acceptance Fee',
     38        'hostel_maintenance': 'Regular Hostel Maintenance Fee',
     39        'block_h_maintenance': 'Block H Maintenance Fee',
     40        'application': 'Application Fee'
     41        }
Note: See TracChangeset for help on using the changeset viewer.