Changeset 12611 for main/ikobacustom.pcn
- Timestamp:
- 13 Feb 2015, 10:15:44 (10 years ago)
- 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 31 31 IRPCContract, 32 32 IIPPMVLContract, 33 IRPPMVLContract) 33 IRPPMVLContract, 34 IAPPITContract 35 ) 34 36 from ikobacustom.pcn.interfaces import MessageFactory as _ 35 37 … … 115 117 iface = IRPPMVLContract 116 118 factory_name = 'waeup.RPPMVLContract' 119 120 class 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 23 23 PDFContractSlipPage, CustomerBaseEditFormPage) 24 24 from ikobacustom.pcn.interfaces import MessageFactory as _ 25 from ikobacustom.pcn.customers.interfaces import IRPCContract 25 from ikobacustom.pcn.customers.interfaces import IRPCContract, IAPPITContract 26 26 27 27 class PDFContractSlipPage(PDFContractSlipPage): … … 51 51 ) 52 52 53 class 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 53 64 class CustomerBaseEditFormPage(CustomerBaseEditFormPage): 54 65 """ View to edit customer base data -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/contracts.py
r12604 r12611 52 52 IRPPMVLContractProcess, 53 53 IRPPMVLContractOfficialUse, 54 IAPPITContract, 55 IAPPITContractEdit, 56 IAPPITContractProcess, 57 IAPPITContractOfficialUse, 54 58 ) 55 59 … … 244 248 return implementedBy(IPPMVLContract) 245 249 250 246 251 class RPPMVLContract(ContractBase): 247 252 """Renewal of Patent and Proprietary Medicines Vendors License contract. … … 281 286 return implementedBy(RPPMVLContract) 282 287 288 289 class 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 309 APPITContract = attrs_to_fields(APPITContract) 310 311 312 class 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 29 29 IRPCContractProcess, 30 30 IIPPMVLContractProcess, 31 IRPPMVLContractProcess) 31 IRPPMVLContractProcess, 32 IAPPITContractProcess) 32 33 from ikobacustom.pcn.interfaces import MessageFactory as _ 33 34 … … 104 105 title = _(u'Renewal of Patent and Proprietary Medicines Vendors Licenses') 105 106 class_name = 'RPPMVLContract' 107 108 class 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 47 47 'manufacturing', 48 48 'retail and dispensing', 49 'research and training', 50 'hospital practice', 49 51 'wholesale', 50 52 ] … … 110 112 ) 111 113 112 work_email = schema. ASCIILine(114 work_email = schema.TextLine( 113 115 title = _(u'Work Email Address'), 114 116 required = False, … … 563 565 ) 564 566 567 occupation = schema.TextLine( 568 title = _(u'Occupation'), 569 required = False, 570 readonly = False, 571 ) 572 565 573 qualifications = schema.Text( 566 574 title = _(u'Educational Qualifications'), … … 600 608 ) 601 609 602 shop_email = schema. ASCIILine(610 shop_email = schema.TextLine( 603 611 title = _(u'Shop Email Address'), 604 612 required = False, … … 736 744 ) 737 745 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 738 759 shop_address = schema.Text( 739 760 title = _(u'Patent Vendor\'s Shop'), … … 742 763 ) 743 764 765 ppmv_signpost = schema.TextLine( 766 title = _(u'PPMV Sign-post Number'), 767 required = False, 768 readonly = False, 769 ) 770 744 771 shop_lga = schema.Choice( 745 772 source = LGASource(), … … 748 775 ) 749 776 750 shop_email = schema. ASCIILine(777 shop_email = schema.TextLine( 751 778 title = _(u'Shop Email Address'), 752 779 required = False, … … 843 870 844 871 """ 872 873 class 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 988 class 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 999 class 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 1011 class 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 36 36 IPPMVLContract, 37 37 RPPMVLContract, 38 APPITContract, 38 39 ) 39 40 from ikobacustom.pcn.customers.interfaces import ( … … 44 45 IIPPMVLContract, 45 46 IRPPMVLContract, 47 IAPPITContract, 46 48 ) 47 49 … … 64 66 verify.verifyObject(IIPPMVLContract, IPPMVLContract()) 65 67 verify.verifyObject(ICustomerNavigation, IPPMVLContract()) 68 verify.verifyObject(IAPPITContract, APPITContract()) 69 verify.verifyObject(ICustomerNavigation, APPITContract()) 66 70 return 67 71 … … 104 108 self.assertEqual(container[id6], contract6) 105 109 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') 106 116 return -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/utils.py
r12604 r12611 62 62 'RPPMVLContract': _( 63 63 'Renewal of Patent and Proprietary Medicines Vendors License'), 64 'APPITContract': _( 65 'Accepting Pupil Pharmacist for Internship Training'), 64 66 } 67 68 69 65 70 66 71 SELECTABLE_DOCTYPES_DICT = deepcopy(DOCTYPES_DICT) … … 77 82 'rpccontracts', 78 83 'ippmvlcontracts', 79 'rppmvlcontracts') 84 'rppmvlcontracts', 85 'appitcontracts') -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/utils/utils.py
r12604 r12611 52 52 'ippmvl': 'Issuance of Patent and Proprietary Medicines Vendors License', 53 53 'rppmvl': 'Renewal of Patent and Proprietary Medicines Vendors License', 54 'appit': 'Accepting Pupil Pharmacist for Internship Training', 54 55 'no': 'no license', 55 56 } … … 78 79 'rpccontracts', 79 80 'ippmvlcontracts', 80 'rppmvlcontracts') 81 'rppmvlcontracts', 82 'appitcontracts') 81 83 82 84 BATCH_PROCESSOR_NAMES = ( … … 90 92 'ippmvlcontractprocessor', 91 93 'rppmvlcontractprocessor', 94 'appitcontractprocessor' 92 95 'pcnproductprocessor', 93 96 'pdfdocumentprocessor',
Note: See TracChangeset for help on using the changeset viewer.