| Line 1483... |
Line 1483... |
| 1483 |
if order.transaction.status == TransactionStatus.AUTHORIZED:
|
1483 |
if order.transaction.status == TransactionStatus.AUTHORIZED:
|
| 1484 |
__capture_txn(order)
|
1484 |
__capture_txn(order)
|
| 1485 |
order.status = OrderStatus.ACCEPTED
|
1485 |
order.status = OrderStatus.ACCEPTED
|
| 1486 |
order.statusDescription = "Order Accepted"
|
1486 |
order.statusDescription = "Order Accepted"
|
| 1487 |
order.accepted_timestamp = datetime.datetime.now()
|
1487 |
order.accepted_timestamp = datetime.datetime.now()
|
| 1488 |
if order.source == 6 or order.source == 7 or order.source == 8:
|
- |
|
| 1489 |
if order.source == 8 and order.cod:
|
- |
|
| 1490 |
order.cod = False
|
- |
|
| 1491 |
session.commit()
|
- |
|
| 1492 |
return "True"
|
- |
|
| 1493 |
__amend_fulfilment_warehouse(order)
|
- |
|
| 1494 |
__update_transfer_price(order, order.fulfilmentWarehouseId)
|
- |
|
| 1495 |
txnSeqRequired = 0
|
1488 |
txnSeqRequired = 0
|
| 1496 |
txnShipSeq = TransactionShipmentSequence.query.filter(TransactionShipmentSequence.transactionId==order.transaction_id).order_by(desc(TransactionShipmentSequence.id,TransactionShipmentSequence.createdTimestamp)).first()
|
1489 |
txnShipSeq = TransactionShipmentSequence.query.filter(TransactionShipmentSequence.transactionId==order.transaction_id).order_by(desc(TransactionShipmentSequence.id,TransactionShipmentSequence.createdTimestamp)).first()
|
| 1497 |
if txnShipSeq is None:
|
1490 |
if txnShipSeq is None:
|
| 1498 |
txnShipSeq = TransactionShipmentSequence()
|
1491 |
txnShipSeq = TransactionShipmentSequence()
|
| 1499 |
txnShipSeq.transactionId = order.transaction_id
|
1492 |
txnShipSeq.transactionId = order.transaction_id
|
| Line 1504... |
Line 1497... |
| 1504 |
txnShipSeqNew = TransactionShipmentSequence()
|
1497 |
txnShipSeqNew = TransactionShipmentSequence()
|
| 1505 |
txnShipSeqNew.transactionId = txnShipSeq.transactionId
|
1498 |
txnShipSeqNew.transactionId = txnShipSeq.transactionId
|
| 1506 |
txnShipSeqNew.createdTimestamp = datetime.datetime.now()
|
1499 |
txnShipSeqNew.createdTimestamp = datetime.datetime.now()
|
| 1507 |
txnShipSeqNew.sequence = txnShipSeq.sequence + 1
|
1500 |
txnShipSeqNew.sequence = txnShipSeq.sequence + 1
|
| 1508 |
txnSeqRequired = txnShipSeq.sequence + 1
|
1501 |
txnSeqRequired = txnShipSeq.sequence + 1
|
| - |
|
1502 |
order.logisticsTransactionId = str(order.transaction_id)+"-"+str(txnSeqRequired)
|
| - |
|
1503 |
if order.source == 6 or order.source == 7 or order.source == 8:
|
| - |
|
1504 |
if order.source == 8 and order.cod:
|
| - |
|
1505 |
order.cod = False
|
| 1509 |
session.commit()
|
1506 |
session.commit()
|
| - |
|
1507 |
return "True"
|
| - |
|
1508 |
__amend_fulfilment_warehouse(order)
|
| - |
|
1509 |
__update_transfer_price(order, order.fulfilmentWarehouseId)
|
| - |
|
1510 |
|
| - |
|
1511 |
session.commit()
|
| - |
|
1512 |
|
| 1510 |
'''
|
1513 |
'''
|
| 1511 |
if order.logistics_provider_id != 7 and order.airwaybill_no is None or order.airwaybill_no == "null":
|
1514 |
if order.logistics_provider_id != 7 and order.airwaybill_no is None or order.airwaybill_no == "null":
|
| 1512 |
logistics_client = LogisticsClient().get_client()
|
1515 |
logistics_client = LogisticsClient().get_client()
|
| 1513 |
if order.cod and order.total_amount > 1:
|
1516 |
if order.cod and order.total_amount > 1:
|
| 1514 |
airwaybillNo= logistics_client.getEmptyAWB(order.logistics_provider_id, DeliveryType.COD)
|
1517 |
airwaybillNo= logistics_client.getEmptyAWB(order.logistics_provider_id, DeliveryType.COD)
|