/** VMI销售新增加单据类型 **/
-- VMI销售订单
IF NOT EXISTS (SELECT 1 FROM t_bas_billtype WHERE FID = 1362174530952364032)
INSERT INTO t_bas_billtype
(fid, fnumber, fbillformid, fisdefault, fbillcoderuleid, fcreatorid, fcreatetime, fmodifierid, fmodifytime, fcontrolprintcount, fmaxprintcount, fprintafteraudit, fdocumentstatus, fdefprinttemplate, fissyspreset, flayoutsolution, fdefwnreporttemplate, fstatus, fenable, fmasterid, fparasettingxml, fbillinitsetting)
VALUES(1362174530952364032, 'sm_SalesOrder_VMI_BT_S', 'sm_salorder', '0', ' ', 1, {ts'2018-08-08 18:08:00'}, 1, {ts'2018-08-08 18:08:00'}, '0', 1, '1', '0', ' ', '1', '/S6F8QA39CS6', NULL, 'C', '1', 1362174530952364032, NULL, ' ');

IF NOT EXISTS (SELECT 1 FROM t_bas_billtype_l WHERE FPKID = '29A0FHDUAFRN')
INSERT INTO t_bas_billtype_l
(fpkid, fid, flocaleid, fname, fdescription)
VALUES('29A0FHDUAFRN', 1362174530952364032, 'zh_CN', 'VMI销售订单', ' ');
IF NOT EXISTS (SELECT 1 FROM t_bas_billtype_l WHERE FPKID = '29A0FHDUAFRO')
INSERT INTO t_bas_billtype_l
(fpkid, fid, flocaleid, fname, fdescription)
VALUES('29A0FHDUAFRO', 1362174530952364032, 'zh_TW', 'VMI銷售訂單', ' ');

IF NOT EXISTS (SELECT 1 FROM t_bas_billtypeparameter WHERE FFORMID = 'sm_salorder' AND FBILLTYPEID = 1362174530952364032)
INSERT INTO t_bas_billtypeparameter
(fformid, fbilltypeid, fdata)
VALUES('sm_salorder', 1362174530952364032, '{"biztype":{"number":"240","masterid":1356397960253931520,"_Type_":"bd_biztype","multilanguagetext":[{"_Type_":"locale","pkid":"28LC3Q=ENC0O","name":"VMI销售","description":"","localeid":"zh_CN"},{"_Type_":"locale","pkid":"28LC3Q=ENC0P","name":"VMI銷售","description":"","localeid":"zh_TW"}],"enable":"1","name":{"zh_TW":"VMI銷售","GLang":"VMI销售","zh_CN":"VMI销售"},"bizcategory":"BZ","id":1356397960253931520},"_Type_":"sm_billtypeparam","entryentity":[{"_Type_":"entryentity","biztypenumber":{"number":"240","masterid":1356397960253931520,"_Type_":"bd_biztype","multilanguagetext":[{"_Type_":"locale","pkid":"28LC3Q=ENC0O","name":"VMI销售","description":"","localeid":"zh_CN"},{"_Type_":"locale","pkid":"28LC3Q=ENC0P","name":"VMI銷售","description":"","localeid":"zh_TW"}],"enable":"1","name":{"zh_TW":"VMI銷售","GLang":"VMI销售","zh_CN":"VMI销售"},"bizcategory":"BZ","id":1356397960253931520},"ispreset":true,"biztypenumber_id":1356397960253931520,"id":0,"isdefault":true,"seq":1}],"biztype_id":1356397960253931520,"bizcategory":"VMI"}');


-- VMI销售订单变更单（旧）
IF NOT EXISTS (SELECT 1 FROM t_bas_billtype WHERE FID = 1362176316635350016)
INSERT INTO t_bas_billtype
(fid, fnumber, fbillformid, fisdefault, fbillcoderuleid, fcreatorid, fcreatetime, fmodifierid, fmodifytime, fcontrolprintcount, fmaxprintcount, fprintafteraudit, fdocumentstatus, fdefprinttemplate, fissyspreset, flayoutsolution, fdefwnreporttemplate, fstatus, fenable, fmasterid, fparasettingxml, fbillinitsetting)
VALUES(1362176316635350016, 'sm_XSalesOrder_VMI_BT_S', 'sm_xsalorder', '0', ' ', 1, {ts'2018-08-08 18:08:00'}, 1, {ts'2018-08-08 18:08:00'}, '0', 1, '1', '0', ' ', '1', '03X7S4BXKAV5', NULL, 'C', '1', 1362176316635350016, NULL, ' ');

