
--format both msg are aleady in Inserted..
 
    delete messages where msg_no in ('VTINVLPN','VTINVLEN');
    commit;
	
	Insert into messages (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION) 
	values ('VTINVLPN  ','Invalid Lpn No.','Invalid Lpn No.Lpn no must start with NJ,CN,DM or EX','E','Y',null,null,null,to_date('15-JUL-14','DD-MON-RR'),'ROHAN     ','BASE           ',null,null);
	--length
	Insert into messages (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION) 
	values ('VTINVLEN','Invalid Lpn No.','Invalid Lpn No.Lpn no should be 10 character.','E','Y',null,null,null,to_date('23-JUL-14','DD-MON-RR'),'DHANRAJ','BASE',null,null);

-----PORCP_WIZ LOT_SL format
	Insert into genmst (FLD_NAME,MOD_NAME,DESCR,ERROR_CD,BLANK_OPT,FLD_TYPE,FLD_MIN,FLD_MAX,VAL_TYPE,CHG_DATE,CHG_USER,CHG_TERM,VAL_TABLE,SQL_INPUT,FLD_WIDTH,UDF_USAGE_1,UDF_USAGE_2,UDF_USAGE_3,VAL_STAGE,OBJ_NAME) values ('LOT_SL','W_PORCP_WIZ','Validation For LOT SL','VTINVLPN  ','N','C','select (case when ( ( ( ? LIKE (''NJ%'')) OR ( ? LIKE (''CN%'')) OR ( ? LIKE (''DM%'')) OR  ( ? LIKE (''EX%''))) AND (  ( ? in (''TA821'',''TA387''))) ) then 1 else 0 end ) from dual','1','Q',to_date('27-JUN-14','DD-MON-RR'),'prg       ','PRG            ',null,':2.lot_sl,:2.lot_sl,:2.lot_sl,:2.lot_sl,:1.site_code',10,null,null,null,null,null);


	--lenght LOT_SL test start..240714
	Insert into genmst (FLD_NAME,MOD_NAME,DESCR,ERROR_CD,BLANK_OPT,FLD_TYPE,FLD_MIN,FLD_MAX,VAL_TYPE,CHG_DATE,CHG_USER,CHG_TERM,VAL_TABLE,SQL_INPUT,FLD_WIDTH,UDF_USAGE_1,UDF_USAGE_2,UDF_USAGE_3,VAL_STAGE,OBJ_NAME) values ('NO_ART','W_PORCP_WIZ','Validation For LOT SL','VTINVLEN  ','N','C','Select (case when(length( ? ) = 10 AND ? in (''TA821'',''TA387'') ) then 1 else 0 end) from dual','1','Q',to_date('15-JUL-14','DD-MON-RR'),'prg       ','PRG            ',null,':2.lot_sl,:1.site_code',10,null,null,null,null,null);

	Insert into system_events (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,OVERWRITE_CORE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,COMP_TYPE,COMP_NAME,COMM_FORMAT) 
	values ('porcp_wiz','post_validate','1','post_gen_val',null,'0',to_date('15-JUL-14','DD-MON-RR'),'BASE      ','BASE','2','EJB','GenValidate',null);

