Ignore:
Timestamp:
6 Sep 2023, 05:08:23 (16 months ago)
Author:
Henrik Bettermann
Message:

Re-insert balance table.

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

    r17549 r17572  
    263263    def _schoolfee_payments_made(self):
    264264        cs = self.context.student.current_session
     265        es = self.context.student.entry_session
    265266        SF_PAYMENTS = ('schoolfee', 'schoolfee40', 'secondinstal', 'clearance')
    266267        sf_paid = dict()
     
    269270        except (AttributeError, TypeError):
    270271            return sf_paid, 0
    271         session = self.context.student.entry_session
     272        session = es
    272273        # Initiliaze sf_paid dict with items
    273         # session: [school fee in session,, amount paid in session, amount due]
     274        # session: [school fee in session, amount paid in session, amount due]
    274275        sf_paid[session] = [getattr(certificate, 'school_fee_1', 0.0), 0.0, 0.0]
    275276        while session < cs + 1:
     
    290291               ticket.p_category == 'brought_fwd':
    291292                  brought_fwd += ticket.amount_auth
    292         # Calculate due, first entry session
    293         entry_session = sessions[0]
    294         #   amount due in session =  brought forward from previous sessions + school fee in session - amount paid in session
    295         sf_paid[entry_session][2] = brought_fwd + sf_paid[entry_session][0] - sf_paid[entry_session][1]
    296         for session in sessions[1:]:
     293        # Calculate due, first for the entry session
     294        # amount due in session =  brought forward from previous sessions + school fees in session - amount paid in session
     295        session = es
     296        sf_paid[session][2] = brought_fwd + sf_paid[session][0] - sf_paid[session][1]
     297        while session < cs + 1:
     298            session += 1
    297299            #   amount due in session =  brought forward from previous session + school fee in session - amount paid in session
    298300            sf_paid[session][2] = sf_paid[session-1][2] + sf_paid[session][0] - sf_paid[session][1]
     
    301303    def update(self):
    302304        super(CustomPaymentsManageFormPage, self).update()
    303         #self.sfp_made = self._schoolfee_payments_made()
     305        self.sfp_made = self._schoolfee_payments_made()
    304306        return
    305307
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/browser_templates/paymentsmanagepage.pt

    r17548 r17572  
    4343    </span>
    4444  </div>
    45 
     45  <br /><br />
     46  <p tal:condition="python: True">
     47  <strong>Balance Brought Forward:</strong> <span tal:content ="python: view.sfp_made[1]">BROUGHTFORWARD</span>
     48  </p>
     49  <br />
     50  <table class="table" style="width: 50%;" tal:condition="python: True">
     51    <thead>
     52    <tr>
     53      <th i18n:translate="">Session</th>
     54      <th i18n:translate="">School Fees</th>
     55      <th i18n:translate="">Amount Paid</th>
     56      <th i18n:translate="">Amount Due</th>
     57    </tr>
     58    </thead>
     59    <tbody>
     60      <tr tal:repeat="sfpm python: view.sfp_made[0]">
     61        <td tal:content ="python: '%s/%s' %(sfpm[0],sfpm[0]+1)">SESSION</td>
     62        <td tal:content ="python: sfpm[1][0]">FEE</td>
     63        <td tal:content ="python: sfpm[1][1]">AMOUNT PAID</td>
     64        <td tal:content ="python: sfpm[1][2]">TOTAL AMOUNT DUE</td>
     65      </tr>
     66    </tbody>
     67  </table>
    4668</form>
Note: See TracChangeset for help on using the changeset viewer.