Ignore:
Timestamp:
20 Jan 2015, 18:00:40 (10 years ago)
Author:
Henrik Bettermann
Message:

Configure IROPContract.

Add IRONContractOfficialUse and IROPContractOfficialUse.

Location:
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers
Files:
4 edited

Legend:

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

    r12499 r12501  
    2929from ikobacustom.pcn.customers.interfaces import (
    3030    IRONContract, IRONContractEdit, IRONContractProcess,
    31     IROPContract, IROPContractEdit, IROPContractProcess)
     31    IROPContract, IROPContractEdit, IROPContractProcess,
     32    IRONContractOfficialUse, IROPContractOfficialUse)
    3233
    3334
     
    4748
    4849    edit_form_fields_interface = IRONContractEdit
     50
     51    ou_form_fields_interface = IRONContractOfficialUse
    4952
    5053    check_docs_interface = IRONContract
     
    8487    edit_form_fields_interface = IROPContractEdit
    8588
     89    ou_form_fields_interface = IROPContractOfficialUse
     90
    8691    check_docs_interface = IROPContract
    8792
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/export.py

    r12499 r12501  
    2323from ikobacustom.pcn.customers.interfaces import (
    2424    IPCNCustomer, IPCNCustomerJPGDocument,
    25     IPCNCustomerPDFDocument, IRONContract, IROPContract)
     25    IPCNCustomerPDFDocument, IRONContractProcess, IROPContractProcess)
    2626from ikobacustom.pcn.interfaces import MessageFactory as _
    2727
     
    5454    """
    5555    grok.name('roncontracts')
    56     iface = IRONContract
     56    iface = IRONContractProcess
    5757    title = _(u'Retention of Name Contracts')
    5858    class_name = 'RONContract'
     
    6363    """
    6464    grok.name('ropcontracts')
    65     iface = IROPContract
     65    iface = IROPContractProcess
    6666    title = _(u'Registration of Premises Contracts')
    6767    class_name = 'ROPContract'
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/interfaces.py

    r12499 r12501  
    1919from zope import schema
    2020from datetime import datetime
     21from waeup.ikoba.interfaces import IIkobaObject
    2122from waeup.ikoba.customers.interfaces import (
    2223    ICustomer, ICustomerDocument, ICustomerPDFDocument, IContract,
     
    127128    #    )
    128129
    129 class IRONContractProcess(IRONContract):
     130class IRONContractOfficialUse(IIkobaObject):
     131    """Interface for editing ROP data by customers.
     132
     133    """
     134
     135    comment = schema.Text(
     136        title= _('Reason for rejection'),
     137        required = False,
     138        )
     139
     140
     141class IRONContractProcess(IRONContract, IRONContractOfficialUse):
    130142    """Interface for processing RON data.
    131143    """
     
    156168    """
    157169
    158     date_of_birth = FormattedDate(
    159         title = _(u'Date of Birth'),
    160         required = True,
     170    premises_address = schema.Text(
     171        title = _(u'Name and  Address of Pharmaceutical Premises'),
     172        required = True,
     173        )
     174
     175    category_practice = schema.TextLine(
     176        title = _(u'Category of Practice'),
     177        description = _(u'retail and dispensing, wholesale, importation, manufacturing, distribution etc.'),
     178        required = False,
     179        )
     180
     181    premises_certificate = schema.TextLine(
     182        title = _(u'Last Premises Certificate'),
     183        description= _('If an old premises. state the last premises certificate number issued with date.'),
     184        required = False,
     185        )
     186
     187    date_of_qualification = FormattedDate(
     188        title = _(u'Date of Qualification'),
     189        required = False,
    161190        show_year = True,
    162         )
    163 
    164     state_of_origin = schema.Choice(
    165         vocabulary = nats_vocab,
    166         title = _(u'State of Origin'),
    167         required = False,
    168         )
    169 
    170     lga = schema.Choice(
    171         source = LGASource(),
    172         title = _(u'State / LGA'),
    173         required = True,
    174         )
    175 
    176     year_qualification = schema.Choice(
    177         title = _(u'Year of Qualification'),
    178         required = True,
    179         values = year_range(),
    180191        )
    181192
    182193    res_address = schema.Text(
    183194        title = _(u'Residential Address'),
    184         required = True,
    185         )
    186 
    187     res_address = schema.Text(
    188         title = _(u'Residential Address'),
    189         required = False,
    190         )
    191 
    192     work_address = schema.Text(
    193         title = _(u'Work Address'),
    194         required = False,
    195         )
    196 
    197     work_email = schema.ASCIILine(
    198         title = _(u'Work Email Address'),
    199         required = False,
    200         constraint=validate_email,
    201         )
    202 
    203     work_phone = PhoneNumber(
    204         title = _(u'Work Phone'),
    205         description = u'',
    206         required = False,
    207         )
    208 
    209     category_practice = schema.TextLine(
    210         title = _(u'Category of Practice'),
    211         description = _(u'academic, retail and dispensing, hospital, administrative, wholesale, importation, manufacturing, etc.'),
     195        required = False,
     196        )
     197
     198    last_license_number = schema.TextLine(
     199        title = _(u'Last Annual License Number'),
    212200        required = False,
    213201        )
     
    215203    superintendent = schema.Bool(
    216204        title= _('Superintendent'),
    217         description= _('Tick box if you are a superintendent pharamcist.'),
     205        description= _('Tick box if you were a superintendent pharamcist last year.'),
     206        required = False,
     207        )
     208
     209    work_address = schema.Text(
     210        title = _(u'Full Time Employment Address'),
     211        description= _('Enter work address if you were not a superintendent pharamcist last year.'),
     212        required = False,
     213        )
     214
     215    pharmacists_directors= schema.TextLine(
     216        title = _(u'Pharmacist Directors'),
     217        description = _(u'Full name of directors and their profession as in Form C.O.7'),
     218        required = False,
     219        )
     220
     221    other_directors= schema.TextLine(
     222        title = _(u'Other Directors'),
     223        description = _(u'Full name of directors and their profession as in Form C.O.7'),
    218224        required = False,
    219225        )
     
    225231    #    )
    226232
    227 class IROPContractProcess(IROPContract):
     233class IROPContractOfficialUse(IIkobaObject):
     234    """Interface for editing ROP data by customers.
     235
     236    """
     237
     238    inspected = schema.Bool(
     239        title = _('Inspected'),
     240        description = _('Has the premises been duly inspected?'),
     241        required = False,
     242        )
     243
     244    recommended = schema.Bool(
     245        title = _('Recommended'),
     246        description= _('Is the premises recommended?'),
     247        required = False,
     248        )
     249
     250    official_in_state = schema.TextLine(
     251        title = _(u'Name of Official in the State'),
     252        required = False,
     253        )
     254
     255class IROPContractProcess(IROPContract, IROPContractOfficialUse):
    228256    """Interface for processing RON data.
    229257    """
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_browser.py

    r12499 r12501  
    220220        result = open(self.outfile, 'rb').read()
    221221        self.assertMatches(result,
    222             'category_practice,class_name,contract_category,contract_id,'
     222            'category_practice,class_name,comment,contract_category,contract_id,'
    223223            'date_of_birth,history,last_product_id,lga,product_object,'
    224224            'product_options,res_address,state,state_of_origin,superintendent,'
    225225            'tc_dict,title,user_id,work_address,work_email,work_phone,'
    226226            'year_qualification\r\n'
    227             ',RONContract,ron,%s,,'
     227            ',RONContract,,ron,%s,,'
    228228            '[u\'2015-01-18 16:40:01 WAT - Contract created by system\'],,,,'
    229229            '[],,created,,,{\'en\': u\'Hello World\'},,K1000000,,,,\r\n'
     
    280280        self.assertMatches(result,
    281281            'category_practice,class_name,contract_category,contract_id,'
    282             'date_of_birth,history,last_product_id,lga,product_object,'
    283             'product_options,res_address,state,state_of_origin,superintendent,'
    284             'tc_dict,title,user_id,work_address,work_email,work_phone,'
    285             'year_qualification\r\n'
     282            'date_of_qualification,history,inspected,last_license_number,'
     283            'last_product_id,official_in_state,other_directors,'
     284            'pharmacists_directors,premises_address,premises_certificate,'
     285            'product_object,product_options,recommended,res_address,'
     286            'state,superintendent,tc_dict,title,user_id,work_address\r\n'
     287
    286288            ',ROPContract,rop,%s,,'
    287             '[u\'2015-01-18 16:40:01 WAT - Contract created by system\'],,,,'
    288             '[],,created,,,{\'en\': u\'Hello World\'},,K1000000,,,,\r\n'
     289            '[u\'2015-01-20 18:51:03 WAT - Contract created by system\']'
     290            ',,,,,,,,,,[],,,created,,{\'en\': u\'Hello World\'},,K1000000,\r\n'
    289291            % self.contract2.contract_id)
    290292        # We can reimport the file if we change the header
Note: See TracChangeset for help on using the changeset viewer.