----repl_iss  --LOT_SL LOT_SL format
	Insert into genmst (FLD_NAME,MOD_NAME,DESCR,ERROR_CD,BLANK_OPT,FLD_TYPE,FLD_MIN,FLD_MAX,VAL_TYPE,CHG_DATE,CHG_USER,CHG_TERM,VAL_TABLE,SQL_INPUT,FLD_WIDTH,UDF_USAGE_1,UDF_USAGE_2,UDF_USAGE_3,VAL_STAGE,OBJ_NAME) values ('LOT_SL__NEW','W_ACTIVE_REPL_ISS','Validation For LOT SL','VTINVLPN  ','N','C','select (case when ( ( ( ? LIKE (''NJ%'')) OR ( ? LIKE (''CN%'')) OR ( ? LIKE (''DM%'')) OR  ( ? LIKE (''EX%''))) AND (  ( ? in (''TA821'',''TA387''))) ) then 1 else 0 end ) from dual','1','Q',to_date('15-JUL-14','DD-MON-RR'),'prg       ','PRG            ',null,':2.lot_sl__new,:2.lot_sl__new,:2.lot_sl__new,:2.lot_sl__new,:1.site_code',10,null,null,null,null,null);

	--lenght  LOT_SL__NEW
	Insert into genmst (FLD_NAME,MOD_NAME,DESCR,ERROR_CD,BLANK_OPT,FLD_TYPE,FLD_MIN,FLD_MAX,VAL_TYPE,CHG_DATE,CHG_USER,CHG_TERM,VAL_TABLE,SQL_INPUT,FLD_WIDTH,UDF_USAGE_1,UDF_USAGE_2,UDF_USAGE_3,VAL_STAGE,OBJ_NAME) values ('NO_ART','W_ACTIVE_REPL_ISS','Validation For LOT SL','VTINVLEN  ','N','C','Select (case when(length( ? ) = 10 AND ? in (''TA821'',''TA387'') ) then 1 else 0 end) from dual','1','Q',to_date('15-JUL-14','DD-MON-RR'),'prg       ','PRG            ',null,':2.lot_sl__new,:1.site_code',10,null,null,null,null,null);

	Insert into system_events (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,OVERWRITE_CORE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,COMP_TYPE,COMP_NAME,COMM_FORMAT) 
	values ('active_repl_iss','post_validate','1','post_gen_val',null,'0',to_date('15-JUL-14','DD-MON-RR'),'BASE      ','BASE','2','EJB','GenValidate',null);
	
----stock_transfer_wiz --LOT_SL LOT_SL format
	Insert into genmst (FLD_NAME,MOD_NAME,DESCR,ERROR_CD,BLANK_OPT,FLD_TYPE,FLD_MIN,FLD_MAX,VAL_TYPE,CHG_DATE,CHG_USER,CHG_TERM,VAL_TABLE,SQL_INPUT,FLD_WIDTH,UDF_USAGE_1,UDF_USAGE_2,UDF_USAGE_3,VAL_STAGE,OBJ_NAME) values ('LOT_SL__TO','W_STOCK_TRANSFER_WIZ','Validation For LOT SL','VTINVLPN  ','N','C','select (case when ( ( ( ? LIKE (''NJ%'')) OR ( ? LIKE (''CN%'')) OR ( ? LIKE (''DM%'')) OR  ( ? LIKE (''EX%''))) AND (  ( ? in (''TA821'',''TA387''))) ) then 1 else 0 end ) from dual','1','Q',to_date('15-JUL-14','DD-MON-RR'),'prg       ','PRG            ',null,':2.lot_sl__to,:2.lot_sl__to,:2.lot_sl__to,:2.lot_sl__to,:0.site_code',10,null,null,null,null,null);

	------length
	Insert into genmst (FLD_NAME,MOD_NAME,DESCR,ERROR_CD,BLANK_OPT,FLD_TYPE,FLD_MIN,FLD_MAX,VAL_TYPE,CHG_DATE,CHG_USER,CHG_TERM,VAL_TABLE,SQL_INPUT,FLD_WIDTH,UDF_USAGE_1,UDF_USAGE_2,UDF_USAGE_3,VAL_STAGE,OBJ_NAME) values ('NO_ART','W_STOCK_TRANSFER_WIZ','Validation For LOT SL','VTINVLEN  ','N','C','Select (case when(length( ? ) = 10 AND ? in (''TA821'',''TA387'') ) then 1 else 0 end) from dual','1','Q',to_date('25-JUL-14','DD-MON-RR'),'prg       ','PRG            ',null,':2.lot_sl__to,:0.site_code',10,null,null,null,null,null);


	Insert into system_events (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,OVERWRITE_CORE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,COMP_TYPE,COMP_NAME,COMM_FORMAT) 
	values ('stock_transfer_wiz','post_validate','1','post_gen_val',null,'0',to_date('25-JUL-14','DD-MON-RR'),'BASE      ','BASE','2','EJB','GenValidate',null);
	
commit;