IF NOT EXISTS (SELECT 1 FROM t_bas_billtype_l WHERE FPKID = '29A0SHW1ZHUF')
INSERT INTO t_bas_billtype_l
(fpkid, fid, flocaleid, fname, fdescription)
VALUES('29A0SHW1ZHUF', 1362176316635350016, 'zh_CN', 'VMI销售订单变更单', ' ');
IF NOT EXISTS (SELECT 1 FROM t_bas_billtype_l WHERE FPKID = '29A0SHW1ZHUG')
INSERT INTO t_bas_billtype_l
(fpkid, fid, flocaleid, fname, fdescription)
VALUES('29A0SHW1ZHUG', 1362176316635350016, 'zh_TW', 'VMI銷售訂單變更單', ' ');

IF NOT EXISTS (SELECT 1 FROM t_bas_billtypeparameter WHERE FFORMID = 'sm_xsalorder' AND FBILLTYPEID = 1362176316635350016)
INSERT INTO t_bas_billtypeparameter
(fformid, fbilltypeid, fdata)
VALUES('sm_xsalorder', 1362176316635350016, '{"biztype":{"number":"240","masterid":1356397960253931520,"_Type_":"bd_biztype","multilanguagetext":[{"_Type_":"locale","pkid":"28LC3Q=ENC0O","name":"VMI销售","description":"","localeid":"zh_CN"},{"_Type_":"locale","pkid":"28LC3Q=ENC0P","name":"VMI銷售","description":"","localeid":"zh_TW"}],"enable":"1","name":{"zh_TW":"VMI銷售","GLang":"VMI销售","zh_CN":"VMI销售"},"bizcategory":"BZ","id":1356397960253931520},"_Type_":"sm_billtypeparam","entryentity":[{"_Type_":"entryentity","biztypenumber":{"number":"240","masterid":1356397960253931520,"_Type_":"bd_biztype","multilanguagetext":[{"_Type_":"locale","pkid":"28LC3Q=ENC0O","name":"VMI销售","description":"","localeid":"zh_CN"},{"_Type_":"locale","pkid":"28LC3Q=ENC0P","name":"VMI銷售","description":"","localeid":"zh_TW"}],"enable":"1","name":{"zh_TW":"VMI銷售","GLang":"VMI销售","zh_CN":"VMI销售"},"bizcategory":"BZ","id":1356397960253931520},"ispreset":true,"biztypenumber_id":1356397960253931520,"id":0,"isdefault":true,"seq":1}],"biztype_id":1356397960253931520,"bizcategory":"VMI"}');


-- VMI销售订单变更单（新）
IF NOT EXISTS (SELECT 1 FROM t_bas_billtype WHERE FID = 1362177387306942464)
INSERT INTO t_bas_billtype
(fid, fnumber, fbillformid, fisdefault, fbillcoderuleid, fcreatorid, fcreatetime, fmodifierid, fmodifytime, fcontrolprintcount, fmaxprintcount, fprintafteraudit, fdocumentstatus, fdefprinttemplate, fissyspreset, flayoutsolution, fdefwnreporttemplate, fstatus, fenable, fmasterid, fparasettingxml, fbillinitsetting)
VALUES(1362177387306942464, 'sm_XSSalesOrder_VMI_BT_S', 'sm_xssalorder', '0', ' ', 1, {ts'2018-08-08 18:08:00'}, 1, {ts'2018-08-08 18:08:00'}, '0', 1, '1', '0', ' ', '1', '1R9P+N4ZPKFU', NULL, 'C', '1', 1362177387306942464, NULL, ' ');

IF NOT EXISTS (SELECT 1 FROM t_bas_billtype_l WHERE FPKID = '29A1+A4S479I')
INSERT INTO t_bas_billtype_l
(fpkid, fid, flocaleid, fname, fdescription)
VALUES('29A1+A4S479I', 1362177387306942464, 'zh_CN', 'VMI销售订单变更单', ' ');
IF NOT EXISTS (SELECT 1 FROM t_bas_billtype_l WHERE FPKID = '29A1+A4S479J')
INSERT INTO t_bas_billtype_l
(fpkid, fid, flocaleid, fname, fdescription)
VALUES('29A1+A4S479J', 1362177387306942464, 'zh_TW', 'VMI銷售訂單變更單', ' ');

