-- 新增生产领料单的编码规则
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YV=URQY5=Z0';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YV=UROE92R6',1,'1',' ','0','3YV=URQY5=Z0',1,'1','1',0,8,'1','SCLL','1',' ',' ','0',' '); 
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YV=URQY5=Z1';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YV=UROE92R6',1,'9','-','0','3YV=URQY5=Z1',1,'1',' ',1,8,'1','yyMMdd','1',' ',' ','1',' '); 
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YV=URQY5=Z2';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YV=UROE92R6',1,'16','-','0','3YV=URQY5=Z2',1,'1',' ',2,6,'1',' ','1',' ',' ','1',' '); 
DELETE FROM T_CR_CodeRule WHERE FID = '3YV=UROE92R6';
INSERT INTO T_CR_CodeRule(FFILTERCONDITION,FISMATCHCODERULE,FEXAMPLE,FAPPMODE,FISADDVIEW,FISAPPCONDITION,FMASTERID,FISUNIQUE,FISMODIFIABLE,FCREATETIME,FBIZOBJECTID,FENABLE,FISUPDATERECOVER,FISAPPORG,FISSERIALNUMBER,FISCHECKNUMBER,FISCHECKCODE,FID,FCTRLMODE,FSPLITSIGN,FISLOG,FSTATUS,FNUMBER,FEXAMPLELENGTH,FISFAST,FMODIFIERID,FISNONBREAK,FMODIFYTIME,FCREATORID,FCONDITIONDESC) VALUES (' ','0',' ','2','1','0','3YV=UROE92R6','0','0',{ts'2024-02-29  00:00:00'},'im_mdc_mftproorder','1','0','1','1','0','0','3YV=UROE92R6','1','-','0','C','3YV=QZU2SKN=',' ','1',1553628481462598656,'0',{ts'2024-02-29  00:00:00'},1553628481462598656,' '); 
DELETE FROM T_CR_CodeRule_l WHERE FID = '3YV=UROE92R6' and FLOCALEID = 'zh_CN';
INSERT INTO T_CR_CodeRule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('3YV=UROE92R6','3YV=UROE93EF','zh_CN','生产领料单'); 
DELETE FROM T_CR_CodeRule_l WHERE FID = '3YV=UROE92R6' and FLOCALEID = 'zh_TW';
INSERT INTO T_CR_CodeRule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('3YV=UROE92R6','3YVYV3MXZHB1','zh_TW','生産領料單'); 

IF EXISTS (SELECT 1 FROM T_CR_CodeRule WHERE FBIZOBJECTID = 'im_mdc_mftproorder' AND FENABLE ='1' AND FID <>'3YV=UROE92R6')
UPDATE T_CR_CODERULE SET FENABLE='0' WHERE FID ='3YV=UROE92R6';

-- 生产退料单
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YV=Y=A8FYML';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YV=Y=9/F+/=',1,'1',' ','0','3YV=Y=A8FYML',1,'1','1',0,8,'1','SCTL','1',' ',' ','0',' '); 
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YV=Y=A8FYMM';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YV=Y=9/F+/=',1,'9','-','0','3YV=Y=A8FYMM',1,'1',' ',1,8,'1','yyMMdd','1',' ',' ','1',' '); 
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YV=Y=A8FYMN';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YV=Y=9/F+/=',1,'16','-','0','3YV=Y=A8FYMN',1,'1',' ',2,6,'1',' ','1',' ',' ','1',' '); 
DELETE FROM T_CR_CodeRule WHERE FID = '3YV=Y=9/F+/=';
INSERT INTO T_CR_CodeRule(FFILTERCONDITION,FISMATCHCODERULE,FEXAMPLE,FAPPMODE,FISADDVIEW,FISAPPCONDITION,FMASTERID,FISUNIQUE,FISMODIFIABLE,FCREATETIME,FBIZOBJECTID,FENABLE,FISUPDATERECOVER,FISAPPORG,FISSERIALNUMBER,FISCHECKNUMBER,FISCHECKCODE,FID,FCTRLMODE,FSPLITSIGN,FISLOG,FSTATUS,FNUMBER,FEXAMPLELENGTH,FISFAST,FMODIFIERID,FISNONBREAK,FMODIFYTIME,FCREATORID,FCONDITIONDESC) VALUES (' ','0',' ','2','1','0','3YV=Y=9/F+/=','0','0',{ts'2024-02-29  00:00:00'},'im_mdc_mftreturnorder','1','0','1','1','0','0','3YV=Y=9/F+/=','1','-','0','C','3YV=VWH=PDDU',' ','1',1553628481462598656,'0',{ts'2024-02-29  00:00:00'},1553628481462598656,' '); 
DELETE FROM T_CR_CodeRule_l WHERE FID = '3YV=Y=9/F+/=' and FLOCALEID = 'zh_TW';
INSERT INTO T_CR_CodeRule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('3YV=Y=9/F+/=','3YVYV3N/XKBK','zh_TW','生産退料單'); 
DELETE FROM T_CR_CodeRule_l WHERE FID = '3YV=Y=9/F+/=' and FLOCALEID = 'zh_CN';
INSERT INTO T_CR_CodeRule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('3YV=Y=9/F+/=','3YV=Y=931DW1','zh_CN','生产退料单'); 

