Subversion Repositories SmartDukaan

Rev

Rev 6237 | Rev 6322 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6237 Rev 6308
Line 19... Line 19...
19
logging.basicConfig(level=logging.DEBUG)
19
logging.basicConfig(level=logging.DEBUG)
20
 
20
 
21
warehouse_allocation_cache = {}
21
warehouse_allocation_cache = {}
22
serviceable_location_cache = {}
22
serviceable_location_cache = {}
23
delivery_estimate_cache = {}
23
delivery_estimate_cache = {}
-
 
24
'''
24
ncr_pincodes = ['110001','110002','110003','110004','110005','110006','110007','110008','110009','110010','110011','110012','110013','110014','110015',\
25
ncr_pincodes = ['110001','110002','110003','110004','110005','110006','110007','110008','110009','110010','110011','110012','110013','110014','110015',\
25
                '110016','110017','110018','110019','110020','110021','110022','110023','110024','110025','110026','110027','110028','110029','110030',\
26
                '110016','110017','110018','110019','110020','110021','110022','110023','110024','110025','110026','110027','110028','110029','110030',\
26
                '110031','110032','110033','110034','110035','110037','110038','110041','110042','110044','110045','110046','110047','110048','110049',\
27
                '110031','110032','110033','110034','110035','110037','110038','110041','110042','110044','110045','110046','110047','110048','110049',\
27
                '110051','110052','110053','110054','110055','110056','110057','110058','110059','110060','110061','110062','110063','110064','110065',\
28
                '110051','110052','110053','110054','110055','110056','110057','110058','110059','110060','110061','110062','110063','110064','110065',\
28
                '110066','110067','110068','110070','110071','110074','110075','110076','110078','110081','110082','110083','110084','110085','110086',\
29
                '110066','110067','110068','110070','110071','110074','110075','110076','110078','110081','110082','110083','110084','110085','110086',\
Line 31... Line 32...
31
                '110301','110302','110501','110502','110503','110504','110505','110510','110511','110512','110601','110602','110603','110604','110605',\
32
                '110301','110302','110501','110502','110503','110504','110505','110510','110511','110512','110601','110602','110603','110604','110605',\
32
                '110606','110607','110608','110609','121001','121002','121003','121004','121005','121006','121007','121008','121009','122001','122002',\
33
                '110606','110607','110608','110609','121001','121002','121003','121004','121005','121006','121007','121008','121009','122001','122002',\
33
                '122003','122005','122006','122008','122009','122010','122015','122017','201010','201011','201012','201014','201301','201302','201303',\
34
                '122003','122005','122006','122008','122009','122010','122015','122017','201010','201011','201012','201014','201301','201302','201303',\
34
                '201304','201305','201306','201307','201309','201310','201311']
35
                '201304','201305','201306','201307','201309','201310','201311']
35
'''
36
'''
-
 
37
'''
-
 
38
Only delhi pincodes for time being
-
 
39
'''
-
 
40
ncr_pincodes = ['110001','110002','110003','110004','110005','110006','110007','110008','110009','110010','110011','110012','110013','110014','110015','110016',\
-
 
41
                '110017','110018','110019','110020','110021','110022','110023','110024','110025','110026','110027','110028','110029','110030','110031','110032',\
-
 
42
                '110033','110034','110035','110037','110038','110041','110042','110044','110045','110046','110047','110048','110049','110051','110052','110053',\
-
 
43
                '110054','110055','110056','110057','110058','110059','110060','110061','110062','110063','110064','110065','110066','110067','110068','110070',\
-
 
44
                '110071','110074','110075','110076','110078','110081','110082','110083','110084','110085','110086','110087','110088','110089','110091','110092',\
-
 
45
                '110093','110094','110095','110096','110101','110103','110104','110105','110106','110107','110108','110109','110110','110112','110113','110114',\
-
 
46
                '110115','110116','110117','110118','110119','110120','110122','110124','110125','110301','110302','110501','110502','110503','110504','110505',\
-
 
47
                '110510','110511','110512','110601','110602','110603','110604','110605','110606','110607','110608','110609']
-
 
48
'''
36
This class is for only data transfer. Never used outside this module.
49
This class is for only data transfer. Never used outside this module.
37
'''
50
'''
38
class _DeliveryEstimateObject:
51
class _DeliveryEstimateObject:
39
    def __init__(self, delivery_time, reliability, provider_id, codAllowed):
52
    def __init__(self, delivery_time, reliability, provider_id, codAllowed):
40
        self.delivery_time = delivery_time
53
        self.delivery_time = delivery_time
Line 98... Line 111...
98
        raise LogisticsServiceException(103, "No Logistics partner listed for this destination pincode and the primary warehouse")
111
        raise LogisticsServiceException(103, "No Logistics partner listed for this destination pincode and the primary warehouse")
99
 
112
 
100
def __get_logistics_provider_for_destination_pincode(type, destination_pin, item_selling_price):
113
def __get_logistics_provider_for_destination_pincode(type, destination_pin, item_selling_price):
101
    if ncr_pincodes.__contains__(destination_pin) and item_selling_price <= 20000:
114
    if ncr_pincodes.__contains__(destination_pin) and item_selling_price <= 20000:
102
        return 3, True
115
        return 3, True
-
 
116
    
-
 
117
    
-
 
118
    '''
-
 
119
    Removed this code for time being
103
    if serviceable_location_cache.get(3).has_key(destination_pin):
120
    if serviceable_location_cache.get(3).has_key(destination_pin):
104
        dest_code, exp, iscod, station_type = serviceable_location_cache.get(3).get(destination_pin)
121
        dest_code, exp, iscod, station_type = serviceable_location_cache.get(3).get(destination_pin)
105
        iscod = iscod and item_selling_price <= 9600
122
        iscod = iscod and item_selling_price <= 9600
106
        return 3, iscod
123
        return 3, iscod
-
 
124
    '''
107
    if serviceable_location_cache.get(1).has_key(destination_pin):
125
    if serviceable_location_cache.get(1).has_key(destination_pin):
108
        dest_code, exp, iscod, station_type = serviceable_location_cache.get(1).get(destination_pin)
126
        dest_code, exp, iscod, station_type = serviceable_location_cache.get(1).get(destination_pin)
109
        iscod = iscod and item_selling_price <= 9600
127
        iscod = iscod and item_selling_price <= 9600
110
        return 1, iscod
128
        return 1, iscod
111
    else:
129
    else: