source: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/utils/utils.py @ 12604

Last change on this file since 12604 was 12604, checked in by Henrik Bettermann, 10 years ago

Add Renewal of Patent and Proprietary Medicines Vendors License.

  • Property svn:keywords set to Id
File size: 3.3 KB
Line 
1## $Id: utils.py 12604 2015-02-12 09:56:13Z henrik $
2##
3## Copyright (C) 2012 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"""Customize general helper utilities for Ikoba.
19"""
20import pytz
21from waeup.ikoba.utils.utils import IkobaUtils, sorted_phone_prefixes
22from ikobacustom.pcn.interfaces import MessageFactory as _
23
24INT_PHONE_PREFIXES = [
25    (1, _('Nigeria'), '234'),
26    (99, _('Germany'), '49'),
27    (99, _('United States'), '1'),
28    (99, _('Niger'), '227'),
29    (99, _('Benin'), '229'),
30    (99, _('Cameroon'), '237'),
31    (99, _('United Kingdom'), '44'),
32    (99, _('France'), '33'),
33    ]
34
35class PCNIkobaUtils(IkobaUtils):
36    """A collection of methods subject to customization.
37    """
38    PORTAL_LANGUAGE = 'en'
39
40    # CURRENCIES must be equal to or an excerpt of ISO_4217_CURRENCIES
41    CURRENCIES = {
42        'EUR': ('EUROPE', _('Euro'), 2, '978'),
43        'USD': ('U.S.', _('US Dollar'), 2, '840'),
44        'NGN': ('NIGERIA', _('Naira'), 2, '566'),
45        }
46
47    CON_CATS_DICT = {
48        'ron': 'Retention of Name',
49        'rop': 'Registration of Premises',
50        'rpr': 'Registration in the Provisional Register',
51        'rpc': 'Registration as Pharmaceutical Chemist',
52        'ippmvl': 'Issuance of Patent and Proprietary Medicines Vendors License',
53        'rppmvl': 'Renewal of Patent and Proprietary Medicines Vendors License',
54        'no': 'no license',
55        }
56
57    PREFERRED_LANGUAGES_DICT = {
58        'en':(1, u'English'),
59        'fr':(2, u'Français'),
60        'de':(3, u'Deutsch'),
61        'ha':(4, u'Hausa'),
62        'yo':(5, u'Yoruba'),
63        'ig':(6, u'Igbo'),
64        }
65
66    EXPORTER_NAMES = (
67        'pdfdocuments',
68        'htmldocuments',
69        'restdocuments',
70        'users',
71        'products',
72        'customers',
73        'pcncustomerjpgdocuments',
74        'pcncustomerpdfdocuments',
75        'roncontracts',
76        'ropcontracts',
77        'rprcontracts',
78        'rpccontracts',
79        'ippmvlcontracts',
80        'rppmvlcontracts')
81
82    BATCH_PROCESSOR_NAMES = (
83        'pcncustomerprocessor',
84        'pcncustomerjpgdocumentprocessor',
85        'pcncustomerpdfdocumentprocessor',
86        'roncontractprocessor',
87        'ropcontractprocessor',
88        'rprcontractprocessor',
89        'rpccontractprocessor',
90        'ippmvlcontractprocessor',
91        'rppmvlcontractprocessor',
92        'pcnproductprocessor',
93        'pdfdocumentprocessor',
94        'htmldocumentprocessor',
95        'restdocumentprocessor',
96        'userprocessor')
97
98    #: A function to return
99    @classmethod
100    def sorted_phone_prefixes(cls, data=INT_PHONE_PREFIXES, request=None):
101        return sorted_phone_prefixes(data, request)
102
103    @property
104    def tzinfo(self):
105        return pytz.timezone('Africa/Lagos')
Note: See TracBrowser for help on using the repository browser.