Changeset 10800


Ignore:
Timestamp:
28 Nov 2013, 09:23:57 (11 years ago)
Author:
Henrik Bettermann
Message:

Issoufou's suggested workflow:

  1. Apply for service (new customer who wants a connection at his residence)
  2. Ekodisco has the capacity to provide that services (approval)
  3. Applicant is now customer, can pay for the services and select the type of meter he wants...
  4. Customer now login and try to pay base on the type of meter he has
  5. Customer can login and print his receipts.

That means we need different entities: applicants and customers. Customers are the students in Kofa.

Step 1 and 2 are implemented in this revision. 3-4 will follow.

Location:
main/kofacustom.ekodisco/trunk/src/kofacustom/ekodisco
Files:
1 added
5 edited

Legend:

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

    r10794 r10800  
    1919"""
    2020import grok
     21from hurry.workflow.interfaces import IWorkflowState
    2122from zope.formlib.textwidgets import BytesDisplayWidget
    2223from waeup.kofa.applicants.browser import (
    2324    ApplicantRegistrationPage, ApplicantsContainerPage)
     25from waeup.kofa.applicants.pdf import PDFApplicationSlip
    2426from kofacustom.ekodisco.applicants.interfaces import (
    2527    ICustomApplicant, ICustomApplicantEdit)
    2628from kofacustom.nigeria.applicants.browser import (
    2729    NigeriaApplicantDisplayFormPage,
    28     NigeriaPDFApplicationSlip,
    2930    ApplicantDisplayFormPage,
    3031    ApplicantManageFormPage,
    3132    ApplicantEditFormPage)
     33
     34
     35from kofacustom.ekodisco.applicants.workflow import STARTED
    3236
    3337from kofacustom.ekodisco.interfaces import MessageFactory as _
     
    6569    form_fields['applicant_id'].for_display = True
    6670    form_fields['reg_number'].for_display = True
     71
     72    submit_state = STARTED
     73
     74    @property
     75    def display_actions(self):
     76        state = IWorkflowState(self.context).getState()
     77        actions = [[],[]]
     78        if state == STARTED:
     79            actions = [[_('Save'), _('Final Submit')], []]
     80        return actions
     81
     82class CustomPDFApplicationSlip(PDFApplicationSlip):
     83    """Bypass NigeriaPDFApplicationSlip
     84    """
  • main/kofacustom.ekodisco/trunk/src/kofacustom/ekodisco/applicants/browser_templates/applicantdisplaypage.pt

    r10789 r10800  
    3838  </tbody>
    3939</table>
    40 <h3  i18n:domain="waeup.kofa" i18n:translate="">
    41     Payment Tickets
    42 </h3>
    43 <table i18n:domain="waeup.kofa">
    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 value/__name__">
    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>
  • main/kofacustom.ekodisco/trunk/src/kofacustom/ekodisco/applicants/browser_templates/applicanteditpage.pt

    r10789 r10800  
    7878    </span>
    7979  </div>
    80 
    81   <br /><br />
    82   <h3 i18n:translate="">
    83       Payment Tickets
    84   </h3>
    85 
    86   <table>
    87     <thead>
    88     <tr>
    89       <th>&nbsp;</th>
    90       <th i18n:translate="">Payment Id</th>
    91       <th i18n:translate="">Creation Date</th>
    92       <th i18n:translate="">Payment Date</th>
    93       <th i18n:translate="">Category</th>
    94       <th i18n:translate="">Item</th>
    95       <th i18n:translate="">State</th>
    96     </tr>
    97     </thead>
    98     <tbody>
    99       <tr tal:repeat="cl context/values">
    100          <td>
    101           <input type="checkbox"
    102                  name="val_id"
    103                  tal:attributes="value cl/__name__"
    104          tal:condition="python: not view.unremovable(cl)" />
    105         </td>
    106         <td> <a tal:attributes="href cl/__name__">
    107         <span tal:content="cl/p_id">PID</span></a></td>
    108         <td tal:content="python: layout.formatDatetime(cl.creation_date)">CREATION DATE</td>
    109         <td tal:content="python: layout.formatDatetime(cl.payment_date)">PAYMENT DATE</td>
    110       <td tal:content ="cl/category">CATEGORY</td>
    111       <td tal:content ="cl/display_item">ITEM</td>
    112       <td tal:content ="cl/p_state_title">STATE</td>
    113       </tr>
    114     </tbody>
    115   </table>
    116 
    117   <div tal:condition="view/availableActions">
    118     <span tal:repeat="action view/actions"
    119           tal:omit-tag="">
    120       <input tal:condition="python:action.label in view.display_actions[1]"
    121              tal:replace="structure action/render"/>
    122     </span>
    123   </div>
    12480</form>
  • main/kofacustom.ekodisco/trunk/src/kofacustom/ekodisco/locales/en/LC_MESSAGES/waeup.kofa.po

    r10793 r10800  
    206206
    207207msgid "Applicant Id"
    208 msgstr "Cistomer Id"
     208msgstr ""
    209209
    210210msgid "${a} <br /> Application Form ${b}"
Note: See TracChangeset for help on using the changeset viewer.