Subversion Repositories SmartDukaan

Rev

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

Rev 6524 Rev 6527
Line 20... Line 20...
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
 
25
ncr_pincodes = ['110001','110002','110003','110004','110005','110006','110007','110008','110009','110010','110011','110012','110013','110014','110015',\
-
 
26
                '110016','110017','110018','110019','110020','110021','110022','110023','110024','110025','110026','110027','110028','110029','110030',\
-
 
27
                '110031','110032','110033','110034','110035','110037','110038','110041','110042','110044','110045','110046','110047','110048','110049',\
-
 
28
                '110051','110052','110053','110054','110055','110056','110057','110058','110059','110060','110061','110062','110063','110064','110065',\
-
 
29
                '110066','110067','110068','110070','110071','110074','110075','110076','110078','110081','110082','110083','110084','110085','110086',\
-
 
30
                '110087','110088','110089','110091','110092','110093','110094','110095','110096','110101','110103','110104','110105','110106','110107',\
-
 
31
                '110108','110109','110110','110112','110113','110114','110115','110116','110117','110118','110119','110120','110122','110124','110125',\
-
 
32
                '110301','110302','110501','110502','110503','110504','110505','110510','110511','110512','110601','110602','110603','110604','110605',\
-
 
33
                '110606','110607','110608','110609','121001','121002','121003','121004','121005','121006','121007','121008','121009','122001','122002',\
-
 
34
                '122003','122005','122006','122008','122009','122010','122015','122017','201001','201002','201003','201004','201005','201006','201007',\
-
 
35
                '201008','201009','201010','201011','201012','201014','201301','201302','201303','201304','201305','201306','201307','201309','201310',\
-
 
36
                '201311']
-
 
37
 
-
 
38
'''
25
'''
39
This class is for only data transfer. Never used outside this module.
26
This class is for only data transfer. Never used outside this module.
40
'''
27
'''
41
class _DeliveryEstimateObject:
28
class _DeliveryEstimateObject:
42
    def __init__(self, delivery_time, reliability, provider_id, codAllowed, otgAvailable):
29
    def __init__(self, delivery_time, reliability, provider_id, codAllowed, otgAvailable):
Line 100... Line 87...
100
    except Exception as ex:
87
    except Exception as ex:
101
        print ex
88
        print ex
102
        raise LogisticsServiceException(103, "No Logistics partner listed for this destination pincode and the primary warehouse")
89
        raise LogisticsServiceException(103, "No Logistics partner listed for this destination pincode and the primary warehouse")
103
 
90
 
104
def __get_logistics_provider_for_destination_pincode(destination_pin, item_selling_price):
91
def __get_logistics_provider_for_destination_pincode(destination_pin, item_selling_price):
105
    if ncr_pincodes.__contains__(destination_pin) and item_selling_price <= 20000:
-
 
106
        dest_code, exp, iscod, otgAvailable = serviceable_location_cache.get(3).get(destination_pin)
-
 
107
        otgAvailable = otgAvailable and item_selling_price >= 2000
-
 
108
        return 3, True, otgAvailable
-
 
109
    
-
 
110
    if serviceable_location_cache.get(3).has_key(destination_pin):
92
    if serviceable_location_cache.get(3).has_key(destination_pin):
111
        dest_code, exp, iscod, otgAvailable = serviceable_location_cache.get(3).get(destination_pin)
93
        dest_code, exp, iscod, otgAvailable = serviceable_location_cache.get(3).get(destination_pin)
112
        iscod = iscod and item_selling_price <= 9600
94
        iscod = iscod and item_selling_price <= 25000
113
        otgAvailable = otgAvailable and item_selling_price >= 2000
95
        otgAvailable = otgAvailable and item_selling_price >= 2000
114
        return 3, iscod, otgAvailable
96
        return 3, iscod, otgAvailable
115
    
97
    
116
    if serviceable_location_cache.get(1).has_key(destination_pin):
98
    if serviceable_location_cache.get(1).has_key(destination_pin):
117
        dest_code, exp, iscod, otgAvailable = serviceable_location_cache.get(1).get(destination_pin)
99
        dest_code, exp, iscod, otgAvailable = serviceable_location_cache.get(1).get(destination_pin)