IF NOT EXISTS (SELECT 1 FROM t_bas_billtypeparameter WHERE FFORMID = 'sm_xssalorder' AND FBILLTYPEID = 1362177387306942464)
INSERT INTO t_bas_billtypeparameter
(fformid, fbilltypeid, fdata)
VALUES('sm_xssalorder', 1362177387306942464, '{"biztype":{"number":"240","masterid":1356397960253931520,"_Type_":"bd_biztype","multilanguagetext":[{"_Type_":"locale","pkid":"28LC3Q=ENC0O","name":"VMI销售","description":"","localeid":"zh_CN"},{"_Type_":"locale","pkid":"28LC3Q=ENC0P","name":"VMI銷售","description":"","localeid":"zh_TW"}],"enable":"1","name":{"zh_TW":"VMI銷售","GLang":"VMI销售","zh_CN":"VMI销售"},"bizcategory":"BZ","id":1356397960253931520},"_Type_":"sm_billtypeparam","entryentity":[{"_Type_":"entryentity","biztypenumber":{"number":"240","masterid":1356397960253931520,"_Type_":"bd_biztype","multilanguagetext":[{"_Type_":"locale","pkid":"28LC3Q=ENC0O","name":"VMI销售","description":"","localeid":"zh_CN"},{"_Type_":"locale","pkid":"28LC3Q=ENC0P","name":"VMI銷售","description":"","localeid":"zh_TW"}],"enable":"1","name":{"zh_TW":"VMI銷售","GLang":"VMI销售","zh_CN":"VMI销售"},"bizcategory":"BZ","id":1356397960253931520},"ispreset":true,"biztypenumber_id":1356397960253931520,"id":0,"isdefault":true,"seq":1}],"biztype_id":1356397960253931520,"bizcategory":"VMI"}');


-- VMI销售发货通知单
IF NOT EXISTS (SELECT 1 FROM t_bas_billtype WHERE FID = 1362175220328170496)
INSERT INTO t_bas_billtype
(fid, fnumber, fbillformid, fisdefault, fbillcoderuleid, fcreatorid, fcreatetime, fmodifierid, fmodifytime, fcontrolprintcount, fmaxprintcount, fprintafteraudit, fdocumentstatus, fdefprinttemplate, fissyspreset, flayoutsolution, fdefwnreporttemplate, fstatus, fenable, fmasterid, fparasettingxml, fbillinitsetting)
VALUES(1362175220328170496, 'sm_delivernotice_VMI_BT_S', 'sm_delivernotice', '0', ' ', 1, {ts'2018-08-08 18:08:00'}, 1, {ts'2018-08-08 18:08:00'}, '0', 1, '1', '0', ' ', '1', '/Z0UX1YF6TQA', NULL, 'C', '1', 1362175220328170496, NULL, ' ');

IF NOT EXISTS (SELECT 1 FROM t_bas_billtype_l WHERE FPKID = '29A0KIA1D5+E')
INSERT INTO t_bas_billtype_l
(fpkid, fid, flocaleid, fname, fdescription)
VALUES('29A0KIA1D5+E', 1362175220328170496, 'zh_CN', 'VMI销售发货通知单', ' ');
IF NOT EXISTS (SELECT 1 FROM t_bas_billtype_l WHERE FPKID = '29A0KIA1D5+F')
INSERT INTO t_bas_billtype_l
(fpkid, fid, flocaleid, fname, fdescription)
VALUES('29A0KIA1D5+F', 1362175220328170496, 'zh_TW', 'VMI銷售發貨通知單', ' ');

IF NOT EXISTS (SELECT 1 FROM t_bas_billtypeparameter WHERE FFORMID = 'sm_delivernotice' AND FBILLTYPEID = 1362175220328170496)
INSERT INTO t_bas_billtypeparameter
(fformid, fbilltypeid, fdata)
VALUES('sm_delivernotice', 1362175220328170496, '{"biztype":{"number":"240","masterid":1356397960253931520,"_Type_":"bd_biztype","multilanguagetext":[{"_Type_":"locale","pkid":"28LC3Q=ENC0O","name":"VMI销售","description":"","localeid":"zh_CN"},{"_Type_":"locale","pkid":"28LC3Q=ENC0P","name":"VMI銷售","description":"","localeid":"zh_TW"}],"enable":"1","name":{"zh_TW":"VMI銷售","GLang":"VMI销售","zh_CN":"VMI销售"},"bizcategory":"BZ","id":1356397960253931520},"_Type_":"sm_billtypeparam","entryentity":[{"_Type_":"entryentity","biztypenumber":{"number":"240","masterid":1356397960253931520,"_Type_":"bd_biztype","multilanguagetext":[{"_Type_":"locale","pkid":"28LC3Q=ENC0O","name":"VMI销售","description":"","localeid":"zh_CN"},{"_Type_":"locale","pkid":"28LC3Q=ENC0P","name":"VMI銷售","description":"","localeid":"zh_TW"}],"enable":"1","name":{"zh_TW":"VMI銷售","GLang":"VMI销售","zh_CN":"VMI销售"},"bizcategory":"BZ","id":1356397960253931520},"ispreset":true,"biztypenumber_id":1356397960253931520,"id":0,"isdefault":true,"seq":1}],"biztype_id":1356397960253931520,"bizcategory":"VMI"}');


