Changeset 12604 for main


Ignore:
Timestamp:
12 Feb 2015, 09:56:13 (10 years ago)
Author:
Henrik Bettermann
Message:

Add Renewal of Patent and Proprietary Medicines Vendors License.

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

Legend:

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

    r12601 r12604  
    3030    IRPRContract,
    3131    IRPCContract,
    32     IIPPMVLContract)
     32    IIPPMVLContract,
     33    IRPPMVLContract)
    3334from ikobacustom.pcn.interfaces import MessageFactory as _
    3435
     
    105106    iface = IIPPMVLContract
    106107    factory_name = 'waeup.IPPMVLContract'
     108
     109class RPPMVLContractProcessor(ContractProcessorBase):
     110    """A batch processor for IRPPMVLContract objects.
     111    """
     112    util_name = 'rppmvlcontractprocessor'
     113    grok.name(util_name)
     114    name = _('Renewal of Patent and Proprietary Medicines Vendors License (Contract) Processor')
     115    iface = IRPPMVLContract
     116    factory_name = 'waeup.RPPMVLContract'
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/contracts.py

    r12601 r12604  
    4848    IIPPMVLContractProcess,
    4949    IIPPMVLContractOfficialUse,
     50    IRPPMVLContract,
     51    IRPPMVLContractEdit,
     52    IRPPMVLContractProcess,
     53    IRPPMVLContractOfficialUse,
    5054    )
    5155
     
    240244        return implementedBy(IPPMVLContract)
    241245
     246class RPPMVLContract(ContractBase):
     247    """Renewal of Patent and Proprietary Medicines Vendors License contract.
     248    """
     249
     250    grok.implements(
     251        IRPPMVLContractProcess,
     252        IRPPMVLContract,
     253        IRPPMVLContractEdit,
     254        ICustomerNavigation)
     255
     256    contract_category = 'rppmvl'
     257
     258    form_fields_interface = IRPPMVLContract
     259
     260    edit_form_fields_interface = IRPPMVLContractEdit
     261
     262    ou_form_fields_interface = IRPPMVLContractOfficialUse
     263
     264    check_docs_interface = IRPPMVLContract
     265
     266RPPMVLContract = attrs_to_fields(RPPMVLContract)
     267
     268
     269class RPPMVLContractFactory(grok.GlobalUtility):
     270    """A factory for contracts.
     271    """
     272    grok.implements(IFactory)
     273    grok.name(u'waeup.RPPMVLContract')
     274    title = u"Create a new license contract.",
     275    description = u"This factory instantiates new contract instances."
     276
     277    def __call__(self, *args, **kw):
     278        return RPPMVLContract(*args, **kw)
     279
     280    def getInterfaces(self):
     281        return implementedBy(RPPMVLContract)
     282
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/export.py

    r12601 r12604  
    2828    IRPRContractProcess,
    2929    IRPCContractProcess,
    30     IIPPMVLContractProcess)
     30    IIPPMVLContractProcess,
     31    IRPPMVLContractProcess)
    3132from ikobacustom.pcn.interfaces import MessageFactory as _
    3233
     
    9596    title = _(u'Issuance of Patent and Proprietary Medicines Vendors Licenses')
    9697    class_name = 'IPPMVLContract'
     98
     99class RPPMVLContractExporter(ContractExporterBase):
     100    """Exporter for Contract instances.
     101    """
     102    grok.name('rppmvlcontracts')
     103    iface = IRPPMVLContractProcess
     104    title = _(u'Renewal of Patent and Proprietary Medicines Vendors Licenses')
     105    class_name = 'RPPMVLContract'
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/interfaces.py

    r12601 r12604  
    9191        source = LGASource(),
    9292        title = _(u'State / LGA'),
    93         required = True,
     93        required = False,
    9494        )
    9595
     
    597597        source = LGASource(),
    598598        title = _(u'State / LGA'),
    599         required = True,
     599        required = False,
    600600        )
    601601
     
    643643        )
    644644
    645     referee1_occupation = schema.Text(
     645    referee1_occupation = schema.TextLine(
    646646        title = _(u'First Referee Occupation'),
    647647        required = False,
     
    667667        )
    668668
    669     referee2_occupation = schema.Text(
     669    referee2_occupation = schema.TextLine(
    670670        title = _(u'Second Referee Occupation'),
    671671        required = False,
     
    711711        )
    712712
     713    incometax_object = schema.Choice(
     714        title = _(u'Income Tax Clearance'),
     715        description = u'Select the pdf document which contains scanned copies '
     716                      u'of your income tax clearance for the past three years. '
     717                      u'You must create such a document first.',
     718        source = CustomerDocumentSource(),
     719        required = True,
     720        )
     721
    713722IIPPMVLContractEdit['certificates_object'].order = IIPPMVLContract[
    714723    'certificates_object'].order
     724
     725IIPPMVLContractEdit['incometax_object'].order = IIPPMVLContract[
     726    'incometax_object'].order
     727
     728class IRPPMVLContract(IContract):
     729    """A Renewal of Patent and Proprietary Medicines Vendors License.
     730
     731    """
     732
     733    res_address = schema.Text(
     734        title = _(u'Residential Address'),
     735        required = False,
     736        )
     737
     738    shop_address = schema.Text(
     739        title = _(u'Patent Vendor\'s Shop'),
     740        description = u'Enter name and address of patent vendor\'s shop.',
     741        required = False,
     742        )
     743
     744    shop_lga = schema.Choice(
     745        source = LGASource(),
     746        title = _(u'State / LGA'),
     747        required = False,
     748        )
     749
     750    shop_email = schema.ASCIILine(
     751        title = _(u'Shop Email Address'),
     752        required = False,
     753        constraint=validate_email,
     754        )
     755
     756    shop_phone = PhoneNumber(
     757        title = _(u'Shop Phone'),
     758        description = u'',
     759        required = False,
     760        )
     761
     762    PPMVL_number = schema.TextLine(
     763        title = _(u'PPMVL Data'),
     764        description = u'State PPMVL number and date of issue of last license.',
     765        required = False,
     766        readonly = False,
     767        )
     768
     769    referee1_name = schema.TextLine(
     770        title = _(u'First Referee Name'),
     771        required = False,
     772        readonly = False,
     773        )
     774
     775    referee1_address = schema.Text(
     776        title = _(u'First Referee Address'),
     777        required = False,
     778        readonly = False,
     779        )
     780
     781    referee1_license = schema.TextLine(
     782        title = _(u'First Referee License Number'),
     783        required = False,
     784        readonly = False,
     785        )
     786
     787    referee1_occupation = schema.TextLine(
     788        title = _(u'First Referee Occupation'),
     789        required = False,
     790        readonly = False,
     791        )
     792
     793    referee2_name = schema.TextLine(
     794        title = _(u'Second Referee Name'),
     795        required = False,
     796        readonly = False,
     797        )
     798
     799    referee2_address = schema.Text(
     800        title = _(u'Second Referee Address'),
     801        required = False,
     802        readonly = False,
     803        )
     804
     805    referee2_license = schema.TextLine(
     806        title = _(u'Second Referee License Number'),
     807        required = False,
     808        readonly = False,
     809        )
     810
     811    referee2_occupation = schema.TextLine(
     812        title = _(u'Second Referee Occupation'),
     813        required = False,
     814        readonly = False,
     815        )
     816
     817
     818class IRPPMVLContractOfficialUse(IIkobaObject):
     819    """Interface for editing RPPMVL official use data.
     820
     821    """
     822
     823    comment = schema.Text(
     824        title= _('Reason for rejection'),
     825        required = False,
     826        )
     827
     828
     829class IRPPMVLContractProcess(IRPPMVLContract, IRPPMVLContractOfficialUse):
     830    """Interface for processing RPPMVL data.
     831    """
     832
     833    product_options = schema.List(
     834        title = _(u'Options/Fees'),
     835        value_type = ProductOptionField(),
     836        required = False,
     837        readonly = False,
     838        default = [],
     839        )
     840
     841class IRPPMVLContractEdit(IRPPMVLContract):
     842    """Interface for editing RPPMVL data by customers.
     843
     844    """
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_contract.py

    r12601 r12604  
    3535    RPCContract,
    3636    IPPMVLContract,
     37    RPPMVLContract,
    3738    )
    3839from ikobacustom.pcn.customers.interfaces import (
     
    4243    IRPCContract,
    4344    IIPPMVLContract,
     45    IRPPMVLContract,
    4446    )
    4547
     
    9698        self.assertEqual(container[id5], contract5)
    9799        self.assertEqual(contract5.class_name, 'IPPMVLContract')
     100
     101        contract6 = createObject(u'waeup.RPPMVLContract')
     102        id6 = contract6.contract_id
     103        container.addContract(contract6)
     104        self.assertEqual(container[id6], contract6)
     105        self.assertEqual(contract6.class_name, 'RPPMVLContract')
    98106        return
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/utils.py

    r12601 r12604  
    6060        'IPPMVLContract': _(
    6161            'Issuance of Patent and Proprietary Medicines Vendors License'),
     62        'RPPMVLContract': _(
     63            'Renewal of Patent and Proprietary Medicines Vendors License'),
    6264        }
    6365
     
    7476        'rprcontracts',
    7577        'rpccontracts',
    76         'ippmvlcontracts')
     78        'ippmvlcontracts',
     79        'rppmvlcontracts')
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/utils/utils.py

    r12601 r12604  
    5151        'rpc': 'Registration as Pharmaceutical Chemist',
    5252        'ippmvl': 'Issuance of Patent and Proprietary Medicines Vendors License',
     53        'rppmvl': 'Renewal of Patent and Proprietary Medicines Vendors License',
    5354        'no': 'no license',
    5455        }
     
    7677        'rprcontracts',
    7778        'rpccontracts',
    78         'ippmvlcontracts')
     79        'ippmvlcontracts',
     80        'rppmvlcontracts')
    7981
    8082    BATCH_PROCESSOR_NAMES = (
     
    8789        'rpccontractprocessor',
    8890        'ippmvlcontractprocessor',
     91        'rppmvlcontractprocessor',
    8992        'pcnproductprocessor',
    9093        'pdfdocumentprocessor',
Note: See TracChangeset for help on using the changeset viewer.