Ignore:
Timestamp:
11 Feb 2015, 10:44:28 (10 years ago)
Author:
Henrik Bettermann
Message:

Add Registration as Pharmaceutical Chemist contract.

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

Legend:

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

    r12571 r12591  
    2828    IRONContract,
    2929    IROPContract,
    30     IRPRContract)
     30    IRPRContract,
     31    IRPCContract)
    3132from ikobacustom.pcn.interfaces import MessageFactory as _
    3233
     
    8586    iface = IRPRContract
    8687    factory_name = 'waeup.RPRContract'
     88
     89class RPCContractProcessor(ContractProcessorBase):
     90    """A batch processor for IRPRContract objects.
     91    """
     92    util_name = 'rpccontractprocessor'
     93    grok.name(util_name)
     94    name = _('Registration as Pharmaceutical Chemist Contract Processor')
     95    iface = IRPCContract
     96    factory_name = 'waeup.RPCContract'
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/contracts.py

    r12571 r12591  
    4040    IRPRContractProcess,
    4141    IRPRContractOfficialUse,
     42    IRPCContract,
     43    IRPCContractEdit,
     44    IRPCContractProcess,
     45    IRPCContractOfficialUse,
    4246    )
    4347
     
    155159    def getInterfaces(self):
    156160        return implementedBy(RPRContract)
     161
     162
     163class RPCContract(ContractBase):
     164    """Registration as Pharmaceutical Chemist contract.
     165    """
     166
     167    grok.implements(
     168        IRPCContractProcess,
     169        IRPCContract,
     170        IRPCContractEdit,
     171        ICustomerNavigation)
     172
     173    contract_category = 'rpc'
     174
     175    form_fields_interface = IRPCContract
     176
     177    edit_form_fields_interface = IRPCContractEdit
     178
     179    ou_form_fields_interface = IRPCContractOfficialUse
     180
     181    check_docs_interface = IRPCContract
     182
     183RPCContract = attrs_to_fields(RPCContract)
     184
     185
     186class RPCContractFactory(grok.GlobalUtility):
     187    """A factory for contracts.
     188    """
     189    grok.implements(IFactory)
     190    grok.name(u'waeup.RPCContract')
     191    title = u"Create a new license contract.",
     192    description = u"This factory instantiates new contract instances."
     193
     194    def __call__(self, *args, **kw):
     195        return RPCContract(*args, **kw)
     196
     197    def getInterfaces(self):
     198        return implementedBy(RPCContract)
     199
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/export.py

    r12571 r12591  
    2626    IRONContractProcess,
    2727    IROPContractProcess,
    28     IRPRContractProcess)
     28    IRPRContractProcess,
     29    IRPCContractProcess)
    2930from ikobacustom.pcn.interfaces import MessageFactory as _
    3031
     
    7778    title = _(u'Registration in the Provisional Register Contracts')
    7879    class_name = 'RPRContract'
     80
     81class RPCContractExporter(ContractExporterBase):
     82    """Exporter for Contract instances.
     83    """
     84    grok.name('rpccontracts')
     85    iface = IRPCContractProcess
     86    title = _(u'Registration as Pharmaceutical Chemist Contracts')
     87    class_name = 'RPCContract'
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/interfaces.py

    r12579 r12591  
    375375
    376376class IRPRContractOfficialUse(IIkobaObject):
    377     """Interface for editing RON official use data.
     377    """Interface for editing RPR official use data.
    378378
    379379    """
     
    386386
    387387class IRPRContractProcess(IRPRContract, IRPRContractOfficialUse):
    388     """Interface for processing RON data.
     388    """Interface for processing RPR data.
    389389    """
    390390
     
    398398
    399399class IRPRContractEdit(IRPRContract):
    400     """Interface for editing RON data by customers.
     400    """Interface for editing RPR data by customers.
    401401
    402402    """
     
    413413IRPRContractEdit['certificates_object'].order = IRPRContract[
    414414    'certificates_object'].order
     415
     416
     417class IRPCContract(IContract):
     418    """A Registration as Pharmaceutical Chemist.
     419
     420    """
     421
     422    state_of_origin = schema.Choice(
     423        vocabulary = nats_vocab,
     424        title = _(u'State of Origin'),
     425        required = False,
     426        )
     427
     428    res_address = schema.Text(
     429        title = _(u'Residential Address'),
     430        required = False,
     431        )
     432
     433    qualifications = schema.Text(
     434        title = _(u'Qualifications'),
     435        description = u'Enter a list of certificates obtained.',
     436        required = False,
     437        readonly = False,
     438        )
     439
     440    certificates_object = schema.Choice(
     441        title = _(u'Certificates'),
     442        description = u'Select the document which contains scanned copies '
     443                      u'of your certificates. You must create such a '
     444                      u'document first.',
     445        source = CustomerDocumentSource(),
     446        required = False,
     447        )
     448
     449    referee1_name = schema.TextLine(
     450        title = _(u'First Referee Name'),
     451        required = False,
     452        readonly = False,
     453        )
     454
     455    referee1_address = schema.Text(
     456        title = _(u'First Referee Address'),
     457        required = False,
     458        readonly = False,
     459        )
     460
     461    referee1_license = schema.TextLine(
     462        title = _(u'First Referee License Number'),
     463        required = False,
     464        readonly = False,
     465        )
     466
     467    referee2_name = schema.TextLine(
     468        title = _(u'Second Referee Name'),
     469        required = False,
     470        readonly = False,
     471        )
     472
     473    referee2_address = schema.Text(
     474        title = _(u'Second Referee Address'),
     475        required = False,
     476        readonly = False,
     477        )
     478
     479    referee2_license = schema.TextLine(
     480        title = _(u'Second Referee License Number'),
     481        required = False,
     482        readonly = False,
     483        )
     484
     485    internship = schema.Text(
     486        title = _(u'Internship'),
     487        description = u'Enter name and address of the company where you '
     488                      u'served your internship, the name of the approved '
     489                      u'registered pharmacist and the period of your service.',
     490        required = False,
     491        readonly = False,
     492        )
     493
     494    nigerian_residence = FormattedDate(
     495        title = _(u'Residence in Nigeria'),
     496        description = u'Enter the date since when you have continously '
     497                      u'resided in Nigeria.',
     498        required = False,
     499        show_year = True,
     500        )
     501
     502
     503class IRPCContractOfficialUse(IIkobaObject):
     504    """Interface for editing RPC official use data.
     505
     506    """
     507
     508    comment = schema.Text(
     509        title= _('Reason for rejection'),
     510        required = False,
     511        )
     512
     513
     514class IRPCContractProcess(IRPCContract, IRPCContractOfficialUse):
     515    """Interface for processing RPC data.
     516    """
     517
     518    product_options = schema.List(
     519        title = _(u'Options/Fees'),
     520        value_type = ProductOptionField(),
     521        required = False,
     522        readonly = False,
     523        default = [],
     524        )
     525
     526class IRPCContractEdit(IRPCContract):
     527    """Interface for editing RPC data by customers.
     528
     529    """
     530
     531    certificates_object = schema.Choice(
     532        title = _(u'Certificates'),
     533        description = u'Select the document which contains scanned copies '
     534                      u'of your certificates. You must create such a '
     535                      u'document first.',
     536        source = CustomerDocumentSource(),
     537        required = True,
     538        )
     539
     540IRPCContractEdit['certificates_object'].order = IRPCContract[
     541    'certificates_object'].order
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_browser.py

    r12558 r12591  
    475475        # First we add a submitted document and a product.
    476476        IWorkflowState(self.document).setState('submitted')
     477        self.contract.title = u'Contract Title'
    477478        self.contract.document_object = self.document
    478479        self.contract.product_object = self.product
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_contract.py

    r12571 r12591  
    3333    ROPContract,
    3434    RPRContract,
     35    RPCContract,
    3536    )
    3637from ikobacustom.pcn.customers.interfaces import (
     
    3839    IROPContract,
    3940    IRPRContract,
     41    IRPCContract,
    4042    )
    4143
     
    5456        verify.verifyObject(IRPRContract, RPRContract())
    5557        verify.verifyObject(ICustomerNavigation, RPRContract())
     58        verify.verifyObject(IRPCContract, RPCContract())
     59        verify.verifyObject(ICustomerNavigation, RPCContract())
    5660        return
    5761
     
    7680        self.assertEqual(container[id3], contract3)
    7781        self.assertEqual(contract3.class_name, 'RPRContract')
     82
     83        contract4 = createObject(u'waeup.RPCContract')
     84        id4 = contract4.contract_id
     85        container.addContract(contract4)
     86        self.assertEqual(container[id4], contract4)
     87        self.assertEqual(contract4.class_name, 'RPCContract')
    7888        return
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/utils.py

    r12571 r12591  
    5757        'ROPContract': _('Registration of Premises'),
    5858        'RPRContract': _('Registration in the Provisional Register'),
     59        'RPCContract': _('Registration as Pharmaceutical Chemist'),
    5960        }
    6061
     
    6970        'roncontracts',
    7071        'ropcontracts',
    71         'rprcontracts')
     72        'rprcontracts',
     73        'rpccontracts')
Note: See TracChangeset for help on using the changeset viewer.