Ignore:
Timestamp:
19 Oct 2022, 21:23:06 (2 years ago)
Author:
Henrik Bettermann
Message:

Show all sf payments. Start with entry session.

File:
1 edited

Legend:

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

    r17033 r17137  
    261261    grok.template('paymentsmanagepage')
    262262
    263     @property
    264     def manage_payments_allowed(self):
    265         return checkPermission('waeup.manageStudent', self.context)
    266 
    267     @property
    268     def schoolfee_payments_made(self):
     263    def _schoolfee_payments_made(self):
    269264        cs = self.context.student.current_session
    270265        SF_PAYMENTS = ('schoolfee', 'schoolfee40', 'secondinstal', 'clearance')
    271         if cs > self.context.student.entry_session:
    272             sf_paid = {cs-1: 0.0, cs: 0.0, cs+1: 0.0}
    273             sessions = (cs-1, cs, cs+1)
    274         else:
    275             sf_paid = {cs: 0.0, cs+1: 0.0}
    276             sessions = (cs, cs+1)
     266        sf_paid = dict()
     267        session = self.context.student.entry_session
     268        while session < cs + 2:
     269            sf_paid[session] = 0.0
     270            session += 1
     271        sessions = sf_paid.keys()
    277272        try:
    278273            certificate = self.context.student['studycourse'].certificate
     
    298293               ticket.p_category == 'brought_fwd':
    299294                  brought_fwd += ticket.amount_auth
    300         return sf_paid, total_sf, brought_fwd
     295        return sorted(sf_paid.items(), key=lambda value: value[0]), total_sf, brought_fwd
     296
     297    def update(self):
     298        super(CustomPaymentsManageFormPage, self).update()
     299        self.sfp_made = self._schoolfee_payments_made()
     300        return
     301
     302    @property
     303    def manage_payments_allowed(self):
     304        return checkPermission('waeup.manageStudent', self.context)
    301305
    302306class StudentGetMatricNumberPage(UtilityView, grok.View):
Note: See TracChangeset for help on using the changeset viewer.