1 | ## $Id: interfaces.py 12797 2015-03-19 16:50:54Z henrik $ |
---|
2 | ## |
---|
3 | ## Copyright (C) 2014 Uli Fouquet & Henrik Bettermann |
---|
4 | ## This program is free software; you can redistribute it and/or modify |
---|
5 | ## it under the terms of the GNU General Public License as published by |
---|
6 | ## the Free Software Foundation; either version 2 of the License, or |
---|
7 | ## (at your option) any later version. |
---|
8 | ## |
---|
9 | ## This program is distributed in the hope that it will be useful, |
---|
10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
12 | ## GNU General Public License for more details. |
---|
13 | ## |
---|
14 | ## You should have received a copy of the GNU General Public License |
---|
15 | ## along with this program; if not, write to the Free Software |
---|
16 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
17 | ## |
---|
18 | |
---|
19 | from zope import schema |
---|
20 | from datetime import datetime |
---|
21 | from zc.sourcefactory.basic import BasicSourceFactory |
---|
22 | from waeup.ikoba.interfaces import IIkobaObject |
---|
23 | from waeup.ikoba.customers.interfaces import ( |
---|
24 | ICustomer, ICustomerDocument, ICustomerPDFDocument, IContract, |
---|
25 | validate_email) |
---|
26 | from waeup.ikoba.customers.vocabularies import ( |
---|
27 | ConCatProductSource, |
---|
28 | CustomerDocumentSource, |
---|
29 | RefereeSourceFactory, |
---|
30 | nats_vocab, |
---|
31 | ) |
---|
32 | from waeup.ikoba.schema import TextLineChoice, FormattedDate, PhoneNumber |
---|
33 | from waeup.ikoba.products.productoptions import ProductOptionField |
---|
34 | from ikobacustom.pcn.interfaces import MessageFactory as _ |
---|
35 | from ikobacustom.pcn.interfaces import LGASource |
---|
36 | from ikobacustom.pcn.customers.schoolgrades import ResultEntryField |
---|
37 | |
---|
38 | def year_range(): |
---|
39 | curr_year = datetime.now().year |
---|
40 | return range(curr_year - 2, curr_year + 5) |
---|
41 | |
---|
42 | class PracticeSource(BasicSourceFactory): |
---|
43 | """A source for categories of practice. |
---|
44 | """ |
---|
45 | def getValues(self): |
---|
46 | return [ |
---|
47 | 'academic', |
---|
48 | 'administrative', |
---|
49 | 'distribution', |
---|
50 | 'importation', |
---|
51 | 'manufacturing', |
---|
52 | 'retail and dispensing', |
---|
53 | 'research and training', |
---|
54 | 'hospital practice', |
---|
55 | 'wholesale', |
---|
56 | ] |
---|
57 | |
---|
58 | |
---|
59 | class IPCNCustomer(ICustomer): |
---|
60 | """Representation of a customer. |
---|
61 | |
---|
62 | """ |
---|
63 | |
---|
64 | date_of_birth = FormattedDate( |
---|
65 | title = _(u'Date of Birth'), |
---|
66 | required = True, |
---|
67 | show_year = True, |
---|
68 | ) |
---|
69 | |
---|
70 | res_address = schema.Text( |
---|
71 | title = _(u'Residential Address'), |
---|
72 | required = True, |
---|
73 | ) |
---|
74 | |
---|
75 | # Customer document interfaces |
---|
76 | |
---|
77 | |
---|
78 | class IPCNCustomerJPGDocument(ICustomerDocument): |
---|
79 | """A customer jpg document. |
---|
80 | |
---|
81 | """ |
---|
82 | |
---|
83 | class IPCNCustomerPDFDocument(ICustomerPDFDocument): |
---|
84 | """A customer pdf document. |
---|
85 | |
---|
86 | """ |
---|
87 | |
---|
88 | # Customer contract interfaces |
---|
89 | |
---|
90 | class IRONContract(IContract): |
---|
91 | """A Retention of Name contract. |
---|
92 | |
---|
93 | """ |
---|
94 | |
---|
95 | state_of_origin = schema.Choice( |
---|
96 | vocabulary = nats_vocab, |
---|
97 | title = _(u'State of Origin'), |
---|
98 | required = False, |
---|
99 | ) |
---|
100 | |
---|
101 | lga = schema.Choice( |
---|
102 | source = LGASource(), |
---|
103 | title = _(u'State / LGA'), |
---|
104 | required = False, |
---|
105 | ) |
---|
106 | |
---|
107 | year_qualification = schema.Choice( |
---|
108 | title = _(u'Year of Qualification'), |
---|
109 | required = True, |
---|
110 | values = year_range(), |
---|
111 | ) |
---|
112 | |
---|
113 | work_address = schema.Text( |
---|
114 | title = _(u'Work Address'), |
---|
115 | required = False, |
---|
116 | ) |
---|
117 | |
---|
118 | work_email = schema.TextLine( |
---|
119 | title = _(u'Work Email Address'), |
---|
120 | required = False, |
---|
121 | constraint=validate_email, |
---|
122 | ) |
---|
123 | |
---|
124 | work_phone = PhoneNumber( |
---|
125 | title = _(u'Work Phone'), |
---|
126 | description = u'', |
---|
127 | required = False, |
---|
128 | ) |
---|
129 | |
---|
130 | categories_practice = schema.List( |
---|
131 | title = _(u'Categories of Practice'), |
---|
132 | value_type = schema.Choice(source=PracticeSource()), |
---|
133 | required = False, |
---|
134 | default = [], |
---|
135 | ) |
---|
136 | |
---|
137 | superintendent = schema.Bool( |
---|
138 | title= _('Superintendent'), |
---|
139 | description= _('Tick box if you are a superintendent pharamcist.'), |
---|
140 | required = False, |
---|
141 | ) |
---|
142 | |
---|
143 | #document_object = schema.Choice( |
---|
144 | # title = _(u'Document'), |
---|
145 | # source = CustomerDocumentSource(), |
---|
146 | # required = False, |
---|
147 | # ) |
---|
148 | |
---|
149 | class IRONContractOfficialUse(IIkobaObject): |
---|
150 | """Interface for editing RON official use data. |
---|
151 | |
---|
152 | """ |
---|
153 | |
---|
154 | comment = schema.Text( |
---|
155 | title= _('Reason for rejection'), |
---|
156 | required = False, |
---|
157 | ) |
---|
158 | |
---|
159 | |
---|
160 | class IRONContractProcess(IRONContract, IRONContractOfficialUse): |
---|
161 | """Interface for processing RON data. |
---|
162 | """ |
---|
163 | |
---|
164 | product_options = schema.List( |
---|
165 | title = _(u'Options/Fees'), |
---|
166 | value_type = ProductOptionField(), |
---|
167 | required = False, |
---|
168 | readonly = False, |
---|
169 | default = [], |
---|
170 | ) |
---|
171 | |
---|
172 | class IRONContractEdit(IRONContract): |
---|
173 | """Interface for editing RON data by customers. |
---|
174 | |
---|
175 | """ |
---|
176 | |
---|
177 | #document_object = schema.Choice( |
---|
178 | # title = _(u'Document'), |
---|
179 | # source = CustomerDocumentSource(), |
---|
180 | # required = True, |
---|
181 | # ) |
---|
182 | |
---|
183 | |
---|
184 | class IROPContract(IContract): |
---|
185 | """A Registration of Premises contract. |
---|
186 | |
---|
187 | """ |
---|
188 | |
---|
189 | premises_address = schema.Text( |
---|
190 | title = _(u'Name and Address of Pharmaceutical Premises'), |
---|
191 | required = True, |
---|
192 | ) |
---|
193 | |
---|
194 | categories_practice = schema.List( |
---|
195 | title = _(u'Categories of Practice'), |
---|
196 | value_type = schema.Choice(source=PracticeSource()), |
---|
197 | required = False, |
---|
198 | default = [], |
---|
199 | ) |
---|
200 | |
---|
201 | premises_certificate = schema.TextLine( |
---|
202 | title = _(u'Last Premises Certificate'), |
---|
203 | description= _('If an old premises, state the last premises certificate number issued with date.'), |
---|
204 | required = False, |
---|
205 | ) |
---|
206 | |
---|
207 | date_of_qualification = FormattedDate( |
---|
208 | title = _(u'Date of Qualification'), |
---|
209 | required = False, |
---|
210 | show_year = True, |
---|
211 | ) |
---|
212 | |
---|
213 | last_license_number = schema.TextLine( |
---|
214 | title = _(u'Last Annual License Number'), |
---|
215 | required = False, |
---|
216 | ) |
---|
217 | |
---|
218 | superintendent = schema.Bool( |
---|
219 | title= _('Superintendent'), |
---|
220 | description= _('Tick box if you were a superintendent pharamcist last year.'), |
---|
221 | required = False, |
---|
222 | ) |
---|
223 | |
---|
224 | work_address = schema.Text( |
---|
225 | title = _(u'Full Time Employment Address'), |
---|
226 | description= _('Enter work address if you were not a superintendent pharamcist last year.'), |
---|
227 | required = False, |
---|
228 | ) |
---|
229 | |
---|
230 | pharmacists_directors= schema.TextLine( |
---|
231 | title = _(u'Pharmacist Directors'), |
---|
232 | description = _(u'Full name of directors and their profession as in Form C.O.7'), |
---|
233 | required = False, |
---|
234 | ) |
---|
235 | |
---|
236 | other_directors= schema.TextLine( |
---|
237 | title = _(u'Other Directors'), |
---|
238 | description = _(u'Full name of directors and their profession as in Form C.O.7'), |
---|
239 | required = False, |
---|
240 | ) |
---|
241 | |
---|
242 | #document_object = schema.Choice( |
---|
243 | # title = _(u'Document'), |
---|
244 | # source = CustomerDocumentSource(), |
---|
245 | # required = False, |
---|
246 | # ) |
---|
247 | |
---|
248 | class IROPContractOfficialUse(IIkobaObject): |
---|
249 | """Interface for editing ROP official use data. |
---|
250 | |
---|
251 | """ |
---|
252 | |
---|
253 | inspected = schema.Bool( |
---|
254 | title = _('Inspected'), |
---|
255 | description = _('Has the premises been duly inspected?'), |
---|
256 | required = False, |
---|
257 | ) |
---|
258 | |
---|
259 | recommended = schema.Bool( |
---|
260 | title = _('Recommended'), |
---|
261 | description= _('Is the premises recommended?'), |
---|
262 | required = False, |
---|
263 | ) |
---|
264 | |
---|
265 | official_in_state = schema.TextLine( |
---|
266 | title = _(u'Name of Official in the State'), |
---|
267 | required = False, |
---|
268 | ) |
---|
269 | |
---|
270 | class IROPContractProcess(IROPContract, IROPContractOfficialUse): |
---|
271 | """Interface for processing RON data. |
---|
272 | """ |
---|
273 | |
---|
274 | product_options = schema.List( |
---|
275 | title = _(u'Options/Fees'), |
---|
276 | value_type = ProductOptionField(), |
---|
277 | required = False, |
---|
278 | readonly = False, |
---|
279 | default = [], |
---|
280 | ) |
---|
281 | |
---|
282 | class IROPContractEdit(IROPContract): |
---|
283 | """Interface for editing RON data by customers. |
---|
284 | |
---|
285 | """ |
---|
286 | |
---|
287 | #document_object = schema.Choice( |
---|
288 | # title = _(u'Document'), |
---|
289 | # source = CustomerDocumentSource(), |
---|
290 | # required = True, |
---|
291 | # ) |
---|
292 | |
---|
293 | class IRPRContract(IContract): |
---|
294 | """A Registration in the Provisional Register contract. |
---|
295 | |
---|
296 | """ |
---|
297 | |
---|
298 | state_of_origin = schema.Choice( |
---|
299 | vocabulary = nats_vocab, |
---|
300 | title = _(u'State of Origin'), |
---|
301 | required = False, |
---|
302 | ) |
---|
303 | |
---|
304 | pharmacies_addresses = schema.Text( |
---|
305 | title = _(u'Pharmacies Attended'), |
---|
306 | description = u'Enter the addresses of pharmacies and periods of attendance.', |
---|
307 | required = False, |
---|
308 | readonly = False, |
---|
309 | ) |
---|
310 | |
---|
311 | qualifications = schema.Text( |
---|
312 | title = _(u'Qualifications'), |
---|
313 | description = u'Enter a list of certificates obtained.', |
---|
314 | required = False, |
---|
315 | readonly = False, |
---|
316 | ) |
---|
317 | |
---|
318 | certificates_object = schema.Choice( |
---|
319 | title = _(u'Certificates'), |
---|
320 | description = u'Select the document which contains scanned copies ' |
---|
321 | u'of your certificates. You must create such a ' |
---|
322 | u'document first.', |
---|
323 | source = CustomerDocumentSource(), |
---|
324 | required = False, |
---|
325 | ) |
---|
326 | |
---|
327 | referee1_name = schema.TextLine( |
---|
328 | title = _(u'First Referee Name'), |
---|
329 | description= _('This referee must be a pharmacist.'), |
---|
330 | required = False, |
---|
331 | readonly = False, |
---|
332 | ) |
---|
333 | |
---|
334 | referee1_address = schema.Text( |
---|
335 | title = _(u'First Referee Address'), |
---|
336 | required = False, |
---|
337 | readonly = False, |
---|
338 | ) |
---|
339 | |
---|
340 | referee1_license = schema.TextLine( |
---|
341 | title = _(u'First Referee License Number'), |
---|
342 | required = False, |
---|
343 | readonly = False, |
---|
344 | ) |
---|
345 | |
---|
346 | referee2_name = schema.TextLine( |
---|
347 | title = _(u'Second Referee Name'), |
---|
348 | required = False, |
---|
349 | readonly = False, |
---|
350 | ) |
---|
351 | |
---|
352 | referee2_address = schema.Text( |
---|
353 | title = _(u'Second Referee Address'), |
---|
354 | required = False, |
---|
355 | readonly = False, |
---|
356 | ) |
---|
357 | |
---|
358 | referee2_license = schema.TextLine( |
---|
359 | title = _(u'Second Referee License Number'), |
---|
360 | required = False, |
---|
361 | readonly = False, |
---|
362 | ) |
---|
363 | |
---|
364 | internship_address = schema.Text( |
---|
365 | title = _(u'Internship'), |
---|
366 | description = _('Enter name and address of company where you want to ' |
---|
367 | 'serve your internship.'), |
---|
368 | required = False, |
---|
369 | readonly = False, |
---|
370 | ) |
---|
371 | |
---|
372 | |
---|
373 | |
---|
374 | class IRPRContractOfficialUse(IIkobaObject): |
---|
375 | """Interface for editing RPR official use data. |
---|
376 | |
---|
377 | """ |
---|
378 | |
---|
379 | comment = schema.Text( |
---|
380 | title= _('Reason for rejection'), |
---|
381 | required = False, |
---|
382 | ) |
---|
383 | |
---|
384 | |
---|
385 | class IRPRContractProcess(IRPRContract, IRPRContractOfficialUse): |
---|
386 | """Interface for processing RPR data. |
---|
387 | """ |
---|
388 | |
---|
389 | product_options = schema.List( |
---|
390 | title = _(u'Options/Fees'), |
---|
391 | value_type = ProductOptionField(), |
---|
392 | required = False, |
---|
393 | readonly = False, |
---|
394 | default = [], |
---|
395 | ) |
---|
396 | |
---|
397 | class IRPRContractEdit(IRPRContract): |
---|
398 | """Interface for editing RPR data by customers. |
---|
399 | |
---|
400 | """ |
---|
401 | |
---|
402 | certificates_object = schema.Choice( |
---|
403 | title = _(u'Certificates'), |
---|
404 | description = u'Select the document which contains scanned copies ' |
---|
405 | u'of your certificates. You must create such a ' |
---|
406 | u'document first.', |
---|
407 | source = CustomerDocumentSource(), |
---|
408 | required = True, |
---|
409 | ) |
---|
410 | |
---|
411 | IRPRContractEdit['certificates_object'].order = IRPRContract[ |
---|
412 | 'certificates_object'].order |
---|
413 | |
---|
414 | |
---|
415 | class IRPCContract(IContract): |
---|
416 | """A Registration as Pharmaceutical Chemist contract. |
---|
417 | |
---|
418 | """ |
---|
419 | |
---|
420 | nationality = schema.Choice( |
---|
421 | vocabulary = nats_vocab, |
---|
422 | title = _(u'Nationality'), |
---|
423 | required = False, |
---|
424 | ) |
---|
425 | |
---|
426 | nationality_aquired = schema.Choice( |
---|
427 | values=[_(u'birth'), _(u'naturalization'), _(u'marriage')], |
---|
428 | title = _(u'Nationality acquired by'), |
---|
429 | required = False, |
---|
430 | ) |
---|
431 | |
---|
432 | qualifications = schema.Text( |
---|
433 | title = _(u'Qualifications'), |
---|
434 | description = u'Enter a list of certificates obtained.', |
---|
435 | required = False, |
---|
436 | readonly = False, |
---|
437 | ) |
---|
438 | |
---|
439 | certificates_object = schema.Choice( |
---|
440 | title = _(u'Certificates'), |
---|
441 | description = u'Select the document which contains scanned copies ' |
---|
442 | u'of your certificates. You must create such a ' |
---|
443 | u'document first.', |
---|
444 | source = CustomerDocumentSource(), |
---|
445 | required = False, |
---|
446 | ) |
---|
447 | |
---|
448 | referee1_name = schema.TextLine( |
---|
449 | title = _(u'First Referee Name'), |
---|
450 | required = False, |
---|
451 | readonly = False, |
---|
452 | ) |
---|
453 | |
---|
454 | referee1_address = schema.Text( |
---|
455 | title = _(u'First Referee Address'), |
---|
456 | required = False, |
---|
457 | readonly = False, |
---|
458 | ) |
---|
459 | |
---|
460 | referee1_license = schema.TextLine( |
---|
461 | title = _(u'First Referee License Number'), |
---|
462 | required = False, |
---|
463 | readonly = False, |
---|
464 | ) |
---|
465 | |
---|
466 | referee2_name = schema.TextLine( |
---|
467 | title = _(u'Second Referee Name'), |
---|
468 | required = False, |
---|
469 | readonly = False, |
---|
470 | ) |
---|
471 | |
---|
472 | referee2_address = schema.Text( |
---|
473 | title = _(u'Second Referee Address'), |
---|
474 | required = False, |
---|
475 | readonly = False, |
---|
476 | ) |
---|
477 | |
---|
478 | referee2_license = schema.TextLine( |
---|
479 | title = _(u'Second Referee License Number'), |
---|
480 | required = False, |
---|
481 | readonly = False, |
---|
482 | ) |
---|
483 | |
---|
484 | internship = schema.Text( |
---|
485 | title = _(u'Internship'), |
---|
486 | description = u'Enter name and address of the company where you ' |
---|
487 | u'served your internship, the name of the approved ' |
---|
488 | u'registered pharmacist and the period of your service.', |
---|
489 | required = False, |
---|
490 | readonly = False, |
---|
491 | ) |
---|
492 | |
---|
493 | nigerian_residence = FormattedDate( |
---|
494 | title = _(u'Residence in Nigeria'), |
---|
495 | description = u'Enter the date since when you have continously ' |
---|
496 | u'resided in Nigeria.', |
---|
497 | required = False, |
---|
498 | show_year = True, |
---|
499 | ) |
---|
500 | |
---|
501 | witness = schema.Text( |
---|
502 | title = _(u'Witness'), |
---|
503 | description = u'Enter name and adress of witness.', |
---|
504 | required = False, |
---|
505 | ) |
---|
506 | |
---|
507 | |
---|
508 | class IRPCContractOfficialUse(IIkobaObject): |
---|
509 | """Interface for editing RPC official use data. |
---|
510 | |
---|
511 | """ |
---|
512 | |
---|
513 | comment = schema.Text( |
---|
514 | title= _('Reason for rejection'), |
---|
515 | required = False, |
---|
516 | ) |
---|
517 | |
---|
518 | |
---|
519 | class IRPCContractProcess(IRPCContract, IRPCContractOfficialUse): |
---|
520 | """Interface for processing RPC data. |
---|
521 | """ |
---|
522 | |
---|
523 | product_options = schema.List( |
---|
524 | title = _(u'Options/Fees'), |
---|
525 | value_type = ProductOptionField(), |
---|
526 | required = False, |
---|
527 | readonly = False, |
---|
528 | default = [], |
---|
529 | ) |
---|
530 | |
---|
531 | class IRPCContractEdit(IRPCContract): |
---|
532 | """Interface for editing RPC data by customers. |
---|
533 | |
---|
534 | """ |
---|
535 | |
---|
536 | certificates_object = schema.Choice( |
---|
537 | title = _(u'Certificates'), |
---|
538 | description = u'Select the document which contains scanned copies ' |
---|
539 | u'of your certificates. You must create such a ' |
---|
540 | u'document first.', |
---|
541 | source = CustomerDocumentSource(), |
---|
542 | required = True, |
---|
543 | ) |
---|
544 | |
---|
545 | IRPCContractEdit['certificates_object'].order = IRPCContract[ |
---|
546 | 'certificates_object'].order |
---|
547 | |
---|
548 | class IIPPMVLContract(IContract): |
---|
549 | """A Issuance of Patent and Proprietary Medicines Vendors License. |
---|
550 | |
---|
551 | """ |
---|
552 | |
---|
553 | occupation = schema.TextLine( |
---|
554 | title = _(u'Occupation'), |
---|
555 | required = False, |
---|
556 | readonly = False, |
---|
557 | ) |
---|
558 | |
---|
559 | qualifications = schema.Text( |
---|
560 | title = _(u'Educational Qualifications'), |
---|
561 | description = u'Enter a list of certificates obtained.', |
---|
562 | required = False, |
---|
563 | readonly = False, |
---|
564 | ) |
---|
565 | |
---|
566 | certificates_object = schema.Choice( |
---|
567 | title = _(u'Certificates/Credentials'), |
---|
568 | description = u'Select the pdf document which contains scanned copies ' |
---|
569 | u'of your certificates. You must create such a ' |
---|
570 | u'document first.', |
---|
571 | source = CustomerDocumentSource(), |
---|
572 | required = False, |
---|
573 | ) |
---|
574 | |
---|
575 | incometax_object = schema.Choice( |
---|
576 | title = _(u'Income Tax Clearance'), |
---|
577 | description = u'Select the pdf document which contains scanned copies ' |
---|
578 | u'of your income tax clearance for the past three years. ' |
---|
579 | u'You must create such a document first.', |
---|
580 | source = CustomerDocumentSource(), |
---|
581 | required = False, |
---|
582 | ) |
---|
583 | |
---|
584 | shop_address = schema.Text( |
---|
585 | title = _(u'Patent Vendor\'s Shop'), |
---|
586 | description = u'Enter name and address of patent vendor\'s shop.', |
---|
587 | required = False, |
---|
588 | ) |
---|
589 | |
---|
590 | shop_lga = schema.Choice( |
---|
591 | source = LGASource(), |
---|
592 | title = _(u'State / LGA'), |
---|
593 | required = False, |
---|
594 | ) |
---|
595 | |
---|
596 | shop_email = schema.TextLine( |
---|
597 | title = _(u'Shop Email Address'), |
---|
598 | required = False, |
---|
599 | constraint=validate_email, |
---|
600 | ) |
---|
601 | |
---|
602 | shop_phone = PhoneNumber( |
---|
603 | title = _(u'Shop Phone'), |
---|
604 | description = u'', |
---|
605 | required = False, |
---|
606 | ) |
---|
607 | |
---|
608 | old_or_new = schema.Choice( |
---|
609 | values=[_(u'old'), _(u'new')], |
---|
610 | title = _(u'Old or New Shop'), |
---|
611 | required = False, |
---|
612 | ) |
---|
613 | |
---|
614 | PPMVL_number = schema.TextLine( |
---|
615 | title = _(u'PPMVL Data'), |
---|
616 | description = u'If an old store, state PPMVL number and date of issue.', |
---|
617 | required = False, |
---|
618 | readonly = False, |
---|
619 | ) |
---|
620 | |
---|
621 | referee1_name = schema.TextLine( |
---|
622 | title = _(u'First Referee Name'), |
---|
623 | required = False, |
---|
624 | readonly = False, |
---|
625 | ) |
---|
626 | |
---|
627 | referee1_address = schema.Text( |
---|
628 | title = _(u'First Referee Address'), |
---|
629 | required = False, |
---|
630 | readonly = False, |
---|
631 | ) |
---|
632 | |
---|
633 | referee1_license = schema.TextLine( |
---|
634 | title = _(u'First Referee License Number'), |
---|
635 | required = False, |
---|
636 | readonly = False, |
---|
637 | ) |
---|
638 | |
---|
639 | referee1_occupation = schema.TextLine( |
---|
640 | title = _(u'First Referee Occupation'), |
---|
641 | required = False, |
---|
642 | readonly = False, |
---|
643 | ) |
---|
644 | |
---|
645 | referee2_name = schema.TextLine( |
---|
646 | title = _(u'Second Referee Name'), |
---|
647 | required = False, |
---|
648 | readonly = False, |
---|
649 | ) |
---|
650 | |
---|
651 | referee2_address = schema.Text( |
---|
652 | title = _(u'Second Referee Address'), |
---|
653 | required = False, |
---|
654 | readonly = False, |
---|
655 | ) |
---|
656 | |
---|
657 | referee2_license = schema.TextLine( |
---|
658 | title = _(u'Second Referee License Number'), |
---|
659 | required = False, |
---|
660 | readonly = False, |
---|
661 | ) |
---|
662 | |
---|
663 | referee2_occupation = schema.TextLine( |
---|
664 | title = _(u'Second Referee Occupation'), |
---|
665 | required = False, |
---|
666 | readonly = False, |
---|
667 | ) |
---|
668 | |
---|
669 | |
---|
670 | class IIPPMVLContractOfficialUse(IIkobaObject): |
---|
671 | """Interface for editing IPPMVL official use data. |
---|
672 | |
---|
673 | """ |
---|
674 | |
---|
675 | comment = schema.Text( |
---|
676 | title= _('Reason for rejection'), |
---|
677 | required = False, |
---|
678 | ) |
---|
679 | |
---|
680 | |
---|
681 | class IIPPMVLContractProcess(IIPPMVLContract, IIPPMVLContractOfficialUse): |
---|
682 | """Interface for processing IPPMVL data. |
---|
683 | """ |
---|
684 | |
---|
685 | product_options = schema.List( |
---|
686 | title = _(u'Options/Fees'), |
---|
687 | value_type = ProductOptionField(), |
---|
688 | required = False, |
---|
689 | readonly = False, |
---|
690 | default = [], |
---|
691 | ) |
---|
692 | |
---|
693 | class IIPPMVLContractEdit(IIPPMVLContract): |
---|
694 | """Interface for editing IPPMVL data by customers. |
---|
695 | |
---|
696 | """ |
---|
697 | |
---|
698 | certificates_object = schema.Choice( |
---|
699 | title = _(u'Certificates'), |
---|
700 | description = u'Select the document which contains scanned copies ' |
---|
701 | u'of your certificates. You must create such a ' |
---|
702 | u'document first.', |
---|
703 | source = CustomerDocumentSource(), |
---|
704 | required = True, |
---|
705 | ) |
---|
706 | |
---|
707 | incometax_object = schema.Choice( |
---|
708 | title = _(u'Income Tax Clearance'), |
---|
709 | description = u'Select the pdf document which contains scanned copies ' |
---|
710 | u'of your income tax clearance for the past three years. ' |
---|
711 | u'You must create such a document first.', |
---|
712 | source = CustomerDocumentSource(), |
---|
713 | required = True, |
---|
714 | ) |
---|
715 | |
---|
716 | IIPPMVLContractEdit['certificates_object'].order = IIPPMVLContract[ |
---|
717 | 'certificates_object'].order |
---|
718 | |
---|
719 | IIPPMVLContractEdit['incometax_object'].order = IIPPMVLContract[ |
---|
720 | 'incometax_object'].order |
---|
721 | |
---|
722 | class IRPPMVLContract(IContract): |
---|
723 | """A Renewal of Patent and Proprietary Medicines Vendors License. |
---|
724 | |
---|
725 | """ |
---|
726 | |
---|
727 | occupation = schema.TextLine( |
---|
728 | title = _(u'Occupation'), |
---|
729 | required = False, |
---|
730 | readonly = False, |
---|
731 | ) |
---|
732 | |
---|
733 | qualifications = schema.Text( |
---|
734 | title = _(u'Educational Qualifications'), |
---|
735 | description = u'Enter a list of certificates obtained.', |
---|
736 | required = False, |
---|
737 | readonly = False, |
---|
738 | ) |
---|
739 | |
---|
740 | shop_address = schema.Text( |
---|
741 | title = _(u'Patent Vendor\'s Shop'), |
---|
742 | description = u'Enter name and address of patent vendor\'s shop.', |
---|
743 | required = False, |
---|
744 | ) |
---|
745 | |
---|
746 | ppmv_signpost = schema.TextLine( |
---|
747 | title = _(u'PPMV Sign-post Number'), |
---|
748 | required = False, |
---|
749 | readonly = False, |
---|
750 | ) |
---|
751 | |
---|
752 | shop_lga = schema.Choice( |
---|
753 | source = LGASource(), |
---|
754 | title = _(u'State / LGA'), |
---|
755 | required = False, |
---|
756 | ) |
---|
757 | |
---|
758 | shop_email = schema.TextLine( |
---|
759 | title = _(u'Shop Email Address'), |
---|
760 | required = False, |
---|
761 | constraint=validate_email, |
---|
762 | ) |
---|
763 | |
---|
764 | shop_phone = PhoneNumber( |
---|
765 | title = _(u'Shop Phone'), |
---|
766 | description = u'', |
---|
767 | required = False, |
---|
768 | ) |
---|
769 | |
---|
770 | PPMVL_number = schema.TextLine( |
---|
771 | title = _(u'PPMVL Data'), |
---|
772 | description = u'State PPMVL number and date of issue of last license.', |
---|
773 | required = False, |
---|
774 | readonly = False, |
---|
775 | ) |
---|
776 | |
---|
777 | referee1_name = schema.TextLine( |
---|
778 | title = _(u'First Referee Name'), |
---|
779 | required = False, |
---|
780 | readonly = False, |
---|
781 | ) |
---|
782 | |
---|
783 | referee1_address = schema.Text( |
---|
784 | title = _(u'First Referee Address'), |
---|
785 | required = False, |
---|
786 | readonly = False, |
---|
787 | ) |
---|
788 | |
---|
789 | referee1_license = schema.TextLine( |
---|
790 | title = _(u'First Referee License Number'), |
---|
791 | required = False, |
---|
792 | readonly = False, |
---|
793 | ) |
---|
794 | |
---|
795 | referee1_occupation = schema.TextLine( |
---|
796 | title = _(u'First Referee Occupation'), |
---|
797 | required = False, |
---|
798 | readonly = False, |
---|
799 | ) |
---|
800 | |
---|
801 | referee2_name = schema.TextLine( |
---|
802 | title = _(u'Second Referee Name'), |
---|
803 | required = False, |
---|
804 | readonly = False, |
---|
805 | ) |
---|
806 | |
---|
807 | referee2_address = schema.Text( |
---|
808 | title = _(u'Second Referee Address'), |
---|
809 | required = False, |
---|
810 | readonly = False, |
---|
811 | ) |
---|
812 | |
---|
813 | referee2_license = schema.TextLine( |
---|
814 | title = _(u'Second Referee License Number'), |
---|
815 | required = False, |
---|
816 | readonly = False, |
---|
817 | ) |
---|
818 | |
---|
819 | referee2_occupation = schema.TextLine( |
---|
820 | title = _(u'Second Referee Occupation'), |
---|
821 | required = False, |
---|
822 | readonly = False, |
---|
823 | ) |
---|
824 | |
---|
825 | |
---|
826 | class IRPPMVLContractOfficialUse(IIkobaObject): |
---|
827 | """Interface for editing RPPMVL official use data. |
---|
828 | |
---|
829 | """ |
---|
830 | |
---|
831 | comment = schema.Text( |
---|
832 | title= _('Reason for rejection'), |
---|
833 | required = False, |
---|
834 | ) |
---|
835 | |
---|
836 | |
---|
837 | class IRPPMVLContractProcess(IRPPMVLContract, IRPPMVLContractOfficialUse): |
---|
838 | """Interface for processing RPPMVL data. |
---|
839 | """ |
---|
840 | |
---|
841 | product_options = schema.List( |
---|
842 | title = _(u'Options/Fees'), |
---|
843 | value_type = ProductOptionField(), |
---|
844 | required = False, |
---|
845 | readonly = False, |
---|
846 | default = [], |
---|
847 | ) |
---|
848 | |
---|
849 | class IRPPMVLContractEdit(IRPPMVLContract): |
---|
850 | """Interface for editing RPPMVL data by customers. |
---|
851 | |
---|
852 | """ |
---|
853 | |
---|
854 | class IAPPITContract(IContract): |
---|
855 | """A Accepting Pupil Pharmacist for Internship Training contract. |
---|
856 | |
---|
857 | """ |
---|
858 | |
---|
859 | institution_address = schema.Text( |
---|
860 | title = _(u'Institution'), |
---|
861 | description= _('Enter name and address of institution ' |
---|
862 | 'where internee will serve.'), |
---|
863 | required = False, |
---|
864 | ) |
---|
865 | |
---|
866 | approved = schema.Bool( |
---|
867 | title= _('Institution Approved'), |
---|
868 | description= _('Tick box if the institution is approved for internship.'), |
---|
869 | required = False, |
---|
870 | ) |
---|
871 | |
---|
872 | inst_certificate = schema.TextLine( |
---|
873 | title = _(u'Institution Certificate'), |
---|
874 | description= _('Enter the institutions certificate number and date.'), |
---|
875 | required = False, |
---|
876 | readonly = False, |
---|
877 | ) |
---|
878 | |
---|
879 | employer_address = schema.Text( |
---|
880 | title = _(u'Employer'), |
---|
881 | description= _('Enter name and address of employer.'), |
---|
882 | required = False, |
---|
883 | ) |
---|
884 | |
---|
885 | internee_name = schema.TextLine( |
---|
886 | title = _(u'Internee Name'), |
---|
887 | required = False, |
---|
888 | readonly = False, |
---|
889 | ) |
---|
890 | |
---|
891 | internee_address = schema.Text( |
---|
892 | title = _(u'Internee Address'), |
---|
893 | required = False, |
---|
894 | ) |
---|
895 | |
---|
896 | provisional_registration = schema.TextLine( |
---|
897 | title = _(u'Provisional Registration'), |
---|
898 | description= _('Enter number and date of certificate of ' |
---|
899 | 'provisional regsitration of the internee.'), |
---|
900 | required = False, |
---|
901 | readonly = False, |
---|
902 | ) |
---|
903 | |
---|
904 | educational_institution = schema.Text( |
---|
905 | title = _(u'Educational Institution Attended'), |
---|
906 | description= _('Enter name, address of institution and period of attendance.'), |
---|
907 | required = False, |
---|
908 | readonly = False, |
---|
909 | ) |
---|
910 | |
---|
911 | educational_qualification = schema.TextLine( |
---|
912 | title = _(u'Qualification'), |
---|
913 | description= _('Enter qualification obtained.'), |
---|
914 | required = False, |
---|
915 | readonly = False, |
---|
916 | ) |
---|
917 | |
---|
918 | supervisor = schema.TextLine( |
---|
919 | title = _(u'Supervising Pharmacist (Preceptor)'), |
---|
920 | required = False, |
---|
921 | readonly = False, |
---|
922 | ) |
---|
923 | |
---|
924 | supervisor_designation = schema.TextLine( |
---|
925 | title = _(u'Designation'), |
---|
926 | description= _('Enter designation of supervisor.'), |
---|
927 | required = False, |
---|
928 | readonly = False, |
---|
929 | ) |
---|
930 | |
---|
931 | supervisor_year = schema.TextLine( |
---|
932 | title = _(u'Year of Qualification'), |
---|
933 | description= _('Enter year of qualification of supervisor.'), |
---|
934 | required = False, |
---|
935 | readonly = False, |
---|
936 | ) |
---|
937 | |
---|
938 | supervisor_regnumber = schema.TextLine( |
---|
939 | title = _(u'Registration Number'), |
---|
940 | description= _('Enter registration number of supervisor.'), |
---|
941 | required = False, |
---|
942 | readonly = False, |
---|
943 | ) |
---|
944 | |
---|
945 | license_regnumber = schema.TextLine( |
---|
946 | title = _(u'Annual License to Practice'), |
---|
947 | description= _('Enter number and date of annual license to practice ' |
---|
948 | 'of supervisor.'), |
---|
949 | required = False, |
---|
950 | readonly = False, |
---|
951 | ) |
---|
952 | |
---|
953 | |
---|
954 | scope_practice = schema.List( |
---|
955 | title = _(u'Scope of Practice'), |
---|
956 | value_type = schema.Choice(source=PracticeSource()), |
---|
957 | description= _('Select scopes of pharmaceutical practice currently ' |
---|
958 | 'undertaken at the institution.'), |
---|
959 | required = False, |
---|
960 | default = [], |
---|
961 | ) |
---|
962 | |
---|
963 | date_of_commencement = FormattedDate( |
---|
964 | title = _(u'Date of Commencement'), |
---|
965 | description = _(u'Enter date of commencement of internship.'), |
---|
966 | required = False, |
---|
967 | show_year = True, |
---|
968 | ) |
---|
969 | |
---|
970 | class IAPPITContractOfficialUse(IIkobaObject): |
---|
971 | """Interface for editing APPIT official use data. |
---|
972 | |
---|
973 | """ |
---|
974 | |
---|
975 | comment = schema.Text( |
---|
976 | title= _('Reason for rejection'), |
---|
977 | required = False, |
---|
978 | ) |
---|
979 | |
---|
980 | |
---|
981 | class IAPPITContractProcess(IAPPITContract, IAPPITContractOfficialUse): |
---|
982 | """Interface for processing APPIT data. |
---|
983 | """ |
---|
984 | |
---|
985 | product_options = schema.List( |
---|
986 | title = _(u'Options/Fees'), |
---|
987 | value_type = ProductOptionField(), |
---|
988 | required = False, |
---|
989 | readonly = False, |
---|
990 | default = [], |
---|
991 | ) |
---|
992 | |
---|
993 | class IAPPITContractEdit(IAPPITContract): |
---|
994 | """Interface for editing APPIT data by customers. |
---|
995 | |
---|
996 | """ |
---|
997 | |
---|
998 | class IRPTContract(IContract): |
---|
999 | """A Registration as a Pharmacy Technician contract. |
---|
1000 | |
---|
1001 | """ |
---|
1002 | |
---|
1003 | state_of_origin = schema.Choice( |
---|
1004 | vocabulary = nats_vocab, |
---|
1005 | title = _(u'State of Origin'), |
---|
1006 | required = False, |
---|
1007 | ) |
---|
1008 | |
---|
1009 | nationality = schema.Choice( |
---|
1010 | vocabulary = nats_vocab, |
---|
1011 | title = _(u'Nationality'), |
---|
1012 | required = False, |
---|
1013 | ) |
---|
1014 | |
---|
1015 | nationality_aquired = schema.Choice( |
---|
1016 | values=[_(u'birth'), _(u'naturalization'), _(u'marriage')], |
---|
1017 | title = _(u'Nationality acquired by'), |
---|
1018 | required = False, |
---|
1019 | ) |
---|
1020 | |
---|
1021 | lga = schema.Choice( |
---|
1022 | source = LGASource(), |
---|
1023 | title = _(u'State / LGA'), |
---|
1024 | required = False, |
---|
1025 | ) |
---|
1026 | |
---|
1027 | office_address = schema.Text( |
---|
1028 | title = _(u'Offices or Business Address'), |
---|
1029 | required = False, |
---|
1030 | ) |
---|
1031 | |
---|
1032 | home_address = schema.Text( |
---|
1033 | title = _(u'Permanent Home Address'), |
---|
1034 | required = False, |
---|
1035 | ) |
---|
1036 | |
---|
1037 | schools_attended = schema.Text( |
---|
1038 | title = _(u'Schools Attended'), |
---|
1039 | description = _('Enter:<br />' |
---|
1040 | '(1) name of primary school, period of attendance<br />' |
---|
1041 | '(2) name of secondary school, period of attendance<br />' |
---|
1042 | '(3) name of post-secondary school, period of attendance'), |
---|
1043 | required = False, |
---|
1044 | ) |
---|
1045 | |
---|
1046 | subjects = schema.List( |
---|
1047 | title = _(u'Subjects'), |
---|
1048 | value_type = ResultEntryField(), |
---|
1049 | required = False, |
---|
1050 | readonly = False, |
---|
1051 | default = [], |
---|
1052 | ) |
---|
1053 | |
---|
1054 | referee1_name = schema.TextLine( |
---|
1055 | title = _(u'First Referee Name'), |
---|
1056 | description= _('This referee must be a pharmacist.'), |
---|
1057 | required = False, |
---|
1058 | readonly = False, |
---|
1059 | ) |
---|
1060 | |
---|
1061 | referee1_address = schema.Text( |
---|
1062 | title = _(u'First Referee Address'), |
---|
1063 | required = False, |
---|
1064 | readonly = False, |
---|
1065 | ) |
---|
1066 | |
---|
1067 | referee2_name = schema.TextLine( |
---|
1068 | title = _(u'Second Referee Name'), |
---|
1069 | required = False, |
---|
1070 | readonly = False, |
---|
1071 | ) |
---|
1072 | |
---|
1073 | referee2_address = schema.Text( |
---|
1074 | title = _(u'Second Referee Address'), |
---|
1075 | required = False, |
---|
1076 | readonly = False, |
---|
1077 | ) |
---|
1078 | |
---|
1079 | |
---|
1080 | class IRPTContractOfficialUse(IIkobaObject): |
---|
1081 | """Interface for editing RPT official use data. |
---|
1082 | |
---|
1083 | """ |
---|
1084 | |
---|
1085 | comment = schema.Text( |
---|
1086 | title= _('Reason for rejection'), |
---|
1087 | required = False, |
---|
1088 | ) |
---|
1089 | |
---|
1090 | |
---|
1091 | class IRPTContractProcess(IRPTContract, IRPTContractOfficialUse): |
---|
1092 | """Interface for processing RPT data. |
---|
1093 | """ |
---|
1094 | |
---|
1095 | product_options = schema.List( |
---|
1096 | title = _(u'Options/Fees'), |
---|
1097 | value_type = ProductOptionField(), |
---|
1098 | required = False, |
---|
1099 | readonly = False, |
---|
1100 | default = [], |
---|
1101 | ) |
---|
1102 | |
---|
1103 | class IRPTContractEdit(IRPTContract): |
---|
1104 | """Interface for editing RPT data by customers. |
---|
1105 | |
---|
1106 | """ |
---|
1107 | |
---|
1108 | class IAPPTContract(IContract): |
---|
1109 | """An Annual Permit for Pharmacy Technician contract. |
---|
1110 | |
---|
1111 | """ |
---|
1112 | |
---|
1113 | state_of_origin = schema.Choice( |
---|
1114 | vocabulary = nats_vocab, |
---|
1115 | title = _(u'State of Origin'), |
---|
1116 | required = False, |
---|
1117 | ) |
---|
1118 | |
---|
1119 | lga = schema.Choice( |
---|
1120 | source = LGASource(), |
---|
1121 | title = _(u'State / LGA'), |
---|
1122 | required = False, |
---|
1123 | ) |
---|
1124 | |
---|
1125 | office_address = schema.Text( |
---|
1126 | title = _(u'Offices or Business Address'), |
---|
1127 | required = False, |
---|
1128 | ) |
---|
1129 | |
---|
1130 | employment = schema.Text( |
---|
1131 | title = _('Employment'), |
---|
1132 | description = _('Enter the name and address of where you ' |
---|
1133 | 'was employed last year.'), |
---|
1134 | required = False, |
---|
1135 | ) |
---|
1136 | |
---|
1137 | supervisor = schema.TextLine( |
---|
1138 | title = _(u'Supervisor'), |
---|
1139 | description= _('Who was your supervisor?'), |
---|
1140 | required = False, |
---|
1141 | readonly = False, |
---|
1142 | ) |
---|
1143 | |
---|
1144 | supervisor_licensenumber = schema.TextLine( |
---|
1145 | title = _(u'Supervisor License Number'), |
---|
1146 | required = False, |
---|
1147 | readonly = False, |
---|
1148 | ) |
---|
1149 | |
---|
1150 | reason_leaving = schema.Text( |
---|
1151 | title = _(u'Reason for Leaving'), |
---|
1152 | description= _('Tell the reason for leaving employment last ' |
---|
1153 | 'year (if applicable).'), |
---|
1154 | required = False, |
---|
1155 | readonly = False, |
---|
1156 | ) |
---|
1157 | |
---|
1158 | courses_attended = schema.Text( |
---|
1159 | title = _(u'Courses, Workshops etc. Attended'), |
---|
1160 | required = False, |
---|
1161 | readonly = False, |
---|
1162 | ) |
---|
1163 | |
---|
1164 | |
---|
1165 | class IAPPTContractOfficialUse(IIkobaObject): |
---|
1166 | """Interface for editing APPT official use data. |
---|
1167 | |
---|
1168 | """ |
---|
1169 | |
---|
1170 | comment = schema.Text( |
---|
1171 | title= _('Reason for rejection'), |
---|
1172 | required = False, |
---|
1173 | ) |
---|
1174 | |
---|
1175 | |
---|
1176 | class IAPPTContractProcess(IAPPTContract, IAPPTContractOfficialUse): |
---|
1177 | """Interface for processing APPT data. |
---|
1178 | """ |
---|
1179 | |
---|
1180 | product_options = schema.List( |
---|
1181 | title = _(u'Options/Fees'), |
---|
1182 | value_type = ProductOptionField(), |
---|
1183 | required = False, |
---|
1184 | readonly = False, |
---|
1185 | default = [], |
---|
1186 | ) |
---|
1187 | |
---|
1188 | class IAPPTContractEdit(IAPPTContract): |
---|
1189 | """Interface for editing APPT data by customers. |
---|
1190 | |
---|
1191 | """ |
---|