Changeset 15796 for main


Ignore:
Timestamp:
12 Nov 2019, 08:23:13 (5 years ago)
Author:
Henrik Bettermann
Message:

Payment slip must not be downloadable before adding surcharges.

Location:
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants/browser.py

    r15472 r15796  
    3131    )
    3232from waeup.kofa.applicants.viewlets import (
    33     PDFActionButton)
     33    PDFActionButton, PaymentReceiptActionButton)
    3434from waeup.kofa.applicants.pdf import PDFApplicationSlip
    3535from kofacustom.nigeria.applicants.interfaces import (
     
    6161        return _('Download application slip')
    6262
     63class PaymentReceiptActionButton(PaymentReceiptActionButton):
     64
     65    @property
     66    def target_url(self):
     67        if not self.context.r_company:
     68            return ''
     69        return self.view.url(self.view.context, self.target)
     70
    6371class NigeriaApplicantDisplayFormPage(ApplicantDisplayFormPage):
    6472    """A display view for applicant data.
     
    178186    form_fields['payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
    179187
     188    @property
     189    def payment_slip_download_warning(self):
     190        return ''
     191
     192    def update(self):
     193        if not self.context.r_company:
     194            self.redirect(self.url(self.context))
     195            return
     196        return
     197
    180198class NigeriaApplicantRegistrationPage(ApplicantRegistrationPage):
    181199    """Captcha'd registration page for applicants.
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/applicantsbrowser.py

    r15772 r15796  
    4343    grok.require('waeup.payApplicant')
    4444    icon = 'actionicon_pay.png'
    45     text = _('Pay via Etranzact')
     45    text = _('Pay via Etranzact WebConnect')
    4646    target = 'goto_etranzact'
    4747
     
    6161    grok.require('waeup.payApplicant')
    6262    icon = 'actionicon_call.png'
    63     text = _('Requery Etranzact History')
     63    text = _('Requery Etranzact WebConnect History')
    6464    target = 'requery_history'
    6565
     
    6969            self.context.__parent__.__parent__.year, self.context):
    7070            return ''
    71         if self.context.p_state in ('paid', 'waived'):
     71        if self.context.p_state in ('paid', 'waived', 'scholarship'):
    7272            return ''
    7373        return self.view.url(self.view.context, self.target)
     
    185185            self.context.__parent__.__parent__.year, self.context):
    186186            return
    187         if self.context.p_state in ('paid', 'waived'):
     187        if self.context.p_state in ('paid', 'waived', 'scholarship'):
    188188            self.flash(_('This ticket has already been paid.'), type='danger')
    189189            return
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/payoutletbrowser.py

    r15788 r15796  
    3131from waeup.kofa.students.viewlets import ApprovePaymentActionButton as APABStudent
    3232from waeup.kofa.applicants.viewlets import ApprovePaymentActionButton as APABApplicant
     33from waeup.kofa.students.viewlets import PaymentReceiptActionButton as PRABStudent
     34from waeup.kofa.applicants.viewlets import PaymentReceiptActionButton as PRABApplicant
    3335from kofacustom.nigeria.interswitch.browser import (
    3436    InterswitchActionButtonStudent,
     
    5759    grok.require('waeup.payApplicant')
    5860    grok.order(3)
    59     icon = 'actionicon_call.png'
    60     text = _('Enter Etranzact PIN')
     61    icon = 'actionicon_pay.png'
     62    text = _('Pay via Etranzact PayOutlet')
    6163    target = 'enterpin'
    6264
     
    6668            self.context.__parent__.__parent__.year, self.context):
    6769            return ''
    68         if self.context.p_state in ('paid', 'waived'):
     70        if self.context.p_state in ('paid', 'waived', 'scholarship'):
    6971            return ''
    7072        return self.view.url(self.view.context, self.target)
     
    7476    grok.require('waeup.payStudent')
    7577    grok.order(3)
    76     icon = 'actionicon_call.png'
    77     text = _('Enter Etranzact PIN')
     78    icon = 'actionicon_pay.png'
     79    text = _('Pay via Etranzact PayOutlet')
    7880    target = 'enterpin'
    7981
     
    8385            self.context.student.current_session, self.context):
    8486            return ''
    85         if self.context.p_state in ('paid', 'waived'):
     87        if self.context.p_state in ('paid', 'waived', 'scholarship'):
    8688            return ''
    8789        return self.view.url(self.view.context, self.target)
     
    9698
    9799    buttonname = _('Submit to Etranzact')
    98     label = _('Requery Etranzact History')
     100    label = _('Requery Etranzact PayOutlet History')
    99101    action = 'query_payoutlet_history'
    100102    placeholder = _('Confirmation Number (PIN)')
     
    123125    grok.template('enterpin')
    124126
     127    buttonname = _('Submit to Etranzact')
     128    label = _('Requery Etranzact PayOutlet History')
     129    action = 'query_payoutlet_history'
     130    placeholder = _('Confirmation Number (PIN)')
     131    gateway_amt = GATEWAY_AMT
     132
    125133    def update(self):
    126134        if not payoutlet_module_activated(
    127135            self.context.__parent__.__parent__.year, self.context):
    128136            return
    129         super(EtranzactEnterPinPageStudent, self).update()
     137        super(EtranzactEnterPinPageApplicant, self).update()
    130138        # Already now it becomes an Etranzact payment. We set the net amount
    131139        # and add the gateway amount.
     
    136144            self.context.r_company = u'etranzact'
    137145        return
     146
     147class PayoutletPaymentReceiptActionButtonApplicant(PRABApplicant):
     148
     149    grok.view(EtranzactEnterPinPageApplicant)
     150
     151    @property
     152    def target_url(self):
     153        if not self.context.r_company:
     154            return ''
     155        return self.view.url(self.view.context, self.target)
     156
     157class PayoutletPaymentReceiptActionButtonStudent(PRABStudent):
     158
     159    grok.view(EtranzactEnterPinPageStudent)
     160
     161    @property
     162    def target_url(self):
     163        if not self.context.r_company:
     164            return ''
     165        return self.view.url(self.view.context, self.target)
    138166
    139167class EtranzactQueryHistoryPageStudent(UtilityView, grok.View):
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/studentsbrowser.py

    r15772 r15796  
    5252    grok.require('waeup.payStudent')
    5353    icon = 'actionicon_pay.png'
    54     text = _('Pay via Etranzact')
     54    text = _('Pay via Etranzact WebConnect')
    5555    target = 'goto_etranzact'
    5656
     
    7070    grok.require('waeup.payStudent')
    7171    icon = 'actionicon_call.png'
    72     text = _('Requery Etranzact History')
     72    text = _('Requery Etranzact WebConnect History')
    7373    target = 'requery_history'
    7474
     
    7878            self.context.student.current_session, self.context):
    7979            return ''
    80         if self.context.p_state in ('paid', 'waived'):
     80        if self.context.p_state in ('paid', 'waived', 'scholarship'):
    8181            return ''
    8282        return self.view.url(self.view.context, self.target)
     
    194194            self.context.student.current_session, self.context):
    195195            return
    196         if self.context.p_state in ('paid', 'waived'):
     196        if self.context.p_state in ('paid', 'waived', 'scholarship'):
    197197            self.flash(_('This ticket has already been paid.'), type='danger')
    198198            return
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/browser.py

    r15711 r15796  
    6262    grok.context(INigeriaStudentOnlinePayment)
    6363
     64    @property
     65    def target_url(self):
     66        if not self.context.r_company:
     67            return ''
     68        return self.view.url(self.view.context, self.target)
     69
     70
    6471class NigeriaStudentBaseDisplayFormPage(StudentBaseDisplayFormPage):
    6572    """ Page to display student base data
     
    221228        'adm_code', 'sex', 'email', 'date_of_birth', 'current_level',
    222229        'flash_notice')
     230
     231    def update(self):
     232        if not self.context.r_company:
     233            self.redirect(self.url(self.context))
     234            return
     235        return
    223236
    224237class NigeriaAccommodationManageFormPage(AccommodationManageFormPage):
Note: See TracChangeset for help on using the changeset viewer.