--销售订单变更单编码规则
-- t_cr_coderule
IF NOT EXISTS (SELECT 1 FROM t_cr_coderule WHERE FID = '05L/LP00JB1U')
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 ('05L/LP00JB1U', ' ', NULL, 'sm_xsalorder', '#', '1', '2', ' ', ' ', '1', 'C', 1, {ts'2018-08-08 18:08:08'}, 1, {ts'2018-08-08 18:08:08'}, '0', NULL, '05L/LP00JB1U', '0');

-- t_cr_coderule_l
IF NOT EXISTS (SELECT 1 FROM t_cr_coderule_l WHERE FPKID = '05L/LP00JQJQ')
INSERT INTO t_cr_coderule_l(FPKID, FID, FLOCALEID, FNAME) VALUES ('05L/LP00JQJQ', '05L/LP00JB1U', 'zh_TW', '銷售訂單變更單編碼規則');
IF NOT EXISTS (SELECT 1 FROM t_cr_coderule_l WHERE FPKID = '05L/LP00JQJR')
INSERT INTO t_cr_coderule_l(FPKID, FID, FLOCALEID, FNAME) VALUES ('05L/LP00JQJR', '05L/LP00JB1U', 'zh_CN', '销售订单变更单编码规则');

-- t_cr_coderuleentry
IF NOT EXISTS (SELECT 1 FROM t_cr_coderuleentry WHERE FENTRYID = '05L/LP2XZLIM')
INSERT INTO t_cr_coderuleentry(FENTRYID, FID, FSEQ, FATTRIBUTETYPE, FATTUSINGMODE, FVALUEATRIBUTE, FFORMAT, FSETTINGVALUE, FLENGTH, FINITIAL, FSTEP, FADDCHAR, FISSPLITSIGN, FADDSTYLE, FCUTSTYLE, FISSORTITEM, FSPLITSIGN, FISVISABLE) 
VALUES ('05L/LP2XZLIM', '05L/LP00JB1U', 0, '8', '3', 'srcbillno', ' ', ' ', 8, 1, 1, ' ', '0', '1', '1', '1', ' ', '1');
IF NOT EXISTS (SELECT 1 FROM t_cr_coderuleentry WHERE FENTRYID = '05L/LP2XZLIN')
INSERT INTO t_cr_coderuleentry(FENTRYID, FID, FSEQ, FATTRIBUTETYPE, FATTUSINGMODE, FVALUEATRIBUTE, FFORMAT, FSETTINGVALUE, FLENGTH, FINITIAL, FSTEP, FADDCHAR, FISSPLITSIGN, FADDSTYLE, FCUTSTYLE, FISSORTITEM, FSPLITSIGN, FISVISABLE)  VALUES ('05L/LP2XZLIN', '05L/LP00JB1U', 1, '16', '1', ' ', ' ', ' ', 3, 1, 1, ' ', '1', '1', '1', '0', '#', '1');