-- 销售退货申请单单据类型
IF NOT EXISTS (SELECT 1 FROM t_bas_billtype WHERE FID = 717824201062387712)
INSERT INTO t_bas_billtype (FID, FNUMBER, FBILLFORMID, FISDEFAULT, FBILLCODERULEID, FCREATORID, FCREATETIME, FMODIFIERID, FMODIFYTIME, FCONTROLPRINTCOUNT, FMAXPRINTCOUNT, FPRINTAFTERAUDIT, FDOCUMENTSTATUS, FDEFPRINTTEMPLATE, FISSYSPRESET, FPARASETTINGXML, FLAYOUTSOLUTION, FDEFWNREPORTTEMPLATE, FSTATUS, FENABLE, FBILLINITSETTING, FMASTERID) VALUES (717824201062387712, 'sm_returnapply_BT_S', 'sm_returnapply', '1', ' ', 15582092, {ts'2018-08-08 18:08:00'}, 15582092, {ts'2018-08-08 18:08:00'}, '0', 1, '1', '0', ' ', '0', NULL, '04Z/7AHGCQWO', NULL, 'C', '1', ' ', 717824201062387712);

-- 销售退货申请单单据类型多语言
IF NOT EXISTS (SELECT 1 FROM t_bas_billtype_l WHERE FPKID ='085/BNMMOUPD')
INSERT INTO t_bas_billtype_l (FPKID, FID, FLOCALEID, FNAME, FDESCRIPTION) VALUES ('085/BNMMOUPD', 717824201062387712, 'zh_CN', '标准销售退货申请单', ' ');
IF NOT EXISTS (SELECT 1 FROM t_bas_billtype_l WHERE FPKID ='085/BNMMOUPE')
INSERT INTO t_bas_billtype_l (FPKID, FID, FLOCALEID, FNAME, FDESCRIPTION) VALUES ('085/BNMMOUPE', 717824201062387712, 'zh_TW', '標準銷售退貨申請單', ' ');

-- 销售退货申请单单据类型参数
IF NOT EXISTS (SELECT 1 FROM t_bas_billtypeparameter WHERE FBILLTYPEID = 717824201062387712 and FFORMID = 'sm_returnapply')
INSERT INTO t_bas_billtypeparameter (FFORMID, FBILLTYPEID, FDATA) VALUES ('sm_returnapply', 717824201062387712, '{"biztype":{"number":"211","masterid":688855385217756160,"_Type_":"bd_biztype","multilanguagetext":[{"_Type_":"locale","pkid":"04L7ND932ZX3","name":"物料类销售退货","description":"","localeid":"zh_CN"},{"_Type_":"locale","pkid":"04L7ND932ZX4","name":"物料類銷售退貨","description":"","localeid":"zh_TW"}],"name":{"zh_TW":"物料類銷售退貨","zh_CN":"物料类销售退货"},"id":688855385217756160},"_Type_":"sm_billtypeparam","biztype_id":688855385217756160}');