Changeset 12617


Ignore:
Timestamp:
14 Feb 2015, 17:22:51 (10 years ago)
Author:
Henrik Bettermann
Message:

Add Annual Permit for Pharmacy Technician 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

    r12616 r12617  
    3333    IRPPMVLContract,
    3434    IAPPITContract,
    35     IRPTContract
     35    IRPTContract,
     36    IAPPTContract
    3637    )
    3738from ikobacustom.pcn.interfaces import MessageFactory as _
     
    136137    iface = IRPTContract
    137138    factory_name = 'waeup.RPTContract'
     139
     140class APPTContractProcessor(ContractProcessorBase):
     141    """A batch processor for IAPPTContract objects.
     142    """
     143    util_name = 'apptcontractprocessor'
     144    grok.name(util_name)
     145    name = _('License Processor: Annual Permit for Pharmacy Technician')
     146    iface = IAPPTContract
     147    factory_name = 'waeup.APPTContract'
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/browser.py

    r12612 r12617  
    2323    PDFContractSlipPage, CustomerBaseEditFormPage)
    2424from ikobacustom.pcn.interfaces import MessageFactory as _
    25 from ikobacustom.pcn.customers.interfaces import IRPCContract, IAPPITContract
     25from ikobacustom.pcn.customers.interfaces import (
     26    IRPCContract, IAPPITContract, IAPPTContract)
    2627
    2728class PDFContractSlipPage(PDFContractSlipPage):
     
    6263                )
    6364
     65class PDFAPPTContractSlipPage(PDFContractSlipPage):
     66    """Deliver pdf file including metadata.
     67    """
     68
     69    grok.context(IAPPTContract)
     70
     71    def _sigsInFooter(self):
     72        return (_('Date, Signature of Applicant'),
     73                _('Date, Signature of Supervisor'),
     74                )
     75
    6476class CustomerBaseEditFormPage(CustomerBaseEditFormPage):
    6577    """ View to edit customer base data
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/contracts.py

    r12615 r12617  
    6060    IRPTContractProcess,
    6161    IRPTContractOfficialUse,
     62    IAPPTContract,
     63    IAPPTContractEdit,
     64    IAPPTContractProcess,
     65    IAPPTContractOfficialUse,
    6266    )
    6367
     
    366370        return implementedBy(RPTContract)
    367371
     372
     373class APPTContract(ContractBase):
     374    """Annual Permit for Pharmacy Technician contract.
     375    """
     376
     377    grok.implements(
     378        IAPPTContractProcess,
     379        IAPPTContract,
     380        IAPPTContractEdit,
     381        ICustomerNavigation)
     382
     383    contract_category = 'appt'
     384
     385    form_fields_interface = IAPPTContract
     386
     387    edit_form_fields_interface = IAPPTContractEdit
     388
     389    ou_form_fields_interface = IAPPTContractOfficialUse
     390
     391    check_docs_interface = IAPPTContract
     392
     393APPTContract = attrs_to_fields(APPTContract)
     394
     395
     396class APPTContractFactory(grok.GlobalUtility):
     397    """A factory for contracts.
     398    """
     399    grok.implements(IFactory)
     400    grok.name(u'waeup.APPTContract')
     401    title = u"Create a new license contract.",
     402    description = u"This factory instantiates new contract instances."
     403
     404    def __call__(self, *args, **kw):
     405        return APPTContract(*args, **kw)
     406
     407    def getInterfaces(self):
     408        return implementedBy(APPTContract)
     409
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/export.py

    r12616 r12617  
    3131    IRPPMVLContractProcess,
    3232    IAPPITContractProcess,
    33     IRPTContractProcess)
     33    IRPTContractProcess,
     34    IAPPTContractProcess)
    3435from ikobacustom.pcn.interfaces import MessageFactory as _
    3536
     
    122123    title = _(u'Licenses: Registration as a Pharmacy Technician')
    123124    class_name = 'RPTContract'
     125
     126class APPTContractExporter(ContractExporterBase):
     127    """Exporter for Contract instances.
     128    """
     129    grok.name('apptcontracts')
     130    iface = IAPPTContractProcess
     131    title = _(u'Licenses: Annual Permit for Pharmacy Technician')
     132    class_name = 'APPTContract'
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/interfaces.py

    r12615 r12617  
    11281128
    11291129    """
     1130
     1131class IAPPTContract(IContract):
     1132    """An Annual Permit for Pharmacy Technician contract.
     1133
     1134    """
     1135
     1136    state_of_origin = schema.Choice(
     1137        vocabulary = nats_vocab,
     1138        title = _(u'State of Origin'),
     1139        required = False,
     1140        )
     1141
     1142    lga = schema.Choice(
     1143        source = LGASource(),
     1144        title = _(u'State / LGA'),
     1145        required = False,
     1146        )
     1147
     1148    office_address = schema.Text(
     1149        title = _(u'Offices or Business Address'),
     1150        required = False,
     1151        )
     1152
     1153    res_address = schema.Text(
     1154        title = _(u'Residential Address'),
     1155        required = False,
     1156        )
     1157
     1158    employed = schema.Bool(
     1159        title= _('Employment'),
     1160        description= _('Tick box if you were employed last year.'),
     1161        required = False,
     1162        )
     1163
     1164    supervisor = schema.TextLine(
     1165        title = _(u'Supervisor'),
     1166        description= _('Enter name of supervisor.'),
     1167        required = False,
     1168        readonly = False,
     1169        )
     1170
     1171    supervisor_licensenumber = schema.TextLine(
     1172        title = _(u'Supervisor License Number'),
     1173        required = False,
     1174        readonly = False,
     1175        )
     1176
     1177    reason_leaving = schema.Text(
     1178        title = _(u'Reason for Leaving'),
     1179        description= _('Tell the reason for leaving emplayment last '
     1180                       'year (if applicable)'),
     1181        required = False,
     1182        readonly = False,
     1183        )
     1184
     1185
     1186    courses_attended = schema.Text(
     1187        title = _(u'Courses, Workshops etc. Attended'),
     1188        required = False,
     1189        readonly = False,
     1190        )
     1191
     1192
     1193class IAPPTContractOfficialUse(IIkobaObject):
     1194    """Interface for editing APPT official use data.
     1195
     1196    """
     1197
     1198    comment = schema.Text(
     1199        title= _('Reason for rejection'),
     1200        required = False,
     1201        )
     1202
     1203
     1204class IAPPTContractProcess(IAPPTContract, IAPPTContractOfficialUse):
     1205    """Interface for processing APPT data.
     1206    """
     1207
     1208    product_options = schema.List(
     1209        title = _(u'Options/Fees'),
     1210        value_type = ProductOptionField(),
     1211        required = False,
     1212        readonly = False,
     1213        default = [],
     1214        )
     1215
     1216class IAPPTContractEdit(IAPPTContract):
     1217    """Interface for editing APPT data by customers.
     1218
     1219    """
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_contract.py

    r12615 r12617  
    3838    APPITContract,
    3939    RPTContract,
     40    APPTContract,
    4041    )
    4142from ikobacustom.pcn.customers.interfaces import (
     
    4849    IAPPITContract,
    4950    IRPTContract,
     51    IAPPTContract,
    5052    )
    5153
     
    124126        self.assertEqual(container[id8], contract8)
    125127        self.assertEqual(contract8.class_name, 'RPTContract')
     128
     129        contract9= createObject(u'waeup.APPTContract')
     130        id9 = contract9.contract_id
     131        container.addContract(contract9)
     132        self.assertEqual(container[id9], contract9)
     133        self.assertEqual(contract9.class_name, 'APPTContract')
    126134        return
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/utils.py

    r12615 r12617  
    6464        'APPITContract': _(
    6565            'Accepting Pupil Pharmacist for Internship Training'),
    66         'RPTContract': _(
    67             'Registration as a Pharmacy Technician'),
     66        'RPTContract': _('Registration as a Pharmacy Technician'),
     67        'APPTContract': _('Annual Permit for Pharmacy Technician'),
    6868        }
    6969
     
    8686        'rppmvlcontracts',
    8787        'appitcontracts',
    88         'rptcontracts')
     88        'rptcontracts',
     89        'apptcontracts')
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/utils/utils.py

    r12615 r12617  
    5454        'appit': 'Accepting Pupil Pharmacist for Internship Training',
    5555        'rpt': 'Registration as a Pharmacy Technician',
     56        'appt': 'Annual Permit for Pharmacy Technician',
    5657        'no': 'no license',
    5758        }
     
    8283        'rppmvlcontracts',
    8384        'appitcontracts',
    84         'rptcontracts',)
     85        'rptcontracts',
     86        'apptcontracts')
    8587
    8688    BATCH_PROCESSOR_NAMES = (
     
    9698        'appitcontractprocessor',
    9799        'rptcontractprocessor',
     100        'apptcontractprocessor',
    98101        'pcnproductprocessor',
    99102        'pdfdocumentprocessor',
Note: See TracChangeset for help on using the changeset viewer.