--库存事务  scm

--增加库存事务--WX140-表头 1191
IF NOT EXISTS (SELECT 1 FROM t_im_invschemes WHERE FID = 1002798520337769472) 
insert into t_im_invschemes (FID, FNUMBER, FCREATORID, FMODIFIERID, FENABLE, FCREATETIME, FMODIFYTIME, FMASTERID, FGROUPID, FDISABLERID, FDISABLEDATE, FINVDC, FTRANSCEIVERTYPEID, FINVSTATUSID, FISOUTUPDATE, FOUTINVSTATUSID, FOWNERTYPE, FKEEPERTYPE, FOUTOWNERTYPE, FOUTKEEPERTYPE, FISINUPDATE, FISPRESET, FBILLFORMID, FISNOTUPDATE)
values (1002798520337769472, 'WX140', 22132776, 22132776, '1', {ts'2019-10-08 10:34:02'}, {ts'2019-10-08 10:34:02'}, 1002798520337769472, 376675954728127488, 0, null, 'A', 687616874967685120, 0, '0','0', ' ', ' ', ' ', ' ', '0','1','im_purinbill', '1');


IF NOT EXISTS (SELECT 1 FROM t_im_invschemes_l WHERE FPKID = '145=KND+EPE1') 
insert into t_im_invschemes_l (FPKID, FID, FLOCALEID, FNAME, FDESCRIPTION)
values ('145=KND+EPE1', 1002798520337769472, 'zh_CN', '外协费用接收', '外协费用接收');

IF NOT EXISTS (SELECT 1 FROM t_im_invschemes_l WHERE FPKID = '145=KND+EPE2') 
insert into t_im_invschemes_l (FPKID, FID, FLOCALEID, FNAME, FDESCRIPTION)
values ('145=KND+EPE2', 1002798520337769472, 'zh_TW', '外協費用接收', '外協費用接收');


--关联业务类型
IF NOT EXISTS (SELECT 1 FROM t_im_biztypeentry WHERE FENTRYID = 1002798520362935296) 
insert into t_im_biztypeentry (FID, FENTRYID, FSEQ, FBIZTYPEID, FALLOWMANUALADD)
values (1002798520337769472, 1002798520362935296, 1, 1002795213917594624, '0');


--增加库存事务--WX1401-表头 1191
IF NOT EXISTS (SELECT 1 FROM t_im_invschemes WHERE FID = 1006427364085003264) 
insert into t_im_invschemes (FID, FNUMBER, FCREATORID, FMODIFIERID, FENABLE, FCREATETIME, FMODIFYTIME, FMASTERID, FGROUPID, FDISABLERID, FDISABLEDATE, FINVDC, FTRANSCEIVERTYPEID, FINVSTATUSID, FISOUTUPDATE, FOUTINVSTATUSID, FOWNERTYPE, FKEEPERTYPE, FOUTOWNERTYPE, FOUTKEEPERTYPE, FISINUPDATE, FISPRESET, FBILLFORMID, FISNOTUPDATE)
values (1006427364085003264, 'WX1401', 22132776, 22132776, '1', {ts'2019-10-08 10:34:02'}, {ts'2019-10-08 10:34:02'}, 1006427364085003264, 376675954728127488, 0, null, 'A', 687617195957770240, 0, '0','0', ' ', ' ', ' ', ' ', '0','1','im_purinbill', '1');


IF NOT EXISTS (SELECT 1 FROM t_im_invschemes_l WHERE FPKID = '14LOLZZGOJK1') 
insert into t_im_invschemes_l (FPKID, FID, FLOCALEID, FNAME, FDESCRIPTION)
values ('14LOLZZGOJK1', 1006427364085003264, 'zh_CN', '外协费用退回', '外协费用退回');

IF NOT EXISTS (SELECT 1 FROM t_im_invschemes_l WHERE FPKID = '14LOLZZGOJK2') 
insert into t_im_invschemes_l (FPKID, FID, FLOCALEID, FNAME, FDESCRIPTION)
values ('14LOLZZGOJK2', 1006427364085003264, 'zh_TW', '外協費用退回', '外協費用退回');


--关联业务类型
IF NOT EXISTS (SELECT 1 FROM t_im_biztypeentry WHERE FENTRYID = 1006427364126946304) 
insert into t_im_biztypeentry (FID, FENTRYID, FSEQ, FBIZTYPEID, FALLOWMANUALADD)
values (1006427364085003264, 1006427364126946304, 1, 1006426561370713088, '0');


