# -*- encoding:utf-8 -*- import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..\\..\\..\\')) from keywords.tms.billing.billingFlow import BillingFlow if __name__ == '__main__': BillingFlow.billing_return_refund(account='ADMIN', order_nos=sys.argv[1].split(','))
sleep(tmsBase.wait_time) # if BaseInfo.get_distributor_id(account='ADMIN', distributor_short_name=sys.argv[1].decode('gbk')) == 0: # obj = BaseInfo.get_subdistributor_id(subdistributor_short_name=sys.argv[1].decode('gbk')) # delivery_dealer = obj[0] + '-' + obj[1] # else: # delivery_dealer = BaseInfo.get_distributor_id(account='ADMIN', distributor_short_name=sys.argv[1].decode('gbk')) + '-' if BaseInfo.get_distributor_id(account='ADMIN', distributor_short_name='autoexpress') == 0: obj = BaseInfo.get_subdistributor_id(subdistributor_short_name='autoexpress') delivery_dealer = obj[0] + '-' + obj[1] else: delivery_dealer = BaseInfo.get_distributor_id(account='ADMIN', distributor_short_name='autoexpress') + '-' RainbowFlow.sorting_forward_to_delivery_dealer(order_ids=order_ids, delivery_dealer=delivery_dealer, account='TIANJINSORTING') sleep(tmsBase.wait_time) ExpressFlow.express_return_on_success(order_ids=order_ids, express_account='AUTOEXPRESS') sleep(tmsBase.wait_time) ExpressUtil.express_check_order_state(order_ids=order_ids, state='退货已签收'.decode('utf-8')) RainbowUtil.rainbow_check_order_state(order_ids=order_ids, state='退货已签收'.decode('utf-8')) refund_order_id = BillingFlow.billing_return_refund(account='ADMIN', order_nos=order_ids) sleep(tmsBase.wait_time) BillingUtil.billing_check_refund_order_state(account='ADMIN', refund_bill_id=refund_order_id, status='已审核'.decode('utf-8'), deduct_status='可抵'.decode('utf-8'))