Changeset 16507


Ignore:
Timestamp:
16 Jun 2021, 06:31:52 (3 years ago)
Author:
Henrik Bettermann
Message:

Add summary table of paid school fees in various sessions.

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

Legend:

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

    r16499 r16507  
    258258    to remove any payment ticket.
    259259    """
     260    grok.template('paymentsmanagepage')
     261
    260262    @property
    261263    def manage_payments_allowed(self):
    262264        return checkPermission('waeup.manageStudent', self.context)
     265
     266    @property
     267    def schoolfee_payments_made(self):
     268        cs = self.context.student.current_session
     269        SF_PAYMENTS = ('schoolfee', 'schoolfee40', 'secondinstal', 'clearance')
     270        sf_paid = {cs-1: 0, cs: 0, cs+1: 0}
     271        for ticket in self.context.student['payments'].values():
     272            if ticket.p_category in SF_PAYMENTS and \
     273                ticket.p_state == 'paid' and \
     274                ticket.p_session in (cs,1, cs, cs+1):
     275                sf_paid[ticket.p_session] += ticket.amount_auth
     276        return sf_paid
    263277
    264278class StudentGetMatricNumberPage(UtilityView, grok.View):
Note: See TracChangeset for help on using the changeset viewer.