- Timestamp:
- 11 Feb 2015, 10:44:28 (10 years ago)
- 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 28 28 IRONContract, 29 29 IROPContract, 30 IRPRContract) 30 IRPRContract, 31 IRPCContract) 31 32 from ikobacustom.pcn.interfaces import MessageFactory as _ 32 33 … … 85 86 iface = IRPRContract 86 87 factory_name = 'waeup.RPRContract' 88 89 class 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 40 40 IRPRContractProcess, 41 41 IRPRContractOfficialUse, 42 IRPCContract, 43 IRPCContractEdit, 44 IRPCContractProcess, 45 IRPCContractOfficialUse, 42 46 ) 43 47 … … 155 159 def getInterfaces(self): 156 160 return implementedBy(RPRContract) 161 162 163 class 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 183 RPCContract = attrs_to_fields(RPCContract) 184 185 186 class 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 26 26 IRONContractProcess, 27 27 IROPContractProcess, 28 IRPRContractProcess) 28 IRPRContractProcess, 29 IRPCContractProcess) 29 30 from ikobacustom.pcn.interfaces import MessageFactory as _ 30 31 … … 77 78 title = _(u'Registration in the Provisional Register Contracts') 78 79 class_name = 'RPRContract' 80 81 class 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 375 375 376 376 class IRPRContractOfficialUse(IIkobaObject): 377 """Interface for editing R ONofficial use data.377 """Interface for editing RPR official use data. 378 378 379 379 """ … … 386 386 387 387 class IRPRContractProcess(IRPRContract, IRPRContractOfficialUse): 388 """Interface for processing R ONdata.388 """Interface for processing RPR data. 389 389 """ 390 390 … … 398 398 399 399 class IRPRContractEdit(IRPRContract): 400 """Interface for editing R ONdata by customers.400 """Interface for editing RPR data by customers. 401 401 402 402 """ … … 413 413 IRPRContractEdit['certificates_object'].order = IRPRContract[ 414 414 'certificates_object'].order 415 416 417 class 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 503 class 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 514 class 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 526 class 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 540 IRPCContractEdit['certificates_object'].order = IRPCContract[ 541 'certificates_object'].order -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_browser.py
r12558 r12591 475 475 # First we add a submitted document and a product. 476 476 IWorkflowState(self.document).setState('submitted') 477 self.contract.title = u'Contract Title' 477 478 self.contract.document_object = self.document 478 479 self.contract.product_object = self.product -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_contract.py
r12571 r12591 33 33 ROPContract, 34 34 RPRContract, 35 RPCContract, 35 36 ) 36 37 from ikobacustom.pcn.customers.interfaces import ( … … 38 39 IROPContract, 39 40 IRPRContract, 41 IRPCContract, 40 42 ) 41 43 … … 54 56 verify.verifyObject(IRPRContract, RPRContract()) 55 57 verify.verifyObject(ICustomerNavigation, RPRContract()) 58 verify.verifyObject(IRPCContract, RPCContract()) 59 verify.verifyObject(ICustomerNavigation, RPCContract()) 56 60 return 57 61 … … 76 80 self.assertEqual(container[id3], contract3) 77 81 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') 78 88 return -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/utils.py
r12571 r12591 57 57 'ROPContract': _('Registration of Premises'), 58 58 'RPRContract': _('Registration in the Provisional Register'), 59 'RPCContract': _('Registration as Pharmaceutical Chemist'), 59 60 } 60 61 … … 69 70 'roncontracts', 70 71 'ropcontracts', 71 'rprcontracts') 72 'rprcontracts', 73 'rpccontracts')
Note: See TracChangeset for help on using the changeset viewer.