IF EXISTS (SELECT 1 FROM T_CR_CodeRule WHERE FBIZOBJECTID = 'im_mdc_mftreturnorder' AND FENABLE ='1' AND FID <>'3YV=Y=9/F+/=')
UPDATE T_CR_CODERULE SET FENABLE='0' WHERE FID ='3YV=Y=9/F+/=';

-- 生产补料单
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YVA5/MQ9GI=';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YVA5/M1WK5P',1,'1',' ','0','3YVA5/MQ9GI=',1,'1','1',0,8,'1','SCBL','1',' ',' ','0',' '); 
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YVA5/MQ9GIA';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YVA5/M1WK5P',1,'9','-','0','3YVA5/MQ9GIA',1,'1',' ',1,8,'1','yyMMdd','1',' ',' ','1',' '); 
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YVA5/MQ9GIB';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YVA5/M1WK5P',1,'16','-','0','3YVA5/MQ9GIB',1,'1',' ',2,6,'1',' ','1',' ',' ','1',' '); 
DELETE FROM T_CR_CodeRule WHERE FID = '3YVA5/M1WK5P';
INSERT INTO T_CR_CodeRule(FFILTERCONDITION,FISMATCHCODERULE,FEXAMPLE,FAPPMODE,FISADDVIEW,FISAPPCONDITION,FMASTERID,FISUNIQUE,FISMODIFIABLE,FCREATETIME,FBIZOBJECTID,FENABLE,FISUPDATERECOVER,FISAPPORG,FISSERIALNUMBER,FISCHECKNUMBER,FISCHECKCODE,FID,FCTRLMODE,FSPLITSIGN,FISLOG,FSTATUS,FNUMBER,FEXAMPLELENGTH,FISFAST,FMODIFIERID,FISNONBREAK,FMODIFYTIME,FCREATORID,FCONDITIONDESC) VALUES (' ','0',' ','2','1','0','3YVA5/M1WK5P','0','0',{ts'2024-02-29  00:00:00'},'im_mdc_mftfeedorder','1','0','1','1','0','0','3YVA5/M1WK5P','1','-','0','C','3YVA33I7LFN7',' ','1',1553628481462598656,'0',{ts'2024-02-29  00:00:00'},1553628481462598656,' '); 
DELETE FROM T_CR_CodeRule_l WHERE FID = '3YVA5/M1WK5P' and FLOCALEID = 'zh_TW';
INSERT INTO T_CR_CodeRule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('3YVA5/M1WK5P','3YVYV3N/KY6B','zh_TW','生産補料單'); 
DELETE FROM T_CR_CodeRule_l WHERE FID = '3YVA5/M1WK5P' and FLOCALEID = 'zh_CN';
INSERT INTO T_CR_CodeRule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('3YVA5/M1WK5P','3YVA5/M1WJHF','zh_CN','生产补料单'); 

IF EXISTS (SELECT 1 FROM T_CR_CodeRule WHERE FBIZOBJECTID = 'im_mdc_mftfeedorder' AND FENABLE ='1' AND FID <>'3YVA5/M1WK5P')
UPDATE T_CR_CODERULE SET FENABLE='0' WHERE FID ='3YVA5/M1WK5P';

-- 完工入库单
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YVAGZRGX+0G';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YVAGZQG/DXU',1,'1',' ','0','3YVAGZRGX+0G',1,'1','1',0,8,'1','WGRK','1',' ',' ','0',' '); 
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YVAGZRGX+0H';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YVAGZQG/DXU',1,'9','-','0','3YVAGZRGX+0H',1,'1',' ',1,8,'1','yyMMdd','1',' ',' ','1',' '); 
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YVAGZRGX+0I';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YVAGZQG/DXU',1,'16','-','0','3YVAGZRGX+0I',1,'1',' ',2,6,'1',' ','1',' ',' ','1',' '); 
DELETE FROM T_CR_CodeRule WHERE FID = '3YVAGZQG/DXU';
INSERT INTO T_CR_CodeRule(FFILTERCONDITION,FISMATCHCODERULE,FEXAMPLE,FAPPMODE,FISADDVIEW,FISAPPCONDITION,FMASTERID,FISUNIQUE,FISMODIFIABLE,FCREATETIME,FBIZOBJECTID,FENABLE,FISUPDATERECOVER,FISAPPORG,FISSERIALNUMBER,FISCHECKNUMBER,FISCHECKCODE,FID,FCTRLMODE,FSPLITSIGN,FISLOG,FSTATUS,FNUMBER,FEXAMPLELENGTH,FISFAST,FMODIFIERID,FISNONBREAK,FMODIFYTIME,FCREATORID,FCONDITIONDESC) VALUES (' ','0',' ','2','1','0','3YVAGZQG/DXU','0','0',{ts'2024-02-29  00:00:00'},'im_mdc_mftmanuinbill','1','0','1','1','0','0','3YVAGZQG/DXU','1','-','0','C','3YVA82Q8WFY2',' ','1',1553628481462598656,'0',{ts'2024-02-29  00:00:00'},1553628481462598656,' '); 
DELETE FROM T_CR_CodeRule_l WHERE FID = '3YVAGZQG/DXU' and FLOCALEID = 'zh_TW';
INSERT INTO T_CR_CodeRule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('3YVAGZQG/DXU','3YVYV3N/XY3F','zh_TW','完工入庫單'); 
DELETE FROM T_CR_CodeRule_l WHERE FID = '3YVAGZQG/DXU' and FLOCALEID = 'zh_CN';
INSERT INTO T_CR_CodeRule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('3YVAGZQG/DXU','3YVAGZQJMUSL','zh_CN','完工入库单'); 

IF EXISTS (SELECT 1 FROM T_CR_CodeRule WHERE FBIZOBJECTID = 'im_mdc_mftmanuinbill' AND FENABLE ='1' AND FID <>'3YVAGZQG/DXU')
UPDATE T_CR_CODERULE SET FENABLE='0' WHERE FID ='3YVAGZQG/DXU';

-- 生产委外领料申请
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YVANV/WFH34';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YVANUZY=S1C',1,'1',' ','0','3YVANV/WFH34',1,'1','1',0,8,'1','SCLLSQ','1',' ',' ','0',' '); 
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YVANV/WFH35';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YVANUZY=S1C',1,'9','-','0','3YVANV/WFH35',1,'1',' ',1,8,'1','yyMMdd','1',' ',' ','1',' '); 
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YVANV/WFH36';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YVANUZY=S1C',1,'16','-','0','3YVANV/WFH36',1,'1',' ',2,6,'1',' ','1',' ',' ','1',' '); 
DELETE FROM T_CR_CodeRule WHERE FID = '3YVANUZY=S1C';
INSERT INTO T_CR_CodeRule(FFILTERCONDITION,FISMATCHCODERULE,FEXAMPLE,FAPPMODE,FISADDVIEW,FISAPPCONDITION,FMASTERID,FISUNIQUE,FISMODIFIABLE,FCREATETIME,FBIZOBJECTID,FENABLE,FISUPDATERECOVER,FISAPPORG,FISSERIALNUMBER,FISCHECKNUMBER,FISCHECKCODE,FID,FCTRLMODE,FSPLITSIGN,FISLOG,FSTATUS,FNUMBER,FEXAMPLELENGTH,FISFAST,FMODIFIERID,FISNONBREAK,FMODIFYTIME,FCREATORID,FCONDITIONDESC) VALUES (' ','0',' ','2','1','0','3YVANUZY=S1C','0','0',{ts'2024-02-29  00:00:00'},'im_mdc_mftomreqapplybill','1','0','1','1','0','0','3YVANUZY=S1C','1','-','0','C','3YVAKOCBVOKD',' ','1',1553628481462598656,'0',{ts'2024-02-29  00:00:00'},1553628481462598656,' '); 
DELETE FROM T_CR_CodeRule_l WHERE FID = '3YVANUZY=S1C' and FLOCALEID = 'zh_TW';
INSERT INTO T_CR_CodeRule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('3YVANUZY=S1C','3YVYV3N/XK7H','zh_TW','生産委外領料申請'); 
DELETE FROM T_CR_CodeRule_l WHERE FID = '3YVANUZY=S1C' and FLOCALEID = 'zh_CN';
INSERT INTO T_CR_CodeRule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('3YVANUZY=S1C','3YVANUZY=RD3','zh_CN','生产委外领料申请'); 

IF EXISTS (SELECT 1 FROM T_CR_CodeRule WHERE FBIZOBJECTID = 'im_mdc_mftomreqapplybill' AND FENABLE ='1' AND FID <>'3YVANUZY=S1C')
UPDATE T_CR_CODERULE SET FENABLE='0' WHERE FID ='3YVANUZY=S1C';

-- 生产委外退料申请
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YVAW1CECGQX';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YVAW1BH3ATS',1,'1',' ','0','3YVAW1CECGQX',1,'1','1',0,8,'1','SCTLSQ','1',' ',' ','0',' '); 
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YVAW1CECGQY';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YVAW1BH3ATS',1,'9','-','0','3YVAW1CECGQY',1,'1',' ',1,8,'1','yyMMdd','1',' ',' ','1',' '); 
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YVAW1CECGQZ';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YVAW1BH3ATS',1,'16','-','0','3YVAW1CECGQZ',1,'1',' ',2,6,'1',' ','1',' ',' ','1',' '); 
DELETE FROM T_CR_CodeRule WHERE FID = '3YVAW1BH3ATS';
INSERT INTO T_CR_CodeRule(FFILTERCONDITION,FISMATCHCODERULE,FEXAMPLE,FAPPMODE,FISADDVIEW,FISAPPCONDITION,FMASTERID,FISUNIQUE,FISMODIFIABLE,FCREATETIME,FBIZOBJECTID,FENABLE,FISUPDATERECOVER,FISAPPORG,FISSERIALNUMBER,FISCHECKNUMBER,FISCHECKCODE,FID,FCTRLMODE,FSPLITSIGN,FISLOG,FSTATUS,FNUMBER,FEXAMPLELENGTH,FISFAST,FMODIFIERID,FISNONBREAK,FMODIFYTIME,FCREATORID,FCONDITIONDESC) VALUES (' ','0',' ','2','1','0','3YVAW1BH3ATS','0','0',{ts'2024-02-29  00:00:00'},'im_mdc_mftreturnapplybill','1','0','1','1','0','0','3YVAW1BH3ATS','1','-','0','C','3YVARAIZIWAX',' ','1',1553628481462598656,'0',{ts'2024-02-29  00:00:00'},1553628481462598656,' '); 
DELETE FROM T_CR_CodeRule_l WHERE FID = '3YVAW1BH3ATS' and FLOCALEID = 'zh_TW';
INSERT INTO T_CR_CodeRule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('3YVAW1BH3ATS','3YVYV3N/KY6F','zh_TW','生産委外退料申請'); 
DELETE FROM T_CR_CodeRule_l WHERE FID = '3YVAW1BH3ATS' and FLOCALEID = 'zh_CN';
INSERT INTO T_CR_CodeRule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('3YVAW1BH3ATS','3YVAW1BH3BH0','zh_CN','生产委外退料申请'); 

IF EXISTS (SELECT 1 FROM T_CR_CodeRule WHERE FBIZOBJECTID = 'im_mdc_mftreturnapplybill' AND FENABLE ='1' AND FID <>'3YVAW1BH3ATS')
UPDATE T_CR_CODERULE SET FENABLE='0' WHERE FID ='3YVAW1BH3ATS';

-- 委外领料单
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YVC5MNL5Q96';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YVC5MM3526+',1,'1',' ','0','3YVC5MNL5Q96',1,'1','1',0,8,'1','WWLL','1',' ',' ','0',' '); 
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YVC5MNL5Q97';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YVC5MM3526+',1,'9','-','0','3YVC5MNL5Q97',1,'1',' ',1,8,'1','yyMMdd','1',' ',' ','1',' '); 
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YVC5MNL5Q98';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YVC5MM3526+',1,'16','-','0','3YVC5MNL5Q98',1,'1',' ',2,6,'1',' ','1',' ',' ','1',' '); 
DELETE FROM T_CR_CodeRule WHERE FID = '3YVC5MM3526+';
INSERT INTO T_CR_CodeRule(FFILTERCONDITION,FISMATCHCODERULE,FEXAMPLE,FAPPMODE,FISADDVIEW,FISAPPCONDITION,FMASTERID,FISUNIQUE,FISMODIFIABLE,FCREATETIME,FBIZOBJECTID,FENABLE,FISUPDATERECOVER,FISAPPORG,FISSERIALNUMBER,FISCHECKNUMBER,FISCHECKCODE,FID,FCTRLMODE,FSPLITSIGN,FISLOG,FSTATUS,FNUMBER,FEXAMPLELENGTH,FISFAST,FMODIFIERID,FISNONBREAK,FMODIFYTIME,FCREATORID,FCONDITIONDESC) VALUES (' ','0',' ','2','1','0','3YVC5MM3526+','0','0',{ts'2024-02-29  00:00:00'},'im_mdc_omoutbill','1','0','1','1','0','0','3YVC5MM3526+','1','-','0','C','3YVC24YB+SE0',' ','1',1553628481462598656,'0',{ts'2024-02-29  00:00:00'},1553628481462598656,' '); 
DELETE FROM T_CR_CodeRule_l WHERE FID = '3YVC5MM3526+' and FLOCALEID = 'zh_TW';
INSERT INTO T_CR_CodeRule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('3YVC5MM3526+','3YVYV3N/KX8G','zh_TW','委外領料單'); 
DELETE FROM T_CR_CodeRule_l WHERE FID = '3YVC5MM3526+' and FLOCALEID = 'zh_CN';
INSERT INTO T_CR_CodeRule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('3YVC5MM3526+','3YVC5MM6SGP8','zh_CN','委外领料单'); 

IF EXISTS (SELECT 1 FROM T_CR_CodeRule WHERE FBIZOBJECTID = 'im_mdc_omoutbill' AND FENABLE ='1' AND FID <>'3YVC5MM3526+')
UPDATE T_CR_CODERULE SET FENABLE='0' WHERE FID ='3YVC5MM3526+';

-- 委外退料单
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YVC894HLKHU';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YVC88/1C3EP',1,'1',' ','0','3YVC894HLKHU',1,'1','1',0,8,'1','WWTL','1',' ',' ','0',' '); 
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YVC894HLKHV';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YVC88/1C3EP',1,'9','-','0','3YVC894HLKHV',1,'1',' ',1,8,'1','yyMMdd','1',' ',' ','1',' '); 
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YVC894HLKHW';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YVC88/1C3EP',1,'16','-','0','3YVC894HLKHW',1,'1',' ',2,6,'1',' ','1',' ',' ','1',' '); 
DELETE FROM T_CR_CodeRule WHERE FID = '3YVC88/1C3EP';
INSERT INTO T_CR_CodeRule(FFILTERCONDITION,FISMATCHCODERULE,FEXAMPLE,FAPPMODE,FISADDVIEW,FISAPPCONDITION,FMASTERID,FISUNIQUE,FISMODIFIABLE,FCREATETIME,FBIZOBJECTID,FENABLE,FISUPDATERECOVER,FISAPPORG,FISSERIALNUMBER,FISCHECKNUMBER,FISCHECKCODE,FID,FCTRLMODE,FSPLITSIGN,FISLOG,FSTATUS,FNUMBER,FEXAMPLELENGTH,FISFAST,FMODIFIERID,FISNONBREAK,FMODIFYTIME,FCREATORID,FCONDITIONDESC) VALUES (' ','0',' ','2','1','0','3YVC88/1C3EP','0','0',{ts'2024-02-29  00:00:00'},'im_mdc_omreturnbill','1','0','1','1','0','0','3YVC88/1C3EP','1','-','0','C','3YVC6P3PQ73E',' ','1',1553628481462598656,'0',{ts'2024-02-29  00:00:00'},1553628481462598656,' '); 
DELETE FROM T_CR_CodeRule_l WHERE FID = '3YVC88/1C3EP' and FLOCALEID = 'zh_TW';
INSERT INTO T_CR_CodeRule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('3YVC88/1C3EP','3YVYV3N/KY7X','zh_TW','委外退料單'); 
DELETE FROM T_CR_CodeRule_l WHERE FID = '3YVC88/1C3EP' and FLOCALEID = 'zh_CN';
INSERT INTO T_CR_CodeRule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('3YVC88/1C3EP','3YVC88/1C2RF','zh_CN','委外退料单'); 

IF EXISTS (SELECT 1 FROM T_CR_CodeRule WHERE FBIZOBJECTID = 'im_mdc_omreturnbill' AND FENABLE ='1' AND FID <>'3YVC88/1C3EP')
UPDATE T_CR_CODERULE SET FENABLE='0' WHERE FID ='3YVC88/1C3EP';

-- 委外补料单
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YVCCD3+3WGX';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YVCCD/TURYG',1,'1',' ','0','3YVCCD3+3WGX',1,'1','1',0,8,'1','WWBL','1',' ',' ','0',' '); 
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YVCCD3+3WGY';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YVCCD/TURYG',1,'9','-','0','3YVCCD3+3WGY',1,'1',' ',1,8,'1','yyMMdd','1',' ',' ','1',' '); 
DELETE FROM T_CR_CodeRuleEntry WHERE FENTRYID = '3YVCCD3+3WGZ';
INSERT INTO T_CR_CodeRuleEntry(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FADDSTYLE,FSETTINGVALUE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('3YVCCD/TURYG',1,'16','-','0','3YVCCD3+3WGZ',1,'1',' ',2,6,'1',' ','1',' ',' ','1',' '); 
DELETE FROM T_CR_CodeRule WHERE FID = '3YVCCD/TURYG';
INSERT INTO T_CR_CodeRule(FFILTERCONDITION,FISMATCHCODERULE,FEXAMPLE,FAPPMODE,FISADDVIEW,FISAPPCONDITION,FMASTERID,FISUNIQUE,FISMODIFIABLE,FCREATETIME,FBIZOBJECTID,FENABLE,FISUPDATERECOVER,FISAPPORG,FISSERIALNUMBER,FISCHECKNUMBER,FISCHECKCODE,FID,FCTRLMODE,FSPLITSIGN,FISLOG,FSTATUS,FNUMBER,FEXAMPLELENGTH,FISFAST,FMODIFIERID,FISNONBREAK,FMODIFYTIME,FCREATORID,FCONDITIONDESC) VALUES (' ','0',' ','2','1','0','3YVCCD/TURYG','0','0',{ts'2024-02-29  00:00:00'},'im_mdc_omfeedbill','1','0','1','1','0','0','3YVCCD/TURYG','1','-','0','C','3YVC9NJK4/8F',' ','1',1553628481462598656,'0',{ts'2024-02-29  00:00:00'},1553628481462598656,' '); 
DELETE FROM T_CR_CodeRule_l WHERE FID = '3YVCCD/TURYG' and FLOCALEID = 'zh_TW';
INSERT INTO T_CR_CodeRule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('3YVCCD/TURYG','3YVYV3N/YXZR','zh_TW','委外補料單'); 
DELETE FROM T_CR_CodeRule_l WHERE FID = '3YVCCD/TURYG' and FLOCALEID = 'zh_CN';
INSERT INTO T_CR_CodeRule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('3YVCCD/TURYG','3YVCCD/XG5FQ','zh_CN','委外补料单'); 

IF EXISTS (SELECT 1 FROM T_CR_CodeRule WHERE FBIZOBJECTID = 'im_mdc_omfeedbill' AND FENABLE ='1' AND FID <>'3YVCCD/TURYG')
UPDATE T_CR_CODERULE SET FENABLE='0' WHERE FID ='3YVCCD/TURYG';



