Changeset 13886 for main/waeup.kofa/trunk/src
- Timestamp:
- 7 Jun 2016, 20:08:05 (9 years ago)
- 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
r13429 r13886 557 557 558 558 @property 559 def display_payments(self): 560 if self.context.special: 561 return True 562 return getattr(self.context.__parent__, 'application_fee', None) 563 564 @property 559 565 def form_fields(self): 560 566 if self.context.special: … … 887 893 display_actions = [[_('Save'), _('Finally Submit')], 888 894 [_('Add online payment ticket'),_('Remove selected tickets')]] 895 896 @property 897 def display_payments(self): 898 if self.context.special: 899 return True 900 return getattr(self.context.__parent__, 'application_fee', None) 889 901 890 902 @property -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicantdisplaypage.pt
r11599 r13886 38 38 </tbody> 39 39 </table> 40 <h3 i18n:domain="waeup.kofa" i18n:translate=""> 41 Payment Tickets 42 </h3> 43 <table i18n:domain="waeup.kofa" class="table table-condensed"> 44 <thead> 45 <tr> 46 <th i18n:translate="">Payment Id</th> 47 <th i18n:translate="">Creation Date</th> 48 <th i18n:translate="">Payment Date</th> 49 <th i18n:translate="">Category</th> 50 <th i18n:translate="">Item</th> 51 <th i18n:translate="">State</th> 52 </tr> 53 </thead> 54 <tbody> 55 <tr tal:repeat="value context/values"> 56 <td> <a tal:attributes="href python:view.url(value)"> 57 <span tal:content="value/p_id">PID</span></a></td> 58 <td tal:content="python: layout.formatDatetime(value.creation_date)">CREATION DATE</td> 59 <td tal:content="python: layout.formatDatetime(value.payment_date)">PAYMENT DATE</td> 60 <td tal:content ="value/category">CATEGORY</td> 61 <td tal:content ="value/display_item">ITEM</td> 62 <td tal:content ="value/p_state_title">STATE</td> 63 </tr> 64 </tbody> 65 </table> 40 <tal:payments condition="view/display_payments"> 41 <h3 i18n:domain="waeup.kofa" i18n:translate=""> 42 Payment Tickets 43 </h3> 44 <table i18n:domain="waeup.kofa" class="table table-condensed"> 45 <thead> 46 <tr> 47 <th i18n:translate="">Payment Id</th> 48 <th i18n:translate="">Creation Date</th> 49 <th i18n:translate="">Payment Date</th> 50 <th i18n:translate="">Category</th> 51 <th i18n:translate="">Item</th> 52 <th i18n:translate="">State</th> 53 </tr> 54 </thead> 55 <tbody> 56 <tr tal:repeat="value context/values"> 57 <td> <a tal:attributes="href python:view.url(value)"> 58 <span tal:content="value/p_id">PID</span></a></td> 59 <td tal:content="python: layout.formatDatetime(value.creation_date)">CREATION DATE</td> 60 <td tal:content="python: layout.formatDatetime(value.payment_date)">PAYMENT DATE</td> 61 <td tal:content ="value/category">CATEGORY</td> 62 <td tal:content ="value/display_item">ITEM</td> 63 <td tal:content ="value/p_state_title">STATE</td> 64 </tr> 65 </tbody> 66 </table> 67 </tal:payments> -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicanteditpage.pt
r12886 r13886 87 87 </div> 88 88 89 <br /><br /> 90 <h3 i18n:translate=""> 91 Payment Tickets 92 </h3> 89 <tal:payments condition="view/display_payments"> 90 <br /><br /> 91 <h3 i18n:translate=""> 92 Payment Tickets 93 </h3> 93 94 94 <table i18n:domain="waeup.kofa" class="table table-condensed"> 95 <thead> 96 <tr> 97 <th> </th> 98 <th i18n:translate="">Payment Id</th> 99 <th i18n:translate="">Creation Date</th> 100 <th i18n:translate="">Payment Date</th> 101 <th i18n:translate="">Category</th> 102 <th i18n:translate="">Item</th> 103 <th i18n:translate="">State</th> 104 </tr> 105 </thead> 106 <tbody> 107 <tr tal:repeat="cl context/values"> 108 <td> 109 <input type="checkbox" 110 name="val_id" 111 tal:attributes="value cl/__name__" 112 tal:condition="python: not view.unremovable(cl)" /> 113 </td> 114 <td> <a tal:attributes="href python:view.url(cl)"> 115 <span tal:content="cl/p_id">PID</span></a></td> 116 <td tal:content="python: layout.formatDatetime(cl.creation_date)">CREATION DATE</td> 117 <td tal:content="python: layout.formatDatetime(cl.payment_date)">PAYMENT DATE</td> 118 <td tal:content ="cl/category">CATEGORY</td> 119 <td tal:content ="cl/display_item">ITEM</td> 120 <td tal:content ="cl/p_state_title">STATE</td> 95 <table i18n:domain="waeup.kofa" class="table table-condensed"> 96 <thead> 97 <tr> 98 <th> </th> 99 <th i18n:translate="">Payment Id</th> 100 <th i18n:translate="">Creation Date</th> 101 <th i18n:translate="">Payment Date</th> 102 <th i18n:translate="">Category</th> 103 <th i18n:translate="">Item</th> 104 <th i18n:translate="">State</th> 121 105 </tr> 122 </tbody> 123 </table> 106 </thead> 107 <tbody> 108 <tr tal:repeat="cl context/values"> 109 <td> 110 <input type="checkbox" 111 name="val_id" 112 tal:attributes="value cl/__name__" 113 tal:condition="python: not view.unremovable(cl)" /> 114 </td> 115 <td> <a tal:attributes="href python:view.url(cl)"> 116 <span tal:content="cl/p_id">PID</span></a></td> 117 <td tal:content="python: layout.formatDatetime(cl.creation_date)">CREATION DATE</td> 118 <td tal:content="python: layout.formatDatetime(cl.payment_date)">PAYMENT DATE</td> 119 <td tal:content ="cl/category">CATEGORY</td> 120 <td tal:content ="cl/display_item">ITEM</td> 121 <td tal:content ="cl/p_state_title">STATE</td> 122 </tr> 123 </tbody> 124 </table> 124 125 125 <div tal:condition="view/availableActions"> 126 <span tal:repeat="action view/actions" 127 tal:omit-tag=""> 128 <input tal:condition="python:action.label in view.display_actions[1]" 129 tal:replace="structure action/render"/> 130 </span> 131 </div> 132 <br /> 133 <p i18n:translate="" tal:condition="context/special"> 134 <strong>Notice:</strong> If you need to pay for another service, 135 select the corresponding special application category above, 136 click 'Save' and then 'Add online payment ticket' again. 137 </p> 126 <div tal:condition="view/availableActions"> 127 <span tal:repeat="action view/actions" 128 tal:omit-tag=""> 129 <input tal:condition="python:action.label in view.display_actions[1]" 130 tal:replace="structure action/render"/> 131 </span> 132 </div> 133 <br /> 134 <p i18n:translate="" tal:condition="context/special"> 135 <strong>Notice:</strong> If you need to pay for another service, 136 select the corresponding special application category above, 137 click 'Save' and then 'Add online payment ticket' again. 138 </p> 139 </tal:payments> 138 140 </form> -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r13657 r13886 887 887 self.login() 888 888 self.browser.open(self.edit_path) 889 # Payment tickets can't be created before the form has been validated890 self.browser.getControl("Add online payment ticket").click()891 self.assertTrue('Required input is missing' in self.browser.contents)892 889 self.fill_correct_values() 893 890 # We have to save the form otherwise the filled fields will be cleared … … 895 892 # requires a filled form but does not save it 896 893 self.browser.getControl("Save").click() 894 # Payment section does not appear if application fee isn't set 895 self.assertFalse('Payment Tickets' in self.browser.contents) 896 self.assertFalse('Add online payment' in self.browser.contents) 897 self.applicantscontainer.application_fee = 200.0 898 self.browser.open(self.edit_path) 897 899 self.browser.getControl("Add online payment ticket").click() 898 900 # Session object missing … … 902 904 configuration = SessionConfiguration() 903 905 configuration.academic_session = session_1 904 configuration.application_fee = 200.0905 906 self.app['configuration'].addSessionConfiguration(configuration) 906 907 self.browser.open(self.edit_path) … … 910 911 self.assertMatches('...Activation Code...', 911 912 self.browser.contents) 913 self.assertTrue( 914 '<span>200.0</span>' in self.browser.contents) 912 915 # Payment ticket can be removed if they haven't received a 913 916 # valid callback … … 1008 1011 return 1009 1012 1010 def test_pay_container_application_fee(self):1011 self.login()1012 self.browser.open(self.edit_path)1013 self.fill_correct_values()1014 self.browser.getControl("Save").click()1015 configuration = SessionConfiguration()1016 configuration.academic_session = session_11017 self.applicantscontainer.application_fee = 120.01018 configuration.application_fee = 9999.91019 self.app['configuration'].addSessionConfiguration(configuration)1020 self.browser.open(self.edit_path)1021 self.browser.getControl("Add online payment ticket").click()1022 self.assertMatches('...Payment ticket created...',1023 self.browser.contents)1024 self.assertMatches('...Payment ticket created...',1025 self.browser.contents)1026 self.assertFalse(1027 '<span>9999.9</span>' in self.browser.contents)1028 self.assertTrue(1029 '<span>120.0</span>' in self.browser.contents)1030 self.assertTrue(1031 '<span>Application Fee</span>' in self.browser.contents)1032 return1033 1034 1013 def prepare_special_container(self): 1035 1014 # Add special application container -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/utils.py
r13216 r13886 73 73 payment.p_category = 'application' 74 74 container_fee = container.application_fee 75 if container_fee: 76 payment.amount_auth = container_fee 77 return 78 payment.amount_auth = session_config.application_fee 79 if payment.amount_auth in (0.0, None): 75 if not container_fee: 80 76 return _('Amount could not be determined.') 77 payment.amount_auth = container_fee 81 78 return 82 79 -
main/waeup.kofa/trunk/src/waeup/kofa/interfaces.py
r13789 r13886 807 807 ) 808 808 809 application_fee = schema.Float(810 title = _(u'Application Fee'),811 default = 0.0,812 required = False,813 )814 815 809 clearance_fee = schema.Float( 816 810 title = _(u'Acceptance Fee'),
Note: See TracChangeset for help on using the changeset viewer.