target_stock_id=get_id("select logic_id FROM yb_direct WHERE branch_id ='%s';"%branch_id)
bill_expdt_date=get_expdt_date("select bill_expdt_date from mcms_dept_buy where branch_id='%s' and bill_mode='16' order by create_time desc LIMIT 1;"%branch_id)
bill_expdt_date=get_expdt_date("select bill_expdt_date from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"%(branch_id,type))
rec_user=get_login_user_uxid()
# rec_addr='二级检验科002'
create_user=rec_user
create_time=get_create_time("select create_time from mcms_dept_buy where branch_id='%s' and bill_mode='16' order by create_time desc LIMIT 1;"%branch_id)
last_modified=get_create_time("select last_modified from mcms_dept_buy where branch_id='%s' and bill_mode='16' order by create_time desc LIMIT 1;"%branch_id)
create_time=get_create_time("select create_time from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"%(branch_id,type))
last_modified=get_create_time("select last_modified from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"%(branch_id,type))
last_modified_user=rec_user
last_auditor=rec_user
last_audit_time=get_create_time("select last_audit_time from mcms_dept_buy where branch_id='%s' and bill_mode='16' order by create_time desc LIMIT 1;"%branch_id)
last_audit_time=get_create_time("select last_audit_time from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"%(branch_id,type))