| Line 124... |
Line 124... |
| 124 |
raise LogisticsServiceException(104, "Unable to fetch delivery estimate for this pincode.")
|
124 |
raise LogisticsServiceException(104, "Unable to fetch delivery estimate for this pincode.")
|
| 125 |
|
125 |
|
| 126 |
warehouse_loc = delivery_estimate.warehouse_location
|
126 |
warehouse_loc = delivery_estimate.warehouse_location
|
| 127 |
try:
|
127 |
try:
|
| 128 |
#Get the id and location of actual warehouse that'll be used to fulfil this order.
|
128 |
#Get the id and location of actual warehouse that'll be used to fulfil this order.
|
| 129 |
warehouse_loc, warehouse_id, items_in_inventory, expected_delay = client.getItemAvailabilityAtLocation(warehouse_loc, itemId)
|
129 |
warehouse_loc, fulfilmentWarehouseId, items_in_inventory, expected_delay, billingWarehouseId = client.getItemAvailabilityAtLocation(warehouse_loc, itemId)
|
| 130 |
except Exception as ex:
|
130 |
except Exception as ex:
|
| 131 |
raise LogisticsServiceException(103, "Unable to fetch inventory information about this item.")
|
131 |
raise LogisticsServiceException(103, "Unable to fetch inventory information about this item.")
|
| 132 |
|
132 |
|
| 133 |
# We are revising the estimates based on the actual warehouse that this order will be assigned to.
|
133 |
# We are revising the estimates based on the actual warehouse that this order will be assigned to.
|
| 134 |
# This warehouse may be located in a zone which is different from the one we allocated for this pincode.
|
134 |
# This warehouse may be located in a zone which is different from the one we allocated for this pincode.
|
| Line 167... |
Line 167... |
| 167 |
delivery_time = int(math.ceil(delivery_time/24.0))
|
167 |
delivery_time = int(math.ceil(delivery_time/24.0))
|
| 168 |
|
168 |
|
| 169 |
logistics_info = LogisticsInfo()
|
169 |
logistics_info = LogisticsInfo()
|
| 170 |
logistics_info.deliveryTime = delivery_time
|
170 |
logistics_info.deliveryTime = delivery_time
|
| 171 |
logistics_info.providerId = delivery_estimate.provider_id
|
171 |
logistics_info.providerId = delivery_estimate.provider_id
|
| 172 |
logistics_info.warehouseId = warehouse_id
|
172 |
logistics_info.warehouseId = billingWarehouseId
|
| - |
|
173 |
logistics_info.fulfilmentWarehouseId = fulfilmentWarehouseId
|
| 173 |
logistics_info.shippingTime = shipping_delay
|
174 |
logistics_info.shippingTime = shipping_delay
|
| 174 |
logistics_info.codAllowed = delivery_estimate.codAllowed
|
175 |
logistics_info.codAllowed = delivery_estimate.codAllowed
|
| 175 |
|
176 |
|
| 176 |
return logistics_info
|
177 |
return logistics_info
|
| 177 |
|
178 |
|