| Line 1927... |
Line 1927... |
| 1927 |
logging.warning("Verify called for order no." + str(orderId) +" which is not in verification pending state");
|
1927 |
logging.warning("Verify called for order no." + str(orderId) +" which is not in verification pending state");
|
| 1928 |
return False
|
1928 |
return False
|
| 1929 |
|
1929 |
|
| 1930 |
def unaccept_order(orderId):
|
1930 |
def unaccept_order(orderId):
|
| 1931 |
logging.info("UnAccepting order no: " + str(orderId))
|
1931 |
logging.info("UnAccepting order no: " + str(orderId))
|
| 1932 |
orders = [get_order(orderId)]
|
1932 |
order = get_order(orderId)
|
| 1933 |
if orders[0].status != OrderStatus.ACCEPTED:
|
1933 |
if order.status != OrderStatus.ACCEPTED:
|
| 1934 |
return False
|
1934 |
return False
|
| 1935 |
logisticsTxnId = order.logisticsTransactionId
|
1935 |
logisticsTxnId = order.logisticsTransactionId
|
| - |
|
1936 |
|
| - |
|
1937 |
orders = [get_order(orderId)]
|
| 1936 |
if logisticsTxnId is None:
|
1938 |
if logisticsTxnId is None:
|
| 1937 |
orders = Order.query.filter(Order.logisticsTransactionId==order.logisticsTransactionId).all()
|
1939 |
orders = Order.query.filter(Order.logisticsTransactionId==order.logisticsTransactionId).all()
|
| 1938 |
for o in orders:
|
1940 |
for o in orders:
|
| 1939 |
o.status = OrderStatus.SUBMITTED_FOR_PROCESSING
|
1941 |
o.status = OrderStatus.SUBMITTED_FOR_PROCESSING
|
| 1940 |
o.statusDescription = 'Submitted For Processing'
|
1942 |
o.statusDescription = 'Submitted For Processing'
|
| Line 10845... |
Line 10847... |
| 10845 |
|
10847 |
|
| 10846 |
|
10848 |
|
| 10847 |
return change_return_transaction_status(returnTransactionId, ReturnTransactionStatus.PROCESSED, returnOrderIds, returnOrdersAttrMap)
|
10849 |
return change_return_transaction_status(returnTransactionId, ReturnTransactionStatus.PROCESSED, returnOrderIds, returnOrdersAttrMap)
|
| 10848 |
|
10850 |
|
| 10849 |
def get_all_return_orders_for_return_pickup_request(logisticsRequestId):
|
10851 |
def get_all_return_orders_for_return_pickup_request(logisticsRequestId):
|
| 10850 |
return ReturnOrderInfo.query.filter(ReturnOrderInfo.logisticsRequestId==logisticsRequestId).all()
|
10852 |
return ReturnOrderInfo.query.filter(ReturnOrderInfo.logisticsRequestId==logisticsRequestId).all()
|
| - |
|
10853 |
|
| - |
|
10854 |
def __clone_return_order(returnOrder, splitReturnOrderQty):
|
| - |
|
10855 |
new_returnOrder = ReturnOrderInfo()
|
| - |
|
10856 |
returnOrderInfo.orderId = returnOrder.orderId
|
| - |
|
10857 |
returnOrderInfo.lineItemId = returnOrder.lineItemId
|
| - |
|
10858 |
returnOrderInfo.returnQuantity = splitReturnOrderQty
|
| - |
|
10859 |
returnOrderInfo.createdAt = datetime.datetime.now()
|
| - |
|
10860 |
if itemCondition=="DAMAGED":
|
| - |
|
10861 |
returnOrderInfo.returnStatus = OrderStatus._VALUES_TO_NAMES[OrderStatus.RET_REQUEST_RECEIVED]
|
| - |
|
10862 |
else:
|
| - |
|
10863 |
returnOrderInfo.returnStatus = OrderStatus._VALUES_TO_NAMES[OrderStatus.DOA_REQUEST_RECEIVED]
|
| - |
|
10864 |
returnOrderInfo.masterOrderId = order.logisticsTransactionId
|
| - |
|
10865 |
returnOrderInfo.warehouse_id = order.warehouse_id
|
| - |
|
10866 |
returnOrderInfo.returnAction = returnInfo.returnAction
|
| - |
|
10867 |
returnOrderInfo.freebieItemId = order.freebieItemId
|
| - |
|
10868 |
returnOrderInfo.returnTxnResolutionStatus = ReturnTxnResolutionStatus._VALUES_TO_NAMES[ReturnTxnResolutionStatus.PENDING]
|
| - |
|
10869 |
|
| - |
|
10870 |
def split_return_order_info(returnOrderId, splitReturnOrderQty):
|
| - |
|
10871 |
returnOrder = ReturnOrderInfo.get_by(id=returnOrderId)
|
| - |
|
10872 |
if returnOrder is None:
|
| - |
|
10873 |
raise TransactionServiceException(101, "No Return Order is there with this Order Id")
|
| 10851 |
|
10874 |
|
| 10852 |
if __name__ == '__main__':
|
10875 |
if __name__ == '__main__':
|
| 10853 |
print get_orders_by_mobile_number("9650889334")
|
10876 |
print get_orders_by_mobile_number("9650889334")
|