-- VMI销售退货申请单
IF NOT EXISTS (SELECT 1 FROM t_bas_billtype WHERE FID = 1362175762953666560)
INSERT INTO t_bas_billtype
(fid, fnumber, fbillformid, fisdefault, fbillcoderuleid, fcreatorid, fcreatetime, fmodifierid, fmodifytime, fcontrolprintcount, fmaxprintcount, fprintafteraudit, fdocumentstatus, fdefprinttemplate, fissyspreset, flayoutsolution, fdefwnreporttemplate, fstatus, fenable, fmasterid, fparasettingxml, fbillinitsetting)
VALUES(1362175762953666560, 'sm_returnapply_VMI_BT_S', 'sm_returnapply', '0', ' ', 1, {ts'2018-08-08 18:08:00'}, 1, {ts'2018-08-08 18:08:00'}, '0', 1, '1', '0', ' ', '1', '04Z/7AHGCQWO', NULL, 'C', '1', 1362175762953666560, NULL, ' ');

IF NOT EXISTS (SELECT 1 FROM t_bas_billtype_l WHERE FPKID = '29A0OGIBEYQH')
INSERT INTO t_bas_billtype_l
(fpkid, fid, flocaleid, fname, fdescription)
VALUES('29A0OGIBEYQH', 1362175762953666560, 'zh_CN', 'VMI销售退货申请单', ' ');
IF NOT EXISTS (SELECT 1 FROM t_bas_billtype_l WHERE FPKID = '29A0OGIBEYQI')
INSERT INTO t_bas_billtype_l
(fpkid, fid, flocaleid, fname, fdescription)
VALUES('29A0OGIBEYQI', 1362175762953666560, 'zh_TW', 'VMI銷售退貨申請單', ' ');

IF NOT EXISTS (SELECT 1 FROM t_bas_billtypeparameter WHERE FFORMID = 'sm_returnapply' AND FBILLTYPEID = 1362175762953666560)
INSERT INTO t_bas_billtypeparameter
(fformid, fbilltypeid, fdata)
VALUES('sm_returnapply', 1362175762953666560, '{"biztype":{"number":"2401","masterid":1356478361144132608,"_Type_":"bd_biztype","multilanguagetext":[{"_Type_":"locale","pkid":"28LR4LLVTNQ1","name":"VMI销售退货","description":"","localeid":"zh_CN"},{"_Type_":"locale","pkid":"28LR4LLVTNQ2","name":"VMI銷售退貨","description":"","localeid":"zh_TW"}],"enable":"1","name":{"zh_TW":"VMI銷售退貨","GLang":"VMI销售退货","zh_CN":"VMI销售退货"},"bizcategory":"BZ","id":1356478361144132608},"_Type_":"sm_billtypeparam","entryentity":[{"_Type_":"entryentity","biztypenumber":{"number":"2401","masterid":1356478361144132608,"_Type_":"bd_biztype","multilanguagetext":[{"_Type_":"locale","pkid":"28LR4LLVTNQ1","name":"VMI销售退货","description":"","localeid":"zh_CN"},{"_Type_":"locale","pkid":"28LR4LLVTNQ2","name":"VMI銷售退貨","description":"","localeid":"zh_TW"}],"enable":"1","name":{"zh_TW":"VMI銷售退貨","GLang":"VMI销售退货","zh_CN":"VMI销售退货"},"bizcategory":"BZ","id":1356478361144132608},"ispreset":true,"biztypenumber_id":1356478361144132608,"id":0,"isdefault":true,"seq":1}],"biztype_id":1356478361144132608,"bizcategory":"VMI"}');





