-- 业务类型 外协费用采购 sys库
IF NOT EXISTS (SELECT 1 FROM t_bd_biztype WHERE FID = '1002795213917594624') 
insert into t_bd_biztype (FID, FNUMBER, FBIZCATEGORY, FISPRESET, FSTATUS, FENABLE, FCREATORID, FCREATETIME, FMODIFIERID, FMODIFYTIME, FDISABLERID, FDISABLEDATE, FMASTERID, FISPURCHASE, FISSALE, FISINVENTORY, FDOMAIN, FNAME, FDESCRIPTION)
values ('1002795213917594624', 'WX110', 'BZ', '1', 'C', '1', '1', {ts'2020-09-25 10:34:02'}, '1',{ts'2020-09-25 10:34:02'}, '0', null, '1002795213917594624', '0', '0', '0', '1', '外协费用采购', ' ');

IF NOT EXISTS (SELECT 1 FROM t_bd_biztype_l WHERE FPKID = '1459ZJQN6FCU') 
insert into t_bd_biztype_l (FPKID, FID, FLOCALEID, FNAME, FDESCRIPTION)
values ('1459ZJQN6FCU', '1002795213917594624', 'zh_CN', '外协费用采购', ' ');

IF NOT EXISTS (SELECT 1 FROM t_bd_biztype_l WHERE FPKID = '1459ZJQN6FCV') 
insert into t_bd_biztype_l (FPKID, FID, FLOCALEID, FNAME, FDESCRIPTION)
values ('1459ZJQN6FCV', '1002795213917594624', 'zh_TW', '外協費用采購', ' ');

IF NOT EXISTS (SELECT 1 FROM t_sbd_biztypebillentity WHERE FENTRYID = '1002795213976314880') 
insert into t_sbd_biztypebillentity (FID, FENTRYID, FSEQ, FBILLFORM)
values ('1002795213917594624', '1002795213976314880', '1', 'pm_purapplybill');

IF NOT EXISTS (SELECT 1 FROM t_sbd_biztypebillentity WHERE FENTRYID = '1002795213976314881') 
insert into t_sbd_biztypebillentity (FID, FENTRYID, FSEQ, FBILLFORM)
values ('1002795213917594624', '1002795213976314881', '2', 'im_purinbill');

IF NOT EXISTS (SELECT 1 FROM t_sbd_biztypebillentity WHERE FENTRYID = '1002795213976314882') 
insert into t_sbd_biztypebillentity (FID, FENTRYID, FSEQ, FBILLFORM)
values ('1002795213917594624', '1002795213976314882', '3', 'pm_purorderbill');

-- 业务类型 外协费用采购退货 sys库
IF NOT EXISTS (SELECT 1 FROM t_bd_biztype WHERE FID = '1006426561370713088') 
insert into t_bd_biztype (FID, FNUMBER, FBIZCATEGORY, FISPRESET, FSTATUS, FENABLE, FCREATORID, FCREATETIME, FMODIFIERID, FMODIFYTIME, FDISABLERID, FDISABLEDATE, FMASTERID, FISPURCHASE, FISSALE, FISINVENTORY, FDOMAIN, FNAME, FDESCRIPTION)
values ('1006426561370713088', 'WX1101', 'BZ', '1', 'C', '1', '1', {ts'2020-09-25 10:34:02'}, '1',{ts'2020-09-25 10:34:02'}, '0', null, '1006426561370713088', '0', '0', '0', '1', '外协费用采购退货', ' ');

IF NOT EXISTS (SELECT 1 FROM t_bd_biztype_l WHERE FPKID = '14LOG6R=TVYF') 
insert into t_bd_biztype_l (FPKID, FID, FLOCALEID, FNAME, FDESCRIPTION)
values ('14LOG6R=TVYF', '1006426561370713088', 'zh_CN', '外协费用采购退货', ' ');

IF NOT EXISTS (SELECT 1 FROM t_bd_biztype_l WHERE FPKID = '14LOG6R=TVYG') 
insert into t_bd_biztype_l (FPKID, FID, FLOCALEID, FNAME, FDESCRIPTION)
values ('14LOG6R=TVYG', '1006426561370713088', 'zh_TW', '外協費用采購退貨', ' ');

IF NOT EXISTS (SELECT 1 FROM t_sbd_biztypebillentity WHERE FENTRYID = '1006426571671923712') 
insert into t_sbd_biztypebillentity (FID, FENTRYID, FSEQ, FBILLFORM)
values ('1006426561370713088', '1006426571671923712', '1', 'im_purinbill');


