Ignore:
Timestamp:
16 Sep 2021, 21:33:48 (3 years ago)
Author:
Henrik Bettermann
Message:

See #137 (no tests yet).

Location:
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/browser.py

    r16607 r16623  
    2424from zope.formlib.textwidgets import BytesDisplayWidget
    2525from hurry.workflow.interfaces import IWorkflowInfo
    26 from waeup.kofa.interfaces import (REQUESTED, ADMITTED, CLEARANCE,
     26from waeup.kofa.interfaces import (
     27    REQUESTED, ADMITTED, CLEARANCE, REQUESTED, CLEARED,
    2728    IExtFileStore, IKofaUtils, academic_sessions_vocab)
    2829from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
     
    269270        SF_PAYMENTS = ('schoolfee', 'schoolfee40', 'secondinstal', 'clearance')
    270271        sf_paid = {cs-1: 0, cs: 0, cs+1: 0}
     272        try:
     273            certificate = self.context.student['studycourse'].certificate
     274        except (AttributeError, TypeError):
     275            return sf_paid, 0
     276        try:
     277            academic_session = grok.getSite()['configuration'][str(cs)]
     278        except KeyError:
     279            return sf_paid, 0
     280        if self.context.student in (ADMITTED, CLEARANCE, REQUESTED, CLEARED):
     281            total_sf = getattr(certificate, 'school_fee_1', 0.0)
     282        else:
     283            total_sf = getattr(certificate, 'school_fee_2', 0.0)
     284        cfee = academic_session.clearance_fee
     285        if self.context.student.is_postgrad:
     286            cfee *= 0.5
     287        total_sf += cfee
    271288        for ticket in self.context.student['payments'].values():
    272289            if ticket.p_category in SF_PAYMENTS and \
     
    274291                ticket.p_session in (cs-1, cs, cs+1):
    275292                sf_paid[ticket.p_session] += ticket.amount_auth
    276         return sf_paid
     293        return sf_paid, total_sf
    277294
    278295class StudentGetMatricNumberPage(UtilityView, grok.View):
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/browser_templates/paymentsmanagepage.pt

    r16510 r16623  
    4545  <br /><br />
    4646
    47   <table class="table" style="width: 33%;">
     47  <table class="table" style="width: 50%;">
    4848    <thead>
    4949    <tr>
    5050      <th i18n:translate="">Session</th>
    51       <th i18n:translate="">Sum of Total School Fees Paid</th>
     51      <th i18n:translate="">School Fees</th>
     52      <th i18n:translate="">Sum Paid</th>
     53      <th i18n:translate="">Amount Due</th>
    5254    </tr>
    5355    </thead>
    5456    <tbody>
    55       <tr tal:repeat="sfpm python: view.schoolfee_payments_made.items()">
     57      <tr tal:repeat="sfpm python: view.schoolfee_payments_made[0].items()">
    5658        <td tal:content ="python: sfpm[0]">YEAR</td>
     59        <td tal:content ="python: view.schoolfee_payments_made[1]">TOTAL</td>
    5760        <td tal:content ="python: sfpm[1]">AMOUNT</td>
     61        <td tal:content ="python: view.schoolfee_payments_made[1]-sfpm[1]">DUE</td>
    5862      </tr>
    5963    </tbody>
Note: See TracChangeset for help on using the changeset viewer.