| Line 11576... |
Line 11576... |
| 11576 |
#from shop2020.clients.LogisticsClient import LogisticsClient
|
11576 |
#from shop2020.clients.LogisticsClient import LogisticsClient
|
| 11577 |
#pincodes = [302006,263139,781001,834001,380051,380001,110074,400095,560037,125055,122001,700009,400709,462022,700023,400015]
|
11577 |
#pincodes = [302006,263139,781001,834001,380051,380001,110074,400095,560037,125055,122001,700009,400709,462022,700023,400015]
|
| 11578 |
#logistics_client = LogisticsClient().get_client()
|
11578 |
#logistics_client = LogisticsClient().get_client()
|
| 11579 |
#for pincode in pincodes:
|
11579 |
#for pincode in pincodes:
|
| 11580 |
# print pincode, logistics_client.getLogisticsEstimation(26385, str(pincode), 1).providerId
|
11580 |
# print pincode, logistics_client.getLogisticsEstimation(26385, str(pincode), 1).providerId
|
| 11581 |
transaction_id=[1,2,3]
|
- |
|
| 11582 |
for transaction_id in transaction_id:
|
- |
|
| 11583 |
transaction = get_transaction(transaction_id)
|
- |
|
| 11584 |
user_client = UserClient().get_client()
|
- |
|
| 11585 |
oa = Attribute()
|
- |
|
| 11586 |
counter = user_client.getCounterByUserId(transaction.customer_id)
|
- |
|
| 11587 |
oa.value = counter.tin
|
- |
|
| 11588 |
address = user_client.getAddressById(counter.address)
|
- |
|
| 11589 |
shipping_refund = 0
|
- |
|
| 11590 |
net_payable = 0
|
- |
|
| 11591 |
for order in transaction.orders:
|
- |
|
| 11592 |
oa.name='tinNumber'
|
- |
|
| 11593 |
oa.orderId = order.id
|
- |
|
| 11594 |
|
- |
|
| 11595 |
order.customer_name = address.name
|
- |
|
| 11596 |
order.customer_pincode = address.pin
|
- |
|
| 11597 |
order.customer_address1 = address.line1
|
- |
|
| 11598 |
order.customer_address2 = address.line2
|
- |
|
| 11599 |
order.customer_city = address.city
|
- |
|
| 11600 |
order.customer_state = address.state
|
- |
|
| 11601 |
order.orderType = OrderType.B2B
|
- |
|
| 11602 |
order.logistics_provider_id = 4 #Self Pickup
|
- |
|
| 11603 |
shipping_refund += order.shippingCost
|
- |
|
| 11604 |
net_payable += order.net_payable_amount
|
- |
|
| 11605 |
order.shippingCost = 0
|
- |
|
| 11606 |
if shipping_refund > 0 and net_payable==0:
|
- |
|
| 11607 |
add_amount_in_wallet(order.customer_id, order.shippingCost, order.transaction_id, WalletReferenceType.REFUND, False, False)
|
- |
|
| 11608 |
payment_client = PaymentClient().get_client()
|
- |
|
| 11609 |
payment_client.
|
- |
|
| 11610 |
payments = payment_client.refundPayment(transaction_id, shipping_refund, False)
|
- |
|
| 11611 |
session.commit()
|
- |
|
| 11612 |
|
11581 |
|
| - |
|
11582 |
# transaction_id=[1,2,3]
|
| - |
|
11583 |
# for transaction_id in transaction_id:
|
| - |
|
11584 |
# transaction = get_transaction(transaction_id)
|
| - |
|
11585 |
# user_client = UserClient().get_client()
|
| - |
|
11586 |
# oa = Attribute()
|
| - |
|
11587 |
# counter = user_client.getCounterByUserId(transaction.customer_id)
|
| - |
|
11588 |
# oa.value = counter.tin
|
| - |
|
11589 |
# address = user_client.getAddressById(counter.address)
|
| - |
|
11590 |
# shipping_refund = 0
|
| - |
|
11591 |
# net_payable = 0
|
| - |
|
11592 |
# for order in transaction.orders:
|
| - |
|
11593 |
# oa.name='tinNumber'
|
| - |
|
11594 |
# oa.orderId = order.id
|
| - |
|
11595 |
#
|
| - |
|
11596 |
# order.customer_name = address.name
|
| - |
|
11597 |
# order.customer_pincode = address.pin
|
| - |
|
11598 |
# order.customer_address1 = address.line1
|
| - |
|
11599 |
# order.customer_address2 = address.line2
|
| - |
|
11600 |
# order.customer_city = address.city
|
| - |
|
11601 |
# order.customer_state = address.state
|
| - |
|
11602 |
# order.orderType = OrderType.B2B
|
| - |
|
11603 |
# order.logistics_provider_id = 4 #Self Pickup
|
| - |
|
11604 |
# shipping_refund += order.shippingCost
|
| - |
|
11605 |
# net_payable += order.net_payable_amount
|
| - |
|
11606 |
# order.shippingCost = 0
|
| - |
|
11607 |
# if shipping_refund > 0 and net_payable==0:
|
| - |
|
11608 |
# add_amount_in_wallet(order.customer_id, order.shippingCost, order.transaction_id, WalletReferenceType.REFUND, False, False)
|
| - |
|
11609 |
# payment_client = PaymentClient().get_client()
|
| - |
|
11610 |
# payment_client.
|
| - |
|
11611 |
# payments = payment_client.refundPayment(transaction_id, shipping_refund, False)
|
| - |
|
11612 |
# session.commit()
|
| - |
|
11613 |
|
| 11613 |
|
11614 |
|