Changeset 12485


Ignore:
Timestamp:
18 Jan 2015, 08:59:35 (10 years ago)
Author:
Henrik Bettermann
Message:

Configure RON interface.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/interfaces.py

    r12484 r12485  
    1818
    1919from zope import schema
     20from datetime import datetime
    2021from waeup.ikoba.customers.interfaces import (
    21     ICustomer, ICustomerDocument, ICustomerPDFDocument, IContract)
     22    ICustomer, ICustomerDocument, ICustomerPDFDocument, IContract,
     23    validate_email)
    2224from waeup.ikoba.customers.vocabularies import (
    23     ConCatProductSource, CustomerDocumentSource)
     25    ConCatProductSource, CustomerDocumentSource, nats_vocab)
     26from waeup.ikoba.schema import TextLineChoice, FormattedDate, PhoneNumber
    2427from waeup.ikoba.products.productoptions import ProductOptionField
    2528from ikobacustom.pcn.interfaces import MessageFactory as _
     29from ikobacustom.pcn.interfaces import LGASource
    2630
     31def year_range():
     32    curr_year = datetime.now().year
     33    return range(curr_year - 2, curr_year + 5)
    2734
    2835class IPCNCustomer(ICustomer):
     
    4754
    4855class IRONContract(IContract):
    49     """A customer contract sample with document attached.
     56    """A Retention Of Name  contract.
    5057
    5158    """
     59
     60    date_of_birth = FormattedDate(
     61        title = _(u'Date of Birth'),
     62        required = True,
     63        show_year = True,
     64        )
     65
     66    state_of_origin = schema.Choice(
     67        vocabulary = nats_vocab,
     68        title = _(u'State of Origin'),
     69        required = False,
     70        )
     71
     72    lga = schema.Choice(
     73        source = LGASource(),
     74        title = _(u'State / LGA'),
     75        required = True,
     76        )
     77
     78    year_qualification = schema.Choice(
     79        title = _(u'Year of Qualification'),
     80        required = True,
     81        values = year_range(),
     82        )
     83
     84    res_address = schema.Text(
     85        title = _(u'Residential Address'),
     86        required = True,
     87        )
     88
     89    res_address = schema.Text(
     90        title = _(u'Residential Address'),
     91        required = False,
     92        )
     93
     94    work_address = schema.Text(
     95        title = _(u'Work Address'),
     96        required = False,
     97        )
     98
     99    work_email = schema.ASCIILine(
     100        title = _(u'Work Email Address'),
     101        required = False,
     102        constraint=validate_email,
     103        )
     104
     105    work_phone = PhoneNumber(
     106        title = _(u'Work Phone'),
     107        description = u'',
     108        required = False,
     109        )
     110
     111    category_practice = schema.TextLine(
     112        title = _(u'Category of Practice'),
     113        description = _(u'academic, retail and dispensing, hospital, administrative, wholesale, importation, manufacturing, etc.'),
     114        required = False,
     115        )
     116
     117    superintendent = schema.Bool(
     118        title= _('Superintendent'),
     119        description= _('Tick box if you are a superintendent pharamcist.'),
     120        required = False,
     121        )
    52122
    53123    #document_object = schema.Choice(
     
    58128
    59129class IRONContractProcess(IRONContract):
    60     """Interface for processing contract data.
     130    """Interface for processing RON data.
    61131    """
    62132
     
    70140
    71141class IRONContractEdit(IRONContract):
    72     """Interface for editing sample contract data by customers.
     142    """Interface for editing RON data by customers.
    73143
    74144    """
Note: See TracChangeset for help on using the changeset viewer.