Ignore:
Timestamp:
10 Jan 2016, 09:13:17 (9 years ago)
Author:
Henrik Bettermann
Message:

Configure transfer payments and let students enter their desired
study course. Save entered text in p_item attribute.

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

Legend:

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

    r13394 r13574  
    819819        )
    820820
     821    transfer_fee = schema.Float(
     822        title = _(u'Transfer Fee'),
     823        default = 0.0,
     824        required = False,
     825        )
     826
    821827    def getSessionString():
    822828        """Return the session string from the vocabulary.
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r13570 r13574  
    17391739            self.flash(error, type="danger")
    17401740            return
     1741        if p_category == 'transfer':
     1742            payment.p_item = self.request.form['new_programme']
    17411743        self.context[payment.p_id] = payment
    17421744        self.flash(_('Payment ticket created.'))
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/onlinepaymentaddform.pt

    r11254 r13574  
    11<form action="." tal:attributes="action request/URL" method="post"
    22      enctype="multipart/form-data">
    3   <table class="form-table">
    4     <tbody>
    5       <tr>
    6         <td class="fieldname">
    7           <span>Payment Category</span>:
    8         </td>
    9         <td>
    10           <select id="form.p_category" name="form.p_category" size="1"
    11                   class="form-control half">
    12             <option tal:repeat="item view/selectable_categories"
    13                     tal:attributes="value python:item[0]">
    14               <span tal:replace="python:item[1]">FEE CATEGORY</span>
    15             </option>
    16           </select>
    17         </td>
    18       </tr>
    19     </tbody>
    20   </table>
     3
     4  <label for="p_cat" i18n:translate="">
     5    Payment Category:
     6  </label>
     7  <select id="form.p_category" name="form.p_category" size="1"
     8          class="form-control half" onclick="test()">
     9    <option tal:repeat="item view/selectable_categories"
     10            tal:attributes="value python:item[0]">
     11      <span tal:replace="python:item[1]">FEE CATEGORY</span>
     12    </option>
     13  </select>
     14
     15  <span id="new_programme" style="display: none;">
     16    <br />
     17    <label for="new_programme" i18n:translate="">
     18      Desired Course of Study:
     19    </label>
     20    <input class="textType" id="new_programme" name="new_programme"
     21      type="text">
     22  </span>
     23  <br />
    2124  <div tal:condition="view/availableActions">
    2225    <input tal:repeat="action view/actions"
     
    2528  </div>
    2629</form>
     30
     31<script type="text/javascript">
     32  function test() {
     33      if (document.getElementById('form.p_category').value == 'transfer') {
     34          document.getElementById('new_programme').style.display = 'block';
     35      } else {
     36          document.getElementById('new_programme').style.display = 'none';
     37      }
     38  }
     39</script>
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r13492 r13574  
    196196        configuration.booking_fee = 123.4
    197197        configuration.maint_fee = 987.0
     198        configuration.transfer_fee = 456.0
    198199        configuration.late_registration_fee = 345.0
    199200        self.app['configuration'].addSessionConfiguration(configuration)
     
    10621063        self.assertEqual(ac.cost, 4567.0)
    10631064        return
     1065
     1066    def test_add_transfer_payment(self):
     1067        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     1068        self.browser.open(self.payments_path)
     1069        self.browser.getLink("Add current session payment ticket").click()
     1070        self.browser.getControl(name="form.p_category").value = ['transfer']
     1071        self.browser.getControl(name="new_programme").value = 'my new study course'
     1072        self.browser.getControl("Create ticket").click()
     1073        self.assertMatches('...ticket created...',
     1074                           self.browser.contents)
     1075        ctrl = self.browser.getControl(name='val_id')
     1076        value = ctrl.options[0]
     1077        self.browser.getLink(value).click()
     1078        self.assertMatches('...my new study course...',
     1079                           self.browser.contents)
     1080        self.assertEqual(self.student['payments'][value].p_item, u'my new study course')
    10641081
    10651082    def test_manage_payments_bypass_ac_creation(self):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r13505 r13574  
    465465        elif category == 'transcript':
    466466            amount = academic_session.transcript_fee
     467        elif category == 'transfer':
     468            amount = academic_session.transfer_fee
    467469        elif category == 'late_registration':
    468470            amount = academic_session.late_registration_fee
Note: See TracChangeset for help on using the changeset viewer.