Ignore:
Timestamp:
21 Sep 2021, 07:44:14 (3 years ago)
Author:
Henrik Bettermann
Message:

Next try.

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

    r16631 r16632  
    270270        SF_PAYMENTS = ('schoolfee', 'schoolfee40', 'secondinstal', 'clearance')
    271271        if cs > self.context.student.entry_session:
    272             sf_paid = {cs-1: 0, cs: 0, cs+1: 0}
     272            sf_paid = {cs-1: 0.0, cs: 0.0, cs+1: 0.0}
    273273            sessions = (cs-1, cs, cs+1)
    274274        else:
    275             sf_paid = {cs: 0, cs+1: 0}
     275            sf_paid = {cs: 0.0, cs+1: 0.0}
    276276            sessions = (cs, cs+1)
    277277        try:
     
    283283        else:
    284284            total_sf = getattr(certificate, 'school_fee_2', 0.0)
    285         for ticket in self.context.student['payments'].values():
     285        brought_fwd = 0.0
     286        for ticket in self.context.values():
     287            amt = ticket.net_amt
     288            if not amt:
     289                amt = ticket.amount_auth
    286290            if ticket.p_category in SF_PAYMENTS and \
    287291                ticket.p_state == 'paid' and \
    288292                ticket.p_session in sessions:
    289                 sf_paid[ticket.p_session] += ticket.net_amt
    290         brought_fwd = 0.0
    291         for key in self.context.keys():
    292             ticket = self.context[key]
     293                sf_paid[ticket.p_session] += amt
    293294            if ticket.p_state != 'paid' and\
    294295               ticket.p_category == 'brought_fwd':
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/browser_templates/paymentsmanagepage.pt

    r16631 r16632  
    4444  </div>
    4545  <br /><br />
    46 
     46  <p>
     47  <strong>Balance Brought Forward:</strong> <span tal:content ="python: view.schoolfee_payments_made[2]">BROUGHTFORWARD</span>
     48  </p>
     49  <br />
    4750  <table class="table" style="width: 50%;">
    4851    <thead>
     
    5962        <td tal:content ="python: view.schoolfee_payments_made[1]">TOTAL</td>
    6063        <td tal:content ="python: sfpm[1]">AMOUNT</td>
    61         <td tal:content ="python: view.schoolfee_payments_made[1]-sfpm[1]">DUE</td>
     64        <td tal:content ="python: view.schoolfee_payments_made[1]+view.schoolfee_payments_made[2]-sfpm[1]">DUE</td>
    6265       
    6366      </tr>
    6467    </tbody>
    6568  </table>
    66   <p>
    67   <strong>Balance Brought Forward:</strong> <span tal:content ="python: view.schoolfee_payments_made[2]">BROUGHTFORWARD</span>
    68   </p>
    69 
    7069</form>
Note: See TracChangeset for help on using the changeset viewer.