| Line 2596... |
Line 2596... |
| 2596 |
else:
|
2596 |
else:
|
| 2597 |
warehouseClient.scanForOrder(None, ScanType.SALE_RET, lineitem.quantity, order.id, order.fulfilmentWarehouseId, order.warehouse_id)
|
2597 |
warehouseClient.scanForOrder(None, ScanType.SALE_RET, lineitem.quantity, order.id, order.fulfilmentWarehouseId, order.warehouse_id)
|
| 2598 |
if warehouse.billingType == BillingType.OURS_EXTERNAL:
|
2598 |
if warehouse.billingType == BillingType.OURS_EXTERNAL:
|
| 2599 |
warehouseClient.scanForOursExternalSaleReturn(order.id, lineitem.transfer_price)
|
2599 |
warehouseClient.scanForOursExternalSaleReturn(order.id, lineitem.transfer_price)
|
| 2600 |
|
2600 |
|
| 2601 |
if order.source == 2 and order.status in (OrderStatus.SUBMITTED_FOR_PROCESSING, OrderStatus.ACCEPTED, OrderStatus.INVENTORY_LOW):
|
2601 |
if order.source == 2 and order.status in (OrderStatus.SUBMITTED_FOR_PROCESSING, OrderStatus.ACCEPTED, OrderStatus.INVENTORY_LOW, OrderStatus.CANCEL_REQUEST_CONFIRMED):
|
| 2602 |
storeOrderDetail = StoreOrderDetail.query.filter(StoreOrderDetail.orderId == order.id).filter(StoreOrderDetail.storeId == order.storeId).first()
|
2602 |
storeOrderDetail = StoreOrderDetail.query.filter(StoreOrderDetail.orderId == order.id).filter(StoreOrderDetail.storeId == order.storeId).first()
|
| 2603 |
if order.created_timestamp.date() == datetime.datetime.now().date():
|
2603 |
if order.created_timestamp.date() == datetime.datetime.now().date():
|
| 2604 |
__push_store_collection_to_hotspot(order, "RefundFromStore", -(storeOrderDetail.cashRefundAmount + storeOrderDetail.cardRefundAmount))
|
2604 |
__push_store_collection_to_hotspot(order, "RefundFromStore", -(storeOrderDetail.cashRefundAmount + storeOrderDetail.cardRefundAmount))
|
| 2605 |
storeOrderDetail.payStatus = StorePaymentStatus.ADV_REFUNDED
|
2605 |
storeOrderDetail.payStatus = StorePaymentStatus.ADV_REFUNDED
|
| 2606 |
else:
|
2606 |
else:
|
| 2607 |
__push_store_collection_to_hotspot(order, "RefundFromHQ", -(storeOrderDetail.cashRefundAmount))
|
2607 |
__push_store_collection_to_hotspot(order, "RefundFromStore", -(storeOrderDetail.cashRefundAmount))
|
| 2608 |
if storeOrderDetail.cardRefundAmount > 0:
|
2608 |
if storeOrderDetail.cardRefundAmount > 0:
|
| 2609 |
storeOrderDetail.payStatus = StorePaymentStatus.REFUND_PENDING
|
2609 |
storeOrderDetail.payStatus = StorePaymentStatus.REFUND_PENDING
|
| 2610 |
else:
|
2610 |
else:
|
| 2611 |
storeOrderDetail.payStatus = StorePaymentStatus.ADV_REFUNDED
|
2611 |
storeOrderDetail.payStatus = StorePaymentStatus.ADV_REFUNDED
|
| 2612 |
order.status = status_transition[order.status]
|
2612 |
order.status = status_transition[order.status]
|