Changeset 8262 for main


Ignore:
Timestamp:
24 Apr 2012, 15:27:00 (13 years ago)
Author:
Henrik Bettermann
Message:

The payment receipt is now called payment slip and can be downloaded even if not paid. This is necessary for eTranzact payments.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py

    r8260 r8262  
    544544    """
    545545    grok.context(IApplicantOnlinePayment)
    546     grok.name('payment_receipt.pdf')
     546    grok.name('payment_slip.pdf')
    547547    grok.require('waeup.viewApplication')
    548548    form_fields = grok.AutoFields(IApplicantOnlinePayment)
     
    561561    def label(self):
    562562        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    563         return translate(_('Online Payment Receipt'),
     563        return translate(_('Online Payment Slip'),
    564564            'waeup.kofa', target_language=portal_language) \
    565565            + ' %s' % self.context.p_id
    566566
    567567    def render(self):
    568         if self.context.p_state != 'paid':
    569             self.flash(_('Ticket not yet paid.'))
    570             self.redirect(self.url(self.context))
    571             return
     568        #if self.context.p_state != 'paid':
     569        #    self.flash(_('Ticket not yet paid.'))
     570        #    self.redirect(self.url(self.context))
     571        #    return
    572572        applicantview = ApplicantBaseDisplayFormPage(self.context.__parent__,
    573573            self.request)
    574574        students_utils = getUtility(IStudentsUtils)
    575         return students_utils.renderPDF(self,'payment_receipt.pdf',
     575        return students_utils.renderPDF(self,'payment_slip.pdf',
    576576            self.context.__parent__, applicantview, note=self.note)
    577577
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r8260 r8262  
    635635                           self.browser.contents)
    636636        payment_url = self.browser.url
    637         # The pdf payment receipt can't yet be opened
    638         self.browser.open(payment_url + '/payment_receipt.pdf')
    639         self.assertMatches('...Ticket not yet paid...',
    640                            self.browser.contents)
     637        # The pdf payment slip can't yet be opened
     638        #self.browser.open(payment_url + '/payment_receipt.pdf')
     639        #self.assertMatches('...Ticket not yet paid...',
     640        #                   self.browser.contents)
    641641        # Request callback
    642642        self.browser.open(payment_url)
     
    649649            "...Transition 'pay' requires 'started' as source state...",
    650650            self.browser.contents)
    651         # The payment receipt can be downloaded now
     651        # The payment slip can be downloaded now
    652652        self.browser.open(payment_url)
    653         self.browser.getLink("Download payment receipt").click()
     653        self.browser.getLink("Download payment slip").click()
    654654        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    655655        self.assertEqual(self.browser.headers['Content-Type'],
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/viewlets.py

    r8243 r8262  
    166166    grok.require('waeup.viewApplication')
    167167    icon = 'actionicon_pdf.png'
    168     text = _('Download payment receipt')
    169     target = 'payment_receipt.pdf'
     168    text = _('Download payment slip')
     169    target = 'payment_slip.pdf'
    170170
    171171    @property
    172172    def target_url(self):
    173         if self.context.p_state != 'paid':
    174             return ''
     173        #if self.context.p_state != 'paid':
     174        #    return ''
    175175        return self.view.url(self.view.context, self.target)
    176176
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r8258 r8262  
    11841184    """
    11851185    grok.context(IStudentOnlinePayment)
    1186     grok.name('payment_receipt.pdf')
     1186    grok.name('payment_slip.pdf')
    11871187    grok.require('waeup.viewStudent')
    11881188    form_fields = grok.AutoFields(IStudentOnlinePayment)
     
    11901190    form_fields['payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
    11911191    prefix = 'form'
    1192     title = 'Payment Data'
    11931192    note = None
    11941193
    11951194    @property
     1195    def title(self):
     1196        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
     1197        return translate(_('Payment Data'), 'waeup.kofa',
     1198            target_language=portal_language)
     1199
     1200    @property
    11961201    def label(self):
    1197         return 'Online Payment Receipt %s' % self.context.p_id
     1202        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
     1203        return translate(_('Online Payment Slip'),
     1204            'waeup.kofa', target_language=portal_language) \
     1205            + ' %s' % self.context.p_id
    11981206
    11991207    def render(self):
    1200         if self.context.p_state != 'paid':
    1201             self.flash('Ticket not yet paid.')
    1202             self.redirect(self.url(self.context))
    1203             return
     1208        #if self.context.p_state != 'paid':
     1209        #    self.flash('Ticket not yet paid.')
     1210        #    self.redirect(self.url(self.context))
     1211        #    return
    12041212        studentview = StudentBaseDisplayFormPage(self.context.getStudent(),
    12051213            self.request)
    12061214        students_utils = getUtility(IStudentsUtils)
    1207         return students_utils.renderPDF(self, 'payment_receipt.pdf',
     1215        return students_utils.renderPDF(self, 'payment_slip.pdf',
    12081216            self.context.getStudent(), studentview, note=self.note)
    12091217
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r8252 r8262  
    12711271        payment_url = self.browser.url
    12721272
    1273         # The pdf payment receipt can't yet be opened
    1274         self.browser.open(payment_url + '/payment_receipt.pdf')
    1275         self.assertMatches('...Ticket not yet paid...',
    1276                            self.browser.contents)
     1273        # The pdf payment slip can't yet be opened
     1274        #self.browser.open(payment_url + '/payment_slip.pdf')
     1275        #self.assertMatches('...Ticket not yet paid...',
     1276        #                   self.browser.contents)
    12771277
    12781278        # The same payment (with same p_item, p_session and p_category)
     
    13071307            self.browser.contents)
    13081308
    1309         # Managers can open the pdf payment receipt
     1309        # Managers can open the pdf payment slip
    13101310        self.browser.open(payment_url)
    1311         self.browser.getLink("Download payment receipt").click()
     1311        self.browser.getLink("Download payment slip").click()
    13121312        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    13131313        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
     
    13841384        ac.owner = self.student_id
    13851385
    1386         # Students can open the pdf payment receipt
    1387         self.browser.open(payment_url + '/payment_receipt.pdf')
     1386        # Students can open the pdf payment slip
     1387        self.browser.open(payment_url + '/payment_slip.pdf')
    13881388        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    13891389        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
  • main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py

    r8135 r8262  
    319319    grok.require('waeup.viewStudent')
    320320    icon = 'actionicon_pdf.png'
    321     text = _('Download payment receipt')
    322     target = 'payment_receipt.pdf'
    323 
    324     @property
    325     def target_url(self):
    326         if self.context.p_state != 'paid':
    327             return ''
     321    text = _('Download payment slip')
     322    target = 'payment_slip.pdf'
     323
     324    @property
     325    def target_url(self):
     326        #if self.context.p_state != 'paid':
     327        #    return ''
    328328        return self.view.url(self.view.context, self.target)
    329329
Note: See TracChangeset for help on using the changeset viewer.