Subversion Repositories SmartDukaan

Rev

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

Rev 4866 Rev 5243
Line 19... Line 19...
19
 
19
 
20
warehouse_allocation_cache = {}
20
warehouse_allocation_cache = {}
21
serviceable_location_cache = {}
21
serviceable_location_cache = {}
22
delivery_estimate_cache = {}
22
delivery_estimate_cache = {}
23
destination_provider_allocation_cache = {}
23
destination_provider_allocation_cache = {}
24
ncr_pincodes = ['110001','110002','110003','110004','110005','110006','110007','110008','110009','110010','110011','110012','110013','110014','110015', \
24
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', \
25
                '110016','110017','110018','110019','110020','110021','110022','110023','110024','110025','110026','110027','110028','110029','110030',\
26
                '110031','110032','110033','110034','110035','110036','110037','110038','110039','110040','110041','110042','110043','110044','110045', \
26
                '110031','110032','110033','110034','110035','110038','110041','110044','110045','110046','110047','110048','110049','110051','110052',\
27
                '110046','110047','110048','110049','110050','110051','110052','110053','110054','110055','110056','110057','110058','110059','110060', \
27
                '110053','110054','110055','110056','110057','110058','110059','110060','110061','110062','110063','110064','110065','110066','110067',\
28
                '110061','110062','110063','110064','110065','110066','110067','110068','110069','110070','110071','110072','110073','110074','110075', \
28
                '110068','110070','110071','110074','110075','110076','110078','110081','110082','110083','110084','110085','110086','110087','110088',\
29
                '110076','110077','110078','110081','110082','110083','110084','110085','110086','110087','110088','110089','110091','110092','110093', \
29
                '110089','110091','110092','110093','110094','110095','110096','110101','110103','110104','110105','110106','110107','110108','110109',\
30
                '110094','110095','110096','121001','121002','121003','121004','121005','121006','121007','121008','121009','122001','122002','122003', \
30
                '110110','110112','110113','110114','110115','110116','110117','110118','110119','110120','110122','110124','110125','110301','110302',\
31
                '122004','122005','122006','122007','122008','122009','122010','122011','122012','122015','122016','122017','122018','122050','122051', \
31
                '110501','110502','110503','110504','110505','110510','110511','110512','110601','110602','110603','110604','110605','110606','110607',\
32
                '201001','201002','201003','201004','201005','201006','201007','201008','201009','201010','201011','201012','201301','201303','201304', \
32
                '110608','110609','122001','122002','122003','122005','122006','122008','122009','122010','122015','122017','201010','201011','201012',\
33
                '201305','201306','201307']
-
 
34
ludhiyana_pincodes  = ['141001','141002','141003','141004','141005','141006','141007','141008','141009','141010','141011','141012','141013','141014']
33
                '201014','201301','201302','201303','201304','201305','201306','201307','201309','201310','201311']
35
 
34
 
36
'''
35
'''
37
This class is for only data transfer. Never used outside this module.
36
This class is for only data transfer. Never used outside this module.
38
'''
37
'''
39
class _DeliveryEstimateObject:
38
class _DeliveryEstimateObject:
Line 113... Line 112...
113
        raise LogisticsServiceException(103, "No Logistics partner listed for this destination pincode and the primary warehouse")
112
        raise LogisticsServiceException(103, "No Logistics partner listed for this destination pincode and the primary warehouse")
114
 
113
 
115
def __get_logistics_provider_for_destination_pincode(type, destination_pin, item_selling_price):
114
def __get_logistics_provider_for_destination_pincode(type, destination_pin, item_selling_price):
116
    if ncr_pincodes.__contains__(destination_pin):
115
    if ncr_pincodes.__contains__(destination_pin):
117
        if item_selling_price <= 20000:
116
        if item_selling_price <= 20000:
118
            return 2, True
117
            return 3, True
119
    if ludhiyana_pincodes.__contains__(destination_pin):
-
 
120
        if item_selling_price <= 10000:
-
 
121
            return 2, True
-
 
122
    if serviceable_location_cache.get(1).has_key(destination_pin):
118
    if serviceable_location_cache.get(1).has_key(destination_pin):
123
        dest_code, exp, iscod, station_type = serviceable_location_cache.get(1).get(destination_pin)
119
        dest_code, exp, iscod, station_type = serviceable_location_cache.get(1).get(destination_pin)
124
        iscod = iscod and item_selling_price <= 10000
120
        iscod = iscod and item_selling_price <= 10000
125
        return 1, iscod
121
        return 1, iscod
126
    else:
122
    else: