| Line 9... |
Line 9... |
| 9 |
get_shipment_info, initialize, get_logistics_estimation, get_provider,\
|
9 |
get_shipment_info, initialize, get_logistics_estimation, get_provider,\
|
| 10 |
get_providers, close_session, get_free_awb_count, get_holidays,\
|
10 |
get_providers, close_session, get_free_awb_count, get_holidays,\
|
| 11 |
is_cod_allowed
|
11 |
is_cod_allowed
|
| 12 |
from shop2020.logistics.service.impl.Converters import to_t_awbupdate,\
|
12 |
from shop2020.logistics.service.impl.Converters import to_t_awbupdate,\
|
| 13 |
to_t_provider
|
13 |
to_t_provider
|
| 14 |
from shop2020.clients.InventoryClient import InventoryClient
|
14 |
from shop2020.clients.CatalogClient import CatalogClient
|
| 15 |
from shop2020.config.client.ConfigClient import ConfigClient
|
15 |
from shop2020.config.client.ConfigClient import ConfigClient
|
| 16 |
import datetime
|
16 |
import datetime
|
| 17 |
import math
|
17 |
import math
|
| 18 |
import sys
|
18 |
import sys
|
| 19 |
from shop2020.logistics.service.impl.DataService import ServiceableLocationDetails,\
|
19 |
from shop2020.logistics.service.impl.DataService import ServiceableLocationDetails,\
|
| Line 126... |
Line 126... |
| 126 |
|
126 |
|
| 127 |
def get_logistics_estimation_with_type(self, itemId, destination_pin, type = DeliveryType.PREPAID):
|
127 |
def get_logistics_estimation_with_type(self, itemId, destination_pin, type = DeliveryType.PREPAID):
|
| 128 |
if not destination_pin:
|
128 |
if not destination_pin:
|
| 129 |
destination_pin = self.default_pincode
|
129 |
destination_pin = self.default_pincode
|
| 130 |
try:
|
130 |
try:
|
| 131 |
client = InventoryClient().get_client()
|
131 |
client = CatalogClient().get_client()
|
| 132 |
item = client.getItem(itemId)
|
132 |
item = client.getItem(itemId)
|
| 133 |
except Exception as ex:
|
133 |
except Exception as ex:
|
| 134 |
raise LogisticsServiceException(103, "Unable to fetch inventory information about this item.")
|
134 |
raise LogisticsServiceException(103, "Unable to fetch inventory information about this item.")
|
| 135 |
|
135 |
|
| 136 |
delivery_estimate = get_logistics_estimation(destination_pin, item.sellingPrice, None, type)
|
136 |
delivery_estimate = get_logistics_estimation(destination_pin, item.sellingPrice, None, type)
|