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

Add Accepting Pupil Pharmacist for Internship Training 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

    r12604 r12611  
    3131    IRPCContract,
    3232    IIPPMVLContract,
    33     IRPPMVLContract)
     33    IRPPMVLContract,
     34    IAPPITContract
     35    )
    3436from ikobacustom.pcn.interfaces import MessageFactory as _
    3537
     
    115117    iface = IRPPMVLContract
    116118    factory_name = 'waeup.RPPMVLContract'
     119
     120class APPITContractProcessor(ContractProcessorBase):
     121    """A batch processor for IRPPMVLContract objects.
     122    """
     123    util_name = 'appitcontractprocessor'
     124    grok.name(util_name)
     125    name = _('Accepting Pupil Pharmacist for Internship Training (Contract) Processor')
     126    iface = IAPPITContract
     127    factory_name = 'waeup.APPITContract'
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/browser.py

    r12600 r12611  
    2323    PDFContractSlipPage, CustomerBaseEditFormPage)
    2424from ikobacustom.pcn.interfaces import MessageFactory as _
    25 from ikobacustom.pcn.customers.interfaces import IRPCContract
     25from ikobacustom.pcn.customers.interfaces import IRPCContract, IAPPITContract
    2626
    2727class PDFContractSlipPage(PDFContractSlipPage):
     
    5151                )
    5252
     53class PDFAPPITContractSlipPage(PDFContractSlipPage):
     54    """Deliver pdf file including metadata.
     55    """
     56
     57    grok.context(IAPPITContract)
     58
     59    def _sigsInFooter(self):
     60        return (_('Date, Signature of Internee'),
     61                _('Date, Signature of Supervisor'),
     62                )
     63
    5364class CustomerBaseEditFormPage(CustomerBaseEditFormPage):
    5465    """ View to edit customer base data
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/contracts.py

    r12604 r12611  
    5252    IRPPMVLContractProcess,
    5353    IRPPMVLContractOfficialUse,
     54    IAPPITContract,
     55    IAPPITContractEdit,
     56    IAPPITContractProcess,
     57    IAPPITContractOfficialUse,
    5458    )
    5559
     
    244248        return implementedBy(IPPMVLContract)
    245249
     250
    246251class RPPMVLContract(ContractBase):
    247252    """Renewal of Patent and Proprietary Medicines Vendors License contract.
     
    281286        return implementedBy(RPPMVLContract)
    282287
     288
     289class APPITContract(ContractBase):
     290    """Accepting Pupil Pharmacist for Internship Training contract.
     291    """
     292
     293    grok.implements(
     294        IAPPITContractProcess,
     295        IAPPITContract,
     296        IAPPITContractEdit,
     297        ICustomerNavigation)
     298
     299    contract_category = 'appit'
     300
     301    form_fields_interface = IAPPITContract
     302
     303    edit_form_fields_interface = IAPPITContractEdit
     304
     305    ou_form_fields_interface = IAPPITContractOfficialUse
     306
     307    check_docs_interface = IAPPITContract
     308
     309APPITContract = attrs_to_fields(APPITContract)
     310
     311
     312class APPITContractFactory(grok.GlobalUtility):
     313    """A factory for contracts.
     314    """
     315    grok.implements(IFactory)
     316    grok.name(u'waeup.APPITContract')
     317    title = u"Create a new license contract.",
     318    description = u"This factory instantiates new contract instances."
     319
     320    def __call__(self, *args, **kw):
     321        return APPITContract(*args, **kw)
     322
     323    def getInterfaces(self):
     324        return implementedBy(APPITContract)
     325
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/export.py

    r12604 r12611  
    2929    IRPCContractProcess,
    3030    IIPPMVLContractProcess,
    31     IRPPMVLContractProcess)
     31    IRPPMVLContractProcess,
     32    IAPPITContractProcess)
    3233from ikobacustom.pcn.interfaces import MessageFactory as _
    3334
     
    104105    title = _(u'Renewal of Patent and Proprietary Medicines Vendors Licenses')
    105106    class_name = 'RPPMVLContract'
     107
     108class APPITContractExporter(ContractExporterBase):
     109    """Exporter for Contract instances.
     110    """
     111    grok.name('appitcontracts')
     112    iface = IAPPITContractProcess
     113    title = _(u'Accepting Pupil Pharmacist for Internship Training Contracts')
     114    class_name = 'APPITContract'
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/interfaces.py

    r12604 r12611  
    4747            'manufacturing',
    4848            'retail and dispensing',
     49            'research and training',
     50            'hospital practice',
    4951            'wholesale',
    5052            ]
     
    110112        )
    111113
    112     work_email = schema.ASCIILine(
     114    work_email = schema.TextLine(
    113115        title = _(u'Work Email Address'),
    114116        required = False,
     
    563565        )
    564566
     567    occupation = schema.TextLine(
     568        title = _(u'Occupation'),
     569        required = False,
     570        readonly = False,
     571        )
     572
    565573    qualifications = schema.Text(
    566574        title = _(u'Educational Qualifications'),
     
    600608        )
    601609
    602     shop_email = schema.ASCIILine(
     610    shop_email = schema.TextLine(
    603611        title = _(u'Shop Email Address'),
    604612        required = False,
     
    736744        )
    737745
     746    occupation = schema.TextLine(
     747        title = _(u'Occupation'),
     748        required = False,
     749        readonly = False,
     750        )
     751
     752    qualifications = schema.Text(
     753        title = _(u'Educational Qualifications'),
     754        description = u'Enter a list of certificates obtained.',
     755        required = False,
     756        readonly = False,
     757        )
     758
    738759    shop_address = schema.Text(
    739760        title = _(u'Patent Vendor\'s Shop'),
     
    742763        )
    743764
     765    ppmv_signpost = schema.TextLine(
     766        title = _(u'PPMV Sign-post Number'),
     767        required = False,
     768        readonly = False,
     769        )
     770
    744771    shop_lga = schema.Choice(
    745772        source = LGASource(),
     
    748775        )
    749776
    750     shop_email = schema.ASCIILine(
     777    shop_email = schema.TextLine(
    751778        title = _(u'Shop Email Address'),
    752779        required = False,
     
    843870
    844871    """
     872
     873class IAPPITContract(IContract):
     874    """A Accepting Pupil Pharmacist for Internship Training contract.
     875
     876    """
     877
     878    institution_address = schema.Text(
     879        title = _(u'Institution'),
     880        description= _('Enter name and address of institution.'),
     881        required = False,
     882        )
     883
     884    approved = schema.Bool(
     885        title= _('Institution Approved'),
     886        description= _('Tick box if the institution is approved for internship.'),
     887        required = False,
     888        )
     889
     890    inst_certificate = schema.TextLine(
     891        title = _(u'Institution Certificate'),
     892        description= _('Enter the institutions certificate number and date.'),
     893        required = False,
     894        readonly = False,
     895        )
     896
     897    employer_address = schema.Text(
     898        title = _(u'Employer'),
     899        description= _('Enter name and address of employer.'),
     900        required = False,
     901        )
     902
     903    internee_name = schema.TextLine(
     904        title = _(u'Internee Name'),
     905        required = False,
     906        readonly = False,
     907        )
     908
     909    internee_address = schema.Text(
     910        title = _(u'Internee Address'),
     911        required = False,
     912        )
     913
     914    provisional_registration = schema.TextLine(
     915        title = _(u'Provisional Registration'),
     916        description= _('Enter number and date of certificate of '
     917                       'provisional regsitration of the internee.'),
     918        required = False,
     919        readonly = False,
     920        )
     921
     922    educational_institution = schema.Text(
     923        title = _(u'Educational Institution Attended'),
     924        description= _('Enter name, address of institution and period of attendance.'),
     925        required = False,
     926        readonly = False,
     927        )
     928
     929    educational_period = schema.TextLine(
     930        title = _(u'Period'),
     931        description= _('Enter period of attendance.'),
     932        required = False,
     933        readonly = False,
     934        )
     935
     936    educational_qualification = schema.TextLine(
     937        title = _(u'Qualification'),
     938        description= _('Enter qualification obtained.'),
     939        required = False,
     940        readonly = False,
     941        )
     942
     943    supervisor = schema.TextLine(
     944        title = _(u'Supervising Pharmacist'),
     945        required = False,
     946        readonly = False,
     947        )
     948
     949    supervisor_designation = schema.TextLine(
     950        title = _(u'Designation'),
     951        description= _('Enter designation of supervisor.'),
     952        required = False,
     953        readonly = False,
     954        )
     955
     956    supervisor_year = schema.TextLine(
     957        title = _(u'Year of Qualification'),
     958        description= _('Enter year of qualification of supervisor.'),
     959        required = False,
     960        readonly = False,
     961        )
     962
     963    supervisor_regnumber = schema.TextLine(
     964        title = _(u'Registration Number'),
     965        description= _('Enter registration number of supervisor.'),
     966        required = False,
     967        readonly = False,
     968        )
     969
     970    license_regnumber = schema.TextLine(
     971        title = _(u'Annual License to Practice'),
     972        description= _('Enter number and date of annual license to practice '
     973                       'of supervisor.'),
     974        required = False,
     975        readonly = False,
     976        )
     977
     978
     979    scope_practice = schema.List(
     980        title = _(u'Scope of Practice'),
     981        value_type = schema.Choice(source=PracticeSource()),
     982        description= _('Select scopes of pharmaceutical practice currently '
     983                       'undertaken at the institution.'),
     984        required = False,
     985        default = [],
     986        )
     987
     988class IAPPITContractOfficialUse(IIkobaObject):
     989    """Interface for editing APPIT official use data.
     990
     991    """
     992
     993    comment = schema.Text(
     994        title= _('Reason for rejection'),
     995        required = False,
     996        )
     997
     998
     999class IAPPITContractProcess(IAPPITContract, IAPPITContractOfficialUse):
     1000    """Interface for processing APPIT data.
     1001    """
     1002
     1003    product_options = schema.List(
     1004        title = _(u'Options/Fees'),
     1005        value_type = ProductOptionField(),
     1006        required = False,
     1007        readonly = False,
     1008        default = [],
     1009        )
     1010
     1011class IAPPITContractEdit(IAPPITContract):
     1012    """Interface for editing APPIT data by customers.
     1013
     1014    """
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_contract.py

    r12604 r12611  
    3636    IPPMVLContract,
    3737    RPPMVLContract,
     38    APPITContract,
    3839    )
    3940from ikobacustom.pcn.customers.interfaces import (
     
    4445    IIPPMVLContract,
    4546    IRPPMVLContract,
     47    IAPPITContract,
    4648    )
    4749
     
    6466        verify.verifyObject(IIPPMVLContract, IPPMVLContract())
    6567        verify.verifyObject(ICustomerNavigation, IPPMVLContract())
     68        verify.verifyObject(IAPPITContract, APPITContract())
     69        verify.verifyObject(ICustomerNavigation, APPITContract())
    6670        return
    6771
     
    104108        self.assertEqual(container[id6], contract6)
    105109        self.assertEqual(contract6.class_name, 'RPPMVLContract')
     110
     111        contract7= createObject(u'waeup.APPITContract')
     112        id7 = contract7.contract_id
     113        container.addContract(contract7)
     114        self.assertEqual(container[id7], contract7)
     115        self.assertEqual(contract7.class_name, 'APPITContract')
    106116        return
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/utils.py

    r12604 r12611  
    6262        'RPPMVLContract': _(
    6363            'Renewal of Patent and Proprietary Medicines Vendors License'),
     64        'APPITContract': _(
     65            'Accepting Pupil Pharmacist for Internship Training'),
    6466        }
     67
     68
     69
    6570
    6671    SELECTABLE_DOCTYPES_DICT = deepcopy(DOCTYPES_DICT)
     
    7782        'rpccontracts',
    7883        'ippmvlcontracts',
    79         'rppmvlcontracts')
     84        'rppmvlcontracts',
     85        'appitcontracts')
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/utils/utils.py

    r12604 r12611  
    5252        'ippmvl': 'Issuance of Patent and Proprietary Medicines Vendors License',
    5353        'rppmvl': 'Renewal of Patent and Proprietary Medicines Vendors License',
     54        'appit': 'Accepting Pupil Pharmacist for Internship Training',
    5455        'no': 'no license',
    5556        }
     
    7879        'rpccontracts',
    7980        'ippmvlcontracts',
    80         'rppmvlcontracts')
     81        'rppmvlcontracts',
     82        'appitcontracts')
    8183
    8284    BATCH_PROCESSOR_NAMES = (
     
    9092        'ippmvlcontractprocessor',
    9193        'rppmvlcontractprocessor',
     94        'appitcontractprocessor'
    9295        'pcnproductprocessor',
    9396        'pdfdocumentprocessor',
Note: See TracChangeset for help on using the changeset viewer.