Ignore:
Timestamp:
14 Feb 2015, 08:55:35 (10 years ago)
Author:
Henrik Bettermann
Message:

Add Registration as a Pharmacy Technician contract.

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

Legend:

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

    r12611 r12615  
    3232    IIPPMVLContract,
    3333    IRPPMVLContract,
    34     IAPPITContract
     34    IAPPITContract,
     35    IRPTContract
    3536    )
    3637from ikobacustom.pcn.interfaces import MessageFactory as _
     
    119120
    120121class APPITContractProcessor(ContractProcessorBase):
    121     """A batch processor for IRPPMVLContract objects.
     122    """A batch processor for IAPPITContract objects.
    122123    """
    123124    util_name = 'appitcontractprocessor'
     
    126127    iface = IAPPITContract
    127128    factory_name = 'waeup.APPITContract'
     129
     130class RPTContractProcessor(ContractProcessorBase):
     131    """A batch processor for IRPTContract objects.
     132    """
     133    util_name = 'rptcontractprocessor'
     134    grok.name(util_name)
     135    name = _('Registration as a Pharmacy Technician (Contract) Processor')
     136    iface = IRPTContract
     137    factory_name = 'waeup.RPTContract'
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/contracts.py

    r12611 r12615  
    5656    IAPPITContractProcess,
    5757    IAPPITContractOfficialUse,
     58    IRPTContract,
     59    IRPTContractEdit,
     60    IRPTContractProcess,
     61    IRPTContractOfficialUse,
    5862    )
    5963
     
    324328        return implementedBy(APPITContract)
    325329
     330
     331class RPTContract(ContractBase):
     332    """Registration as a Pharmacy Technician contract.
     333    """
     334
     335    grok.implements(
     336        IRPTContractProcess,
     337        IRPTContract,
     338        IRPTContractEdit,
     339        ICustomerNavigation)
     340
     341    contract_category = 'rpt'
     342
     343    form_fields_interface = IRPTContract
     344
     345    edit_form_fields_interface = IRPTContractEdit
     346
     347    ou_form_fields_interface = IRPTContractOfficialUse
     348
     349    check_docs_interface = IRPTContract
     350
     351RPTContract = attrs_to_fields(RPTContract)
     352
     353
     354class RPTContractFactory(grok.GlobalUtility):
     355    """A factory for contracts.
     356    """
     357    grok.implements(IFactory)
     358    grok.name(u'waeup.RPTContract')
     359    title = u"Create a new license contract.",
     360    description = u"This factory instantiates new contract instances."
     361
     362    def __call__(self, *args, **kw):
     363        return RPTContract(*args, **kw)
     364
     365    def getInterfaces(self):
     366        return implementedBy(RPTContract)
     367
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/export.py

    r12611 r12615  
    3030    IIPPMVLContractProcess,
    3131    IRPPMVLContractProcess,
    32     IAPPITContractProcess)
     32    IAPPITContractProcess,
     33    IRPTContractProcess)
    3334from ikobacustom.pcn.interfaces import MessageFactory as _
    3435
     
    113114    title = _(u'Accepting Pupil Pharmacist for Internship Training Contracts')
    114115    class_name = 'APPITContract'
     116
     117class RPTContractExporter(ContractExporterBase):
     118    """Exporter for Contract instances.
     119    """
     120    grok.name('rptcontracts')
     121    iface = IRPTContractProcess
     122    title = _(u'Registration as a Pharmacy Technician Contracts')
     123    class_name = 'RPTContract'
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/interfaces.py

    r12612 r12615  
    10141014
    10151015    """
     1016
     1017class IRPTContract(IContract):
     1018    """A Registration as a Pharmacy Technician contract.
     1019
     1020    """
     1021
     1022    state_of_origin = schema.Choice(
     1023        vocabulary = nats_vocab,
     1024        title = _(u'State of Origin'),
     1025        required = False,
     1026        )
     1027
     1028    nationality = schema.Choice(
     1029        vocabulary = nats_vocab,
     1030        title = _(u'Nationality'),
     1031        required = False,
     1032        )
     1033
     1034    nationality_aquired = schema.Choice(
     1035        values=[_(u'birth'), _(u'naturalization')],
     1036        title = _(u'Nationality acquired by'),
     1037        required = False,
     1038        )
     1039
     1040    lga = schema.Choice(
     1041        source = LGASource(),
     1042        title = _(u'State / LGA'),
     1043        required = False,
     1044        )
     1045
     1046    office_address = schema.Text(
     1047        title = _(u'Offices or Business Address'),
     1048        required = False,
     1049        )
     1050
     1051    home_address = schema.Text(
     1052        title = _(u'Permanent Home Address'),
     1053        required = False,
     1054        )
     1055
     1056    res_address = schema.Text(
     1057        title = _(u'Residential Address'),
     1058        required = False,
     1059        )
     1060
     1061    schools_attended = schema.Text(
     1062        title = _(u'Schools Attended'),
     1063        description = _('Enter:<br />'
     1064                        '(1) name of primary school, period of attendance<br />'
     1065                        '(2) name of secondary school, period of attendance<br />'
     1066                        '(3) name of post-secondary school, period of attendance'),
     1067        required = False,
     1068        )
     1069
     1070    subjects = schema.List(
     1071        title = _(u'Subjects'),
     1072        value_type = ResultEntryField(),
     1073        required = False,
     1074        readonly = False,
     1075        default = [],
     1076        )
     1077
     1078    referee1_name = schema.TextLine(
     1079        title = _(u'First Referee Name'),
     1080        required = False,
     1081        readonly = False,
     1082        )
     1083
     1084    referee1_address = schema.Text(
     1085        title = _(u'First Referee Address'),
     1086        required = False,
     1087        readonly = False,
     1088        )
     1089
     1090    referee2_name = schema.TextLine(
     1091        title = _(u'Second Referee Name'),
     1092        required = False,
     1093        readonly = False,
     1094        )
     1095
     1096    referee2_address = schema.Text(
     1097        title = _(u'Second Referee Address'),
     1098        required = False,
     1099        readonly = False,
     1100        )
     1101
     1102
     1103class IRPTContractOfficialUse(IIkobaObject):
     1104    """Interface for editing RPT official use data.
     1105
     1106    """
     1107
     1108    comment = schema.Text(
     1109        title= _('Reason for rejection'),
     1110        required = False,
     1111        )
     1112
     1113
     1114class IRPTContractProcess(IRPTContract, IRPTContractOfficialUse):
     1115    """Interface for processing RPT data.
     1116    """
     1117
     1118    product_options = schema.List(
     1119        title = _(u'Options/Fees'),
     1120        value_type = ProductOptionField(),
     1121        required = False,
     1122        readonly = False,
     1123        default = [],
     1124        )
     1125
     1126class IRPTContractEdit(IRPTContract):
     1127    """Interface for editing RPT data by customers.
     1128
     1129    """
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_contract.py

    r12611 r12615  
    3737    RPPMVLContract,
    3838    APPITContract,
     39    RPTContract,
    3940    )
    4041from ikobacustom.pcn.customers.interfaces import (
     
    4647    IRPPMVLContract,
    4748    IAPPITContract,
     49    IRPTContract,
    4850    )
    4951
     
    6870        verify.verifyObject(IAPPITContract, APPITContract())
    6971        verify.verifyObject(ICustomerNavigation, APPITContract())
     72        verify.verifyObject(IRPTContract, RPTContract())
     73        verify.verifyObject(ICustomerNavigation, RPTContract())
    7074        return
    7175
     
    114118        self.assertEqual(container[id7], contract7)
    115119        self.assertEqual(contract7.class_name, 'APPITContract')
     120
     121        contract8= createObject(u'waeup.RPTContract')
     122        id8 = contract8.contract_id
     123        container.addContract(contract8)
     124        self.assertEqual(container[id8], contract8)
     125        self.assertEqual(contract8.class_name, 'RPTContract')
    116126        return
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/utils.py

    r12611 r12615  
    6464        'APPITContract': _(
    6565            'Accepting Pupil Pharmacist for Internship Training'),
     66        'RPTContract': _(
     67            'Registration as a Pharmacy Technician'),
    6668        }
    6769
     
    8385        'ippmvlcontracts',
    8486        'rppmvlcontracts',
    85         'appitcontracts')
     87        'appitcontracts',
     88        'rptcontracts')
Note: See TracChangeset for help on using the changeset viewer.