sql=" select * from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_QL' order by CREATE_TIME desc LIMIT 1;"%(
branch_id,type)
actual=check_mcms_dept_buy_sql(sql)
print(actual)
iftype==16:
source_id=process_tuple(get_id("select id from mcms_psi where target_branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"%(branch_id,type)))
eliftype==20:
source_id=process_tuple(get_id("select id from mcms_psi where target_branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"%(branch_id,type)))
else:
source_id=process_tuple(get_id("select id from mcms_psi where target_branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"%(branch_id,type)))
# source_id = ''.join(source_id)
source_no=get_id("select order_no from mcms_psi where id='%s';"%source_id)
#获取入库单主键DR_ID
sql=" select id from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_QL' order by CREATE_TIME desc LIMIT 1;"%(
branch_id,type)
DR_ID=get_id(sql)
#获取order_no
sql=" select order_no from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_QL' order by CREATE_TIME desc LIMIT 1;"%(