Changeset 12601 for main


Ignore:
Timestamp:
11 Feb 2015, 21:38:41 (10 years ago)
Author:
Henrik Bettermann
Message:

Add 'Issuance of Patent and Proprietary Medicines Vendors License' contract.

Location:
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn
Files:
8 edited

Legend:

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

    r12591 r12601  
    2929    IROPContract,
    3030    IRPRContract,
    31     IRPCContract)
     31    IRPCContract,
     32    IIPPMVLContract)
    3233from ikobacustom.pcn.interfaces import MessageFactory as _
    3334
     
    9596    iface = IRPCContract
    9697    factory_name = 'waeup.RPCContract'
     98
     99class IPPMVLContractProcessor(ContractProcessorBase):
     100    """A batch processor for IIPPMVLContract objects.
     101    """
     102    util_name = 'ippmvlcontractprocessor'
     103    grok.name(util_name)
     104    name = _('Issuance of Patent and Proprietary Medicines Vendors License (Contract) Processor')
     105    iface = IIPPMVLContract
     106    factory_name = 'waeup.IPPMVLContract'
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/contracts.py

    r12591 r12601  
    4444    IRPCContractProcess,
    4545    IRPCContractOfficialUse,
     46    IIPPMVLContract,
     47    IIPPMVLContractEdit,
     48    IIPPMVLContractProcess,
     49    IIPPMVLContractOfficialUse,
    4650    )
    4751
     
    198202        return implementedBy(RPCContract)
    199203
     204
     205class IPPMVLContract(ContractBase):
     206    """Issuance of Patent and Proprietary Medicines Vendors License contract.
     207    """
     208
     209    grok.implements(
     210        IIPPMVLContractProcess,
     211        IIPPMVLContract,
     212        IIPPMVLContractEdit,
     213        ICustomerNavigation)
     214
     215    contract_category = 'ippmvl'
     216
     217    form_fields_interface = IIPPMVLContract
     218
     219    edit_form_fields_interface = IIPPMVLContractEdit
     220
     221    ou_form_fields_interface = IIPPMVLContractOfficialUse
     222
     223    check_docs_interface = IIPPMVLContract
     224
     225IPPMVLContract = attrs_to_fields(IPPMVLContract)
     226
     227
     228class IPPMVLContractFactory(grok.GlobalUtility):
     229    """A factory for contracts.
     230    """
     231    grok.implements(IFactory)
     232    grok.name(u'waeup.IPPMVLContract')
     233    title = u"Create a new license contract.",
     234    description = u"This factory instantiates new contract instances."
     235
     236    def __call__(self, *args, **kw):
     237        return IPPMVLContract(*args, **kw)
     238
     239    def getInterfaces(self):
     240        return implementedBy(IPPMVLContract)
     241
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/export.py

    r12591 r12601  
    2727    IROPContractProcess,
    2828    IRPRContractProcess,
    29     IRPCContractProcess)
     29    IRPCContractProcess,
     30    IIPPMVLContractProcess)
    3031from ikobacustom.pcn.interfaces import MessageFactory as _
    3132
     
    8687    title = _(u'Registration as Pharmaceutical Chemist Contracts')
    8788    class_name = 'RPCContract'
     89
     90class IPPMVLContractExporter(ContractExporterBase):
     91    """Exporter for Contract instances.
     92    """
     93    grok.name('ippmvlcontracts')
     94    iface = IIPPMVLContractProcess
     95    title = _(u'Issuance of Patent and Proprietary Medicines Vendors Licenses')
     96    class_name = 'IPPMVLContract'
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/interfaces.py

    r12600 r12601  
    416416
    417417class IRPCContract(IContract):
    418     """A Registration as Pharmaceutical Chemist.
     418    """A Registration as Pharmaceutical Chemist contract.
    419419
    420420    """
     
    552552IRPCContractEdit['certificates_object'].order = IRPCContract[
    553553    'certificates_object'].order
     554
     555class IIPPMVLContract(IContract):
     556    """A Issuance of Patent and Proprietary Medicines Vendors License.
     557
     558    """
     559
     560    res_address = schema.Text(
     561        title = _(u'Residential Address'),
     562        required = False,
     563        )
     564
     565    qualifications = schema.Text(
     566        title = _(u'Educational Qualifications'),
     567        description = u'Enter a list of certificates obtained.',
     568        required = False,
     569        readonly = False,
     570        )
     571
     572    certificates_object = schema.Choice(
     573        title = _(u'Certificates/Credentials'),
     574        description = u'Select the pdf document which contains scanned copies '
     575                      u'of your certificates. You must create such a '
     576                      u'document first.',
     577        source = CustomerDocumentSource(),
     578        required = False,
     579        )
     580
     581    incometax_object = schema.Choice(
     582        title = _(u'Income Tax Clearance'),
     583        description = u'Select the pdf document which contains scanned copies '
     584                      u'of your income tax clearance for the past three years. '
     585                      u'You must create such a document first.',
     586        source = CustomerDocumentSource(),
     587        required = False,
     588        )
     589
     590    shop_address = schema.Text(
     591        title = _(u'Patent Vendor\'s Shop'),
     592        description = u'Enter name and address of patent vendor\'s shop.',
     593        required = False,
     594        )
     595
     596    shop_lga = schema.Choice(
     597        source = LGASource(),
     598        title = _(u'State / LGA'),
     599        required = True,
     600        )
     601
     602    shop_email = schema.ASCIILine(
     603        title = _(u'Shop Email Address'),
     604        required = False,
     605        constraint=validate_email,
     606        )
     607
     608    shop_phone = PhoneNumber(
     609        title = _(u'Shop Phone'),
     610        description = u'',
     611        required = False,
     612        )
     613
     614    old_or_new = schema.Choice(
     615        values=[_(u'old'), _(u'new')],
     616        title = _(u'Old or New Shop'),
     617        required = False,
     618        )
     619
     620    PPMVL_number = schema.TextLine(
     621        title = _(u'PPMVL Data'),
     622        description = u'If an old store, state PPMVL number and date of issue.',
     623        required = False,
     624        readonly = False,
     625        )
     626
     627    referee1_name = schema.TextLine(
     628        title = _(u'First Referee Name'),
     629        required = False,
     630        readonly = False,
     631        )
     632
     633    referee1_address = schema.Text(
     634        title = _(u'First Referee Address'),
     635        required = False,
     636        readonly = False,
     637        )
     638
     639    referee1_license = schema.TextLine(
     640        title = _(u'First Referee License Number'),
     641        required = False,
     642        readonly = False,
     643        )
     644
     645    referee1_occupation = schema.Text(
     646        title = _(u'First Referee Occupation'),
     647        required = False,
     648        readonly = False,
     649        )
     650
     651    referee2_name = schema.TextLine(
     652        title = _(u'Second Referee Name'),
     653        required = False,
     654        readonly = False,
     655        )
     656
     657    referee2_address = schema.Text(
     658        title = _(u'Second Referee Address'),
     659        required = False,
     660        readonly = False,
     661        )
     662
     663    referee2_license = schema.TextLine(
     664        title = _(u'Second Referee License Number'),
     665        required = False,
     666        readonly = False,
     667        )
     668
     669    referee2_occupation = schema.Text(
     670        title = _(u'Second Referee Occupation'),
     671        required = False,
     672        readonly = False,
     673        )
     674
     675
     676class IIPPMVLContractOfficialUse(IIkobaObject):
     677    """Interface for editing IPPMVL official use data.
     678
     679    """
     680
     681    comment = schema.Text(
     682        title= _('Reason for rejection'),
     683        required = False,
     684        )
     685
     686
     687class IIPPMVLContractProcess(IIPPMVLContract, IIPPMVLContractOfficialUse):
     688    """Interface for processing IPPMVL data.
     689    """
     690
     691    product_options = schema.List(
     692        title = _(u'Options/Fees'),
     693        value_type = ProductOptionField(),
     694        required = False,
     695        readonly = False,
     696        default = [],
     697        )
     698
     699class IIPPMVLContractEdit(IIPPMVLContract):
     700    """Interface for editing IPPMVL data by customers.
     701
     702    """
     703
     704    certificates_object = schema.Choice(
     705        title = _(u'Certificates'),
     706        description = u'Select the document which contains scanned copies '
     707                      u'of your certificates. You must create such a '
     708                      u'document first.',
     709        source = CustomerDocumentSource(),
     710        required = True,
     711        )
     712
     713IIPPMVLContractEdit['certificates_object'].order = IIPPMVLContract[
     714    'certificates_object'].order
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_contract.py

    r12591 r12601  
    3434    RPRContract,
    3535    RPCContract,
     36    IPPMVLContract,
    3637    )
    3738from ikobacustom.pcn.customers.interfaces import (
     
    4041    IRPRContract,
    4142    IRPCContract,
     43    IIPPMVLContract,
    4244    )
    4345
     
    5860        verify.verifyObject(IRPCContract, RPCContract())
    5961        verify.verifyObject(ICustomerNavigation, RPCContract())
     62        verify.verifyObject(IIPPMVLContract, IPPMVLContract())
     63        verify.verifyObject(ICustomerNavigation, IPPMVLContract())
    6064        return
    6165
     
    8690        self.assertEqual(container[id4], contract4)
    8791        self.assertEqual(contract4.class_name, 'RPCContract')
     92
     93        contract5 = createObject(u'waeup.IPPMVLContract')
     94        id5 = contract5.contract_id
     95        container.addContract(contract5)
     96        self.assertEqual(container[id5], contract5)
     97        self.assertEqual(contract5.class_name, 'IPPMVLContract')
    8898        return
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/utils.py

    r12591 r12601  
    5858        'RPRContract': _('Registration in the Provisional Register'),
    5959        'RPCContract': _('Registration as Pharmaceutical Chemist'),
     60        'IPPMVLContract': _(
     61            'Issuance of Patent and Proprietary Medicines Vendors License'),
    6062        }
    6163
     
    7173        'ropcontracts',
    7274        'rprcontracts',
    73         'rpccontracts')
     75        'rpccontracts',
     76        'ippmvlcontracts')
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/utils/lgas.py

    r12175 r12601  
    6868    ('akwa_ibom_itu','Akwa Ibom / Itu'),
    6969    ('akwa_ibom_mbo','Akwa Ibom / Mbo'),
    70     ('akwa_ibom_mkpat-enin','Akwa Ibom / Mkpat-Enin'),
     70    ('akwa_ibom_mkpat-enin','Akwa Ibom / Mpat-Enin'),
    7171    ('akwa_ibom_nsit-atai','Akwa Ibom / Nsit-Atai'),
    7272    ('akwa_ibom_nsit-ibom','Akwa Ibom / Nsit-Ibom'),
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/utils/utils.py

    r12591 r12601  
    5050        'rpr': 'Registration in the Provisional Register',
    5151        'rpc': 'Registration as Pharmaceutical Chemist',
     52        'ippmvl': 'Issuance of Patent and Proprietary Medicines Vendors License',
    5253        'no': 'no license',
    5354        }
     
    7475        'ropcontracts',
    7576        'rprcontracts',
    76         'rpccontracts')
     77        'rpccontracts',
     78        'ippmvlcontracts')
    7779
    7880    BATCH_PROCESSOR_NAMES = (
     
    8486        'rprcontractprocessor',
    8587        'rpccontractprocessor',
     88        'ippmvlcontractprocessor',
    8689        'pcnproductprocessor',
    8790        'pdfdocumentprocessor',
Note: See TracChangeset for help on using the changeset viewer.