| Line 1288... |
Line 1288... |
| 1288 |
session.commit()
|
1288 |
session.commit()
|
| 1289 |
return "True"
|
1289 |
return "True"
|
| 1290 |
__amend_fulfilment_warehouse(order)
|
1290 |
__amend_fulfilment_warehouse(order)
|
| 1291 |
__update_transfer_price(order, order.fulfilmentWarehouseId)
|
1291 |
__update_transfer_price(order, order.fulfilmentWarehouseId)
|
| 1292 |
session.commit()
|
1292 |
session.commit()
|
| 1293 |
|
1293 |
'''
|
| 1294 |
if order.logistics_provider_id != 7 and order.airwaybill_no is None or order.airwaybill_no == "null":
|
1294 |
if order.logistics_provider_id != 7 and order.airwaybill_no is None or order.airwaybill_no == "null":
|
| 1295 |
logistics_client = LogisticsClient().get_client()
|
1295 |
logistics_client = LogisticsClient().get_client()
|
| 1296 |
if order.cod and order.total_amount > 1:
|
1296 |
if order.cod and order.total_amount > 1:
|
| 1297 |
airwaybillNo= logistics_client.getEmptyAWB(order.logistics_provider_id, DeliveryType.COD)
|
1297 |
airwaybillNo= logistics_client.getEmptyAWB(order.logistics_provider_id, DeliveryType.COD)
|
| 1298 |
else:
|
1298 |
else:
|
| 1299 |
airwaybillNo= logistics_client.getEmptyAWB(order.logistics_provider_id, DeliveryType.PREPAID)
|
1299 |
airwaybillNo= logistics_client.getEmptyAWB(order.logistics_provider_id, DeliveryType.PREPAID)
|
| 1300 |
|
1300 |
|
| 1301 |
order.airwaybill_no = airwaybillNo
|
1301 |
order.airwaybill_no = airwaybillNo
|
| 1302 |
order.tracking_id = airwaybillNo
|
1302 |
order.tracking_id = airwaybillNo
|
| 1303 |
session.commit()
|
1303 |
session.commit()
|
| - |
|
1304 |
'''
|
| 1304 |
|
1305 |
|
| 1305 |
logging.info("Successfully accepted the order no.:" + str(orderId))
|
1306 |
logging.info("Successfully accepted the order no.:" + str(orderId))
|
| 1306 |
return True
|
1307 |
return True
|
| 1307 |
else:
|
1308 |
else:
|
| 1308 |
logging.warning("Accept called for the unacceptable order: " + str(orderId))
|
1309 |
logging.warning("Accept called for the unacceptable order: " + str(orderId))
|
| Line 2927... |
Line 2928... |
| 2927 |
logistics_info.deliveryTime = adjust_delivery_time(current_time, logistics_info.deliveryTime)
|
2928 |
logistics_info.deliveryTime = adjust_delivery_time(current_time, logistics_info.deliveryTime)
|
| 2928 |
logistics_info.deliveryDelay = adjust_delivery_time(current_time, (logistics_info.shippingTime + logistics_info.deliveryDelay))
|
2929 |
logistics_info.deliveryDelay = adjust_delivery_time(current_time, (logistics_info.shippingTime + logistics_info.deliveryDelay))
|
| 2929 |
new_order.warehouse_id = logistics_info.warehouseId
|
2930 |
new_order.warehouse_id = logistics_info.warehouseId
|
| 2930 |
new_order.fulfilmentWarehouseId = logistics_info.fulfilmentWarehouseId
|
2931 |
new_order.fulfilmentWarehouseId = logistics_info.fulfilmentWarehouseId
|
| 2931 |
new_order.logistics_provider_id = logistics_info.providerId
|
2932 |
new_order.logistics_provider_id = logistics_info.providerId
|
| - |
|
2933 |
'''
|
| 2932 |
new_order.airwaybill_no = logistics_info.airway_billno
|
2934 |
new_order.airwaybill_no = logistics_info.airway_billno
|
| 2933 |
new_order.tracking_id = new_order.airwaybill_no
|
2935 |
new_order.tracking_id = new_order.airwaybill_no
|
| - |
|
2936 |
'''
|
| 2934 |
new_order.source = order.source
|
2937 |
new_order.source = order.source
|
| 2935 |
|
2938 |
|
| 2936 |
order.courier_delivery_time = (current_time + datetime.timedelta(days=logistics_info.deliveryDelay)).replace(hour=PREPAID_SHIPPING_CUTOFF_TIME, minute=0, second=0)
|
2939 |
order.courier_delivery_time = (current_time + datetime.timedelta(days=logistics_info.deliveryDelay)).replace(hour=PREPAID_SHIPPING_CUTOFF_TIME, minute=0, second=0)
|
| 2937 |
new_order.expected_delivery_time = (current_time + datetime.timedelta(days=logistics_info.deliveryTime)).replace(hour=PREPAID_SHIPPING_CUTOFF_TIME, minute=0, second=0)
|
2940 |
new_order.expected_delivery_time = (current_time + datetime.timedelta(days=logistics_info.deliveryTime)).replace(hour=PREPAID_SHIPPING_CUTOFF_TIME, minute=0, second=0)
|
| 2938 |
new_order.promised_delivery_time = new_order.expected_delivery_time
|
2941 |
new_order.promised_delivery_time = new_order.expected_delivery_time
|
| Line 2951... |
Line 2954... |
| 2951 |
new_order.accepted_timestamp = current_time
|
2954 |
new_order.accepted_timestamp = current_time
|
| 2952 |
new_order.billing_timestamp = current_time
|
2955 |
new_order.billing_timestamp = current_time
|
| 2953 |
new_order.status = OrderStatus.BILLED
|
2956 |
new_order.status = OrderStatus.BILLED
|
| 2954 |
new_order.statusDescription = 'Order Billed'
|
2957 |
new_order.statusDescription = 'Order Billed'
|
| 2955 |
|
2958 |
|
| - |
|
2959 |
if new_order.logistics_provider_id != 7 and new_order.airwaybill_no is None:
|
| 2956 |
if is_cod and order.total_amount > 1:
|
2960 |
if is_cod and order.total_amount > 1:
|
| 2957 |
new_order.airwaybill_no= logistics_client.getEmptyAWB(new_order.logistics_provider_id, DeliveryType.COD)
|
2961 |
new_order.airwaybill_no= logistics_client.getEmptyAWB(new_order.logistics_provider_id, DeliveryType.COD)
|
| - |
|
2962 |
new_order.tracking_id = new_order.airwaybill_no
|
| 2958 |
else:
|
2963 |
else:
|
| 2959 |
new_order.airwaybill_no= logistics_client.getEmptyAWB(new_order.logistics_provider_id, DeliveryType.PREPAID)
|
2964 |
new_order.airwaybill_no= logistics_client.getEmptyAWB(new_order.logistics_provider_id, DeliveryType.PREPAID)
|
| - |
|
2965 |
new_order.tracking_id = new_order.airwaybill_no
|
| 2960 |
|
2966 |
|
| 2961 |
session.commit()
|
2967 |
session.commit()
|
| 2962 |
else:
|
2968 |
else:
|
| 2963 |
session.commit()
|
2969 |
session.commit()
|
| 2964 |
inventoryClient = InventoryClient().get_client()
|
2970 |
inventoryClient = InventoryClient().get_client()
|
| 2965 |
inventoryClient.reserveItemInWarehouse(item_id, logistics_info.fulfilmentWarehouseId, sourceId, new_order.id, to_java_date(new_order.created_timestamp), to_java_date(new_order.promised_shipping_time), new_order.lineitems[0].quantity)
|
2971 |
inventoryClient.reserveItemInWarehouse(item_id, logistics_info.fulfilmentWarehouseId, sourceId, new_order.id, to_java_date(new_order.created_timestamp), to_java_date(new_order.promised_shipping_time), new_order.lineitems[0].quantity)
|