Subversion Repositories SmartDukaan

Rev

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

Rev 23132 Rev 23135
Line 42... Line 42...
42
location_state={}
42
location_state={}
43
 
43
 
44
'Delhivery Bluedart, Fedex Surface, Fedex Air'
44
'Delhivery Bluedart, Fedex Surface, Fedex Air'
45
state_locations = {}
45
state_locations = {}
46
provider_costing_sheet = {}
46
provider_costing_sheet = {}
-
 
47
 
-
 
48
 
47
DELHIVERY = 3
49
DELHIVERY = 3
48
 
50
 
-
 
51
RQUICK = 47
-
 
52
ARAMEX = 2
-
 
53
ECOMEXPRESS = 49
-
 
54
PROVIDER_PRIORITY = [RQUICK, ARAMEX, ECOMEXPRESS]
-
 
55
 
49
#pincode location map is ab
56
#pincode location map is ab
50
#{'110001':{1:{"sameState":False, "providerInfo":{1:(1,1), 2:(1,1)}}},}
57
#{'110001':{1:{"sameState":False, "providerInfo":{1:(1,1), 2:(1,1)}}},}
51
pincode_locations = {}
58
pincode_locations = {}
52
#{(dest_pin, provider):(otgAvailable,providerCodLimit, websiteCodLimit, storeCodLimit, providerPrepaidLimit)} 
59
#{(dest_pin, provider):(otgAvailable,providerCodLimit, websiteCodLimit, storeCodLimit, providerPrepaidLimit)} 
53
serviceable_map = {}
60
serviceable_map = {}
Line 277... Line 284...
277
            return None, False
284
            return None, False
278
            
285
            
279
        
286
        
280
 
287
 
281
def __get_logistics_provider_for_destination_pincode(destination_pin, item_selling_price, weight, type, billingWarehouseId):
288
def __get_logistics_provider_for_destination_pincode(destination_pin, item_selling_price, weight, type, billingWarehouseId):
282
    #As of now we are dealing with Aramex and RQucikExpress. i.e. 2 and 47 and we have just one location i.e. gurgaon will generailise this 
-
 
283
    #Once bandwidth is available these things will be derived through improved logic.
-
 
284
    #As of now otg is set to False, Use rquick if it is serviceable else use aramex
-
 
285
    otg=False
289
    otg=False
286
    PRIMARY_PROVIDER = 47
-
 
287
    SECONDARY_PROVIDER = 2
-
 
288
    TERTIARY_PROVIDER = 49
-
 
289
    providerList = [PRIMARY_PROVIDER, SECONDARY_PROVIDER, TERTIARY_PROVIDER]
290
    providerList = list(PROVIDER_PRIORITY)
290
    a, b = __get_provider(providerList,destination_pin, item_selling_price, weight, type, billingWarehouseId)
291
    provider_id, isCod = __get_provider(providerList, destination_pin, item_selling_price, weight, type, billingWarehouseId)
291
    print "a", a 
292
    print "provider_id", provider_id 
292
    return a, b, otg
293
    return provider_id, isCod, otg
293
    
294
    
294
 
295
 
295
def __getStateByPin(destination_pin):
296
def __getStateByPin(destination_pin):
296
    pinCodeState = PincodeStates.get_by(pin=destination_pin)
297
    pinCodeState = PincodeStates.get_by(pin=destination_pin)
297
    if pinCodeState is not None:
298
    if pinCodeState is not None:
Line 700... Line 701...
700
    print pincode, transactionAmount, isCod, weight, billingWarehouseId
701
    print pincode, transactionAmount, isCod, weight, billingWarehouseId
701
    deliveryEstimate = {}
702
    deliveryEstimate = {}
702
    logsiticsCosting = {}
703
    logsiticsCosting = {}
703
    providerCostingMap = {}
704
    providerCostingMap = {}
704
    serviceability = {}
705
    serviceability = {}
705
    
706
    providerList = list(PROVIDER_PRIORITY)
-
 
707
    #for now this part is disabled and only the same logistics partner is used as priority
-
 
708
    providerIds = [__get_provider(providerList, pincode, transactionAmount, weight, type, billingWarehouseId)]
706
    for providerId in serviceable_location_cache.keys():
709
    #for providerId in serviceable_location_cache.keys():
-
 
710
    for providerId in providerIds:
707
        if serviceable_location_cache.has_key(providerId) and serviceable_location_cache.get(providerId).has_key(pincode):
711
        if serviceable_location_cache.has_key(providerId) and serviceable_location_cache.get(providerId).has_key(pincode):
708
            dest_code, exp, iscod, otgAvailable, websiteCodLimit, storeCodLimit, providerPrepaidLimit, providerCodLimit = serviceable_location_cache.get(providerId).get(pincode)
712
            dest_code, exp, iscod, otgAvailable, websiteCodLimit, storeCodLimit, providerPrepaidLimit, providerCodLimit = serviceable_location_cache.get(providerId).get(pincode)
709
            if isCod and iscod:
713
            if isCod and iscod:
710
                if not isCompleteTxn:
714
                if not isCompleteTxn:
711
                    if transactionAmount <= providerCodLimit:
715
                    if transactionAmount <= providerCodLimit: