-- 销售退货申请单编码规则
IF NOT EXISTS (SELECT 1 FROM t_cr_coderule WHERE FID = '08B4RIX+FWZF')
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 ('08B4RIX+FWZF', ' ', NULL, 'sm_returnapply', '-', '1', '2', ' ', ' ', '1', 'C', 1, {ts'2018-08-08 18:08:00'}, 1, {ts'2018-08-08 18:08:00'}, NULL, NULL, '08B4RIX+FWZF', '0');

-- 销售退货申请单编码规则多语言
IF NOT EXISTS (SELECT 1 FROM t_cr_coderule_l WHERE FPKID = '08B4RIX22R+C')
INSERT INTO t_cr_coderule_l (FPKID, FID, FLOCALEID, FNAME) VALUES ('08B4RIX22R+C', '08B4RIX+FWZF', 'zh_TW', '銷售退貨申請單編碼規則');
IF NOT EXISTS (SELECT 1 FROM t_cr_coderule_l WHERE FPKID = '08B4RIX22R+D')
INSERT INTO t_cr_coderule_l (FPKID, FID, FLOCALEID, FNAME) VALUES ('08B4RIX22R+D', '08B4RIX+FWZF', 'zh_CN', '销售退货申请单编码规则');

-- 销售退货申请单编码规则明细
IF NOT EXISTS (SELECT 1 FROM t_cr_coderuleentry WHERE FENTRYID = '08B4RIYGGZW1')
INSERT INTO t_cr_coderuleentry (FENTRYID, FID, FSEQ, FATTRIBUTETYPE, FATTUSINGMODE, FVALUEATRIBUTE, FFORMAT, FSETTINGVALUE, FLENGTH, FINITIAL, FSTEP, FADDCHAR, FISSPLITSIGN, FADDSTYLE, FCUTSTYLE, FISSORTITEM, FSPLITSIGN, FISVISABLE) VALUES ('08B4RIYGGZW1', '08B4RIX+FWZF', 0, '1', ' ', ' ', 'XSTHSQ', ' ', 8, 1, 1, ' ', '0', '1', '1', '0', ' ', '1');
IF NOT EXISTS (SELECT 1 FROM t_cr_coderuleentry WHERE FENTRYID = '08B4RIYGGZW2')
INSERT INTO t_cr_coderuleentry (FENTRYID, FID, FSEQ, FATTRIBUTETYPE, FATTUSINGMODE, FVALUEATRIBUTE, FFORMAT, FSETTINGVALUE, FLENGTH, FINITIAL, FSTEP, FADDCHAR, FISSPLITSIGN, FADDSTYLE, FCUTSTYLE, FISSORTITEM, FSPLITSIGN, FISVISABLE) VALUES ('08B4RIYGGZW2', '08B4RIX+FWZF', 1, '2', '1', 'bizdate', 'yyMMdd', ' ', 8, 1, 1, ' ', '1', '1', '1', '1', '-', '1');
IF NOT EXISTS (SELECT 1 FROM t_cr_coderuleentry WHERE FENTRYID = '08B4RIYGGZW3')
INSERT INTO t_cr_coderuleentry (FENTRYID, FID, FSEQ, FATTRIBUTETYPE, FATTUSINGMODE, FVALUEATRIBUTE, FFORMAT, FSETTINGVALUE, FLENGTH, FINITIAL, FSTEP, FADDCHAR, FISSPLITSIGN, FADDSTYLE, FCUTSTYLE, FISSORTITEM, FSPLITSIGN, FISVISABLE) VALUES ('08B4RIYGGZW3', '08B4RIX+FWZF', 2, '16', '1', ' ', ' ', ' ', 6, 1, 1, ' ', '1', '1', '1', '0', '-', '1');
