-- 新增领料申请的编码规则 2019-09-06
-- t_cr_coderule
IF NOT EXISTS (SELECT 1 FROM t_cr_coderule WHERE fid = '06R3EFK2ALGA') 
insert into t_cr_coderule (FID, FNUMBER, FRULETYPE, FBIZOBJECTID, FSPLITSIGN, FCTRLMODE, FAPPMODE, FEXAMPLE, FEXAMPLELENGTH, FENABLE, FSTATUS, FCREATORID, FCREATETIME, FMODIFIERID, FMODIFYTIME, FDISABLERID, FDISABLEDATE, FMASTERID, FISUPDATERECOVER)
values ('06R3EFK2ALGA', ' ', null, 'im_materialreqbill', '-', '1', '2', ' ', ' ', '1', 'C', 1, {ts'2019-08-22 18:08:00'}, 1, {ts'2019-08-22 18:08:00'}, null, null, '06R3EFK2ALGA', '0');

-- t_cr_coderule_l
IF NOT EXISTS (SELECT 1 FROM t_cr_coderule_l WHERE FPKID = '06R3EFK2=RGS') 
insert into t_cr_coderule_l (FPKID, FID, FLOCALEID, FNAME) values ('06R3EFK2=RGS', '06R3EFK2ALGA', 'zh_CN', '领料申请单编码规则');

IF NOT EXISTS (SELECT 1 FROM t_cr_coderule_l WHERE FPKID = '073EGUSQ=UCO') 
insert into t_cr_coderule_l (FPKID, FID, FLOCALEID, FNAME) values ('073EGUSQ=UCO', '06R3EFK2ALGA', 'zh_TW', '領料申請單編碼規則');

-- t_cr_coderuleentry
IF NOT EXISTS (SELECT 1 FROM t_cr_coderuleentry WHERE FENTRYID = '073ET6U3DX2U') 
insert into t_cr_coderuleentry (FENTRYID, FID, FSEQ, FATTRIBUTETYPE, FATTUSINGMODE, FVALUEATRIBUTE, FFORMAT, FSETTINGVALUE, FLENGTH, FINITIAL, FSTEP, FADDCHAR, FISSPLITSIGN, FADDSTYLE, FCUTSTYLE, FISSORTITEM, FSPLITSIGN, FISVISABLE)
values ('073ET6U3DX2U', '06R3EFK2ALGA', 0, '1', ' ', ' ', 'LLSQ', ' ', 8, 1, 1, ' ', '0', '1', '1', '0', ' ', '1');

IF NOT EXISTS (SELECT 1 FROM t_cr_coderuleentry WHERE FENTRYID = '073ET6U3DX2V') 
insert into t_cr_coderuleentry (FENTRYID, FID, FSEQ, FATTRIBUTETYPE, FATTUSINGMODE, FVALUEATRIBUTE, FFORMAT, FSETTINGVALUE, FLENGTH, FINITIAL, FSTEP, FADDCHAR, FISSPLITSIGN, FADDSTYLE, FCUTSTYLE, FISSORTITEM, FSPLITSIGN, FISVISABLE)
values ('073ET6U3DX2V', '06R3EFK2ALGA', 1, '2', '1', 'biztime', 'yyMMdd', ' ', 8, 1, 1, ' ', '1', '1', '1', '1', '-', '1');

IF NOT EXISTS (SELECT 1 FROM t_cr_coderuleentry WHERE FENTRYID = '073ET6U3DX2W') 
insert into t_cr_coderuleentry (FENTRYID, FID, FSEQ, FATTRIBUTETYPE, FATTUSINGMODE, FVALUEATRIBUTE, FFORMAT, FSETTINGVALUE, FLENGTH, FINITIAL, FSTEP, FADDCHAR, FISSPLITSIGN, FADDSTYLE, FCUTSTYLE, FISSORTITEM, FSPLITSIGN, FISVISABLE)
values ('073ET6U3DX2W', '06R3EFK2ALGA', 2, '16', '1', ' ', ' ', ' ', 6, 1, 1, ' ', '1', '1', '1', '0', '-', '1');