| Line 159... |
Line 159... |
| 159 |
client = InventoryClient().get_client()
|
159 |
client = InventoryClient().get_client()
|
| 160 |
fulfilmentWarehouseId, expected_delay, billingWarehouseId, sellingPrice, totalAvailability, weight = 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, weight, type)
|
164 |
delivery_estimate = get_logistics_estimation(destination_pin, sellingPrice, weight, type, billingWarehouseId)
|
| 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.
|
| Line 370... |
Line 370... |
| 370 |
finally:
|
370 |
finally:
|
| 371 |
close_session()
|
371 |
close_session()
|
| 372 |
|
372 |
|
| 373 |
def addNewAwbs(self, providerId, isCod, awbs):
|
373 |
def addNewAwbs(self, providerId, isCod, awbs):
|
| 374 |
try:
|
374 |
try:
|
| 375 |
add_new_awbs(providerId, isCod, awbs)
|
375 |
return add_new_awbs(providerId, isCod, awbs)
|
| 376 |
finally:
|
376 |
finally:
|
| 377 |
close_session()
|
377 |
close_session()
|
| 378 |
|
378 |
|