Subversion Repositories SmartDukaan

Rev

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

Rev 22031 Rev 22147
Line 122... Line 122...
122
        =delivery_estimate.delivery_time, delivery_estimate.delivery_delay, delivery_estimate.providerZoneCode
122
        =delivery_estimate.delivery_time, delivery_estimate.delivery_delay, delivery_estimate.providerZoneCode
123
 
123
 
124
def __cache_serviceable_location_details_table():
124
def __cache_serviceable_location_details_table():
125
    serviceable_locations = ServiceableLocationDetails.query.filter(or_("exp!=0","cod!=0"))
125
    serviceable_locations = ServiceableLocationDetails.query.filter(or_("exp!=0","cod!=0"))
126
    for serviceable_location in serviceable_locations:
126
    for serviceable_location in serviceable_locations:
-
 
127
        #Bluedart is temporarily not serviceable
-
 
128
        if serviceable_location.provider_id==1:
-
 
129
            continue
127
        try:
130
        try:
128
            provider_pincodes = serviceable_location_cache[serviceable_location.provider_id]
131
            provider_pincodes = serviceable_location_cache[serviceable_location.provider_id]
129
        except:
132
        except:
130
            provider_pincodes = {}
133
            provider_pincodes = {}
131
            serviceable_location_cache[serviceable_location.provider_id] = provider_pincodes 
134
            serviceable_location_cache[serviceable_location.provider_id] = provider_pincodes 
Line 244... Line 247...
244
    #As of now we are dealing with Aramex and Bluedart. i.e. 1 and 2 and we have just one location i.e. gurgaon will generailise this 
247
    #As of now we are dealing with Aramex and Bluedart. i.e. 1 and 2 and we have just one location i.e. gurgaon will generailise this 
245
    #Once bandwidth is available these things will be derived through improved logic.
248
    #Once bandwidth is available these things will be derived through improved logic.
246
    #As of now otg is set to False
249
    #As of now otg is set to False
247
    otg=False
250
    otg=False
248
    aramexServiceable = serviceable_location_cache.has_key(2) and serviceable_location_cache.get(2).has_key(destination_pin)
251
    aramexServiceable = serviceable_location_cache.has_key(2) and serviceable_location_cache.get(2).has_key(destination_pin)
249
    #blueDartServiceable =  serviceable_location_cache.has_key(1) and serviceable_location_cache.get(1).has_key(destination_pin)
252
    blueDartServiceable =  serviceable_location_cache.has_key(1) and serviceable_location_cache.get(1).has_key(destination_pin)
250
    #Bluedart is temporarily not serviceable
253
    
251
    blueDartServiceable =  False
254
    #blueDartServiceable =  False
252
    if blueDartServiceable and aramexServiceable:
255
    if blueDartServiceable and aramexServiceable:
253
        state = __getStateByPin(destination_pin)
256
        state = __getStateByPin(destination_pin)
254
        if state is None:
257
        if state is None:
255
            state = 'DELHI'
258
            state = 'DELHI'
256
        #Prioritise Bluedart in Gujarat and Rajasthan
259
        #Prioritise Bluedart in Gujarat and Rajasthan