| Line 1671... |
Line 1671... |
| 1671 |
return False
|
1671 |
return False
|
| 1672 |
|
1672 |
|
| 1673 |
def accept_order(orderId):
|
1673 |
def accept_order(orderId):
|
| 1674 |
logging.info("Accepting order no: " + str(orderId))
|
1674 |
logging.info("Accepting order no: " + str(orderId))
|
| 1675 |
order = get_order(orderId)
|
1675 |
order = get_order(orderId)
|
| - |
|
1676 |
|
| - |
|
1677 |
logistics_client = LogisticsClient().get_client()
|
| - |
|
1678 |
provider = logistics_client.getProvider(order.logistics_provider_id)
|
| - |
|
1679 |
providerLimits = logistics_client.getProviderLimitDetailsForPincode(provider.id, order.customer_pincode)
|
| - |
|
1680 |
|
| - |
|
1681 |
if order.total_weight > provider.bundleWeightLimit:
|
| - |
|
1682 |
raise TransactionServiceException(210, "Logistics Partner "+provider.name+ " Group Shipment Weight Limit Violated i.e. "+str(provider.bundleWeightLimit)+" Suggestion: Split Order!!!")
|
| - |
|
1683 |
|
| - |
|
1684 |
if order.cod:
|
| - |
|
1685 |
if order.total_amount > provider.maxCodLimit:
|
| - |
|
1686 |
raise TransactionServiceException(210, "Logistics Partner "+provider.name+ " Max Cod Amount Collection Limit Violated i.e. "+ str(provider.maxCodLimit)+" Suggestion: Split Order!!!")
|
| - |
|
1687 |
|
| - |
|
1688 |
if order.logistics_provider_id!=4:
|
| - |
|
1689 |
|
| - |
|
1690 |
providerCodLimit = float(providerLimits.get("providerCodLimit"))
|
| - |
|
1691 |
providerPrepaidLimit = float(providerLimits.get("providerPrepaidLimit"))
|
| - |
|
1692 |
|
| - |
|
1693 |
if order.cod:
|
| - |
|
1694 |
if order.total_amount > providerCodLimit:
|
| - |
|
1695 |
raise TransactionServiceException(212, "Provider Maximum COD Limit Violated for Customer Pincode i.e. "+str(providerCodLimit)+" Suggestion: Split Order!!!")
|
| - |
|
1696 |
|
| - |
|
1697 |
if not order.cod:
|
| - |
|
1698 |
if order.total_amount > providerPrepaidLimit:
|
| - |
|
1699 |
raise TransactionServiceException(212, "Logistics Partner "+provider.name+ " Max Prepaid Amount Limit Violated Rs." +str(providerPrepaidLimit)+" Suggestion: Split Order!!!")
|
| - |
|
1700 |
|
| 1676 |
if order.status in [OrderStatus.SUBMITTED_FOR_PROCESSING, OrderStatus.INVENTORY_LOW, OrderStatus.LOW_INV_PO_RAISED, OrderStatus.LOW_INV_REVERSAL_IN_PROCESS, OrderStatus.LOW_INV_NOT_AVAILABLE_AT_HOTSPOT, OrderStatus.CAPTURE_IN_PROCESS]:
|
1701 |
if order.status in [OrderStatus.SUBMITTED_FOR_PROCESSING, OrderStatus.INVENTORY_LOW, OrderStatus.LOW_INV_PO_RAISED, OrderStatus.LOW_INV_REVERSAL_IN_PROCESS, OrderStatus.LOW_INV_NOT_AVAILABLE_AT_HOTSPOT, OrderStatus.CAPTURE_IN_PROCESS]:
|
| 1677 |
if not order.cod:
|
1702 |
if not order.cod:
|
| 1678 |
if order.transaction.status == TransactionStatus.AUTHORIZED and order.transaction.payment_option!=capitalFloatPayMethod:
|
1703 |
if order.transaction.status == TransactionStatus.AUTHORIZED and order.transaction.payment_option!=capitalFloatPayMethod:
|
| 1679 |
__capture_txn(order)
|
1704 |
__capture_txn(order)
|
| 1680 |
order.status = OrderStatus.ACCEPTED
|
1705 |
order.status = OrderStatus.ACCEPTED
|
| Line 8044... |
Line 8069... |
| 8044 |
if totalOrdersAmount > provider.maxCodLimit:
|
8069 |
if totalOrdersAmount > provider.maxCodLimit:
|
| 8045 |
raise TransactionServiceException(210, "Logistics Partner "+provider.name+ " Max Cod Amount Collection Limit Violated i.e. "+ str(provider.maxCodLimit))
|
8070 |
raise TransactionServiceException(210, "Logistics Partner "+provider.name+ " Max Cod Amount Collection Limit Violated i.e. "+ str(provider.maxCodLimit))
|
| 8046 |
|
8071 |
|
| 8047 |
if order.logistics_provider_id!=4:
|
8072 |
if order.logistics_provider_id!=4:
|
| 8048 |
|
8073 |
|
| 8049 |
websiteCodLimit = float(providerLimits.get("websiteCodLimit"))
|
8074 |
providerCodLimit = float(providerLimits.get("providerCodLimit"))
|
| 8050 |
providerPrepaidLimit = float(providerLimits.get("providerPrepaidLimit"))
|
8075 |
providerPrepaidLimit = float(providerLimits.get("providerPrepaidLimit"))
|
| 8051 |
|
8076 |
|
| 8052 |
if order.cod:
|
8077 |
if order.cod:
|
| 8053 |
if totalOrdersAmount > websiteCodLimit:
|
8078 |
if totalOrdersAmount > providerCodLimit:
|
| 8054 |
raise TransactionServiceException(212, "Website Maximum COD Limit Violated i.e. "+str(websiteCodLimit))
|
8079 |
raise TransactionServiceException(212, "Provider Maximum COD Limit Violated for Customer Pincode i.e. "+str(providerCodLimit))
|
| 8055 |
|
8080 |
|
| 8056 |
if not order.cod:
|
8081 |
if not order.cod:
|
| 8057 |
if totalOrdersAmount > providerPrepaidLimit:
|
8082 |
if totalOrdersAmount > providerPrepaidLimit:
|
| 8058 |
raise TransactionServiceException(212, "Logistics Partner "+provider.name+ " Max Prepaid Amount Limit Violated Rs." +str(providerPrepaidLimit))
|
8083 |
raise TransactionServiceException(212, "Logistics Partner "+provider.name+ " Max Prepaid Amount Limit Violated Rs." +str(providerPrepaidLimit))
|
| 8059 |
|
8084 |
|