def test_return_recycle(): """销售退货回收(带备注)""" # 提交非定做销售单 sale_order = gen_sale_info(constants.ONLINE_PATI_ID, False, [0]) sale_id = commit_sale_order(sale_order, return_sale_id=True)['sale_id'] # 付款 data_pay = copy.deepcopy(SALE_PAY) data_pay['bill_id'] = sale_id data_pay['amount'] = sale_order['sale_real_price'] sale_pay(data_pay) # 库存商品提货销售单详情 params_pick_sale_detial = copy.deepcopy(STOCK_PICK_SALE_DETAIL) params_pick_sale_detial['sale_id'] = sale_id params_pick_sale_detial['stat_depo_id'] = sale_order['list'][0]['depot_id'] resp_pick_sale_detail = stock_pick_sale_detail(params_pick_sale_detial) if resp_pick_sale_detail['data']: stat_id = resp_pick_sale_detail['data'][0]['stat_id'] # 取件 data_sale_pick = copy.deepcopy(SALE_PICK) data_sale_pick['stat_id'] = stat_id sale_pick(data_sale_pick) # 退货回收 data_recycle = list() data_recycle.append({'stat_id': stat_id}) return_recycle(data_recycle)
def test_sales_order_custom_traver_odos(odos): """提交定做销售定单(遍历眼别)""" # 提交定做销售单 sale_order = gen_sale_info(constants.ONLINE_PATI_ID, True, [0], odos=odos) sale_id = commit_sale_order(sale_order, return_sale_id=True)['sale_id'] # 获得一个销售订单 resp = sales_order_detail(sale_id) # 校验 verify_result(sale_id, sale_order, resp['data'])
def test_sales_order_detail(): """获得一个销售订单""" # 提交非定做销售单 sale_order = gen_sale_info(constants.ONLINE_PATI_ID, True, [0]) sale_id = commit_sale_order(sale_order, return_sale_id=True)['sale_id'] # 获得一个销售订单 resp = sales_order_detail(sale_id) # 校验 verify_result(sale_id, sale_order, resp['data'])
def test_sales_order_list(): """销售单列表""" # 提交非定做销售单 sale_order = gen_sale_info(constants.ONLINE_PATI_ID, True, [0]) sale_id = commit_sale_order(sale_order, return_sale_id=True)['sale_id'] # 销售单列表 params = copy.deepcopy(SALES_ORDER_LIST) resp = sales_order_list(params) # 校验 verify_result(sale_id, sale_order, resp)
def test_add_return_withreasons(): """退货(带备注)""" # 提交非定做销售单 sale_order = gen_sale_info(constants.ONLINE_PATI_ID, True, [0]) sale_id = commit_sale_order(sale_order, return_sale_id=True)['sale_id'] # 付款 data_pay = copy.deepcopy(SALE_PAY) data_pay['bill_id'] = sale_id data_pay['amount'] = sale_order['sale_real_price'] sale_pay(data_pay) # 获取退货列表 resp_return_list = get_return_list(sale_id) # 退货(带备注) data_ = copy.deepcopy(ADD_RETURN_WITHREASONS) data_['sales_id'] = sale_id data_['refund_reasons'][0]['statId'] = resp_return_list['data'][0][ 'stat_id'] add_return_withreasons(data_) # 校验 verify_result(sale_id)
def test_sales_order_custom_invalid_odos(odos): """提交定做销售定单(非法眼别)""" # 提交定做销售单 sale_order = gen_sale_info(constants.ONLINE_PATI_ID, True, [0], odos=odos) commit_sale_order(sale_order, return_sale_id=True, exp_http_status=500, exp_status='0001', exp_message=u'无效眼别(odos)值:{}'.format(odos))