Subversion Repositories SmartDukaan

Rev

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

Rev 22637 Rev 22724
Line 162... Line 162...
162
    def get_logistics_estimation_with_type(self, itemId, destination_pin, type, pickUp=PickUpType.COURIER):
162
    def get_logistics_estimation_with_type(self, itemId, destination_pin, type, pickUp=PickUpType.COURIER):
163
        try:
163
        try:
164
            #Get the id and location of actual warehouse that'll be used to fulfil this order.
164
            #Get the id and location of actual warehouse that'll be used to fulfil this order.
165
            client = InventoryClient().get_client()
165
            client = InventoryClient().get_client()
166
            fulfilmentWarehouseId, expected_delay, billingWarehouseId, sellingPrice, totalAvailability, weight = client.getItemAvailabilityAtLocation(itemId, self.sourceId)
166
            fulfilmentWarehouseId, expected_delay, billingWarehouseId, sellingPrice, totalAvailability, weight = client.getItemAvailabilityAtLocation(itemId, self.sourceId)
-
 
167
            #We assume that if totalAvailability 0 then its the case of hotspot billing where itemAvailabilityCache is sort of bypassed
-
 
168
            if totalAvailability <= 0:
-
 
169
                expected_delay = 0
-
 
170
                
167
        except Exception as ex:
171
        except Exception as ex:
168
            raise LogisticsServiceException(103, "Unable to fetch inventory information about this item.")
172
            raise LogisticsServiceException(103, "Unable to fetch inventory information about this item.")
169
        
173
        
170
        if pickUp == PickUpType.COURIER:
174
        if pickUp == PickUpType.COURIER:
171
            delivery_estimate = get_logistics_estimation(destination_pin, sellingPrice, weight, type, billingWarehouseId)
175
            delivery_estimate = get_logistics_estimation(destination_pin, sellingPrice, weight, type, billingWarehouseId)