| Line 2128... |
Line 2128... |
| 2128 |
order.status = OrderStatus.RTO_LOST_IN_TRANSIT
|
2128 |
order.status = OrderStatus.RTO_LOST_IN_TRANSIT
|
| 2129 |
order.statusDescription = "RTO lost in transit"
|
2129 |
order.statusDescription = "RTO lost in transit"
|
| 2130 |
order.received_return_timestamp = datetime.datetime.now()
|
2130 |
order.received_return_timestamp = datetime.datetime.now()
|
| 2131 |
else:
|
2131 |
else:
|
| 2132 |
return False
|
2132 |
return False
|
| - |
|
2133 |
|
| - |
|
2134 |
if order.insurer > 0:
|
| - |
|
2135 |
detail = InsuranceDetailForOrder.get_by(order_id = order.id)
|
| - |
|
2136 |
detail.expiryDate = datetime.datetime.now()
|
| 2133 |
|
2137 |
|
| 2134 |
# For OUR warehouses, we need to scan in items for every return
|
2138 |
# For OUR warehouses, we need to scan in items for every return
|
| 2135 |
inventoryClient = InventoryClient().get_client()
|
2139 |
inventoryClient = InventoryClient().get_client()
|
| 2136 |
warehouse = inventoryClient.getWarehouse(order.warehouse_id)
|
2140 |
warehouse = inventoryClient.getWarehouse(order.warehouse_id)
|
| 2137 |
if warehouse.billingType == BillingType.OURS or warehouse.billingType == BillingType.OURS_EXTERNAL:
|
2141 |
if warehouse.billingType == BillingType.OURS or warehouse.billingType == BillingType.OURS_EXTERNAL:
|
| Line 2545... |
Line 2549... |
| 2545 |
litem.transfer_price = line_item.transfer_price
|
2549 |
litem.transfer_price = line_item.transfer_price
|
| 2546 |
litem.nlc = line_item.nlc
|
2550 |
litem.nlc = line_item.nlc
|
| 2547 |
litem.dealText = line_item.dealText
|
2551 |
litem.dealText = line_item.dealText
|
| 2548 |
litem.vatRate = line_item.vatRate
|
2552 |
litem.vatRate = line_item.vatRate
|
| 2549 |
litem.order = new_order
|
2553 |
litem.order = new_order
|
| - |
|
2554 |
|
| - |
|
2555 |
if order.insurer > 0:
|
| - |
|
2556 |
new_order.insurer = order.insurer
|
| - |
|
2557 |
new_order.insuranceAmount = order.insuranceAmount
|
| - |
|
2558 |
newDetail = InsuranceDetailForOrder()
|
| - |
|
2559 |
oldDetail = InsuranceDetailForOrder.get_by(order_id = order.id)
|
| - |
|
2560 |
newDetail.dob = oldDetail.dob
|
| - |
|
2561 |
newDetail.guardianName = oldDetail.guardianName
|
| - |
|
2562 |
newDetail.order = new_order
|
| 2550 |
|
2563 |
|
| 2551 |
logistics_client = LogisticsClient().get_client()
|
2564 |
logistics_client = LogisticsClient().get_client()
|
| 2552 |
item_id = new_order.lineitems[0].item_id
|
2565 |
item_id = new_order.lineitems[0].item_id
|
| 2553 |
logistics_info = logistics_client.getLogisticsInfo(new_order.customer_pincode, item_id, is_cod, PickUpType.COURIER) #TODO: We should be able to pass another flag to suggest ignoring the inventory situation.
|
2566 |
logistics_info = logistics_client.getLogisticsInfo(new_order.customer_pincode, item_id, is_cod, PickUpType.COURIER) #TODO: We should be able to pass another flag to suggest ignoring the inventory situation.
|
| 2554 |
logistics_info.shippingTime = adjust_delivery_time(current_time, logistics_info.shippingTime)
|
2567 |
logistics_info.shippingTime = adjust_delivery_time(current_time, logistics_info.shippingTime)
|
| 2555 |
logistics_info.deliveryTime = adjust_delivery_time(current_time, logistics_info.deliveryTime)
|
2568 |
logistics_info.deliveryTime = adjust_delivery_time(current_time, logistics_info.deliveryTime)
|