--单据类型 增加外协采购申请单 单据类型 sys
IF NOT EXISTS (SELECT 1 FROM T_BAS_BILLTYPE WHERE FID = '1002796011481277440') 
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 ('1002796011481277440', 'pm_purapplybill_EMS_BT_S', 'pm_purapplybill', '0', ' ', 1, {ts '2020-06-23 11:07:47'}, 1, {ts '2020-06-23 11:07:47'}, '0', 1, '1', '0', ' ', '0', '/MKJNQ1/XYHG', null, 'C', '1', '1002796011481277440', null, ' ');

--单据类型 外协采购申请单单据类型多语言 sys
IF NOT EXISTS (SELECT 1 FROM T_BAS_BILLTYPE_l WHERE FPKID = '145=3CD+5YPP') 
insert into T_BAS_BILLTYPE_l (FPKID, FID, FLOCALEID, FNAME, FDESCRIPTION)
values ('145=3CD+5YPP', '1002796011481277440', 'zh_CN', '外协采购申请单', '外协采购申请单'); 

IF NOT EXISTS (SELECT 1 FROM T_BAS_BILLTYPE_l WHERE FPKID = '145=3CD+5YPQ') 
insert into T_BAS_BILLTYPE_l (FPKID, FID, FLOCALEID, FNAME, FDESCRIPTION)
values ('145=3CD+5YPQ', '1002796011481277440', 'zh_TW', '外協采購申請單', '外協采購申請單');

--单据类型 外协采购申请单 业务类型 参数 sys
IF NOT EXISTS (SELECT 1 FROM T_BAS_BILLTYPEPARAMETER WHERE FBILLTYPEID = '1002796011481277440') 
insert into T_BAS_BILLTYPEPARAMETER (FFORMID, FBILLTYPEID, FDATA)
values ('pm_purapplybill', '1002796011481277440', '{"biztype":{"number":"WX110","masterid":1002795213917594624,"_Type_":"bd_biztype","multilanguagetext":[{"_Type_":"locale","pkid":"1459ZJQN6FCU","name":"外协费用采购","description":"","localeid":"zh_CN"},{"_Type_":"locale","pkid":"1459ZJQN6FCV","name":"外協費用采購","description":"","localeid":"zh_TW"}],"name":{"zh_TW":"外協費用采購","zh_CN":"外协费用采购"},"id":1002795213917594624},"_Type_":"pm_billtypeparameter","biztype_id":1002795213917594624}');

--单据类型 增加外协采购订单 单据类型 sys
IF NOT EXISTS (SELECT 1 FROM T_BAS_BILLTYPE WHERE FID = '1005695800258488320') 
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 ('1005695800258488320', 'pm_PurOrderBill_EMS_BT_S', 'pm_purorderbill', '0', ' ', 1, {ts '2020-06-23 11:07:47'}, 1, {ts '2020-06-23 11:07:47'}, '0', 1, '1', '0', ' ', '0', '/LVO0CKPO89N', null, 'C', '1', '1005695800258488320', null, ' ');

--单据类型 外协采购订单单据类型多语言 sys
IF NOT EXISTS (SELECT 1 FROM T_BAS_BILLTYPE_l WHERE FPKID = '14I5Y252WMZK') 
insert into T_BAS_BILLTYPE_l (FPKID, FID, FLOCALEID, FNAME, FDESCRIPTION)
values ('14I5Y252WMZK', '1005695800258488320', 'zh_CN', '外协采购订单', '外协采购订单'); 

IF NOT EXISTS (SELECT 1 FROM T_BAS_BILLTYPE_l WHERE FPKID = '14I5Y252WMZL') 
insert into T_BAS_BILLTYPE_l (FPKID, FID, FLOCALEID, FNAME, FDESCRIPTION)
values ('14I5Y252WMZL', '1005695800258488320', 'zh_TW', '外協采購訂單', '外協采購訂單');

--单据类型 外协采购订单 业务类型 参数 sys
IF NOT EXISTS (SELECT 1 FROM T_BAS_BILLTYPEPARAMETER WHERE FBILLTYPEID = '1005695800258488320') 
insert into T_BAS_BILLTYPEPARAMETER (FFORMID, FBILLTYPEID, FDATA)
values ('pm_purorderbill', '1005695800258488320', '{"biztype":{"number":"WX110","masterid":1002795213917594624,"_Type_":"bd_biztype","multilanguagetext":[{"_Type_":"locale","pkid":"1459ZJQN6FCU","name":"外协费用采购","description":"","localeid":"zh_CN"},{"_Type_":"locale","pkid":"1459ZJQN6FCV","name":"外協費用采購","description":"","localeid":"zh_TW"}],"name":{"zh_TW":"外協費用采購","zh_CN":"外协费用采购"},"id":1002795213917594624},"_Type_":"pm_billtypeparameter","biztype_id":1002795213917594624}');



