| Line 155... |
Line 155... |
| 155 |
|
155 |
|
| 156 |
def get_logistics_estimation_with_type(self, itemId, destination_pin, type):
|
156 |
def get_logistics_estimation_with_type(self, itemId, destination_pin, type):
|
| 157 |
try:
|
157 |
try:
|
| 158 |
#Get the id and location of actual warehouse that'll be used to fulfil this order.
|
158 |
#Get the id and location of actual warehouse that'll be used to fulfil this order.
|
| 159 |
client = InventoryClient().get_client()
|
159 |
client = InventoryClient().get_client()
|
| 160 |
fulfilmentWarehouseId, expected_delay, billingWarehouseId, sellingPrice, totalAvailability = client.getItemAvailabilityAtLocation(itemId, self.sourceId)
|
160 |
fulfilmentWarehouseId, expected_delay, billingWarehouseId, sellingPrice, totalAvailability, weight = client.getItemAvailabilityAtLocation(itemId, self.sourceId)
|
| 161 |
except Exception as ex:
|
161 |
except Exception as ex:
|
| 162 |
raise LogisticsServiceException(103, "Unable to fetch inventory information about this item.")
|
162 |
raise LogisticsServiceException(103, "Unable to fetch inventory information about this item.")
|
| 163 |
|
163 |
|
| 164 |
delivery_estimate = get_logistics_estimation(destination_pin, sellingPrice)
|
164 |
delivery_estimate = get_logistics_estimation(destination_pin, sellingPrice, weight, type)
|
| 165 |
if delivery_estimate is None:
|
165 |
if delivery_estimate is None:
|
| 166 |
raise LogisticsServiceException(104, "Unable to fetch delivery estimate for this pincode.")
|
166 |
raise LogisticsServiceException(104, "Unable to fetch delivery estimate for this pincode.")
|
| 167 |
|
167 |
|
| 168 |
|
168 |
|
| 169 |
## Commented below part as we have only Delhi as warehouse city. If we will add some more warehouses in different cities, this could be useful.
|
169 |
## Commented below part as we have only Delhi as warehouse city. If we will add some more warehouses in different cities, this could be useful.
|