Subversion Repositories SmartDukaan

Rev

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

Rev 7870 Rev 7900
Line 91... Line 91...
91
    except Exception as ex:
91
    except Exception as ex:
92
        print ex
92
        print ex
93
        raise LogisticsServiceException(103, "No Logistics partner listed for this destination pincode and the primary warehouse")
93
        raise LogisticsServiceException(103, "No Logistics partner listed for this destination pincode and the primary warehouse")
94
 
94
 
95
def __get_logistics_provider_for_destination_pincode(destination_pin, item_selling_price, weight, type, billingWarehouseId):
95
def __get_logistics_provider_for_destination_pincode(destination_pin, item_selling_price, weight, type, billingWarehouseId):
-
 
96
#    if billingWarehouseId not in [12,13] and serviceable_location_cache.get(6).has_key(destination_pin):
-
 
97
#        if weight < 480 and serviceable_location_cache.get(3).has_key(destination_pin) and (type == DeliveryType.PREPAID or item_selling_price < 3000):
-
 
98
#            dest_code, exp, iscod, otgAvailable, websiteCodLimit, storeCodLimit, providerPrepaidLimit = serviceable_location_cache.get(3).get(destination_pin)
-
 
99
#            if item_selling_price <= providerPrepaidLimit:
-
 
100
#                iscod = iscod and item_selling_price <= websiteCodLimit
-
 
101
#                otgAvailable = otgAvailable and item_selling_price >= 2000
-
 
102
#                return 3, iscod, otgAvailable
-
 
103
#        else:
-
 
104
#            dest_code, exp, iscod, otgAvailable, websiteCodLimit, storeCodLimit, providerPrepaidLimit = serviceable_location_cache.get(6).get(destination_pin)
-
 
105
#            if item_selling_price <= providerPrepaidLimit:
-
 
106
#                iscod = iscod and item_selling_price <= websiteCodLimit
-
 
107
#                otgAvailable = otgAvailable and item_selling_price >= 2000
-
 
108
#                return 6, iscod, otgAvailable
-
 
109
#            
-
 
110
#    if serviceable_location_cache.get(3).has_key(destination_pin):
-
 
111
#        dest_code, exp, iscod, otgAvailable, websiteCodLimit, storeCodLimit, providerPrepaidLimit = serviceable_location_cache.get(3).get(destination_pin)
-
 
112
#        if item_selling_price <= providerPrepaidLimit:
-
 
113
#            iscod = iscod and item_selling_price <= websiteCodLimit
-
 
114
#            otgAvailable = otgAvailable and item_selling_price >= 2000
-
 
115
#            return 3, iscod, otgAvailable
-
 
116
 
96
    if billingWarehouseId not in [12,13] and serviceable_location_cache.get(6).has_key(destination_pin):
117
    if billingWarehouseId not in [12,13] and serviceable_location_cache.get(6).has_key(destination_pin):
97
        if weight < 480 and serviceable_location_cache.get(3).has_key(destination_pin) and (type == DeliveryType.PREPAID or item_selling_price < 3000):
-
 
98
            dest_code, exp, iscod, otgAvailable, websiteCodLimit, storeCodLimit, providerPrepaidLimit = serviceable_location_cache.get(3).get(destination_pin)
-
 
99
            if item_selling_price <= providerPrepaidLimit:
-
 
100
                iscod = iscod and item_selling_price <= websiteCodLimit
-
 
101
                otgAvailable = otgAvailable and item_selling_price >= 2000
-
 
102
                return 3, iscod, otgAvailable
-
 
103
        else:
-
 
104
            dest_code, exp, iscod, otgAvailable, websiteCodLimit, storeCodLimit, providerPrepaidLimit = serviceable_location_cache.get(6).get(destination_pin)
-
 
105
            if item_selling_price <= providerPrepaidLimit:
-
 
106
                iscod = iscod and item_selling_price <= websiteCodLimit
-
 
107
                otgAvailable = otgAvailable and item_selling_price >= 2000
-
 
108
                return 6, iscod, otgAvailable
-
 
109
            
-
 
110
    if serviceable_location_cache.get(3).has_key(destination_pin):
-
 
111
        dest_code, exp, iscod, otgAvailable, websiteCodLimit, storeCodLimit, providerPrepaidLimit = serviceable_location_cache.get(3).get(destination_pin)
118
        dest_code, exp, iscod, otgAvailable, websiteCodLimit, storeCodLimit, providerPrepaidLimit = serviceable_location_cache.get(6).get(destination_pin)
112
        if item_selling_price <= providerPrepaidLimit:
119
        if item_selling_price <= providerPrepaidLimit:
113
            iscod = iscod and item_selling_price <= websiteCodLimit
120
            iscod = iscod and item_selling_price <= websiteCodLimit
114
            otgAvailable = otgAvailable and item_selling_price >= 2000
121
            otgAvailable = otgAvailable and item_selling_price >= 2000
115
            return 3, iscod, otgAvailable
122
            return 6, iscod, otgAvailable
116
    
123
            
117
    if serviceable_location_cache.get(1).has_key(destination_pin):
124
    if serviceable_location_cache.get(1).has_key(destination_pin):
118
        dest_code, exp, iscod, otgAvailable, websiteCodLimit, storeCodLimit, providerPrepaidLimit = serviceable_location_cache.get(1).get(destination_pin)
125
        dest_code, exp, iscod, otgAvailable, websiteCodLimit, storeCodLimit, providerPrepaidLimit = serviceable_location_cache.get(1).get(destination_pin)
119
        if item_selling_price <= providerPrepaidLimit:
126
        if item_selling_price <= providerPrepaidLimit:
120
            iscod = iscod and item_selling_price <= websiteCodLimit
127
            iscod = iscod and item_selling_price <= websiteCodLimit
121
            otgAvailable = otgAvailable and item_selling_price >= 2000
128
            otgAvailable = otgAvailable and item_selling_price >= 2000