UPDATE LOCATION SET CYCLE_COUNT_REQD        = 'N' WHERE LOC_CODE = 'GRL';
INSERT INTO USER_SITE (user_id,
	site_code,
	chg_date,
	chg_user,
	chg_term,
	add_date,
	add_user,
	add_term,
	profile_id)
VALUES (
	'WMS',
	'TA821',
	TO_TIMESTAMP('31-05-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'M',
	'M',
	TO_TIMESTAMP('31-05-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'M',
	'M',
	NULL);

INSERT INTO INVSTAT  (	inv_stat,
	descr,
	available,
	overiss,
	plan_prod,
	record,
	chg_date,
	chg_user,
	chg_term,
	usable,
	stat_type,
	report_type)
VALUES (
	'GRL  ',
	'GENERAL RECEIPT',
	'Y',
	'N',
	'Y',
	'Y',
	TO_TIMESTAMP('5-01-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'1         ',
	'1              ',
	'Y',
	'M',
	NULL);

INSERT INTO INVSTAT  (	inv_stat,
	descr,
	available,
	overiss,
	plan_prod,
	record,
	chg_date,
	chg_user,
	chg_term,
	usable,
	stat_type,
	report_type)
VALUES (
	'DSO  ',
	'Deep Storage Reserve',
	'Y',
	'Y',
	'Y',
	'Y',
	TO_TIMESTAMP('5-01-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	'Y',
	'M',
	NULL);
INSERT INTO INVSTAT  (	inv_stat,
	descr,
	available,
	overiss,
	plan_prod,
	record,
	chg_date,
	chg_user,
	chg_term,
	usable,
	stat_type,
	report_type)
VALUES (
	'PND  ',
	'PICK ON DELIVERY',
	'Y',
	'N',
	'Y',
	'Y',
	TO_TIMESTAMP('5-01-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'1         ',
	'1              ',
	'Y',
	'M',
	NULL);
INSERT INTO INVSTAT  (	inv_stat,
	descr,
	available,
	overiss,
	plan_prod,
	record,
	chg_date,
	chg_user,
	chg_term,
	usable,
	stat_type,
	report_type)
VALUES (
	'PSO  ',
	'Reserve',
	'Y',
	'Y',
	'Y',
	'Y',
	TO_TIMESTAMP('5-01-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'3         ',
	'3              ',
	'Y',
	'M',
	NULL);

UPDATE DISPARM SET VAR_VALUE = 'PSO' WHERE PRD_CODE = '999999' AND VAR_NAME = 'RESERVE_LOCATION';
INSERT INTO LOCATION (loc_code,
	descr,
	sh_descr,
	loc_type,
	inv_stat ,
	one_item,
	capacity,
	cap_uom,
	loc_group,
	temp ,
	site_code,
	site_code__own,
	item_code,
	eff_from,
	valid_upto,
	hire_charge,
	usable,
	chg_date,
	chg_user,
	chg_term,
	zone,
	pallet_based,
	single_lot_sl,
	item_lot_opt ,
	cycle_count_reqd)
VALUES (
	'GRL',
	'GENERAL RECEIPT',
	'GENERAL RECEIPT',
	'C',
	'GRL',
	'Y',
	999999999,
	NULL,
	'S    ',
	'N',
	'TA821',
	NULL,
	NULL,
	fn_sysdate(),
	TO_TIMESTAMP('1-01-2049 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	NULL,
	'Y',
	TO_TIMESTAMP('19-03-2007 13:21:30','DD-MM-YYYY HH24:MI:SS'),
	'RAS       ',
	'01JULIAN       ',
	NULL,
	'Y',
	'Y',
	'0',
	'Y');
-- 02/06/12
INSERT INTO DISPARM(PRD_CODE,VAR_NAME,VAR_TYPE, VAR_VALUE,DESCR, VAR_SUBS,
CHG_DATE,CHG_USER,CHG_TERM)
VALUES ( '999999', 'DEEP_STORE_INVSTAT', 'S', 'DSO','Deep Storage
Inventory', NULL, TO_DATE('01-06-2012 11:12:09','DD-MM-YYYYHH24:MI:SS'),
'BASE', 'BASE309');

INSERT INTO DISPARM(PRD_CODE,VAR_NAME,VAR_TYPE, VAR_VALUE,DESCR, VAR_SUBS,
CHG_DATE,CHG_USER,CHG_TERM)
VALUES ( '999999', 'PND_INVSTAT', 'S', 'PND', 'Pending Inventory', NULL,
TO_DATE('01-06-2012 11:12:09','DD-MM-YYYY HH24:MI:SS'),'BASE', 'BASE309');

UPDATE DISPARM SET VAR_VALUE = 'PSO' WHERE PRD_CODE = '999999' AND
VAR_NAME = 'RESERV_LOCATION';
--- 04/06/12
update itemser set acct_code__ap = '0590', acct_code__in = '1440',acct_code__pr = '5132' , acct_code__ppv = '14419',
CCTR_CODE__AP ='H651', CCTR_CODE__IN = 'H651', CCTR_CODE__PR = 'H651', CCTR_CODE__PH = 'H651', CCTR_CODE__PPV = 'H651'
where item_ser in ('NT','EX','EX1');

UPDATE SUPPLIER SET ACCT_CODE__AP = '0590', CCTR_CODE__AP = 'H651' WHERE SUPP_CODE = 'TA0529';

alter table repl_iss_det add lot_sl__new char(15);
update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER=""><SCAN_LABEL>Location:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location Code To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>New LPN:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl__new</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_repl_iss' and form_no = '2';

update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Pick Location:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Case Label:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>case_label</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Loc Code To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_case_pick' and form_no = '3';

Insert into obj_links (OBJ_NAME,FORM_NO,FIELD_NAME,TARGET_OBJ_NAME,LINK_FORM_NAME,LINK_TITLE,LINK_URI,LINK_TYPE,LINK_ARG,UPDATE_FLAG,LINK_NAME,RIGHTS_CHAR,IMAGE) values ('sorder','1','cust_pord','shipment_hdr','shipment_hdr11','View Shipment',null,'1','sale_order.String','1','S','*',null); 
Insert into obj_links (OBJ_NAME,FORM_NO,FIELD_NAME,TARGET_OBJ_NAME,LINK_FORM_NAME,LINK_TITLE,LINK_URI,LINK_TYPE,LINK_ARG,UPDATE_FLAG,LINK_NAME,RIGHTS_CHAR,IMAGE) values ('shipment_hdr','1','desp_id','shipment_det','shipment_det11','View Items',null,'1','desp_id.String','1','S','*',null);
commit;
-- 05/06/12 from sun
-- merged in 6-3-0-1
ALTER TABLE DISTROUTE MODIFY (STAN_CODE__FR  NULL);
ALTER TABLE DISTROUTE MODIFY (STAN_CODE__TO  NULL);
ALTER TABLE DISTROUTE ADD CUST_CODE CHAR(10);

ALTER TABLE DISTROUTEDET ADD MIN_WEIGHT NUMBER(14,6) default 0;
ALTER TABLE DISTROUTEDET ADD MAX_WEIGHT NUMBER(14,6) default 0;
ALTER TABLE DISTROUTEDET MODIFY (MAX_WEIGHT NOT NULL);
ALTER TABLE DISTROUTEDET MODIFY (MIN_WEIGHT NOT NULL);

ALTER TABLE DISTROUTEDET ADD STATE_CODE__TO CHAR(5) default ' ';
ALTER TABLE DISTROUTEDET ADD STATE_CODE__FR CHAR(5) default ' ';
ALTER TABLE DISTROUTEDET MODIFY (STATE_CODE__TO NOT NULL);
ALTER TABLE DISTROUTEDET MODIFY (STATE_CODE__FR NOT NULL);
ALTER TABLE DISTROUTEDET ADD LOC_TYPE CHAR(3);
ALTER TABLE TRANSPORTER ADD LOC_CODE__DOCK CHAR(8);

--INSERT INTO DISPARM(PRD_CODE,VAR_NAME,VAR_TYPE, VAR_VALUE,DESCR, VAR_SUBS, CHG_DATE,CHG_USER,CHG_TERM)
--VALUES ( '999999', 'DEEP_STORE_INVSTAT', 'S', 'DSO','Deep Storage Inventory', NULL, TO_DATE('01-06-2012 11:12:09','DD-MM-YYYYHH24:MI:SS'), 'BASE', 'BASE309');
  

--INSERT INTO DISPARM(PRD_CODE,VAR_NAME,VAR_TYPE, VAR_VALUE,DESCR, VAR_SUBS, CHG_DATE,CHG_USER,CHG_TERM)
--VALUES ( '999999', 'PND_INVSTAT', 'S', 'PND', 'Pending Inventory', NULL, TO_DATE('01-06-2012 11:12:09','DD-MM-YYYY HH24:MI:SS'),'BASE', 'BASE309');

insert into refser ( 	ref_ser , 	descr , 	type , 	sys_ser , 	prefix , 	chg_date , 	chg_user , 	chg_term , 	seq_name , 	tax_form_reqd , 	trans_type ) 
VALUES ( 	'A-PICK', 	'Active Picking', 	'S', 	'A-PICK', 	NULL, 	sysdate, 	'base ', 	'base  ', 	NULL, 	NULL, 	NULL);
	
insert into refser ( 	ref_ser , 	descr , 	type , 	sys_ser , 	prefix , 	chg_date , 	chg_user , 	chg_term , 	seq_name , 	tax_form_reqd , 	trans_type )
VALUES ( 	'C-PICK', 	'Case Picking', 	'S', 	'C-PICK', 	NULL, 	sysdate, 	'base ', 	'base ', 	NULL, 	NULL, 	NULL); 	
	insert into refser ( 	ref_ser , 	descr , 	type , 	sys_ser , 	prefix , 	chg_date , 	chg_user , 	chg_term , 	seq_name , 	tax_form_reqd , 	trans_type )
values ( 	'E-ORD', 	'Deep Storage', 	'S', 	'E-ORD', 	NULL, 	sysdate, 	'base ', 	'base', 	NULL, 	NULL, 	NULL);
	
insert into refser ( 	ref_ser , 	descr , 	type , 	sys_ser , 	prefix , 	chg_date , 	chg_user , 	chg_term , 	seq_name , 	tax_form_reqd , 	trans_type )
values ( 	'N-ORD', 	'Pick and Drop', 	'S', 	'N-ORD', 	NULL, 	sysdate, 	'BASE  ', 	'BASE  ', 	NULL, 	NULL, 	NULL);

insert into refser ( 	ref_ser , 	descr , 	type , 	sys_ser , 	prefix , 	chg_date , 	chg_user , 	chg_term , 	seq_name , 	tax_form_reqd , 	trans_type )
values ( 	'P-TASK', 	'Pick Order Task', 	'S', 	'P-TASK', 	NULL, 	sysdate, 	'base ', 	'base ', 	NULL, 	NULL, 	NULL);
	
insert into refser ( 	ref_ser , 	descr , 	type , 	sys_ser , 	prefix , 	chg_date , 	chg_user , 	chg_term , 	seq_name , 	tax_form_reqd , 	trans_type )
values ( 	'R-TASK', 	'Replanishment Task', 	'S', 	'R-TASK', 	NULL, 	sysdate , 	'base ', 	'base ', 	NULL, 	NULL, 	NULL);

	
insert into refser ( 	ref_ser , 	descr , 	type , 	sys_ser , 	prefix , 	chg_date , 	chg_user , 	chg_term , 	seq_name , 	tax_form_reqd , 	trans_type )
values ( 	'S-DSP', 	'Despatch', 	'S', 	'S-DSP', 	NULL, 	sysdate, 	'CNF  ', 	'99TARUN ', 	NULL, 	NULL, 	NULL);
	
insert into refser ( 	ref_ser , 	descr , 	type , 	sys_ser , 	prefix , 	chg_date , 	chg_user , 	chg_term , 	seq_name , 	tax_form_reqd , 	trans_type )
values ( 	'M-PACK', 	'Master Pack', 	'M', 	'M-PACK', 	NULL, 	sysdate, 	'CNF  ', 	'99TARUN ', 	NULL, 	NULL, 	NULL);

--INSERT INTO PERIOD_STAT( SITE_CODE,PRD_CODE,STAT_ADM,STAT_FIN,STAT_SAL,STAT_IC,STAT_PUR,STAT_MFG,PROC_DATE,CHG_DATE,CHG_USER,CHG_TERM,ADD_DATE,ADD_USER,ADD_TERM)
--VALUES('TA821','201205','Y','Y','Y','Y','Y','N',TO_DATE('1-05-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),TO_DATE('9-05-2012 12:19:34','DD-MM-YYYY HH24:MI:SS'),'BASE','TAROWMSNET',NULL,'BASE','TAROWMSNET');


--INSERT INTO PERIOD_STAT( SITE_CODE,PRD_CODE,STAT_ADM,STAT_FIN,STAT_SAL,STAT_IC,STAT_PUR,STAT_MFG,PROC_DATE,CHG_DATE,CHG_USER,CHG_TERM,ADD_DATE,ADD_USER,ADD_TERM)
--VALUES('TA821','201209','Y','Y','Y','Y','Y','N',TO_DATE('1-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),TO_DATE('9-05-2012 12:20:10','DD-MM-YYYY HH24:MI:SS'),'BASE','TAROWMSNET',NULL,'BASE','TAROWMSNET');	


--INSERT INTO PERIOD_STAT( SITE_CODE,PRD_CODE,STAT_ADM,STAT_FIN,STAT_SAL,STAT_IC,STAT_PUR,STAT_MFG,PROC_DATE,CHG_DATE,CHG_USER,CHG_TERM,ADD_DATE,ADD_USER,ADD_TERM)
--VALUES('TA821','201206','Y','Y','Y','Y','Y','N',TO_DATE('1-05-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),TO_DATE('30-05-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),'BASE309','BASE',NULL,'BASE','TAROWMSNET');

--INSERT INTO CUSTOMER_SERIES(CUST_CODE,ITEM_SER,CR_TERM,CREDIT_LMT,CUST_CLASS,SALES_PERS,CREDIT_PRD,IGNORE_CREDIT,CHG_DATE,CHG_USER,CHG_TERM,PENDING_ORDER,LEVEL_CODE__HIER,LEVEL_CODE__PAR__HIER,IGNORE_DAYS,BUSI_LIMIT,LEVEL_CODE__PAR_HIER,ITEM_SER__INV,DISC_PERC,BLACK_LISTED,BLACK_LISTED_DATE,DLV_TERM,HOLD_SHIPMENT,REPL_FACTOR,REPL_OPT,MIN_SHELF_PERC,COMM_PERC__BASE,VARIENCE_QTYPER,SALES_PERS__1,COMM_PERC__1,COMM_PERC__ON_1,SALES_PERS__2,COMM_PERC__2,COMM_PERC__ON_2,COMM_PERC,COMM_PERC__ON,TERR_CODE,FRT_RECO,EXP_RECO,COMM_TABLE__1,COMM_TABLE__2,COMM_TABLE__3,REAS_CODE__BKLIST,CR_TERM__NP)
--VALUES('WA0004','NT','CNFCH',99999999999.99,'A','EZZZZZ',NULL,5000,TO_DATE('22-04-2000 12:24:15','DD-MM-YYYY HH24:MI:SS'),'SUN','1','Y','DUMMY',NULL,39,99999999999.99,NULL,'CO',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

--INSERT INTO distroute ( 	dist_route , 	descr, 	stan_code__fr, 	stan_code__to , 	frt_amt, 	curr_code, 	chg_date, 	chg_user, 	chg_term, 	cust_code)
 --VALUES ( 	'DOC01', 	'Routing to DOC Location', 	'USA02', 	'UAN04', 	150, 	'RS   ', 	TO_DATE('6-03-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'), 	'TAROWMS   ', 	'172.16.100.193 ', 	'WA0004    ');

--INSERT INTO distroutedet ( 	dist_route, 	line_no, 	stan_code__fr, 	stan_code__to, 	tran_code, 	frt_amt, 	curr_code, 	tran_time, 	exch_rate, 	trans_mode, 	max_weight, 	min_weight, 	state_code__to, 	state_code__fr, 	loc_type)
 --VALUES ( 	'DOC01', 	1, 	'USA02', 	'UAN04', 	'ZY0007    ', 	150, 	'RS   ', 	NULL, 	1, 	'ROAD ', 	100, 	150, 	'AR   ', 	'AR   ', 	'DOC');
--INSERT INTO transporter (tran_code,	transporter_type, tran_name, group_code, addr1, addr2, addr3, city, state_code, pin, count_code, stan_code, cont_pers, cont_pfx, sh_name, tele1, tele2, tele3, tele_ext, fax,modem, tran_code__pay, credit_prd, credit_lmt, credit_int, round_off, round_to, chq_name, curr_code, pay_mode, frt_list, acct_code__fp, cctr_code__fp, cr_term, active, frt_term, email_addr, godown_addr1, godown_addr2, godown_addr3, payable_ref, chg_date, chg_user, chg_term, contact_code, add_term, add_user, add_date, pan_no, bank_acct, tax_reg_st, acct_code__adv, cctr_code__adv, ser_tax_reg, acct_code__ap, cctr_code__ap, tax_class, tax_env, scac_code, master_pack)
 --VALUES('ZY0007    ','T','M P CARGO MOVERS','ZY0007    ','315, GROHITAM BLDG; NEAR MATHADI BHAVAN','SECTOR 19/C, VASHI NAVI MUMBAI-400 705',NULL,'MUMBAI','MAH  ','400705','IND  ','MH001',NULL,NULL,'M P CARGO MOVERS','022-65156431','65156433','9320161973',NULL,NULL,NULL,'ZY0007    ',0,0,NULL,'R',1,'M P CARGO MOVERS','RS   ','Q',NULL,'0636      ','    ','0    ','Y','B',NULL,NULL,NULL,NULL,NULL,TO_DATE('30-07-2009 18:05:43','DD-MM-YYYY HH24:MI:SS'),'RAS       ','13DAMISRAS     ','ZY0007    ','11ANMISDBHAT   ','DRUPADB   ',TO_DATE('29-07-2009 00:00:00','DD-MM-YYYY HH24:MI:SS'),'AAAFM4022E',NULL,NULL,'0636      ','    ','NOTAVAILABLE',NULL,NULL,NULL,NULL,NULL,NULL);

 drop table item_process;
 CREATE TABLE "ITEM_PROCESS" ("ITEM_CODE" CHAR(10) NOT NULL,
 "ANALYSIS_CLASS" CHAR(1), "TRAN_DATE" DATE NOT NULL, "SITE_CODE" CHAR(10),
 "LOC_CODE" CHAR(10), "PRIORITY_SEQ" NUMBER(3,0), "CHG_USER" CHAR(10),
 "CHG_TERM" CHAR(15), "CHG_DATE" DATE) ;
 ALTER TABLE TAROTEST."ITEM_PROCESS" ADD ( CONSTRAINT ITEM_PROCESS_X
 PRIMARY KEY ( "TRAN_DATE", "ITEM_CODE" )) ;
 

INSERT INTO itm2menu  ( 	application , 	level_1 , 	level_2 , 	level_3 , 	level_4 , 	level_5 , 	win_name , 	descr , 	comments , 	menu_path , 	icon_path, 	obj_type, 	chg_date , 	chg_term , 	chg_user) 
VALUES ( 	'DIS', 	3, 	35, 	0, 	0, 	0, 	'w_item_process', 	'Itemprocess', 	'Itemprocess Map List', 	'DIS.3.35.0.0.0', 	'e12_logo.gif',		'M', 	fn_sysdate(), 	'BASE', 	'Sankar');

INSERT INTO transetup ( 	tran_window , 	save_flag , 	val_flag , 	key_flag , 	repeate_add , 	chg_date , 	chg_user , 	chg_term , 	edi_option , 	confirm_mode , 	mail_option , 	garbage_opt , 	table_name, 	application )
VALUES ( 	'w_item_process', 	'2', 	'2', 	'M', 	'N', 	fn_sysdate(), 	'Sankar ', 	'BASE ', 	'0', 	'0', 	'0', 	'N', 	'item_process', 	'DIS'); 	
INSERT INTO obj_forms ( 	win_name , 	title , 	obj_brow_name , 	obj_edit_name , 	form_no) VALUES ( 	'w_item_process', 	'Item process Map', 	'', 	'', 	'1');

INSERT INTO obj_actions ( 	obj_name , 	line_no , 	rights_char , 	interactive , 	service_code , 	description , 	title , 	image , 	action_type , 	form_no , 	chg_date , 	chg_term , 	chg_user)
VALUES ( 	'item_process', 	1, 	'E', 	'a', 	'a', 	'Editing Existing Record', 	'Edit', 	'edit~normal.gif', 	'S', 	'1', 	fn_sysdate(), 	'BASE ', 	'Sankar');

INSERT INTO itm2menu (
	application,
	level_1,
	level_2,
	level_3,
	level_4,
	level_5,
	win_name,
	descr,
	comments,
	menu_path,
	icon_path,
	close_icon,
	open_icon,
	obj_type,
	chg_date,
	chg_term,
	chg_user,
	mob_deploy)
VALUES (
	'WMS',
	1,
	16,
	0,
	0,
	0,
	'w_expired_stock_transfer',
	'Expired Stock Transfer',
	'Expired Stock Transfe',
	'WMS.1.16.0.0.0',
	'e12_logo.gif',
	NULL,
	NULL,
	'W',
	fn_sysdate(),
	'BASE',
	'Rohan',
	NULL);
INSERT INTO transetup (
	tran_window,
	save_flag,
	val_flag,
	key_flag,
	key_string,
	udf_1,
	udf_2,
	udf_3,
	udf_4,
	udf_5,
	repeate_add,
	chg_date,
	chg_user,
	chg_term,
	edi_option,
	site_acc_col,
	confirm_col,
	confirm_val,
	repeat_add_det,
	repeatadddet,
	load_mode,
	auto_confirm,
	ledg_post_conf,
	chg_date_on_conf,
	tran_id_col,
	mail_option,
	confirm_mode,
	garbage_opt,
	val_flag_edi,
	verify_password,
	cust_acc_col,
	sales_pers_acc_col,
	supp_acc_col,
	item_ser_acc_code,
	emp_acc_col,
	item_ser_acc_col,
	workflow_opt,
	table_name,
	application,
	table_desc,
	tran_date_col,
	tran_id__from,
	tran_id__to,
	table_name_det1,
	table_name_det2,
	table_name_det3,
	multitire_opt,
	ref_ser,
	view_mode,
	tax_forms,
	sign_status,
	user_tran_window,
	custom_preview_obj,
	ignoreerrlist_onload,
	childdata_argopt,
	edit_tmplt,
	wrkflw_init,
	edittax,
	formal_args,
	audit_trail_opt,
	edit_opt,
	cache_opt,
	optimize_mode,
	edit_expr,
	rate_col,
	qty_col,
	edit_expr_inp,
	rcp_cache_status,
	print_control,
	transfer_mode,
	profile_id__res,
	tran_compl_msg,
	period_option,
	wrkflw_priority,
	exec_type,
	disp_meta_data,
	allow_attach,
	start_form,
	isattachment)
VALUES (
	'w_expired_stock_transfer',
	'2',
	'2',
	'A',
	'seq10',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'N',
	fn_sysdate(),
	'Rohan',
	'BASE',
	'0',
	'site_code',
	'CONFIRMED',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'TRAN_ID',
	'0',
	'0',
	'N',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'STOCK_TRANSFER',
	'WMS',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'XFRX',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_forms (
	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode)
 VALUES (
	'w_expired_stock_transfer',
	'Expired Stk Transfer',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_forms (
	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode)
 VALUES (
	'w_expired_stock_transfer',
	'Detail',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Loc Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__fr</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no__fr</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<item_descr>(<item_code>),<line_no>,<loc_code__fr>,<lot_no__fr>,<lot_sl__fr>',
	NULL,
	NULL,
	NULL,
	'E');

INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
	'expired_stock_transfer',
	1,
	NULL,
	'Saving',
	NULL,
	NULL,
	'S',
	'Finish',
	'3',
	NULL,
	NULL,
	'U',
	NULL,
        fn_sysdate(),
	'BASE',
	'Rohan');

INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
	'expired_stock_transfer',
	2,
	NULL,
	'Prev',
	'a',
	'a',
	'P',
	'Next',
	'2',
	NULL,
	NULL,
	'U',
	NULL,
	fn_sysdate(),
	'BASE',
	'Rohan');

INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
	'expired_stock_transfer',
	3,
	NULL,
	'Next',
	'a',
	'a',
	'N',
	'Next',
	'2',
	NULL,
	NULL,
	'U',
	NULL,
	fn_sysdate(),
	'BASE',
	'Rohan');

INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
	'expired_stock_transfer',
	4,
	NULL,
	'Prev',
	'a',
	'a',
	'P',
	'Prev',
	'3',
	NULL,
	NULL,
	'U',
	NULL,
	fn_sysdate(),
	'BASE',
	'Rohan');

INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
	'expired_stock_transfer',
	5,
	'confirm~normal.gif',
	'Confirming records',
	'pre_confirm',
	'a',
	'F',
	'Confirm',
	'3',
	'2',
	'1',
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'Rohan');

INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
	'expired_stock_transfer',
	6,
	NULL,
	'Next',
	NULL,
	NULL,
	'N',
	'Next',
	'1',
	NULL,
	NULL,
	'U',
	NULL,
	fn_sysdate(),
	'BASE',
	'Rohan');



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 (
	'expired_stock_transfer',
	'post_save_rec_2',
	'1',
	'posr_stock_transfer_2',
	NULL,
	'0',
	fn_sysdate(),
	'Rohan',
	'BASE',
	'2',
	'EJB',
	'StockTransferPos',
	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 (
	'expired_stock_transfer',
	'default_data_wiz',
	'1',
	'stock_transfer_grl_default_data',
	NULL,
	'0',
	fn_sysdate(),
	'Rohan    ',
	'BASE',
	'2',
	'EJB',
	'ExpStockTransferIC',
	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 (
	'expired_stock_transfer',
	'pre_validate',
	'1',
	'prv_stock_transfer_grl',
	NULL,
	'0',
	fn_sysdate(),
	'Rohan    ',
	'BASE',
	'2',
	'EJB',
	'ExpStockTransferIC',
	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 (
	'expired_stock_transfer',
	'post_save',
	'1',
	'pos_expired_stock_transfer',
	NULL,
	'0',
	fn_sysdate(),
	'Rohan ',
	'BASE',
	'2',
	'EJB',
	'ExpStkTransferPos',
	NULL);

INSERT INTO system_event_services (
	service_code,
	service_descr,
	service_uri,
	service_provider,
	method_name,
	return_value,
	return_type,
	return_descr,
	return_xfrm,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'pos_expired_stock_transfer',
	'Validation',
	'http://localhost:9090/axis/services/ValidatorService',
	'BASE',
	'postSave',
	'String',
	'S',
	NULL,
	NULL,
	fn_sysdate(),
	'Rohan',
	'BASE');

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_expired_stock_transfer',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan',
	'BASE',
	'EJB');
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_expired_stock_transfer',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan',
	'BASE',
	'ExpStkTransferPos');
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_expired_stock_transfer',
	3,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_expired_stock_transfer',
	4,
	'<tran_id>',
	'I',
	NULL,
	'B.String',
	NULL,
	fn_sysdate(),
	'Rohan',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_expired_stock_transfer',
	5,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_expired_stock_transfer',
	6,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_expired_stock_transfer',
	7,
	'DB_CONN',
	'I',
	NULL,
	'S.Connection',
	NULL,
	fn_sysdate(),
	'Rohan',
	'BASE',
	NULL);

INSERT INTO disparm (
	prd_code ,
	var_name ,
	var_type ,
	var_value ,
	descr ,
	var_subs ,
	chg_date ,
	chg_user ,
	chg_term 
	 )
VALUES (
	'999999',
	'EXP_STOCK_TRANSFER',
	'S',
	'N',
	'Near Exp stock transfer',
	0,
	fn_sysdate(),
	'BASE',
	'Rohan'
	);
commit;

------ 05/12/12
INSERT INTO disparm (
	prd_code ,
	var_name ,
	var_type ,
	var_value ,
	descr ,
	var_subs ,
	chg_date ,
	chg_user ,
	chg_term 
	 )
VALUES (
	'999999',
	'MASTER_PACK_BEST_FIT',
	'S',
	'N',
	'Algorithm to use master pack best fit Y/N',
	0,
	fn_sysdate(),
	'BASE',
	'pragyan'
	);

delete from obj_forms where win_name='w_expired_stock_transfer';

INSERT INTO obj_forms ( 	win_name, 	title, 	obj_brow_name, 	obj_edit_name, 	cross_update_expr, 	expr_fld_info, 	target_fld_info, 	expr_comment, 	form_no, 	scr_flag, 	auto_accept_scan, 	scan_flag, 	scan_metadata, 	property_info, 	scan_delimiter, 	column_on_save, 	after_save, 	ext_setup, 	ext_metadata, 	ext_com, 	auto_accept_weighdata, 	form_type, 	disp_metadata, 	parent_key_col, 	qty_col, 	rate_col, 	assisted_mode)
 VALUES ( 	'w_expired_stock_transfer', 	'Expired Stk Transfer', 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	'1', 	'F', 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL);
INSERT INTO obj_forms ( 	win_name, 	title, 	obj_brow_name, 	obj_edit_name, 	cross_update_expr, 	expr_fld_info, 	target_fld_info, 	expr_comment, 	form_no, 	scr_flag, 	auto_accept_scan, 	scan_flag, 	scan_metadata, 	property_info, 	scan_delimiter, 	column_on_save, 	after_save, 	ext_setup, 	ext_metadata, 	ext_com, 	auto_accept_weighdata, 	form_type, 	disp_metadata, 	parent_key_col, 	qty_col, 	rate_col, 	assisted_mode)
 VALUES ( 	'w_expired_stock_transfer', 	'Detail', 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	'2', 	'T', 	NULL, 	NULL, 	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Loc Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__fr</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no__fr</FIELD></FIELDS></MAPPING_SCAN></SCAN_INFO>', 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	'checkedImage@img<item_descr>(<item_code>),<line_no>,<loc_code__fr>,<lot_no__fr>,<lot_sl__fr>,<hold_qty>', 	NULL, 	NULL, 	NULL, 	'E');

delete from messages where msg_no = 'CONFSUCC';

delete from obj_forms where win_name='w_expired_stock_transfer';

INSERT INTO obj_forms ( 	win_name, 	title, 	obj_brow_name, 	obj_edit_name, 	cross_update_expr, 	expr_fld_info, 	target_fld_info, 	expr_comment, 	form_no, 	scr_flag, 	auto_accept_scan, 	scan_flag, 	scan_metadata, 	property_info, 	scan_delimiter, 	column_on_save, 	after_save, 	ext_setup, 	ext_metadata, 	ext_com, 	auto_accept_weighdata, 	form_type, 	disp_metadata, 	parent_key_col, 	qty_col, 	rate_col, 	assisted_mode)
 VALUES ( 	'w_expired_stock_transfer', 	'Expired Stk Transfer', 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	'1', 	'F', 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL);
INSERT INTO obj_forms ( 	win_name, 	title, 	obj_brow_name, 	obj_edit_name, 	cross_update_expr, 	expr_fld_info, 	target_fld_info, 	expr_comment, 	form_no, 	scr_flag, 	auto_accept_scan, 	scan_flag, 	scan_metadata, 	property_info, 	scan_delimiter, 	column_on_save, 	after_save, 	ext_setup, 	ext_metadata, 	ext_com, 	auto_accept_weighdata, 	form_type, 	disp_metadata, 	parent_key_col, 	qty_col, 	rate_col, 	assisted_mode)
 VALUES ( 	'w_expired_stock_transfer', 	'Detail', 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	'2', 	'T', 	NULL, 	NULL, 	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Loc Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__fr</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no__fr</FIELD></FIELDS></MAPPING_SCAN></SCAN_INFO>', 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	'checkedImage@img<item_descr>(<item_code>),<line_no>,<loc_code__fr>,<lot_no__fr>,<lot_sl__fr>,<hold_qty>', 	NULL, 	NULL, 	NULL, 	'E');


INSERT INTO obj_links ( 	obj_name , 	form_no , 	field_name , 	target_obj_name , 	link_form_name , 	link_title , 	link_uri , 	link_type , 	link_arg , 	update_flag , 	link_name , 	rights_char , 	image ) 	VALUES ( 	'wave_task', 	'2', 	'ref_id', 	'pick_ord', 	'pick_ord21', 	'pick order', 	NULL, 	'2', 	'ref_id.String', 	'1', 	NULL, 	'*', 	NULL);
	
INSERT INTO obj_links ( 	obj_name , 	form_no , 	field_name , 	target_obj_name , 	link_form_name , 	link_title , 	link_uri , 	link_type , 	link_arg , 	update_flag , 	link_name , 	rights_char , 	image )
VALUES ( 	'wave_task', 	'2', 	'wave_id', 	'repl_ord', 	'repl_ord21', 	'Replenishment order', 	NULL, 	'2', 	'ref_id.String', 	'1', 	NULL, 	'*', 	NULL);

INSERT INTO  obj_forms ( 	win_name , 	title , 	obj_brow_name , 	obj_edit_name , 	cross_update_expr , 	expr_fld_info , 	target_fld_info , 	expr_comment , 	form_no , 	scr_flag , 	auto_accept_scan , 	scan_flag , 	scan_metadata , 	property_info , 	scan_delimiter , 	column_on_save , 	after_save , 	ext_setup , 	ext_metadata , 	ext_com , 	auto_accept_weighdata , 	form_type , 	disp_metadata , 	parent_key_col , 	qty_col , 	rate_col , 	assisted_mode ) 	VALUES ( 	'w_pick_ord', 	'Header', 	'd_pick_ord11', 	'd_pick_ord21', 	NULL, 	NULL, 	NULL, 	NULL, 	'1', 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL);
	
INSERT INTO  obj_forms ( 	win_name , 	title , 	obj_brow_name , 	obj_edit_name , 	cross_update_expr , 	expr_fld_info , 	target_fld_info , 	expr_comment , 	form_no , 	scr_flag , 	auto_accept_scan , 	scan_flag , 	scan_metadata , 	property_info , 	scan_delimiter , 	column_on_save , 	after_save , 	ext_setup , 	ext_metadata , 	ext_com , 	auto_accept_weighdata , 	form_type , 	disp_metadata , 	parent_key_col , 	qty_col , 	rate_col , 	assisted_mode ) 	VALUES ( 	'w_pick_ord', 	'Detail', 	'd_pick_ord12', 	'd_pick_ord22', 	NULL, 	NULL, 	NULL, 	NULL, 	'2', 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL);

INSERT INTO  obj_forms ( 	win_name , 	title , 	obj_brow_name , 	obj_edit_name , 	cross_update_expr , 	expr_fld_info , 	target_fld_info , 	expr_comment , 	form_no , 	scr_flag , 	auto_accept_scan , 	scan_flag , 	scan_metadata , 	property_info , 	scan_delimiter , 	column_on_save , 	after_save , 	ext_setup , 	ext_metadata , 	ext_com , 	auto_accept_weighdata , 	form_type , 	disp_metadata , 	parent_key_col , 	qty_col , 	rate_col , 	assisted_mode ) 	VALUES ( 	'w_repl_ord', 	'Header', 	'd_repl_ord11', 	'd_repl_ord21', 	NULL, 	NULL, 	NULL, 	NULL, 	'1', 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL);

INSERT INTO  obj_forms ( 	win_name , 	title , 	obj_brow_name , 	obj_edit_name , 	cross_update_expr , 	expr_fld_info , 	target_fld_info , 	expr_comment , 	form_no , 	scr_flag , 	auto_accept_scan , 	scan_flag , 	scan_metadata , 	property_info , 	scan_delimiter , 	column_on_save , 	after_save , 	ext_setup , 	ext_metadata , 	ext_com , 	auto_accept_weighdata , 	form_type , 	disp_metadata , 	parent_key_col , 	qty_col , 	rate_col , 	assisted_mode ) 	VALUES ( 	'w_repl_ord', 	'Detail', 	'd_repl_ord12', 	'd_repl_ord22', 	NULL, 	NULL, 	NULL, 	NULL, 	'2', 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL);
-- end 05/06/12 from sun

-- 05/06/12 from gulzar
Insert into obj_links (OBJ_NAME,FORM_NO,FIELD_NAME,TARGET_OBJ_NAME,LINK_FORM_NAME,LINK_TITLE,LINK_URI,LINK_TYPE,LINK_ARG,UPDATE_FLAG,LINK_NAME,RIGHTS_CHAR,IMAGE) values ('sorder','1','cust_pord','shipment_hdr','shipment_hdr11','View Shipment',null,'1','sale_order.String','1','S','*',null); 
Insert into obj_links (OBJ_NAME,FORM_NO,FIELD_NAME,TARGET_OBJ_NAME,LINK_FORM_NAME,LINK_TITLE,LINK_URI,LINK_TYPE,LINK_ARG,UPDATE_FLAG,LINK_NAME,RIGHTS_CHAR,IMAGE) values ('shipment_hdr','1','desp_id','shipment_det','shipment_det11','View Items',null,'1','desp_id.String','1','S','*',null);
insert into obj_links(obj_name,form_no,field_name,target_obj_name,link_form_name,link_title,link_type,link_arg,update_flag,rights_char)
 values('wavegen','1','site_code','view_stock','view_stock11','Veiw Inventory','1','item_code.String,site_code.String','0','0');

 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 (
	'VTLOCCODE8',
	'Invalid Location !',
	'Entered location is not valid, please enter valid location ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Gulzar',
	'BASE141',
	NULL,
	NULL);
 
 commit;
 
-- end from gulzar

--- 05/06/12 office
update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Location Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="3"><SCAN_LABEL>Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>quantity</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
 where win_name = 'w_porcp_wiz' and form_no = '3';

 UPDATE ITEM SET LOC_CODE = 'GRL'
WHERE ITEM_CODE IN ('EF0050','EF0150','EF0500','EF0900');
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 (
    'VTPOQTY4',
    'Invalid Quantity !',
    'Entered quantity does not match with order quantity, please enter valid quantity ',
    'E',
    'Y',
    NULL,
    NULL,
    NULL,
    fn_sysdate(),
    'Gulzar',
    'BASE141',
    NULL,
    NULL);
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 (
    'LPNNOTEXT',
    'Stock not exist !',
    'Stock does not exist for the entered LPN, please enter valid LPN',
    'E',
    'Y',
    NULL,
    NULL,
    NULL,
    fn_sysdate(),
    'Gulzar',
    'BASE141',
    NULL,
    NULL);
    
alter table transetup add (ALLOW_ATTACH char(1)) ;

ALTER TABLE USER_RIGHTS ADD ( fav_option char(1), fav_order decimal(16, 0));

ALTER TABLE OBJ_FORMS ADD ( storage_key_metadata varchar2(100));

alter table batchload add (TRAN_ID__REF VARCHAR2(60)); 
-- 06/06/12 gulzar

delete  from obj_forms where win_name='w_stock_transfer_grl';

INSERT INTO obj_forms  (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info,
	expr_comment ,
	form_no ,
	scr_flag ,
	scan_flag ,
	scan_metadata ,
	auto_accept_scan ,
	property_info ,
	ext_com ,
	ext_metadata ,
	ext_setup ,
	after_save ,
	column_on_save ,
	scan_delimiter ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col,
	assisted_mode)
VALUES (
	'w_stock_transfer_grl',
	'Stock Transfer',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_forms  (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info,
	expr_comment ,
	form_no ,
	scr_flag ,
	scan_flag ,
	scan_metadata ,
	auto_accept_scan ,
	property_info ,
	ext_com ,
	ext_metadata ,
	ext_setup ,
	after_save ,
	column_on_save ,
	scan_delimiter ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col,
	assisted_mode)
VALUES (
	'w_stock_transfer_grl',
	'LPN No',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lpn_no</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E');
INSERT INTO obj_forms (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info,
	expr_comment ,
	form_no ,
	scr_flag ,
	scan_flag ,
	scan_metadata ,
	auto_accept_scan ,
	property_info ,
	ext_com ,
	ext_metadata ,
	ext_setup ,
	after_save ,
	column_on_save ,
	scan_delimiter ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col,
	assisted_mode)
VALUES (
	'w_stock_transfer_grl',
	'Detail',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	'F',
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>LPN No To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl__to</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Location Code To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'',
	NULL,
	'E');

alter table pick_ord_det
add lot_sl__new char(15);

alter table repl_iss_det
add lot_sl__new char(15);

insert into messages(
MSG_NO,         
MSG_STR ,       
MSG_DESCR,      
MSG_TYPE,
MSG_OPT,
chg_date,
chg_user,
chg_term
)
values(
'LPNORDTYPE',
'Invalid New LPN NO',
' New LPN NO it can not be plan',
'E',
'Y',
sysdate,
'base',
'base'
);

update obj_forms set scan_metadata = '<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location Code To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
 where win_name = 'w_stock_transfer_grl' and form_no = '3';

 insert into obj_links(obj_name,form_no,field_name,target_obj_name,link_form_name,link_title,link_type,link_arg,update_flag,rights_char)
 values('view_stock11','1','lot_no','view_lock','view_lock11','Veiw Lock','1','lot_no.String','0','0');

alter table rcpdet_form add line_no number(6);
alter table rcpdet_form modify line_no number(6) not null;
alter table rcpdet_form drop constraint RCPDET_TL;
alter table rcpdet_form add constraint rcpdet_from_x primary key(tran_id,line_no);
update system_events set event_code ='post_save_rec_3' where obj_name='stock_transfer_grl' and event_code='post_save_rec_2';
update system_events set event_code ='pre_navigate_next' where obj_name='stock_transfer_grl' and event_code='pre_validate';
commit; 

-- end 06/06/12
-- 06/06/12 sun
delete from messages where msg_no = 'CONFSUCC';
INSERT INTO MESSAGES ( 	msg_no , 	msg_str , 	msg_descr , 	msg_type , 	msg_opt ,  	chg_date , 	chg_user , 	chg_term )
VALUES ( 	'CONFSUCC', 	'Transfer sucess', 	'Stock Transfer Sucessful.', 	'P', 	'Y', 	fn_sysdate(), 	'ROHAN'  , 	'BASE ' 	);


delete from obj_links where obj_name = 'wave_task' and field_name = 'ref_id' ;
INSERT INTO obj_links ( 	obj_name , 	form_no , 	field_name , 	target_obj_name , 	link_form_name , 	link_title , 	link_uri , 	link_type , 	link_arg , 	update_flag , 	link_name , 	rights_char , 	image ) 	
VALUES ( 	'wave_task', 	'2', 	'ref_id', 	'pick_ord', 	'pick_ord21', 	'pick order', 	NULL, 	'2', 	'ref_id.String', 	'1', 	NULL, 	'*', 	NULL);
delete from obj_links where obj_name = 'wave_task' and field_name = 'wave_id' ;
INSERT INTO obj_links ( 	obj_name , 	form_no , 	field_name , 	target_obj_name , 	link_form_name , 	link_title , 	link_uri , 	link_type , 	link_arg , 	update_flag , 	link_name , 	rights_char , 	image )
VALUES ( 	'wave_task', 	'2', 	'wave_id', 	'repl_ord', 	'repl_ord21', 	'Replenishment order', 	NULL, 	'2', 	'ref_id.String', 	'1', 	NULL, 	'*', 	NULL);

delete from obj_forms where win_name in ( 'w_pick_ord','w_repl_ord');
INSERT INTO  obj_forms ( 	win_name , 	title , 	obj_brow_name , 	obj_edit_name , 	cross_update_expr , 	expr_fld_info , 	target_fld_info , 	expr_comment , 	form_no , 	scr_flag , 	auto_accept_scan , 	scan_flag , 	scan_metadata , 	property_info , 	scan_delimiter , 	column_on_save , 	after_save , 	ext_setup , 	ext_metadata , 	ext_com , 	auto_accept_weighdata , 	form_type , 	disp_metadata , 	parent_key_col , 	qty_col , 	rate_col , 	assisted_mode ) 	VALUES ( 	'w_pick_ord', 	'Header', 	'd_pick_ord11', 	'd_pick_ord21', 	NULL, 	NULL, 	NULL, 	NULL, 	'1', 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL);
INSERT INTO  obj_forms ( 	win_name , 	title , 	obj_brow_name , 	obj_edit_name , 	cross_update_expr , 	expr_fld_info , 	target_fld_info , 	expr_comment , 	form_no , 	scr_flag , 	auto_accept_scan , 	scan_flag , 	scan_metadata , 	property_info , 	scan_delimiter , 	column_on_save , 	after_save , 	ext_setup , 	ext_metadata , 	ext_com , 	auto_accept_weighdata , 	form_type , 	disp_metadata , 	parent_key_col , 	qty_col , 	rate_col , 	assisted_mode ) 	VALUES ( 	'w_pick_ord', 	'Detail', 	'd_pick_ord12', 	'd_pick_ord22', 	NULL, 	NULL, 	NULL, 	NULL, 	'2', 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL);
INSERT INTO  obj_forms ( 	win_name , 	title , 	obj_brow_name , 	obj_edit_name , 	cross_update_expr , 	expr_fld_info , 	target_fld_info , 	expr_comment , 	form_no , 	scr_flag , 	auto_accept_scan , 	scan_flag , 	scan_metadata , 	property_info , 	scan_delimiter , 	column_on_save , 	after_save , 	ext_setup , 	ext_metadata , 	ext_com , 	auto_accept_weighdata , 	form_type , 	disp_metadata , 	parent_key_col , 	qty_col , 	rate_col , 	assisted_mode ) 	VALUES ( 	'w_repl_ord', 	'Header', 	'd_repl_ord11', 	'd_repl_ord21', 	NULL, 	NULL, 	NULL, 	NULL, 	'1', 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL);
INSERT INTO  obj_forms ( 	win_name , 	title , 	obj_brow_name , 	obj_edit_name , 	cross_update_expr , 	expr_fld_info , 	target_fld_info , 	expr_comment , 	form_no , 	scr_flag , 	auto_accept_scan , 	scan_flag , 	scan_metadata , 	property_info , 	scan_delimiter , 	column_on_save , 	after_save , 	ext_setup , 	ext_metadata , 	ext_com , 	auto_accept_weighdata , 	form_type , 	disp_metadata , 	parent_key_col , 	qty_col , 	rate_col , 	assisted_mode ) 	VALUES ( 	'w_repl_ord', 	'Detail', 	'd_repl_ord12', 	'd_repl_ord22', 	NULL, 	NULL, 	NULL, 	NULL, 	'2', 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL, 	NULL);

delete from obj_forms where win_name='w_expired_stock_transfer';

INSERT INTO obj_forms (
	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode)
 VALUES (
	'w_expired_stock_transfer',
	'Expired Stk Transfer',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_forms (
	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode)
 VALUES (
	'w_expired_stock_transfer',
	'Detail',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Loc Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__fr</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no__fr</FIELD></FIELDS></MAPPING_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<item_descr>(<item_code>),<line_no>,<loc_code__fr>,<lot_no__fr>,<lot_sl__fr>,<hold_qty>',
	NULL,
	NULL,
	NULL,
	'E');
	delete from obj_actions where obj_name = 'expired_stock_transfer';
INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
	'expired_stock_transfer',
	1,
	NULL,
	'Saving',
	NULL,
	NULL,
	'S',
	'Finish',
	'3',
	NULL,
	NULL,
	'U',
	NULL,
        fn_sysdate(),
	'BASE',
	'Rohan');

INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
	'expired_stock_transfer',
	2,
	NULL,
	'Prev',
	'a',
	'a',
	'P',
	'Next',
	'2',
	NULL,
	NULL,
	'U',
	NULL,
	fn_sysdate(),
	'BASE',
	'Rohan');

INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
	'expired_stock_transfer',
	3,
	NULL,
	'Next',
	'a',
	'a',
	'N',
	'Next',
	'2',
	NULL,
	NULL,
	'U',
	NULL,
	fn_sysdate(),
	'BASE',
	'Rohan');

INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
	'expired_stock_transfer',
	4,
	NULL,
	'Prev',
	'a',
	'a',
	'P',
	'Prev',
	'3',
	NULL,
	NULL,
	'U',
	NULL,
	fn_sysdate(),
	'BASE',
	'Rohan');

INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
	'expired_stock_transfer',
	5,
	'confirm~normal.gif',
	'Confirming records',
	'pre_confirm',
	'a',
	'F',
	'Confirm',
	'3',
	'2',
	'1',
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'Rohan');

INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
	'expired_stock_transfer',
	6,
	NULL,
	'Next',
	NULL,
	NULL,
	'N',
	'Next',
	'1',
	NULL,
	NULL,
	'U',
	NULL,
	fn_sysdate(),
	'BASE',
	'Rohan');


delete from system_events where obj_name = 'expired_stock_transfer';
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 (
	'expired_stock_transfer',
	'post_save_rec_2',
	'1',
	'posr_stock_transfer_2',
	NULL,
	'0',
	fn_sysdate(),
	'Rohan',
	'BASE',
	'2',
	'EJB',
	'StockTransferPos',
	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 (
	'expired_stock_transfer',
	'default_data_wiz',
	'1',
	'stock_transfer_grl_default_data',
	NULL,
	'0',
	fn_sysdate(),
	'Rohan    ',
	'BASE',
	'2',
	'EJB',
	'ExpStockTransferIC',
	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 (
	'expired_stock_transfer',
	'pre_validate',
	'1',
	'prv_stock_transfer_grl',
	NULL,
	'0',
	fn_sysdate(),
	'Rohan    ',
	'BASE',
	'2',
	'EJB',
	'ExpStockTransferIC',
	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 (
	'expired_stock_transfer',
	'post_save',
	'1',
	'pos_expired_stock_transfer',
	NULL,
	'0',
	fn_sysdate(),
	'Rohan ',
	'BASE',
	'2',
	'EJB',
	'ExpStkTransferPos',
	NULL);
delete from system_event_services where service_code = 'pos_expired_stock_transfer';
INSERT INTO system_event_services (
	service_code,
	service_descr,
	service_uri,
	service_provider,
	method_name,
	return_value,
	return_type,
	return_descr,
	return_xfrm,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'pos_expired_stock_transfer',
	'Validation',
	'http://localhost:9090/axis/services/ValidatorService',
	'BASE',
	'postSave',
	'String',
	'S',
	NULL,
	NULL,
	fn_sysdate(),
	'Rohan',
	'BASE');
delete from system_service_args where service_code = 'pos_expired_stock_transfer';

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_expired_stock_transfer',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan',
	'BASE',
	'EJB');
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_expired_stock_transfer',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan',
	'BASE',
	'ExpStkTransferPos');
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_expired_stock_transfer',
	3,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_expired_stock_transfer',
	4,
	'<tran_id>',
	'I',
	NULL,
	'B.String',
	NULL,
	fn_sysdate(),
	'Rohan',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_expired_stock_transfer',
	5,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_expired_stock_transfer',
	6,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_expired_stock_transfer',
	7,
	'DB_CONN',
	'I',
	NULL,
	'S.Connection',
	NULL,
	fn_sysdate(),
	'Rohan',
	'BASE',
	NULL);

delete from refser where ref_ser in ( 'E-ORD','R-DSO','RP-PSO','RS-DSO' );
delete from refser where ref_ser = 'N-ORD';

insert into refser (
	ref_ser ,
	descr ,
	type ,
	sys_ser ,
	prefix ,
	chg_date ,
	chg_user ,
	chg_term ,
	seq_name ,
	tax_form_reqd ,
	trans_type )
values (
	'R-DSO',
	'Deep Storage',
	'S',
	'R-DSO',
	NULL,
	sysdate,
	'base ',
	'base',
	NULL,
	NULL,
	NULL);
	
insert into refser (
	ref_ser ,
	descr ,
	type ,
	sys_ser ,
	prefix ,
	chg_date ,
	chg_user ,
	chg_term ,
	seq_name ,
	tax_form_reqd ,
	trans_type )
values (
	'R-PSO',
	'Pick and Drop',
	'S',
	'R-PSO',
	NULL,
	sysdate,
	'BASE  ',
	'BASE  ',
	NULL,
	NULL,
	NULL);

insert into refser (
	ref_ser ,
	descr ,
	type ,
	sys_ser ,
	prefix ,
	chg_date ,
	chg_user ,
	chg_term ,
	seq_name ,
	tax_form_reqd ,
	trans_type )
values (
	'RP-PSO',
	'Replanish (Stock to Dock) PSO to DOC',
	'S',
	'RP-PSO',
	NULL,
	TO_DATE('6-06-2012 05:15:32','DD-MM-YYYY HH24:MI:SS'),
	'base      ',
	'base           ',
	NULL,
	NULL,
	NULL);
	
insert into refser (
	ref_ser ,
	descr ,
	type ,
	sys_ser ,
	prefix ,
	chg_date ,
	chg_user ,
	chg_term ,
	seq_name ,
	tax_form_reqd ,
	trans_type )
values (
	'RS-DSO',
	'Replanish (Stock to Dock) DSO to PSO',
	'S',
	'RS-DSO',
	NULL,
	TO_DATE('6-06-2012 05:15:32','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL,
	NULL);

-- end 06/06/12 sun
-- 07/06/12 dipak
delete  from obj_forms where win_name='w_stock_transfer_grl';

update system_events set event_code ='post_save_rec_3' where obj_name='stock_transfer_grl' and event_code='post_save_rec_2';
update system_events set event_code ='pre_navigate_next' where obj_name='stock_transfer_grl' and event_code='pre_validate';
commit;

INSERT INTO obj_forms  (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info,
	expr_comment ,
	form_no ,
	scr_flag ,
	scan_flag ,
	scan_metadata ,
	auto_accept_scan ,
	property_info ,
	ext_com ,
	ext_metadata ,
	ext_setup ,
	after_save ,
	column_on_save ,
	scan_delimiter ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col,
	assisted_mode)
VALUES (
	'w_stock_transfer_grl',
	'Stock Transfer',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_forms  (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info,
	expr_comment ,
	form_no ,
	scr_flag ,
	scan_flag ,
	scan_metadata ,
	auto_accept_scan ,
	property_info ,
	ext_com ,
	ext_metadata ,
	ext_setup ,
	after_save ,
	column_on_save ,
	scan_delimiter ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col,
	assisted_mode)
VALUES (
	'w_stock_transfer_grl',
	'LPN No',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lpn_no</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E');
INSERT INTO obj_forms (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info,
	expr_comment ,
	form_no ,
	scr_flag ,
	scan_flag ,
	scan_metadata ,
	auto_accept_scan ,
	property_info ,
	ext_com ,
	ext_metadata ,
	ext_setup ,
	after_save ,
	column_on_save ,
	scan_delimiter ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col,
	assisted_mode)
VALUES (
	'w_stock_transfer_grl',
	'Detail',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	'F',
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>LPN No To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl__to</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Location Code To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'',
	NULL,
	'E');

-- end 07/06/12 dipak
alter table workorder_issdet_sl add shortage_confirm char(1);
update obj_forms set scan_metadata = '<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location Code To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_stock_transfer_grl' and form_no = '3';
-- 08/06/12
Insert into OBJ_LINKS (OBJ_NAME,FORM_NO,FIELD_NAME,TARGET_OBJ_NAME,LINK_FORM_NAME,LINK_TITLE,LINK_URI,LINK_TYPE,LINK_ARG,UPDATE_FLAG,LINK_NAME,RIGHTS_CHAR,IMAGE) values ('sordamd','1','amd_date','sorderscheme','sorderscheme11','Sales Order Scheme',null,'1','sale_order.String','0',null,'S',null);
Insert into OBJ_LINKS (OBJ_NAME,FORM_NO,FIELD_NAME,TARGET_OBJ_NAME,LINK_FORM_NAME,LINK_TITLE,LINK_URI,LINK_TYPE,LINK_ARG,UPDATE_FLAG,LINK_NAME,RIGHTS_CHAR,IMAGE) values ('sordamd','1','sale_order','sorderscheme','sorderscheme11','View Scheme Detail',null,'1','sale_order.String','0',null,'S',null);
--DELETE EXISTING RECORD FROM ITM2MENU
DELETE FROM ITM2MENU WHERE WIN_NAME = 'w_palletprc';

--INSERT NEW RECORD INTO ITM2MENU TABLE
Insert into ITM2MENU (APPLICATION,LEVEL_1,LEVEL_2,LEVEL_3,LEVEL_4,LEVEL_5,WIN_NAME,DESCR,COMMENTS,MENU_PATH,ICON_PATH,CLOSE_ICON,OPEN_ICON,OBJ_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('SFA',1,54,0,0,0,'w_palletprc','Pallet No Generation','Pallet No Generation','SFA.1.54.0.0.0','e12_logo.gif',null,null,'P','05/jun/12','Mahesh','BASE      ');

--DELETE EXISTING RECORD FROM TRANSETUP
DELETE FROM TRANSETUP WHERE TRAN_WINDOW = 'w_palletprc';

--INSERT NEW RECORD INTO TRANSETUP TABLE
Insert into TRANSETUP (TRAN_WINDOW,SAVE_FLAG,VAL_FLAG,KEY_FLAG,KEY_STRING,UDF_1,UDF_2,UDF_3,UDF_4,UDF_5,REPEATE_ADD,CHG_DATE,CHG_USER,CHG_TERM,EDI_OPTION,SITE_ACC_COL,CONFIRM_COL,CONFIRM_VAL,REPEAT_ADD_DET,LOAD_MODE,AUTO_CONFIRM,LEDG_POST_CONF,CHG_DATE_ON_CONF,TRAN_ID_COL,MAIL_OPTION,CONFIRM_MODE,GARBAGE_OPT,VAL_FLAG_EDI,VERIFY_PASSWORD,TABLE_NAME,APPLICATION,TABLE_DESC,TRAN_DATE_COL,SALES_PERS_ACC_COL,CUST_ACC_COL,SUPP_ACC_COL,ITEM_SER_ACC_COL,EMP_ACC_COL,WORKFLOW_OPT,TRAN_ID__FROM,TRAN_ID__TO,MULTITIRE_OPT,REF_SER,VIEW_MODE,TABLE_NAME_DET1,TABLE_NAME_DET2,TABLE_NAME_DET3,TAX_FORMS,SIGN_STATUS,USER_TRAN_WINDOW,CUSTOM_PREVIEW_OBJ,CHILDDATA_ARGOPT,IGNOREERRLIST_ONLOAD,EDIT_TMPLT,WRKFLW_INIT,FORMAL_ARGS,EDIT_OPT,AUDIT_TRAIL_OPT,EDITTAX,CACHE_OPT,OPTIMIZE_MODE,EDIT_EXPR,TRANSFER_MODE,RATE_COL,QTY_COL,RCP_CACHE_STATUS,PRINT_CONTROL,ITEM_SER_ACC_CODE,PROFILE_ID__RES,PERIOD_OPTION,TRAN_COMPL_MSG,WRKFLW_PRIORITY,EXEC_TYPE,DISP_META_DATA,START_FORM,ISATTACHMENT,ALLOW_ATTACH) values ('w_palletprc','2','2','A','35167200,seq10',null,null,null,null,null,'N','05/jun/12','Mahesh    ','Base           ','0',null,null,'Y','N',null,null,null,null,'pallet_no',null,null,null,null,null,'pallet_no',null,null,null,null,null,null,null,null,'0',null,null,null,'M-PALT',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'M',null,null,null,null,null,null,null);

--DELETE EXISTING RECORD FROM OBJ_FORMS
DELETE FROM OBJ_FORMS WHERE WIN_NAME = 'w_palletprc';

--INSERT NEW RECORD INTO OBJ_FORMS TABLE
Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,AUTO_ACCEPT_SCAN,SCAN_METADATA,SCAN_FLAG,SCR_FLAG,PROPERTY_INFO,EXT_COM,EXT_METADATA,EXT_SETUP,AFTER_SAVE,COLUMN_ON_SAVE,SCAN_DELIMITER,AUTO_ACCEPT_WEIGHDATA,RATE_COL,QTY_COL,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,ASSISTED_MODE) values ('w_palletprc','Process',null,null,null,null,null,null,'1',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);

--DELETE EXISTING RECORD FROM OBJ_ACTIONS
DELETE FROM OBJ_ACTIONS WHERE OBJ_NAME = 'palletprc';

--INSERT NEW RECORD INTO OBJ_ACTIONS TABLE
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,RIGHTS_CHAR,INTERACTIVE,SERVICE_CODE,DESCRIPTION,TITLE,IMAGE,ACTION_TYPE,FORM_NO,SERVICE_HANDLER,PLACEMENT,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('palletprc',1,'R','a','process','Action Button for processing the data','Process',null,'U','1',null,null,null,null,null,null);

--DELETE EXISTING RECORD FROM SYSTEM_EVENTS
DELETE FROM SYSTEM_EVENTS WHERE OBJ_NAME = 'palletprc' ;

--INSERT NEW RECORDS INTO SYSTEM_EVENTS TABLE
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('palletprc','pre_validate','1','prv_default_ejb',null,'05/jun/12','Mahesh    ','BASE','2','0','EJB','CartonNoGenIC',null);
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('palletprc','process','1','prc_pallet_no_gen',null,'05/jun/12','Mahesh    ','Base','2','0','EJB','CartonNoGenPrc',null);

--DELETE EXISTING RECORD FROM SYSTEM_EVENT_SERVICES
DELETE FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = 'prv_default_ejb' OR SERVICE_CODE = 'prc_pallet_no_gen';

--INSERT NEW RECORDS INTO SYSTEM_EVENT_SERVICES TABLE
Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM) values ('prc_pallet_no_gen','Process','http://localhost:9090/axis/services/ValidatorService',null,'process','String','S',null,null,'05/jun/12','Mahesh    ','Mahesh');
Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM) values ('prv_default_ejb',null,'http://localhost:9090/axis/services/ProcessService',null,'wfValData','String','S',null,null,'05/jun/12','Subrata   ','Subu');

--DELETE EXISTING RECORD FROM SYSTEM_SERVICE_ARGS
DELETE FROM SYSTEM_SERVICE_ARGS WHERE SERVICE_CODE = 'prv_default_ejb' OR SERVICE_CODE = 'prc_pallet_no_gen';

--INSERT NEW RECORDS INTO SYSTEM_EVENT_ARGS TABLE
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prc_pallet_no_gen',1,'COMPONENT_TYPE','I','Component Type','C.String',null,'05/jun/12','Mahesh    ','BASE','EJB');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prc_pallet_no_gen',2,'COMPONENT_NAME','I','Component Name','C.String',null,'05/jun/12','Mahesh    ','BASE','CartonNoGenPrc');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prc_pallet_no_gen',3,'XML_DATA_1','I','XML data of form no 1','S',null,'05/jun/12','Mahesh    ','BASE',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prc_pallet_no_gen',4,'XML_DATA__ALL','I','XML data of form no 1','S',null,'05/jun/12','Mahesh    ','BASE',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prc_pallet_no_gen',5,'WINDOW_NAME','I','Object Context','S',null,'05/jun/12','Mahesh    ','BASE','w_palletprc');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prc_pallet_no_gen',6,'XTRA_PARAMS','I','Extra Arguments','S',null,'05/jun/12','Mahesh    ','BASE',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',1,'COMPONENT_TYPE','I',null,'S',null,'05/jun/12','Manohar   ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',2,'COMPONENT_NAME','I',null,'S',null,'05/jun/12','Manohar   ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',3,'XML_DATA','I',null,'S',null,'05/jun/12','Manohar   ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',4,'XML_DATA_1','I',null,'S',null,'05/jun/12','Manohar   ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',5,'XML_DATA_ALL','I',null,'S',null,'05/jun/12','Manohar   ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',6,'OBJ_CONTEXT','I',null,'S',null,'05/jun/12','Manohar   ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',7,'EDIT_FLAG','I',null,'S',null,'05/jun/12','Manohar   ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',8,'XTRA_PARAMS','I',null,'S',null,'05/jun/12','Manohar   ','Manohar',null);

--DELETE EXISTING RECORD FROM MESSAGES
DELETE FROM MESSAGES WHERE MSG_NO = 'NOTANUMBR1' OR MSG_NO = 'PRCSUCCESS' OR MSG_NO = 'VTPNOEMPTY';

--INSERT NEW RECORDS INTO MESSAGES TABLE 
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 ('NOTANUMBR1','Not a Valid Number!','Please Enter a valid number','E','Y',null,null,null,null,null,null,null,null);
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 ('PRCSUCCESS','Process Completed','Process Completed Successfully.','P','Y',null,null,null,'05/jun/12','Mahesh    ','BASE           ',null,null);
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 ('VTPNOEMPTY','Empty no of Pallet','Please Enter the no of Pallet','E','Y',null,null,null,null,null,null,null,null);

--DELETE EXISTING RECORD FROM ITM2MENU
DELETE FROM ITM2MENU WHERE WIN_NAME = 'w_shipment';

--INSERT NEW RECORD INTO ITM2MENU TABLE
Insert into ITM2MENU (APPLICATION,LEVEL_1,LEVEL_2,LEVEL_3,LEVEL_4,LEVEL_5,WIN_NAME,DESCR,COMMENTS,MENU_PATH,ICON_PATH,CLOSE_ICON,OPEN_ICON,OBJ_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('SFA',1,53,0,0,0,'w_shipment','Shipment Transaction','Shipment','SFA.1.53.0.0.0','e12_logo.gif',null,null,null,'01/jun/12','Mahesh','Patidar   ');

--DELETE EXISTING RECORD FROM TRANSETUP
DELETE FROM TRANSETUP WHERE TRAN_WINDOW = 'w_shipment';

--INSERT NEW RECORD INTO TRANSETUP TABLE
Insert into TRANSETUP (TRAN_WINDOW,SAVE_FLAG,VAL_FLAG,KEY_FLAG,KEY_STRING,UDF_1,UDF_2,UDF_3,UDF_4,UDF_5,REPEATE_ADD,CHG_DATE,CHG_USER,CHG_TERM,EDI_OPTION,SITE_ACC_COL,CONFIRM_COL,CONFIRM_VAL,REPEAT_ADD_DET,LOAD_MODE,AUTO_CONFIRM,LEDG_POST_CONF,CHG_DATE_ON_CONF,TRAN_ID_COL,MAIL_OPTION,CONFIRM_MODE,GARBAGE_OPT,VAL_FLAG_EDI,VERIFY_PASSWORD,TABLE_NAME,APPLICATION,TABLE_DESC,TRAN_DATE_COL,SALES_PERS_ACC_COL,CUST_ACC_COL,SUPP_ACC_COL,ITEM_SER_ACC_COL,EMP_ACC_COL,WORKFLOW_OPT,TRAN_ID__FROM,TRAN_ID__TO,MULTITIRE_OPT,REF_SER,VIEW_MODE,TABLE_NAME_DET1,TABLE_NAME_DET2,TABLE_NAME_DET3,TAX_FORMS,SIGN_STATUS,USER_TRAN_WINDOW,CUSTOM_PREVIEW_OBJ,CHILDDATA_ARGOPT,IGNOREERRLIST_ONLOAD,EDIT_TMPLT,WRKFLW_INIT,FORMAL_ARGS,EDIT_OPT,AUDIT_TRAIL_OPT,EDITTAX,CACHE_OPT,OPTIMIZE_MODE,EDIT_EXPR,TRANSFER_MODE,RATE_COL,QTY_COL,RCP_CACHE_STATUS,PRINT_CONTROL,ITEM_SER_ACC_CODE,PROFILE_ID__RES,PERIOD_OPTION,TRAN_COMPL_MSG,WRKFLW_PRIORITY,EXEC_TYPE,DISP_META_DATA,START_FORM,ISATTACHMENT,ALLOW_ATTACH) values ('w_shipment','2','2','M','seq10',null,null,null,null,null,'N','01/jun/12','Mahesh    ','Base           ','0','SITE_CODE','CONFIRMED','Y','N',null,'N','Y','N','shipment_id','0','0',null,null,null,'shipment','WMS','Shipment',null,null,null,null,null,null,'0',null,null,null,null,'F',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'M',null,null,null,null,null,null,null);

--DELETE EXISTING RECORD FROM OBJ_FORMS
DELETE FROM OBJ_FORMS WHERE WIN_NAME = 'w_shipment';

--INSERT NEW RECORDS INTO OBJ_FORMS TABLE
Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,AUTO_ACCEPT_SCAN,SCAN_METADATA,SCAN_FLAG,SCR_FLAG,PROPERTY_INFO,EXT_COM,EXT_METADATA,EXT_SETUP,AFTER_SAVE,COLUMN_ON_SAVE,SCAN_DELIMITER,AUTO_ACCEPT_WEIGHDATA,RATE_COL,QTY_COL,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,ASSISTED_MODE) values ('w_shipment','Shipment','d_shipment_brow','d_shipment_edit',null,null,null,null,'1',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);
Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,AUTO_ACCEPT_SCAN,SCAN_METADATA,SCAN_FLAG,SCR_FLAG,PROPERTY_INFO,EXT_COM,EXT_METADATA,EXT_SETUP,AFTER_SAVE,COLUMN_ON_SAVE,SCAN_DELIMITER,AUTO_ACCEPT_WEIGHDATA,RATE_COL,QTY_COL,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,ASSISTED_MODE) values ('w_shipment','Docs','d_shipment_brow','d_shipment_edit',null,null,null,null,'2',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);

--DELETE EXISTING RECORDS FROM OBJ_ACTIONS
DELETE FROM OBJ_ACTIONS WHERE OBJ_NAME = 'shipment';

--INSERT NEW RECORDS INTO OBJ_ACTIONS TABLE
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,RIGHTS_CHAR,INTERACTIVE,SERVICE_CODE,DESCRIPTION,TITLE,IMAGE,ACTION_TYPE,FORM_NO,SERVICE_HANDLER,PLACEMENT,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('shipment',1,'A','a','a','Adding New','Add','add.gif','S','1',null,null,null,null,null,null);
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,RIGHTS_CHAR,INTERACTIVE,SERVICE_CODE,DESCRIPTION,TITLE,IMAGE,ACTION_TYPE,FORM_NO,SERVICE_HANDLER,PLACEMENT,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('shipment',2,'E','a','a','Editing Existing Record','Edit','edit.gif','S','1',null,null,null,null,null,null);
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,RIGHTS_CHAR,INTERACTIVE,SERVICE_CODE,DESCRIPTION,TITLE,IMAGE,ACTION_TYPE,FORM_NO,SERVICE_HANDLER,PLACEMENT,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('shipment',4,'S','a','a','Saving','Save','save.gif','S','1',null,null,null,null,null,null);
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,RIGHTS_CHAR,INTERACTIVE,SERVICE_CODE,DESCRIPTION,TITLE,IMAGE,ACTION_TYPE,FORM_NO,SERVICE_HANDLER,PLACEMENT,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('shipment',5,'F','a','pre_confirm','Confirmation','Confirm','confirm.gif','U','1','2',null,null,null,null,null);
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,RIGHTS_CHAR,INTERACTIVE,SERVICE_CODE,DESCRIPTION,TITLE,IMAGE,ACTION_TYPE,FORM_NO,SERVICE_HANDLER,PLACEMENT,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('shipment',21,'X','1','audit_trail','View Audit Trail','View Audit','menu.bmp','U','1','1','1',null,null,null,null);

--DELETE EXISTING RECORDS FROM SYSTEM_EVENTS
DELETE FROM SYSTEM_EVENTS WHERE OBJ_NAME = 'shipment';

--INSERT NEW RECORDS INTO SYSTEM_EVENTS TABLE
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('shipment','audit_trail','1','project_audit_trail',null,'01/jun/12','d         ','Base45','2','0',null,null,null);
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('shipment','post_item_change','1','poic_default_ejb',null,'01/jun/12','Mahesh    ','BASE','2','0','EJB','ShipmentIC',null);
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('shipment','post_validate','1','post_gen_val',null,'01/jun/12','system    ','system','2','0','EJB','GenValidate',null);
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('shipment','pre_confirm','1','prcm_default_ejb',null,'01/jun/12','Mahesh    ','BASE','2','0','EJB','ShipmentConf',null);
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('shipment','pre_validate','1','prv_default_ejb',null,'01/jun/12','Mahesh    ','BASE','2','0','EJB','ShipmentIC',null);

--DELETE EXISTING RECORDS FROM SYSTEM_EVENT_SERVICES
DELETE FROM SYSTEM_EVENT_SERVICES where service_code = 'project_audit_trail' or service_code = 'poic_default_ejb' or service_code = 'post_gen_val' or service_code = 'prcm_default_ejb' or service_code = 'prv_default_ejb' ;

--INSERT NEW RECORDS INTO SYSTEM_EVENT_SERVICES TABLE
Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM) values ('poic_default_ejb',null,'http://localhost:9090/axis/services/ValidatorService',null,'itemChanged','String','S',null,null,'01/jun/12','Subrata   ','Subu');
Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM) values ('post_gen_val','validation','http://localhost:9090/axis/services/ValidatorService','BASE iformation','wfValData','String','S',null,null,'01/jun/12','ALKA      ','BASE');
Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM) values ('prcm_default_ejb','Action To confirm','http://localhost:9090/axis/services/ValidatorService','Base Information','confirm','String','S',null,null,'01/jun/12','base      ','base');
Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM) values ('project_audit_trail','calling audit log jsp','http://192.168.0.25:9090/ibase/webitm/jsp/ITMAuditForms.jsp',null,'doPost',null,null,null,null,'01/jun/12','Base      ','Base91');
Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM) values ('prv_default_ejb',null,'http://localhost:9090/axis/services/ProcessService',null,'wfValData','String','S',null,null,'01/jun/12','Subrata   ','Subu');

--DELETE EXISTING RECORDS FROM SYSTEM_SERVICE_ARGS
DELETE FROM SYSTEM_SERVICE_ARGS where service_code = 'project_audit_trail' or service_code = 'poic_default_ejb' or service_code = 'post_gen_val' or service_code = 'prcm_default_ejb' or service_code = 'prv_default_ejb' ;

--INSERT NEW RECORDS INTO SYSTEM_SERVICE_ARGS TABLE
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',1,'COMPONENT_TYPE','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',2,'COMPONENT_NAME','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',3,'XML_DATA','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',4,'XML_DATA_1','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',5,'XML_DATA_ALL','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',6,'OBJ_CONTEXT','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',7,'FOCUSED_COLUMN','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',8,'EDIT_FLAG','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',9,'XTRA_PARAMS','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_gen_val',1,'COMPONENT_TYPE','I',null,'C.String',null,'01/jun/12','Jiten     ','Base218','EJB');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_gen_val',2,'COMPONENT_NAME','I',null,'C.String',null,'01/jun/12','Jiten     ','Base218','GenValidate');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_gen_val',3,'XML_DATA','I',null,'S',null,'01/jun/12','Jiten     ','Base218',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_gen_val',4,'XML_DATA_ALL','I',null,'S',null,'01/jun/12','Jiten     ','Base218',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_gen_val',5,'XML_DATA_ALL','I',null,'S',null,'01/jun/12','Jiten     ','Base218',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_gen_val',6,'OBJ_CONTEXT','I',null,'S',null,'01/jun/12','Jiten     ','Base218',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_gen_val',7,'WIN_NAME','I',null,'S',null,'01/jun/12','Jiten     ','Base218',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_gen_val',8,'XTRA_PARAMS','I',null,'S',null,'01/jun/12','Jiten     ','Base218',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prcm_default_ejb',1,'COMPONENT_TYPE','I','Component Type','C.String',null,'01/jun/12','BASE      ','BASE','EJB');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prcm_default_ejb',2,'COMPONENT_NAME','I','Component Name','C.String',null,'01/jun/12','BASE      ','BASE',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prcm_default_ejb',3,'<tran_id>','I','tranid','C.String',null,'01/jun/12','BASE      ','BASE',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prcm_default_ejb',4,'XTRA_PARAMS','I','Extra Arguments','S',null,'01/jun/12','BASE      ','BASE',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prcm_default_ejb',5,'FORCED_FLAG','I','Forced Flag','S',null,'01/jun/12','BASE      ','BASE',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',1,'COMPONENT_TYPE','I',null,'S',null,'01/jun/12','Manohar   ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',2,'COMPONENT_NAME','I',null,'S',null,'01/jun/12','Manohar   ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',3,'XML_DATA','I',null,'S',null,'01/jun/12','Manohar   ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',4,'XML_DATA_1','I',null,'S',null,'01/jun/12','Manohar   ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',5,'XML_DATA_ALL','I',null,'S',null,'01/jun/12','Manohar   ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',6,'OBJ_CONTEXT','I',null,'S',null,'01/jun/12','Manohar   ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',7,'EDIT_FLAG','I',null,'S',null,'01/jun/12','Manohar   ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',8,'XTRA_PARAMS','I',null,'S',null,'01/jun/12','Manohar   ','Manohar',null);

--DELETE EXISTING RECORDS FROM OBJ_ITEMCHANGE
DELETE FROM OBJ_ITEMCHANGE WHERE OBJ_NAME = 'shipment';

--INSERT NEW RECORDS INTO OBJ_ITEMCHANGE TABLE
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','2','tare_weight',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','1','curr_code',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','1','freight_amt',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','1','frt_list',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','1','gross_weight',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','1','itm_default',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','1','load_type',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','1','stan_code__from',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','1','stan_code__to',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','1','tare_weight',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','1','tran_code',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','2','charge_code',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','2','itm_default',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','3','itm_default',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','3','stan_code__dlv',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','3','stan_code__ship',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','3','tran_code',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','2','curr_code',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','2','curr_code__bc',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','2','curr_code__frt',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','2','itm_default',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','2','stan_code__dlv',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','2','stan_code__ship',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','2','tran_code',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','2','ptcn',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','2','itm_defaultedit',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','1','itm_defaultedit',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','1','net_weight',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','2','net_weight',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','2','gross_weight',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','1','gross_weight',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','1','gross_weight',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('shipment','1','tare_weight',null);

--DELETE EXISTING RECORDS FROM messages
DELETE FROM messages where msg_no = 'VMSITECD1' or
msg_no = 'VMSITE' or
msg_no = 'VMTRAN1' or
msg_no = 'VMSTANCD1' or
msg_no = 'VTFRLEXT' or
msg_no = 'VMCUR1' or
msg_no = 'VMLOADTY' or
msg_no = 'VMLOADCD' or
msg_no = 'VTDSPCON' or
msg_no = 'REFSERCD' or
msg_no = 'VTDESPC' ;


--INSERT NEW RECORDS INTO MESSAGES TABLE
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 ('REFSERCD  ','Reference can not be blank','Reference can not be blank','E',null,null,null,null,'01/jun/12','BASE      ','BASE           ',null,null);
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 ('VMCUR1    ','Invalid currency code !','The currency code entered does not exist in the currency master. First you have to define it in the master','E','Y',null,null,null,'01/jun/12','BASE      ','BASE           ',null,null);
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 ('VMLOADTY  ','Empty Load Type!','Load Type should not be Empty.','E','Y',null,null,null,'01/jun/12','BASE      ','BASE           ',null,null);
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 ('VMSTANCD1 ','Station code not defined ',' Station Code Not Defined In Master','E',null,null,null,null,'01/jun/12','BASE      ','BASE           ',null,null);
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 ('VMTRAN1   ','Invalid transporter!','Transporter code entered does not exist. Please enter valid/defined transporter code.','E','Y',null,null,null,'01/jun/12','BASE      ','BASE           ',null,null);
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 ('VMSITE    ','Invalid Site Code !','Entered site code not defined  in site master.','E','Y',null,null,null,'01/jun/12','BASE      ','BASE           ',null,null);
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 ('VMSITECD1 ','Site Cannot be Empty!','Site code cannot be empty. Enter a valid site code.','E','Y',null,null,null,'01/jun/12','BASE      ','BASE           ',null,null);
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 ('VTDESPC   ','Despatch confirmed!','Despatch confirmed successfully !','P','N',null,null,null,'01/jun/12','BASE      ','BASE           ',null,null);
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 ('VTFRLEXT  ','Invalid Freight List !','Freight List doesnot exists in Master.','E','Y',null,null,null,'01/jun/12','BASE      ','BASE           ',null,null);
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 ('VTDSPCON  ','Despatch Already Confirmed','Despatch Already Confirmed. Enter other reference id','E','Y',null,null,null,null,null,null,null,null);
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 ('VMLOADCD  ','Load type cannot be empy','Load type cannot be empy','E','Y',null,null,null,null,null,null,null,null);

--DELETE EXISTING RECORDS FROM POPHELP
DELETE FROM POPHELP where mod_name = 'W_SHIPMENT';

--INSERT NEW RECORDS INTO POPHELP TABLE
Insert into POPHELP (FIELD_NAME,MOD_NAME,SQL_STR,DW_OBJECT,MSG_TITLE,WIDTH,HEIGHT,CHG_DATE,CHG_USER,CHG_TERM,DIST_OPT,FILTER_STRING,SQL_INPUT,DEFAULT_COL,POP_ALIGN,QUERY_MODE,PAGE_CONTEXT,POPHELP_COLS,POPHELP_SOURCE,MULTI_OPT,HELP_OPTION) values ('PTCN              ','W_SHIPMENT','SELECT PTCN FROM WAVE_TASK_DET WHERE REF_ID IN (SELECT DESP_ID FROM DESPATCH WHERE CONFIRMED != ''Y'')',null,'PTCN',null,null,'01/jun/12','MAHESH    ','BASE           ','1',null,null,1,null,null,null,null,null,null,null);
Insert into POPHELP (FIELD_NAME,MOD_NAME,SQL_STR,DW_OBJECT,MSG_TITLE,WIDTH,HEIGHT,CHG_DATE,CHG_USER,CHG_TERM,DIST_OPT,FILTER_STRING,SQL_INPUT,DEFAULT_COL,POP_ALIGN,QUERY_MODE,PAGE_CONTEXT,POPHELP_COLS,POPHELP_SOURCE,MULTI_OPT,HELP_OPTION) values ('REF_ID            ','W_SHIPMENT','SELECT DESP_ID FROM DESPATCH WHERE CONFIRMED != ''Y''',null,'REFERENCE ID',null,null,'01/jun/12','MAHESH    ','BASE           ',null,null,null,null,null,null,null,null,null,null,null);

--ALTER TABLE SHIP_DOCS FOR ADD PTCN NO COLUNM
alter table ship_docs add PTCN char(10);
-- 09/06/12 sun
INSERT INTO itm2menu (
	application,
	level_1,
	level_2,
	level_3,
	level_4,
	level_5,
	win_name,
	descr,
	comments,
	menu_path,
	icon_path,
	close_icon,
	open_icon,
	obj_type,
	chg_date,
	chg_term,
	chg_user,
	mob_deploy)
VALUES (
	'WMS',
	1,
	21,
	0,
	0,
	0,
	'w_phy_item_scan',
	'Physical item Scan',
	'Physical item Scan',
	'WMS.1.21.0.0.0',
	'e12_logo.gif',
	NULL,
	NULL,
	'W',
	NULL,
	'BASE           ',
	'Rohan     ',
	NULL);

INSERT INTO transetup (
	tran_window,
	save_flag,
	val_flag,
	key_flag,
	key_string,
	udf_1,
	udf_2,
	udf_3,
	udf_4,
	udf_5,
	repeate_add,
	chg_date,
	chg_user,
	chg_term,
	edi_option,
	site_acc_col,
	confirm_col,
	confirm_val,
	repeat_add_det,
	repeatadddet,
	load_mode,
	auto_confirm,
	ledg_post_conf,
	chg_date_on_conf,
	tran_id_col,
	mail_option,
	confirm_mode,
	garbage_opt,
	val_flag_edi,
	verify_password,
	cust_acc_col,
	sales_pers_acc_col,
	supp_acc_col,
	item_ser_acc_code,
	emp_acc_col,
	item_ser_acc_col,
	workflow_opt,
	table_name,
	application,
	table_desc,
	tran_date_col,
	tran_id__from,
	tran_id__to,
	table_name_det1,
	table_name_det2,
	table_name_det3,
	multitire_opt,
	ref_ser,
	view_mode,
	tax_forms,
	sign_status,
	user_tran_window,
	custom_preview_obj,
	ignoreerrlist_onload,
	childdata_argopt,
	edit_tmplt,
	wrkflw_init,
	edittax,
	formal_args,
	audit_trail_opt,
	edit_opt,
	cache_opt,
	optimize_mode,
	edit_expr,
	rate_col,
	qty_col,
	edit_expr_inp,
	rcp_cache_status,
	print_control,
	transfer_mode,
	profile_id__res,
	tran_compl_msg,
	period_option,
	wrkflw_priority,
	exec_type,
	disp_meta_data,
	allow_attach,
	start_form,
	isattachment)
VALUES (
	'w_phy_item_scan',
	'2',
	'2',
	'A',
	'seq10',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'N',
	fn_sysdate(),
	'Rohan     ',
	'BASE           ',
	'0',
	'site_code',
	'CONFIRMED',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'TRAN_ID',
	'0',
	'0',
	'N',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'PHYSCAN',
	'WMS',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'PSCAN',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

	
INSERT INTO REFSER (
	ref_ser ,
	descr ,
	type ,
	sys_ser ,
	prefix ,
	chg_date ,
	chg_user ,
	chg_term ,
	seq_name ,
	tax_form_reqd ,
	trans_type )
 VALUES (
	'PSCAN',
	'Physical Item Scan',
	'S',
	NULL,
	NULL,
	fn_sysdate(),
	'Rohan',
	'BASE',
	NULL,
	NULL,
	NULL);
	
INSERT INTO obj_forms (
	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode)
 VALUES (
 'w_phy_item_scan',
	'Detail',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN NO:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Physical Scan Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>qty_physical</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<descr>(<item_code>),<loc_code>,<lot_no>,<lot_sl>',
	NULL,
	NULL,
	NULL,
	'E');
 
 INSERT INTO obj_forms (
	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode)
 VALUES (
 'w_phy_item_scan',
	'Physical Item Scan',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
	'phy_item_scan',
	1,
	NULL,
	'Saving',
	NULL,
	NULL,
	'S',
	'Finish',
	'3',
	NULL,
	NULL,
	'U',
	NULL,
	fn_sysdate(),
	'BASE           ',
	'Rohan     ');
 
 INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
 'phy_item_scan',
	2,
	NULL,
	'Prev',
	'a',
	'a',
	'P',
	'Next',
	'2',
	NULL,
	NULL,
	'U',
	NULL,
	fn_sysdate(),
	'BASE           ',
	'Rohan     ');
 
 INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
 'phy_item_scan',
	3,
	NULL,
	'Next',
	'a',
	'a',
	'N',
	'Next',
	'2',
	NULL,
	NULL,
	'U',
	NULL,
	fn_sysdate(),
	'BASE           ',
	'Rohan     ');
 INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
 	'phy_item_scan',
	4,
	NULL,
	'Prev',
	'a',
	'a',
	'P',
	'Prev',
	'3',
	NULL,
	NULL,
	'U',
	NULL,
	fn_sysdate(),
	'BASE           ',
	'Rohan     ');
 INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
 'phy_item_scan',
	5,
	'confirm~normal.gif',
	'Confirming records',
	'pre_confirm',
	'a',
	'F',
	'Confirm',
	'3',
	'2',
	'1',
	'S',
	NULL,
	fn_sysdate(),
	'BASE           ',
	'Rohan     ');
 INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
 'phy_item_scan',
	6,
	NULL,
	'Next',
	NULL,
	NULL,
	'N',
	'Next',
	'1',
	NULL,
	NULL,
	'U',
	NULL,
	fn_sysdate(),
	'BASE           ',
	'Rohan     ');
 
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 (
	'phy_item_scan',
	'default_data_wiz',
	'1',
	'phy_scan_default_data',
	NULL,
	'0',
	fn_sysdate(),
	'Rohan',
	'BASE',
	'2',
	'EJB',
	'PhyItemScanIC',
	NULL);


INSERT INTO system_event_services (
	service_code,
	service_descr,
	service_uri,
	service_provider,
	method_name,
	return_value,
	return_type,
	return_descr,
	return_xfrm,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'phy_scan_default_data',
	'Default Data',
	'http://localhost:9090/axis/services/ValidatorService',
	'BASE',
	'itemChanged',
	'String',
	'S',
	NULL,
	NULL,
	fn_sysdate(),
	'Rohan',
	'BASE');
	
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
		'phy_scan_default_data',
		1,
		'COMPONENT_TYPE',
		'I',
		NULL,
		'S',
		NULL,
		fn_sysdate(),
		'Rohan    ',
		'BASE',
		'EJB');

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
		'phy_scan_default_data',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan    ',
	'BASE',
	'PhyItemScanIC');

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
'phy_scan_default_data',
	3,
	'XML_DATA',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan    ',
	'BASE',
	NULL);

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
'phy_scan_default_data',
	4,
	'XML_DATA_1',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
'phy_scan_default_data',
	5,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan    ',
	'BASE',
	NULL);

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'phy_scan_default_data',
	6,
	'OBJ_CONTEXT',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan    ',
	'BASE',
	NULL);

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'phy_scan_default_data',
	7,
	'FOCUSED_COLUMN',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan    ',
	'BASE',
	NULL);

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
'phy_scan_default_data',
	8,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan    ',
	'BASE',
	NULL);

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'phy_scan_default_data',
	9,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan    ',
	'BASE',
	NULL);

//new one	
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 (
	'phy_item_scan',
	'pre_validate',
	'1',
	'prv_phy_scan',
	NULL,
	'0',
	fn_sysdate(),
	'Rohan     ',
	'BASE',
	'2',
	'EJB',
	'PhyItemScanIC',
	NULL);


INSERT INTO system_event_services (
	service_code,
	service_descr,
	service_uri,
	service_provider,
	method_name,
	return_value,
	return_type,
	return_descr,
	return_xfrm,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'prv_phy_scan',
	'Validation',
	'http://localhost:9090/axis/services/ValidatorService',
	'BASE',
	'wfValData',
	'String',
	'S',
	NULL,
	NULL,
	fn_sysdate(),
	'Rohan    ',
	'BASE');

	
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
		'prv_phy_scan',
		1,
		'COMPONENT_TYPE',
		'I',
		NULL,
		'S',
		NULL,
		fn_sysdate(),
		'Rohan    ',
		'BASE',
		'EJB');

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prv_phy_scan',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan    ',
	'BASE',
	'PhyItemScanIC');

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prv_phy_scan',
	3,
	'XML_DATA',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan    ',
	'BASE',
	NULL);

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prv_phy_scan',
	4,
	'XML_DATA_1',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prv_phy_scan',
	5,
	'XML_DATA__ALL',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan    ',
	'BASE',
	NULL);

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prv_phy_scan',
	6,
	'OBJ_CONTEXT',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan    ',
	'BASE',
	NULL);

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prv_phy_scan',
	7,
	'EDIT_FLAG',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prv_phy_scan',
	8,
	'XTRA_PARAMS',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan    ',
	'BASE',
	NULL);
	
INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'NULLPHYQTY',
	'Null Quantity',
	'Null Physical Quantity.Please Enter Quantity.',
	'E',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE '
	);

INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'NOTMATCH',
	'No Match Found',
	'Physical Scan Quantity and Stock Quantity are not Equals.',
	'W',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE '
	);

-- end 09/06/12 sun
-- 09/06/12 office
--drop table group_pricelist cascade constraints;
CREATE TABLE group_pricelist
(
	group_code		CHAR(10) NOT NULL,
	CUST_CODE		CHAR(10) not null,
	eff_from 		date not null,
	valid_upto		date not null,
	price_list		char(5) ,
    REMARK              VARCHAR2(25), 
    DISCOUNT            NUMBER(7,2),    
    CHG_USER   		CHAR(10) ,
	CHG_TERM  		VARCHAR2(15) ,
	CHG_DATE   		DATE )TABLESPACE ITM_MFG_D1;

------------------------------------------------------------------------------
/* SET PRIMARY KEY FOR group_pricelist */
------------------------------------------------------------------------------

 ALTER TABLE group_pricelist ADD CONSTRAINT group_pList_X PRIMARY KEY (group_code,CUST_CODE,eff_from,valid_upto) USING INDEX TABLESPACE 
 ITM_MFG_I1;
Insert into obj_itemchange (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('group_pricelist','1','group_code',null);
Insert into obj_itemchange (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('group_pricelist','1','cust_code',null);
delete from system_events where obj_name = 'group_pricelist' and event_code = 'pre_save';

Insert into  system_events  (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('group_pricelist','pre_save','1','presave_gplist',null,sysdate,'BASE      ','BASE','2','0','EJB','GroupPriceListPrs',null);

Insert into system_event_services (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM) values ('presave_gplist','preSaveRec','http://192.168.0.124/BaseE12DotNetService6-3-0-003/E12BusinessLogic6-3-0-003.asmx','BASE','preSaveRec','String','S',null,null,sysdate,'UMAKANTA  ','UMAKANTA');

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('presave_gplist',1,'COMPONENT_TYPE','I',null,'C.String',null,sysdate,'BASE    ','BASE','EJB');
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('presave_gplist',2,'COMPONENT_NAME','I',null,'C.String',null,sysdate,'BASE    ','BASE','GroupPriceListPrs');
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('presave_gplist',3,'XML_DATA','I',null,'S',null,sysdate,'BASE    ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('presave_gplist',4,'DOM_ID','I',null,'S',null,sysdate,'BASE    ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('presave_gplist',5,'OBJ_CONTEXT','I',null,'S',null,sysdate,'BASE    ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('presave_gplist',6,'EDIT_FLAG','I',null,'S',null,sysdate,'BASE    ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('presave_gplist',7,'XTRA_PARAMS','I',null,'S',null,sysdate,'BASE    ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('presave_gplist',8,'DB_CONN','I',null,'S.Connection',null,sysdate,'BASE    ','BASE',null);
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 
('VMBCUST9','INVALID CUSTOMER','Please Enter Valid CUSTOMER OR PERIOD. ENTRY IS ALREADY PRESENT FOR SAME CUSTOMER AND SAME PERIOD.','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

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 
('VMBCUST8','INVALID CUSTOMER CODE','Please Enter Valid Customer Code.','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

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 
('VTCUSNL','CUSTOMER CODE NULL','Please Enter Customer Code. ','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);


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 
('VMBBLCUST','BLACK LISTED CUSTOMER CODE','Please Enter Active Customer Code. ','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);


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 
('INVEFFDAT3','INVALID VALID UPTO DATE','Please Enter Valid Upto date greater than Effective date ','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

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 
('INVEFFDAT2','INVALID EFFECTIVE FROM DATE','Please Enter Effective date less than Valid Upto date','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

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 
('VMGRCOD1','INVALID GROUP CODE','Please Enter Valid Group Code. ','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

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 
('VMPRILI1','INVALID PRICE LIST','Please Enter Valid Price List. ','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

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 
('VMGROUP','GROUP CODE NULL','Please Enter Group Code. ','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

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 
('VMPRICELS','PRICELIST NULL','Please Enter Price List. ','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

Insert into obj_itemchange (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('group_pricelist','1','group_code',null);


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 ('PRVDATUPDT','WARNING MESSAGE...','Same Data Found Against Customer. Valid Upto Date Update Successfully','W','Y',null,null,null,sysdate,'BASE','BASE',null,null);

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 ('INVDATA','INVALID DATA...','Invalid Data. Please Enter Valid Data','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

Insert into system_events (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) 
values ('group_pricelist','post_validate','1','postsave_sret',null,sysdate,'BASE','BASE','2','0','EJB','GroupPriceListPostSave',null);

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
 ('PRVDATUPDT','WARNING MESSAGE...','Same Data Found Against Customer. Valid Upto Date Update Successfully','W','Y',null,null,null,sysdate,'BASE','BASE',null,null);

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 
('NULLEFFDA','NULL EFFECTIVE FROM DATE','Please Enter Effective From Date','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

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 
('NULLVALDA','NULL VALID UPTO DATE','Please Enter Valid Upto Date','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

Insert into obj_actions (OBJ_NAME,LINE_NO,RIGHTS_CHAR,INTERACTIVE,SERVICE_CODE,DESCRIPTION,TITLE,IMAGE,ACTION_TYPE,FORM_NO,SERVICE_HANDLER,PLACEMENT,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('group_pricelist',3,'X','1','audit_trail','View Audit Trail','View Audit','menu.bmp','U','1','1','1',null,null,null,null);

Insert into system_events (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) 
values ('group_pricelist','audit_trail','1','project_audit_trail',null,sysdate,'BASE      ','BASE','2','0',null,null,null);

update system_events set service_code = 'poic_default_ejb',comp_type='EJB',comp_name = 'DistributionRoute' 
where obj_name = 'distroute' and event_code = 'post_item_change';
update system_events set service_code = 'prv_default_ejb',comp_type='EJB',comp_name = 'DistributionRoute' 
where obj_name = 'distroute' and event_code = 'pre_validate';

Insert into obj_actions (OBJ_NAME,LINE_NO,RIGHTS_CHAR,INTERACTIVE,SERVICE_CODE,DESCRIPTION,TITLE,IMAGE,ACTION_TYPE,FORM_NO,SERVICE_HANDLER,PLACEMENT,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('bracket_group',3,'X','1','audit_trail','View Audit Trail','View Audit','menu.bmp','U','1','1','1',null,null,null,null);

Insert into system_events (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) 
values ('bracket_group','audit_trail','1','project_audit_trail',null,sysdate,'BASE      ','BASE','2','0',null,null,null);
update obj_forms set scan_metadata = '<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location Code To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_stock_transfer_grl' and form_no = '3';

update obj_forms set scan_metadata = '<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lpn_no</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_stock_transfer_grl' and form_no = '2';

-- end 09/06/12 office
-- 10/06/12 
update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Pick Location:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>quantity</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Case Label:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>case_label</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_active_pick' and form_no = '3';
update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Pick Location:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Number of Cases:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>no_art</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Case Label:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>case_label</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name in ('w_case_pick','w_master_pick') and form_no = '3';
create table pallet_no (pallet_no varchar2(25) not null);
INSERT INTO obj_itemchange (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'schemedef_tr',
	'1',
	'promo_term',
	null);
Insert into
pophelp(FIELD_NAME,MOD_NAME,SQL_STR,DW_OBJECT,MSG_TITLE,WIDTH,HEIGHT,CHG_DATE,CHG_USER,CHG_TERM,DIST_OPT,FILTER_STRING,SQL_INPUT,DEFAULT_COL,POP_ALIGN,QUERY_MODE,PAGE_CONTEXT,POPHELP_COLS,POPHELP_SOURCE,MULTI_OPT,HELP_OPTION)
 values ('CUST_CODE','W_GROUP_PRICELIST','SELECT CUST_CODE, CUST_NAME FROM
CUSTOMER WHERE BLACK_LISTED <>''Y''',null,'Group
Code',null,null,sysdate,'base','base','1',null,null,null,null,null,null,null,null,null,null);
update pophelp set sql_str='SELECT FLD_VALUE,DESCR FROM GENCODES  WHERE 
FLD_NAME=''GROUP_CODE'''
where trim(field_name)='GROUP_CODE' and mod_name='W_GROUP_PRICELIST'   ;
alter table pick_ord_det add lot_sl__new char(15);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 ('VMSTATENUL','State code Empty !!',' Please enter defined state code.','E','Y',null,null,null,to_timestamp('27-04-06','DD-MM-RR HH12:MI:SSXFF AM'),'BASE      ','BASE           ',null,null);
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 ('VMSTATENUL','State code Empty !!',' Please enter defined state code.','E','Y',null,null,null,to_timestamp('27-04-06','DD-MM-RR HH12:MI:SSXFF AM'),'BASE      ','BASE           ',null,null);
Insert into obj_actions (OBJ_NAME,LINE_NO,RIGHTS_CHAR,INTERACTIVE,SERVICE_CODE,DESCRIPTION,TITLE,IMAGE,ACTION_TYPE,FORM_NO,SERVICE_HANDLER,PLACEMENT,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('policy_mst',3,'X','1','audit_trail','View Audit Trail','View Audit','menu.bmp','U','1','1','1',null,null,null,null);

Insert into system_events (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) 
values ('policy_mst','audit_trail','1','project_audit_trail',null,sysdate,'BASE      ','BASE','2','0',null,null,null);

update obj_forms set disp_metadata = 'checkedImage@img<item_descr>(<item_code>), <lot_no>, <lot_sl>, <quantity> <unit> = <loc_code__to> <lot_sl__new>'
where win_name = 'w_repl_iss' and form_no = '2';
-- 11/06/12
update itm2menu set win_name = 'w_active_repl_iss',descr = 'Replenishment (Active Pick)', menu_path = 'WMS.1.13.0.0.0', obj_type = 'W'
where application = 'WMS' and level_1 = 1 and level_2 = 13;

delete from obj_forms where win_name in ( 'w_repl_iss','w_active_repl_iss');
INSERT INTO obj_forms (win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata)
VALUES (
	'w_active_repl_iss',
	'Replenishment Task',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Replenishment Task ID:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>repl_order</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL);
INSERT INTO obj_forms (win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata)
VALUES (
	'w_active_repl_iss',
	'Inventory',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location Code To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>New LPN:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl__new</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<item_descr>(<item_code>), <lot_no>, <lot_sl>, <quantity> <unit> = <loc_code__to> <lot_sl__new>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL);



INSERT INTO obj_forms (win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata)
VALUES (
	'w_repl_iss',
	'Replenishment Task',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Replenishment Task ID:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>repl_order</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL);
INSERT INTO obj_forms (win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata)
VALUES (
	'w_repl_iss',
	'Inventory',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location Code To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<item_descr>(<item_code>), <lot_no>, <lot_sl>, <quantity> <unit> = <loc_code__to>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL);
insert into transetup (TRAN_WINDOW,
SAVE_FLAG,
VAL_FLAG,
KEY_FLAG,
KEY_STRING,
REPEATE_ADD,
CHG_DATE,
CHG_USER,
CHG_TERM,
EDI_OPTION,
SITE_ACC_COL,
CONFIRM_COL,
CONFIRM_VAL,
REPEAT_ADD_DET,
REPEATADDDET,
LEDG_POST_CONF,
TRAN_ID_COL,
WORKFLOW_OPT,
TABLE_NAME,
REF_SER,
AUDIT_TRAIL_OPT,
EDIT_OPT
)
select 'w_active_repl_iss',
SAVE_FLAG,
VAL_FLAG,
KEY_FLAG,
KEY_STRING,
REPEATE_ADD,
CHG_DATE,
CHG_USER,
CHG_TERM,
EDI_OPTION,
SITE_ACC_COL,
CONFIRM_COL,
CONFIRM_VAL,
REPEAT_ADD_DET,
REPEATADDDET,
LEDG_POST_CONF,
TRAN_ID_COL,
WORKFLOW_OPT,
TABLE_NAME,
REF_SER,
AUDIT_TRAIL_OPT,
EDIT_OPT
 from transetup where tran_window = 'w_repl_iss';

insert into obj_actions (
OBJ_NAME,
LINE_NO,
IMAGE,
DESCRIPTION,
SERVICE_CODE,
INTERACTIVE,
RIGHTS_CHAR,
TITLE,
FORM_NO,
SERVICE_HANDLER,
PLACEMENT,
ACTION_TYPE,
TRAN_TYPE,
CHG_DATE,
CHG_TERM,
CHG_USER 
)
select 'active_repl_iss',
LINE_NO,
IMAGE,
DESCRIPTION,
SERVICE_CODE,
INTERACTIVE,
RIGHTS_CHAR,
TITLE,
FORM_NO,
SERVICE_HANDLER,
PLACEMENT,
ACTION_TYPE,
TRAN_TYPE,
CHG_DATE,
CHG_TERM,
CHG_USER 
from obj_actions where obj_name = 'repl_iss';
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
)
select 'active_repl_iss',
EVENT_CODE,
EVENT_CONTEXT,
SERVICE_CODE,
METHOD_RULE,
OVERWRITE_CORE,
CHG_DATE,
CHG_USER,
CHG_TERM,
RESULT_HANDLE,
COMP_TYPE,
COMP_NAME,
COMM_FORMAT
from system_events where obj_name = 'repl_iss';
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 ('INVPLTNOM','INVALID PALLET NO','pallet no not exist in master, please enter valid pallet no','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);
alter table carton_master add ptcn char(10);
alter table carton_master add sscc_18 varchar2(35);
alter table carton_master add scan_flag char(1);
insert into messages(
MSG_NO,
MSG_STR ,
MSG_DESCR,
MSG_TYPE,
MSG_OPT,
chg_date,
chg_user,
chg_term
)
values(
'VMCUSTBRGP',
'Invalid Customer Code',
'Dublicate Customer Code for Bracket Group Code',
'E',
'Y',
sysdate,
'base',
'base'
);
update system_events set service_code = 'post_gen_val'
where obj_name = 'group_price_list' and event_code = 'post_validate';
-- end merged in 6-3-0-1
alter table transporter add suffix varchar2(15);
alter table transporter add prefix varchar2(15);

insert into messages(
MSG_NO,         
MSG_STR ,       
MSG_DESCR,      
MSG_TYPE,
MSG_OPT,
chg_date,
chg_user,
chg_term
)
values(
'VTSTATEFR',
'Invalid Station',
'Station Code From  not define in State Code From',
'E',
'Y',
sysdate,
'base',
'base'
);

insert into messages(
MSG_NO,         
MSG_STR ,       
MSG_DESCR,      
MSG_TYPE,
MSG_OPT,
chg_date,
chg_user,
chg_term
)
values(
'VTSTATETO',
'Invalid Station',
'Station Code To not define in State Code To',
'E',
'Y',
sysdate,
'base',
'base'
);

-- 13/06/12
update itm2menu set descr = 'Replenishment', comments = 'Replenishment'
where application = 'WMS' and level_1 = 1 and level_2 = 9;
update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location From:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location Code To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_repl_iss' and form_no = '2';
update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location From:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location Code To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>New LPN:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl__new</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_active_repl_iss' and form_no = '2';
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)
select 
'active_repl_iss',
EVENT_CODE,
EVENT_CONTEXT,
SERVICE_CODE,
METHOD_RULE,
OVERWRITE_CORE,
CHG_DATE,
CHG_USER,
CHG_TERM,
RESULT_HANDLE,
COMP_TYPE,
COMP_NAME,
COMM_FORMAT from system_events where obj_name = 'repl_iss';

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 ('VQUANTI','quantity not same ','quantity not same ,please enter valid quantity','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);
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 ('VQUANTI2','quantity not same ','quantity not same ,please enter valid quantity','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);
-- 14/06/12


/*INSERT INTO itm2menu (
	application ,
	level_1 ,
	level_2 ,
	level_3 ,
	level_4 ,
	level_5 ,
	win_name ,
	descr ,
	comments ,
	menu_path ,
	icon_path ,
	close_icon ,
	open_icon ,
	obj_type ,
	chg_date ,
	chg_term ,
	chg_user )
VALUES (
	'SFA',
	16,
	3,
	0,
	0,
	0,
	'w_checksheet',
	'Check Sheet Verification',
	'Check Sheet Verification',
	'SFA.15.3.0.0.0',
	'e12_logo.gif',
	NULL,
	NULL,
	'W',
	sysdate,
	'BASE141',
	'Kunal');
*/

INSERT INTO transetup (
	tran_window ,
	save_flag ,
	val_flag ,
	key_flag ,
	key_string,
	repeate_add ,
	chg_date ,
	chg_user ,
	chg_term ,
	edi_option ,
	confirm_mode ,
	mail_option ,
	garbage_opt ,
	table_name,
	application,
	ref_ser,
	tran_id_col,
	confirm_col,
	confirm_val)
VALUES (
	'w_checksheet',
	'2',
	'2',
	'A',
	'MP,seq08',
	'N',
  sysdate,
	'Kunal',
	'BASE ',
	'0',
	'0',
	'0',
	'N',
	null,
	'WMS',
	null,
	null,
	'',
	'');

INSERT INTO obj_actions (
	obj_name ,
	line_no ,
	rights_char ,
	interactive ,
	service_code ,
	description ,
	title ,
	image ,
	action_type ,
	form_no ,
	chg_date ,
	chg_term ,
	chg_user)
VALUES (
	'checksheet',
	 1,
	'S',
	'',
	'',
	'Saving',
	'Finish',
	'',
	'U',
	'3',
	sysdate,
	'BASE ',
	'Kunal');

INSERT INTO obj_forms  (	win_name ,title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info,
	expr_comment ,
	form_no ,
	scr_flag ,
	scan_flag ,
	scan_metadata ,
	auto_accept_scan ,
	property_info ,
	ext_com ,
	ext_metadata ,
	ext_setup ,
	after_save ,
	column_on_save ,
	scan_delimiter ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col,
	assisted_mode)
VALUES (
	'w_checksheet',
	'Check Sheet',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E');

INSERT INTO obj_forms (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info,
	expr_comment ,
	form_no ,
	scr_flag ,
	scan_flag ,
	scan_metadata ,
	auto_accept_scan ,
	property_info ,
	ext_com ,
	ext_metadata ,
	ext_setup ,
	after_save ,
	column_on_save ,
	scan_delimiter ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col,
	assisted_mode)
VALUES (
	'w_checksheet',
	'Detail',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'T',
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>SSCC 18</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>sscc_18</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'<carton_no>(<carton_no>), <pick_order>, <line_no__pick>, <ptcn>',
	NULL,
	'E');


INSERT INTO system_events (	obj_name ,	event_code ,	event_context,	service_code ,	chg_date ,	chg_user ,	chg_term ,	result_handle ,	overwrite_core ,	comp_type ,	comp_name)
VALUES (	'checksheet',	'pre_validate',	'1',	'prv_pick_iss',	sysdate,	'Kunal',	'BASE',	'2',	'0',	'EJB',	'CheckSheetIC');

INSERT INTO system_events (	obj_name ,	event_code ,	event_context,	service_code ,	chg_date ,	chg_user ,	chg_term ,	result_handle ,	overwrite_core ,	comp_type ,	comp_name)
VALUES (	'checksheet',	'pre_navigate',	'1',	'prv_pick_iss',	sysdate,	'Kunal',	'BASE',	'2',	'0',	'EJB',	'CheckSheetIC');

INSERT INTO system_events (	obj_name ,	event_code ,	event_context,	service_code ,	chg_date ,	chg_user ,	chg_term ,	result_handle ,	overwrite_core ,	comp_type ,	comp_name)
VALUES (	'checksheet',	'default_data_wiz',	'1',	'pick_iss_default_data',	sysdate,	'Kunal',	'BASE',	'2',	'0',	'EJB',	'CheckSheetIC');

INSERT INTO system_events (	obj_name ,	event_code ,	event_context ,	service_code ,	method_rule ,	chg_date ,	chg_user ,	chg_term ,	result_handle ,	overwrite_core ,	comp_type ,	comp_name ,	comm_format )
VALUES (	'checksheet',	'pre_save',	'1',	'prsr_pick_iss',	NULL,sysdate,	'Kunal',	'BASE',	'2',	'0',	'EJB',	'CheckSheetPrs',	NULL);
-- 15/06/12

Insert into obj_itemchange (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('repl_order','2','item_code',null);
Insert into obj_itemchange (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('repl_order','2','itm_default',null);


Insert into system_events (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('repl_order','post_item_change','1','poic_default_ejb',null,to_timestamp('08-JUN-12','DD-MON-RR HH.MI.SSXFF AM'),'Mahesh    ','BASE','2','0','EJB','ReplOrderIC',null);
Insert into system_events (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('repl_order','pre_validate','1','prv_default_ejb',null,to_timestamp('08-JUN-12','DD-MON-RR HH.MI.SSXFF AM'),'akhilesh  ','BASE','2','0','EJB','ReplOrderIC',null);



Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,AUTO_ACCEPT_SCAN,SCAN_METADATA,SCAN_FLAG,SCR_FLAG,PROPERTY_INFO,EXT_COM,EXT_METADATA,EXT_SETUP,AFTER_SAVE,COLUMN_ON_SAVE,SCAN_DELIMITER,AUTO_ACCEPT_WEIGHDATA,RATE_COL,QTY_COL,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,ASSISTED_MODE,STORAGE_KEY_METADATA) values ('w_repl_order','Header',null,null,null,null,null,null,'1',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);
Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,AUTO_ACCEPT_SCAN,SCAN_METADATA,SCAN_FLAG,SCR_FLAG,PROPERTY_INFO,EXT_COM,EXT_METADATA,EXT_SETUP,AFTER_SAVE,COLUMN_ON_SAVE,SCAN_DELIMITER,AUTO_ACCEPT_WEIGHDATA,RATE_COL,QTY_COL,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,ASSISTED_MODE,STORAGE_KEY_METADATA) values ('w_repl_order','Detail',null,null,null,null,null,null,'2',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);


Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,RIGHTS_CHAR,INTERACTIVE,SERVICE_CODE,DESCRIPTION,TITLE,IMAGE,ACTION_TYPE,FORM_NO,SERVICE_HANDLER,PLACEMENT,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('repl_order',2,'E','a','a','Editing Existing Record','Edit','edit.gif','S','1',null,null,null,null,null,null);
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,RIGHTS_CHAR,INTERACTIVE,SERVICE_CODE,DESCRIPTION,TITLE,IMAGE,ACTION_TYPE,FORM_NO,SERVICE_HANDLER,PLACEMENT,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('repl_order',4,'S','a','a','Saving','Save','save.gif','S','1',null,null,null,null,null,null);

--Insert into itm2menu (APPLICATION,LEVEL_1,LEVEL_2,LEVEL_3,LEVEL_4,LEVEL_5,WIN_NAME,DESCR,COMMENTS,MENU_PATH,ICON_PATH,CLOSE_ICON,OPEN_ICON,OBJ_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('SFA',1,50,0,0,0,'w_repl_order','Replenishment Order','Replenishment Order','SFA.1.50.0.0.0','e12_logo.gif',null,null,null,to_timestamp('08-JUN-12','DD-MON-RR HH.MI.SSXFF AM'),'akhilesh',null);


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 ('VMADDNAL  ','Cannot Add new Record','Add New Record not valid','E','Y',null,null,null,null,null,null,null,null);

INSERT INTO obj_links (obj_name,
	form_no,
	field_name,
	target_obj_name,
	link_form_name,
	link_title,
	link_uri,
	link_type,
	link_arg,
	update_flag,
	link_name,
	rights_char,
	image)
VALUES (
	'wave_task',
	'2',
	'ref_ser',
	'despatch',
	'desparch21',
	'View Shipment',
	NULL,
	'2',
	'ref_id.String',
	'0',
	NULL,
	'*',
	NULL);
update obj_links set update_flag = '0' where obj_name = 'wave_task';
	
INSERT INTO obj_forms (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	form_no)
VALUES (
	'w_item_process',
	'Item process Map',
	'',
	'',
	'1');

INSERT INTO obj_actions (
	obj_name ,
	line_no ,
	rights_char ,
	interactive ,
	service_code ,
	description ,
	title ,
	image ,
	action_type ,
	form_no ,
	chg_date ,
	chg_term ,
	chg_user)
VALUES (
	'item_process',
	1,
	'E',
	'a',
	'a',
	'Editing Existing Record',
	'Edit',
	'edit~normal.gif',
	'S',
	'1',
	fn_sysdate(),
	'BASE ',
	'Sankar');

	INSERT INTO system_event_services  (
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,
	return_descr ,
	return_xfrm ,
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'poic_default_man',
	'itemchanged',
	'http://localhost:9090/axis/services/ValidatorService',
	NULL,
	'itemChanged',
	'String',
	'S',
	NULL,
	NULL,
	sysdate ,
	'base      ',
	'1');


INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'poic_default_man',
	1,
	'COMPONENT_TYPE ',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Dpk       ',
	'1',
	'EJB');
	
	
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'poic_default_man',
	2,
	'COMPONENT_NAME ',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Dpk       ',
	'Dpk',
	'StockAllocIc');

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'poic_default_man',
	3,
	'XML_DATA       ',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Dpk       ',
	'Dpk',
	NULL);

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'poic_default_man',
	4,
	'XML_DATA_1',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Dpk       ',
	'Dpk',
	NULL);

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'poic_default_man',
	5,
	'XML_DATA_2',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Dpk       ',
	'Dpk',
	NULL);

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'poic_default_man',
	6,
	'OBJ_CONTEXT ',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Dpk       ',
	'Dpk',
	NULL);

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'poic_default_man',
	7,
	'FOCUSED_COLUMN ',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Dpk       ',
	'Dpk',
	NULL);

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'poic_default_man',
	8,
	'EDIT_FLAG ',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Dpk       ',
	'Dpk',
	NULL);

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'poic_default_man',
	9,
	'XTRA_PARAMS ',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Dpk       ',
	'Dpk',
	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 (
	'sord_alloc',
	'post_item_change',
	'1',
	'poic_default_man',
	NULL,
	'0',
	sysdate,
	'BASE      ',
	'BASE',
	'2',
	'EJB',
	'StockAllocIc',
	NULL);
INSERT INTO SYSTEM_EVENTS (
	obj_name,
	event_code,
	event_context,
	service_code,
	method_rule,
	chg_date,
	chg_user,
	chg_term,
	result_handle,
	overwrite_core,
	comp_type,
	comp_name,
	comm_format)
VALUES (
	'phy_item_scan',
	'pre_save',
	'1',
	'prsr_phy_item_scan',
	NULL,
	sysdate ,
	'base  ',
	'BASE',
	'2',
	'0',
	'EJB',
	'PhyScanPreSave',
	NULL);


INSERT INTO SYSTEM_EVENT_SERVICES (
	service_code,
	service_descr,
	service_uri,
	service_provider,
	method_name,
	return_value,
	return_type,
	return_descr,
	return_xfrm,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'prsr_phy_item_scan',
	'preSave',
	'http://192.168.0.124/BaseE12DotNetService5-18-001/E12BusinessLogic5-18-001.asmx',
	'BASE',
	'preSave',
	'String',
	'S',
	NULL,
	NULL,
	sysdate,
	'base',
	'BASE');



INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prsr_phy_item_scan',
	1,
	'COMPONENT_TYPE',
	'l',
	NULL,
	'C.String',
	NULL,
	sysdate,
	'base',
	'base',
	'EJB');

INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prsr_phy_item_scan',
	2,
	'COMPONENT_NAME',
	'l',
	NULL,
	'C.String',
	NULL,
	sysdate,
	'base',
	'base',
	'PhyScanPreSave');

INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prsr_phy_item_scan',
	3,
	'XML_DATA_ALL',
	'l',
	NULL,
	'S',
	NULL,
	sysdate,
	'base',
	'base',
	NULL);
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prsr_phy_item_scan',
	4,
	'EDIT_FLAG',
	'l',
	NULL,
	'S',
	NULL,
	sysdate,
	'base',
	'base',
	NULL);

INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prsr_phy_item_scan',
	5,
	'XTRA_PARAMS',
	'l',
	NULL,
	'S',
	NULL,
	sysdate,
	'base',
	'base',
	NULL);

INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prsr_phy_item_scan',
	6,
	'DB_CONN',
	'l',
	NULL,
	'S.Connection',
	NULL,
	sysdate,
	'base',
	'base',
	NULL);
alter table pack_hdr add sscc_18 varchar2(35);

--Obj_links
Insert into obj_links (OBJ_NAME,FORM_NO,FIELD_NAME,TARGET_OBJ_NAME,LINK_FORM_NAME,LINK_TITLE,LINK_URI,LINK_TYPE,LINK_ARG,UPDATE_FLAG,LINK_NAME,RIGHTS_CHAR,IMAGE) values ('rcp_tr','1','cust_code','receivables_tr','receivables_tr11','Receivables Details',null,'1','cust_code.String','0',null,'S',null);

--Post save
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('rcp_tr','post_save','1','post_save_crcp',null,fn_sysdate(),'base','base','2','0','EJB','CremittanceTrPostSave',null);
Insert into SYSTEM_EVENT_SERVICES(SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM) 
values ('post_save_crcp',null,'http://localhost/BaseE12DotNetService6-3-0-003/E12BusinessLogic6-3-0-003.asmx',null,'postSave','String','S',null,null,fn_sysdate(),'base','base');

Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_save_crcp',1,'COMPONENT_TYPE','I',null,'S',null,fn_sysdate(),'base      ','base','EJB');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_save_crcp',2,'COMPONENT_NAME','I',null,'S',null,fn_sysdate(),'base      ','base','CremittanceTrPostSave');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_save_crcp',3,'XML_DATA_ALL','I',null,'S',null,fn_sysdate(),'base      ','base',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_save_crcp',4,'EDIT_FLAG','I',null,'S',null,fn_sysdate(),'base      ','base',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_save_crcp',5,'XTRA_PARAMS','I',null,'S',null,fn_sysdate(),'base      ','base',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_save_crcp',6,'DB_CONN','I',null,'S.Connection',null,fn_sysdate(),'base      ','base',null);
update obj_forms  set scan_metadata = '<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Packing Task ID:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>tran_id</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Master Pack Carton No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>outer_carton_no</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="3"><SCAN_LABEL>Tracking No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>sscc_18</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_master_pack' and form_no = '1';

Insert into disparm
(PRD_CODE,VAR_NAME,VAR_TYPE,VAR_VALUE,DESCR,VAR_SUBS,CHG_DATE,CHG_USER,CHG_TERM)
values ('999999','CASE_PICK_OPTION','S','S','S - Single Case Scanning, M - Individual Cas Scanning',0,sysdate,'BASE','BASE');
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('rcp_tr','pre_validate','1','prv_default_ejb',null,to_timestamp('28-AUG-11','DD-MON-RR HH.MI.SSXFF AM'),'akhilesh  ','BASE','2','0','EJB','CRemittanceTr',null);
-- 16/06/12
ALTER TABLE CARTON_MASTER ADD carton_type CHAR(1); 


alter table repl_iss_hdr add carton_no varchar2(15);
update messages set msg_str = 'Invalid Pallet/Carton number', msg_descr = 'The Pallet/Carton is not existing in the master'
where msg_no = 'INVPLTNOM';
update obj_forms set scan_metadata = '<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Pallet/Carton Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Pick Task ID:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pick_order</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_case_pick' and form_no = '1';

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 (
	'VTINVCTND',
	'Invalid Carton Number',
	'Carton number cannot be blank should exists in master',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Gulzar',
	'BASE141',
	NULL,
	NULL);
INSERT INTO obj_forms (win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata)
VALUES (
	'w_repl_iss_dock',
	'Replenishment Task',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Replenishment Task ID:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>repl_order</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL);
INSERT INTO obj_forms (win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata)
VALUES (
	'w_repl_iss_dock',
	'Inventory',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location Code To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>New LPN:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl__new</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<item_descr>(<item_code>), <lot_no>, <lot_sl>, <quantity> <unit> = <loc_code__to> <lot_sl__new>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL);
insert into transetup (TRAN_WINDOW,
SAVE_FLAG,
VAL_FLAG,
KEY_FLAG,
KEY_STRING,
REPEATE_ADD,
CHG_DATE,
CHG_USER,
CHG_TERM,
EDI_OPTION,
SITE_ACC_COL,
CONFIRM_COL,
CONFIRM_VAL,
REPEAT_ADD_DET,
REPEATADDDET,
LEDG_POST_CONF,
TRAN_ID_COL,
WORKFLOW_OPT,
TABLE_NAME,
REF_SER,
AUDIT_TRAIL_OPT,
EDIT_OPT
)
select 'w_repl_iss_dock',
SAVE_FLAG,
VAL_FLAG,
KEY_FLAG,
KEY_STRING,
REPEATE_ADD,
CHG_DATE,
CHG_USER,
CHG_TERM,
EDI_OPTION,
SITE_ACC_COL,
CONFIRM_COL,
CONFIRM_VAL,
REPEAT_ADD_DET,
REPEATADDDET,
LEDG_POST_CONF,
TRAN_ID_COL,
WORKFLOW_OPT,
TABLE_NAME,
REF_SER,
AUDIT_TRAIL_OPT,
EDIT_OPT
 from transetup where tran_window = 'w_repl_iss';

insert into obj_actions (
OBJ_NAME,
LINE_NO,
IMAGE,
DESCRIPTION,
SERVICE_CODE,
INTERACTIVE,
RIGHTS_CHAR,
TITLE,
FORM_NO,
SERVICE_HANDLER,
PLACEMENT,
ACTION_TYPE,
TRAN_TYPE,
CHG_DATE,
CHG_TERM,
CHG_USER 
)
select 'repl_iss_dock',
LINE_NO,
IMAGE,
DESCRIPTION,
SERVICE_CODE,
INTERACTIVE,
RIGHTS_CHAR,
TITLE,
FORM_NO,
SERVICE_HANDLER,
PLACEMENT,
ACTION_TYPE,
TRAN_TYPE,
CHG_DATE,
CHG_TERM,
CHG_USER 
from obj_actions where obj_name = 'repl_iss';
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
)
select 'repl_iss_dock',
EVENT_CODE,
EVENT_CONTEXT,
SERVICE_CODE,
METHOD_RULE,
OVERWRITE_CORE,
CHG_DATE,
CHG_USER,
CHG_TERM,
RESULT_HANDLE,
COMP_TYPE,
COMP_NAME,
COMM_FORMAT
from system_events where obj_name = 'repl_iss';
update itm2menu set win_name = 'w_repl_iss_dock', descr = 'Stock to Dock', comments = 'Stock to Dock', obj_type = 'W'
where application = 'WMS' and level_1 = 1 and level_2 = 12;
update obj_forms set scan_metadata = '<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Replenishment Task ID:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>repl_order</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Carton Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>carton_no</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name in  ('w_repl_iss_dock') and form_no = '1';
ALTER TABLE CARTON_MASTER ADD REF_SER CHAR(6); 

insert into refser ( 	ref_ser , 	descr , 	type , 	sys_ser , 	prefix , 	chg_date , 	chg_user , 	chg_term , 	seq_name , 	tax_form_reqd , 	trans_type )
values ( 	'M-PICK', 	'Case Pick (Master pack)', 	'M', 	'M-PICK', 	NULL, 	sysdate, 	'CNF  ', 	'99TARUN ', 	NULL, 	NULL, 	NULL);
-- 18/06/12
update obj_forms set scan_metadata = '<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Packing Task ID:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>tran_id</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Master Pack Carton No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>outer_carton_no</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_master_pack' and form_no = '1';

INSERT INTO obj_links (obj_name,
	form_no,
	field_name,
	target_obj_name,
	link_form_name,
	link_title,
	link_uri,
	link_type,
	link_arg,
	update_flag,
	link_name,
	rights_char,
	image)
VALUES (
	'wavegen',
	'5',
	'item_code',
	'sorder',
	'sorder21',
	'View Order',
	NULL,
	'2',
	'sale_order.String',
	'0',
	NULL,
	'V',
	NULL);
update obj_links set link_title = 'Pick Order'
where obj_name = 'wave_task'
and form_no = '2' and field_name = 'ref_id';
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 (
	'FRT_TERM',
	'X',
	'Invalid Feight Term',
	'UV_FRTERM ',
	'Y',
	'C',
	'select count(1) from gencodes where FLD_NAME=''''FR_TERM'''' AND
MOD_NAME=''''X'''' and fld_value = ?',
	NULL,
	'M',
	TO_TIMESTAMP('18-06-2012 15:21:11','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'localhost.local',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
iNSERT INTO gencodes
(
	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3
)
 VALUES (
	'FRT_TERM',
	'X',
	'P',
	'Paid',
	'Paid',
	TO_TIMESTAMP('28-06-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	'Y',
	NULL,
	NULL,
	NULL);

INSERT INTO gencodes
(
	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3
)
VALUES (
	'FRT_TERM',
	'X',
	'T',
	'To Pay',
	'To Pay',
	TO_TIMESTAMP('28-06-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	'Y',
	NULL,
	NULL,
	NULL);
INSERT INTO gencodes
(
	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3
)
VALUES (
	'FRT_TERM',
	'X',
	'O',
	'On Bill',
	'On Bill',
	TO_TIMESTAMP('28-06-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	'Y',
	NULL,
	NULL,
	NULL);
INSERT INTO gencodes
(
	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3
)
VALUES (
	'FRT_TERM',
	'X',
	'F',
	'FOR',
	'FOR',
	TO_TIMESTAMP('28-06-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	'Y',
	NULL,
	NULL,
	NULL);
Insert into OBJ_LINKS (OBJ_NAME,FORM_NO,FIELD_NAME,TARGET_OBJ_NAME,LINK_FORM_NAME,LINK_TITLE,LINK_URI,LINK_TYPE,LINK_ARG,UPDATE_FLAG,LINK_NAME,RIGHTS_CHAR,IMAGE) values ('sorder','1','item_ser','sorderscheme','sorderscheme11','Sales Order Scheme',null,'1','sale_order.String','0',null,'S',null);

INSERT INTO OBJ_LINKS(obj_name,form_no,field_name,target_obj_name,LINK_FORM_NAME,LINK_TITLE,LINK_URI,LINK_TYPE,LINK_ARG,UPDATE_FLAG,RIGHTS_CHAR,IMAGE,LINK_NAME) 
values ('inv_hold_rel','1','tran_id','inventorydet','inventorydet11','Inventory Detail',null,'1','tran_id.String','1','*',null,null) ;

create or replace function fn_lock_exists (as_lotno in char)
return number is  ll_flag number(2);
begin
ll_flag:=0;
         select count(1) into ll_flag from inv_hold_rel_trace
         where lot_no = as_lotno
          having (sum(case when hold_qty is null then 0 else hold_qty
end)+sum(case when rel_qty is null then 0 else rel_qty end )) >0  ;
     return ll_flag;
end;
/
INSERT INTO MESSAGES ( 	msg_no , 	msg_str , 	msg_descr , 	msg_type , 	msg_opt ,  	chg_date , 	chg_user , 	chg_term )
VALUES ( 	'VTSHPID', 	'Invalid Confirmed', 	'Specified Shipment is already confirmed', 	'W', 	'Y', 	fn_sysdate(), 	'ROHAN'  , 	'BASE ' 	);

update obj_forms set scan_metadata = '<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Shipment ID:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>shipment_id</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_checksheet' and form_no = '1';
update obj_forms set scan_metadata = '<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Pallet / Carton Number :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_checksheet' and form_no = '2';
delete from system_events where obj_name = 'checksheet';
INSERT INTO system_events (	obj_name ,	event_code ,	event_context,	service_code ,	chg_date ,	chg_user ,	chg_term ,	result_handle ,	overwrite_core ,	comp_type ,	comp_name)
VALUES (	'checksheet',	'pre_validate',	'1',	'prv_load',	sysdate,	'Kunal',	'BASE',	'2',	'0',	'EJB',	'CheckSheetIC');

INSERT INTO system_events (	obj_name ,	event_code ,	event_context,	service_code ,	chg_date ,	chg_user ,	chg_term ,	result_handle ,	overwrite_core ,	comp_type ,	comp_name)
VALUES (	'checksheet',	'pre_navigate',	'1',	'prv_load',	sysdate,	'Kunal',	'BASE',	'2',	'0',	'EJB',	'CheckSheetIC');

INSERT INTO system_events (	obj_name ,	event_code ,	event_context,	service_code ,	chg_date ,	chg_user ,	chg_term ,	result_handle ,	overwrite_core ,	comp_type ,	comp_name)
VALUES (	'checksheet',	'default_data_wiz',	'1',	'load_default_data',	sysdate,	'Kunal',	'BASE',	'2',	'0',	'EJB',	'CheckSheetIC');

INSERT INTO system_events (	obj_name ,	event_code ,	event_context ,	service_code ,	method_rule ,	chg_date ,	chg_user ,	chg_term ,	result_handle ,	overwrite_core ,	comp_type ,	comp_name ,	comm_format )
VALUES (	'checksheet',	'pre_save',	'1',	'prsr_load',	NULL,sysdate,	'Kunal',	'BASE',	'2',	'0',	'EJB',	'CheckSheetPrs',	NULL);
INSERT INTO system_event_services (	service_code,
	service_uri,
	method_name,
	return_value,
	return_type,
	return_xfrm,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'load_default_data',
	'http://192.168.0.124/BaseE12DotNetService6-3-0-003/E12BusinessLogic6-3-0-003.asmx',
	'itemChanged',
	'String',
	'S',
	NULL,
	TO_TIMESTAMP('22-09-2011 12:23:32','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE');
INSERT INTO system_event_services (	service_code,
	service_uri,
	method_name,
	return_value,
	return_type,
	return_xfrm,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'prcm_load',
	'http://192.168.0.124/BaseE12DotNetService6-3-0-003/E12BusinessLogic6-3-0-003.asmx',
	'confirm',
	'String',
	'S',
	NULL,
	TO_TIMESTAMP('22-09-2011 12:23:32','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'Gulzar');
INSERT INTO system_event_services (	service_code,
	service_uri,
	method_name,
	return_value,
	return_type,
	return_xfrm,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'prsr_load',
	'http://192.168.0.124/BaseE12DotNetService6-3-0-003/E12BusinessLogic6-3-0-003.asmx',
	'preSave',
	NULL,
	NULL,
	NULL,
	TO_TIMESTAMP('22-09-2011 12:23:32','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE');
INSERT INTO system_event_services (	service_code,
	service_uri,
	method_name,
	return_value,
	return_type,
	return_xfrm,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'prv_load',
	'http://192.168.0.124/BaseE12DotNetService6-3-0-003/E12BusinessLogic6-3-0-003.asmx',
	'wfValData',
	'String',
	'S',
	NULL,
	TO_TIMESTAMP('22-09-2011 12:23:32','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE');
Insert into system_events (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('rcp_tr','verify','1','act_verify',null,SYSDATE,'akhilesh','akhilesh','2','0','EJB','CRemittanceTrVerify',null);

Insert into system_event_services (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM) values ('act_verify','Verify for Cust Remittance ','http://192.168.0.124/BaseE12DotNetService5-18-001/E12BusinessLogic5-18-001.asmx','Base Information','confirm','String','S',null,null,SYSDATE,'akhilesh','BASE31');

Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('act_verify',1,'COMPONENT_TYPE','I',null,'S',null,SYSDATE,'BASE      ','BASE107','EJB');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('act_verify',2,'COMPONENT_NAME',null,null,'S',null,SYSDATE,'BASE      ','BASE107','CRemittanceTrVerify');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('act_verify',3,'<tran_id>',null,null,'B.String',null,SYSDATE,'BASE      ','BASE107',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('act_verify',4,'XTRA_PARAMS',null,null,'S',null,SYSDATE,'BASE      ','BASE107',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('act_verify',5,'FORCED_FLAG',null,null,'S',null,SYSDATE,'BASE      ','BASE107',null);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (

	'load_default_data',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	null);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (

	'load_default_data',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	null);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (

	'load_default_data',
	3,
	'XML_DATA',
	'I',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (

	'load_default_data',
	4,
	'XML_DATA_1',
	'I',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (

	'load_default_data',
	5,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (

	'load_default_data',
	6,
	'OBJ_CONTEXT',
	'I',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (
	'load_default_data',
	7,
	'FOCUSED_COLUMN',
	'I',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (
	'load_default_data',
	8,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (
	'load_default_data',
	9,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (
	'prcm_load',
	1,
	'COMPONENT_TYPE',
	'I',
	'COMPONENT_TYPE',
	'C.String',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	null);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (
	'prcm_load',
	2,
	'COMPONENT_NAME',
	'I',
	'COMPONENT_NAME',
	'C.String',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	null);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (
	'prcm_load',
	3,
	'<tran_id>',
	'I',
	'Transaction id',
	'C.String',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (
	'prcm_load',
	4,
	'XTRA_PARAMS',
	'I',
	'XTRA_PARAMS',
	'S',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (
	'prcm_load',
	5,
	'FORCED_FLAG',
	'I',
	'FORCED_FLAG',
	'S',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (
	'prsr_load',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'C.String',
	NULL,
	TO_TIMESTAMP('15-09-2011 13:52:05','DD-MM-YYYY HH24:MI:SS'),
	'GULZAR    ',
	'GULZAR',
	null);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (

	'prsr_load',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'C.String',
	NULL,
	TO_TIMESTAMP('15-09-2011 13:52:05','DD-MM-YYYY HH24:MI:SS'),
	'GULZAR    ',
	'GULZAR',
	null);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (
	'prsr_load',
	3,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('15-09-2011 13:52:05','DD-MM-YYYY HH24:MI:SS'),
	'GULZAR    ',
	'GULZAR',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (
	'prsr_load',
	4,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('15-09-2011 13:52:06','DD-MM-YYYY HH24:MI:SS'),
	'GULZAR    ',
	'GULZAR',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (
	'prsr_load',
	5,
	'XTRA_PARAMS',
	NULL,
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('15-09-2011 13:52:06','DD-MM-YYYY HH24:MI:SS'),
	'GULZAR    ',
	'GULZAR',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (
	'prsr_load',
	6,
	'DB_CONN',
	NULL,
	NULL,
	'S.Connection',
	NULL,
	TO_TIMESTAMP('15-09-2011 13:52:06','DD-MM-YYYY HH24:MI:SS'),
	'GULZAR    ',
	'GULZAR',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (
	'prv_load',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	null);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (
	'prv_load',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	null);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (
	'prv_load',
	3,
	'XML_DATA',
	'l',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (
	'prv_load',
	4,
	'XML_DATA_1',
	'l',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (
	'prv_load',
	5,
	'XML_DATA_ALL',
	'l',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (
	'prv_load',
	6,
	'OBJ_CONTEXT',
	'l',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (
	'prv_load',
	7,
	'EDIT_FLAG',
	'l',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
 VALUES (
	'prv_load',
	8,
	'XTRA_PARAMS',
	'l',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('14-09-2011 10:14:19','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
delete from obj_actions where obj_name = 'checksheet';	
insert into obj_actions (
OBJ_NAME,
LINE_NO,
IMAGE,
DESCRIPTION,
SERVICE_CODE,
INTERACTIVE,
RIGHTS_CHAR,
TITLE,
FORM_NO,
SERVICE_HANDLER,
PLACEMENT,
ACTION_TYPE,
TRAN_TYPE,
CHG_DATE,
CHG_TERM,
CHG_USER 
)           
select 'checksheet',
LINE_NO,
IMAGE,
DESCRIPTION,
SERVICE_CODE,
INTERACTIVE,
RIGHTS_CHAR,
TITLE,
FORM_NO,
SERVICE_HANDLER,
PLACEMENT,
ACTION_TYPE,
TRAN_TYPE,
CHG_DATE,
CHG_TERM,
CHG_USER 
from obj_actions where obj_name = 'repl_iss';
-- 19/06/12
INSERT INTO obj_forms (win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata)
VALUES (
	'w_active_pick',
	'Dock Location',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'4',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Dock Location :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'<loc_code__to>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL);

INSERT INTO obj_forms (win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata)
VALUES (
	'w_case_pick',
	'Dock Location',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'4',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Dock Location :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'<loc_code__to>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL);


delete from obj_actions where obj_name in ('active_pick','case_pick');
INSERT INTO obj_actions(obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user) VALUES (
	'active_pick',
	1,
	NULL,
	'Navigate - Next',
	NULL,
	NULL,
	'N',
	'Next',
	'1',
	NULL,
	NULL,
	'U',
	NULL,
	TO_TIMESTAMP('8-05-2012 13:26:15','DD-MM-YYYY HH24:MI:SS'),
	'BASE           ',
	'Gulzar    ');
INSERT INTO obj_actions(obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user) VALUES (
	'active_pick',
	2,
	NULL,
	'Navigate - Next',
	'a',
	'a',
	'N',
	'Next',
	'2',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions(obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user) VALUES (
	'active_pick',
	3,
	NULL,
	'Navigate - Prev',
	'a',
	'a',
	'P',
	'Prev',
	'2',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions(obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user) VALUES (
	'active_pick',
	6,
	'confirm~normal.gif',
	'Confirming records',
	'pre_confirm',
	'a',
	'F',
	'Confirm',
	'4',
	'2',
	'1',
	'S',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions(obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user) VALUES (
	'active_pick',
	5,
	NULL,
	'Saving',
	NULL,
	NULL,
	'S',
	'Finish',
	'4',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions(obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user) VALUES (
	'active_pick',
	4,
	NULL,
	'Navigate - Prev',
	'a',
	'a',
	'P',
	'Prev',
	'3',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions(obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user) VALUES (
	'case_pick',
	7,
	NULL,
	'Next',
	NULL,
	NULL,
	'N',
	'Next',
	'1',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions(obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user) VALUES (
	'case_pick',
	3,
	NULL,
	'Prev',
	'a',
	'a',
	'P',
	'Prev',
	'2',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions(obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user) VALUES (
	'case_pick',
	2,
	NULL,
	'Next',
	'a',
	'a',
	'N',
	'Next',
	'2',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions(obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user) VALUES (
	'case_pick',
	1,
	NULL,
	'Saving',
	NULL,
	NULL,
	'S',
	'Finish',
	'4',
	NULL,
	NULL,
	'U',
	NULL,
	TO_TIMESTAMP('8-05-2012 13:26:08','DD-MM-YYYY HH24:MI:SS'),
	'BASE           ',
	'Gulzar    ');
INSERT INTO obj_actions(obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user) VALUES (
	'case_pick',
	6,
	'confirm~normal.gif',
	'Confirming records',
	'pre_confirm',
	'a',
	'F',
	'Confirm',
	'4',
	'2',
	'1',
	'S',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions(obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user) VALUES (
	'case_pick',
	5,
	NULL,
	'Saving',
	NULL,
	NULL,
	'S',
	'Finish',
	'4',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions(obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user) VALUES (
	'case_pick',
	4,
	NULL,
	'Prev',
	'a',
	'a',
	'P',
	'Prev',
	'3',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions(obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user) VALUES (
	'case_pick',
	8,
	NULL,
	'Next',
	'a',
	'a',
	'N',
	'Next',
	'3',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions(obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user) VALUES (
	'active_pick',
	8,
	NULL,
	'Next',
	'a',
	'a',
	'N',
	'Next',
	'3',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions(obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user) VALUES (
	'case_pick',
	9,
	NULL,
	'Prev',
	'a',
	'a',
	'P',
	'Prev',
	'4',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions(obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user) VALUES (
	'active_pick',
	9,
	NULL,
	'Prev',
	'a',
	'a',
	'P',
	'Prev',
	'4',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Pallet / Carton Number :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no</FIELD></FIELDS></MAPPING_SCAN></SCAN_INFO>'
where win_name = 'w_checksheet' and form_no = '2';

INSERT INTO system_events (	obj_name ,	event_code ,	event_context ,	service_code ,	method_rule ,	chg_date ,	chg_user ,	chg_term ,	result_handle ,	overwrite_core ,	comp_type ,	comp_name ,	comm_format )
VALUES (	'checksheet',	'post_save',	'1',	'prso_load',	NULL,sysdate,	'Kunal',	'BASE',	'2',	'0',	'EJB',	'CheckSheetPos',	NULL);

INSERT INTO system_event_services (
	service_code ,
	service_uri ,
	method_name ,
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'prso_load',
	'http://localhost:9090/axis/services/ValidatorService',
	'postSave',
	sysdate,
	'Kunal',
	'BASE');
  
    
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
values (
	'prso_load',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Kunal',
	'Kunal',
	'EJB');
  
  
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
values (
	'prso_load',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Kunal',
	'Kunal',
	'CheckSheetPos');
  
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
values (
	'prso_load',
	3,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Kunal',
	'Kunal',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
values (
	'prso_load',
	4,
	'<tran_id>',
	'I',
	NULL,
	'B.String',
	NULL,
	sysdate,
	'Kunal',
	'Kunal',
	NULL);
  
  
INSERT INTO system_service_args 
(	service_code ,	line_no ,	arg_name ,	arg_mode ,	descr ,	arg_type ,	arg_xfrm ,
	chg_date ,	chg_user ,	chg_term ,	arg_value )
values (	'prso_load',	5,	'EDIT_FLAG',	'I',	NULL,	'S',	NULL,
	sysdate,	'Kunal',	'Kunal',	NULL);
  
  
  
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
values (
	'prso_load',
	6,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Kunal',
	'Kunal',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
values (
	'prso_load',
	7,
	'DB_CONN',
	'I',
	NULL,
	'S.Connection',
	NULL,
 sysdate,
	'Kunal',
	'Kunal',
	NULL);
delete from system_events where obj_name = 'checksheet' and event_code = 'pre_save';

update obj_forms set disp_metadata = '<pallet_no>'
where win_name = 'w_checksheet' and form_no = '2';
update transetup set key_flag = 'M', AUDIT_TRAIL_OPT ='0'
where tran_window = 'w_checksheet';
update transetup set ref_ser = 'RCPJV'
where tran_window = 'w_receivables_jv';
-- 22/06/12
UPDATE obj_forms SET title='Nexp/Exp Process'
WHERE win_name='w_expired_stock_transfer' AND form_no='1';

UPDATE obj_forms SET scan_metadata='<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__fr</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl__fr</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
WHERE win_name='w_expired_stock_transfer' AND form_no='2';

INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'NULLLOCCD',
	'Null Location Code',
	'Please enter Location To Code.It can not null.',
	'E',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE '
	);
	
INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'LOCTONTVAL',
	'Location To Not Valid',
	'Please enter Valid Location Code To.',
	'E',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE '
	);

INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'NEXPNTVAL',
	'Location To Not Valid',
	'Not Valid Near-Expired Location.Please enter valid Location To',
	'E',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE '
	);	

INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'EXPNTVAL',
	'Location To Not Valid',
	'Not Valid Expired Location.Please enter Valid Location Code To.',
	'E',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE '
	);	
	
INSERT INTO disparm (
	prd_code ,
	var_name ,
	var_type ,
	var_value ,
	descr ,
	var_subs ,
	chg_date ,
	chg_user ,
	chg_term 
	 )
VALUES (
	'999999',
	'EXP_LOCK_RES',
	'S',
	'EXXFR',
	'Exp stock transfer',
	0,
	fn_sysdate(),
	'BASE',
	'Rohan'
	);
	
INSERT INTO disparm (
	prd_code ,
	var_name ,
	var_type ,
	var_value ,
	descr ,
	var_subs ,
	chg_date ,
	chg_user ,
	chg_term 
	 )
VALUES (
	'999999',
	'NEAR_LOCK_RES',
	'S',
	'NEXFR',
	'Near Exp stock transfer',
	0,
	fn_sysdate(),
	'BASE',
	'Rohan'
	);

INSERT INTO disparm (
	prd_code ,
	var_name ,
	var_type ,
	var_value ,
	descr ,
	var_subs ,
	chg_date ,
	chg_user ,
	chg_term 
	 )
VALUES (
	'999999',
	'NEAR_EXP_RES',
	'S',
	'ENEXR',
	'Near Exp and expire stock transfer',
	0,
	fn_sysdate(),
	'BASE',
	'Rohan'
	);

INSERT INTO invstat (
	inv_stat,
	descr,
	available,
	overiss,
	plan_prod,
	record,
	chg_date,
	chg_user,
	chg_term,
	usable,
	stat_type,
	report_type)
VALUES (
	'NEXP',
	'NEAR EXPIRY',
	'Y',
	'N',
	'N',
	'Y',
	fn_sysdate(),
	'Rohan',
	'BASE',
	'Y',
	'M',
	NULL);	

insert into obj_itemchange values('wavegen','1','sale_order__from','Y');
insert into obj_itemchange values('wavegen','1','sale_order__to','Y');



update transetup set KEY_STRING='seq10',TRAN_ID_COL='tran_id',REF_SER='I-PRC' where tran_window='w_item_process';

drop table ITEM_PROCESS;
create table ITEM_PROCESS
(
        TRAN_ID char(10),
	ITEM_CODE char(10),
	ANALYSIS_CLASS char(1),
	TRAN_DATE DATE,
	SITE_CODE char(10),
	LOC_CODE char(10),
	PRIORITY_SEQ NUMBER(3,0),
	CHG_USER char(10),
	CHG_TERM char(15),
	CHG_DATE DATE,
    CONSTRAINT pk_item_process PRIMARY KEY (ITEM_CODE,TRAN_DATE)
)





ALTER TABLE PHYSCAN
ADD EMP_CODE__USER CHAR(10);

ALTER TABLE PHYSCAN
ADD ref_id CHAR(10);

                                              
CREATE OR REPLACE FUNCTION CHECK_PHYSCAN_VALUE(LS_ITEM_CODE IN CHAR, LS_SITE_CODE IN CHAR, LS_LOC_CODE IN CHAR, LS_LOT_NO IN CHAR, LS_LOT_SL IN CHAR) 
RETURN NUMBER IS LS_NUM NUMBER ; 
   LS_CNT NUMBER; 
BEGIN 
 BEGIN 
   SELECT  COUNT(*) INTO LS_CNT FROM INV_HOLD_DET 
    WHERE TRIM(SITE_CODE) = TRIM(LS_SITE_CODE)
      AND TRIM(ITEM_CODE) = TRIM(LS_ITEM_CODE)
      AND TRIM(LOC_CODE) = TRIM(LS_LOC_CODE) 
      AND TRIM(LOT_NO) = TRIM(LS_LOT_NO)
      AND TRIM(LOT_SL) = TRIM(LS_LOT_SL); 
 IF (LS_CNT  = 0) THEN 
   LS_NUM := 0 ; 
 ELSE 
   LS_NUM := 1; 
END IF ; 
EXCEPTION 
WHEN NO_DATA_FOUND  THEN 
LS_NUM := 0 ; 
END; 
RETURN LS_NUM ; 
END ;
/


UPDATE SYSTEM_EVENTS SET OBJ_NAME = 'phy_item_scan1' WHERE SERVICE_CODE = 'prsr_phy_item_scan';


DELETE FROM OBJ_FORMS WHERE form_no = '2' AND win_name = 'w_phy_item_scan';
INSERT INTO OBJ_FORMS (
	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata)
VALUES (
	'w_phy_item_scan',
	'Detail',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN NO:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="4"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Physical Scan Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>qty_physical</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<descr>(<item_code>),<loc_code>,<lot_no>,<lot_sl>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL);
	INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'INVDOCLOC',
	'Invalid DOC Location',
	'Invalid DOC Location ,Please enter valid DOC Location.',
	'E',
	'Y',
	sysdate,
	'BASE'  ,
	'BASE');
INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'INVDSOLOC',
	'Invalid Deep Storage Location',
	'Invalid Deep Storage Location,Enter valid Deep Storage Location.',
	'E',
	'Y',
	sysdate,
	'BASE'  ,
	'BASE');
INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'INVPNDLOC',
	'Invalid Pick & Drop Location',
	'Invalid Pick & Drop Location ,Please enter valid Deep Pick & Drop Location.',
	'E',
	'Y',
	sysdate,
	'BASE'  ,
	'BASE');
INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term)
VALUES (
	'INVAPKLOC',
	'Invalid Active pick Location ',
	'Invalid Active pick Location ,Please enter valid Active pick Location.',
	'E',
	'Y',
	sysdate,
	'BASE'  ,
	'BASE');
INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'INVCPKLOC',
	'Invalid Case Pick Location',
	'Invalid Case Pick Location ,Please enter valid Case Pick Location.',
	'E',
	'Y',
	sysdate,
	'BASE'  ,
	'BASE');
--23-JUN-12
create table ITEM_PROCESS
(
        TRAN_ID char(10),
        ITEM_CODE char(10),
        ANALYSIS_CLASS char(1),
        TRAN_DATE DATE,
        SITE_CODE char(10),
        LOC_CODE char(10),
        PRIORITY_SEQ NUMBER(3,0),
        CHG_USER char(10),
        CHG_TERM char(15),
        CHG_DATE DATE);

ALTER TABLE ITEM_PROCESS ADD CONSTRAINT pk_item_process PRIMARY KEY
(ITEM_CODE,TRAN_DATE);
INSERT INTO obj_itemchange (
	obj_name,
	form_no,
	field_name,
	mandatory )
 VALUES (
	'wavegen',
	'1  ',
	'itm_default',
	'Y');
INSERT INTO obj_itemchange (
	obj_name,
	form_no,
	field_name,
	mandatory )
 VALUES (
	'wavegen',
	'1  ',
	'sale_order__from',
	'Y');
INSERT INTO obj_itemchange (
	obj_name,
	form_no,
	field_name,
	mandatory )
 VALUES (
	'wavegen',
	'1  ',
	'sale_order__to',
	'Y');


CREATE TABLE PHYSCAN (
TRAN_ID			CHAR(10) NOT NULL, 
TRAN_DATE		DATE NOT NULL, 
SITE_CODE		CHAR(5) NOT NULL, 
STATUS			CHAR(1), 
STATUS_DATE		DATE, 
CONFIRMED		CHAR(1), 
REMARKS			VARCHAR2(60), 
CHG_DATE		DATE, 
CHG_USER		CHAR(10), 
CHG_TERM		CHAR(15), 
EMP_CODE__USER		CHAR(10), 
REF_ID			CHAR(10)
) ;
ALTER TABLE PHYSCAN ADD ( CONSTRAINT PK_PHYSCAN PRIMARY KEY ( TRAN_ID )) ;
CREATE UNIQUE INDEX PK_PHYSCAN ON PHYSCAN (TRAN_ID ) ;



CREATE TABLE PHYSCANDET (
TRAN_ID				CHAR(10) NOT NULL, 
LINE_NO				NUMBER(5,0) NOT NULL, 
SITE_CODE			CHAR(5) NOT NULL, 
ITEM_CODE			CHAR(10) NOT NULL, 
LOC_CODE			CHAR(8) NOT NULL, 
LOT_NO				CHAR(15) NOT NULL, 
LOT_SL				CHAR(15) NOT NULL, 
QUANTITY			NUMBER(14,3) NOT NULL, 
UNIT				CHAR(3) NOT NULL, 
QTY_PHYSICAL			NUMBER(14,3)
) ;

ALTER TABLE PHYSCANDET ADD ( CONSTRAINT PK_PHYSCAN_DET PRIMARY KEY ( TRAN_ID, LINE_NO )) ;
ALTER TABLE PHYSCANDET ADD ( CONSTRAINT FK_PHYSCAN_TRAN FOREIGN KEY ( TRAN_ID ) REFERENCES PHYSCAN ) ;
CREATE UNIQUE INDEX PK_PHYSCAN_DET ON PHYSCANDET (TRAN_ID , LINE_NO ) ;
-- 24/06/12
update obj_forms set title = 'Receipt Inventory',disp_metadata = 'checkedImage@img<item_descr>(<item_code>) , <lot_no> , <unit> = <lot_sl> , <loc_code>'
where win_name = 'w_porcp_wiz' and form_no = '3';

update obj_forms set scan_metadata = '<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Pallet Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Pick Task ID:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pick_order</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_case_pick' and form_no = '1';
insert into obj_itemchange values ('sordform_tr','1','cust_code__dlv',null);
-- 28/06/12
update itm2menu set descr = 'Replenishment (Active Pick)', comments = 'Replenishment (Active Pick)'
where win_name = 'w_active_repl_iss';

update obj_forms set title = 'Replenish Inventory'
where win_name = 'w_active_repl_iss' and form_no = '2';

update obj_forms set title = 'Replenish Inventory'
where win_name = 'w_repl_iss' and form_no = '2';

delete from obj_actions where obj_name = 'inv_hold_rel' and service_code = 'act_impdbs';
-- 29/06/12
delete from obj_forms where win_name = 'w_receivables_jv';
INSERT INTO obj_forms (	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	qty_col,
	rate_col)
VALUES (
	'w_receivables_jv',
	'RecvJV',
	'd_rcp_jv_brow',
	'd_receipt_edit_adv',
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	NULL,
	NULL);
INSERT INTO obj_forms (	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	qty_col,
	rate_col)
VALUES (
	'w_receivables_jv',
	'RcpDetail',
	'd_rcpdet_brow',
	'd_rcpdet_edit',
	'[(ref_ser.equals("M-INV") ? rcp_amt : 0 )][(ref_ser.equals("M-INV") ? fin_chg :0)][(ref_ser.equals("M-INV") ? diff_amt__exch : 0)][(ref_ser.equals("M-INV") ? (-rcp_amt-fin_chg) : 0)][(bill_disc.equals("Y") ? rcp_amt :0)][diff_amt__exch_rdet+diff_amt__exch_radv+diff_amt__exch_repc]',
	'[2..S.ref_ser,2..D.rcp_amt][2..S.ref_ser,2..D.fin_chg][2..S.ref_ser,2..D.diff_amt__exch][2..S.ref_ser,2..D.rcp_amt,2..D.fin_chg][2..S.bill_disc,2..D.rcp_amt][1.1.D.diff_amt__exch_rdet,1.1.D.diff_amt__exch_radv,1.1.D.diff_amt__exch_repc]',
	'[1.1.D.bill_amt][1.1.D.fin_chg][1.1.D.diff_amt__exch_rdet][1.1.D.adv_amt__rdet][1.1.D.bill_disc_amt][1.1.D.diff_amt__exch]',
	'Update the fields Total,Fin Charge,Difference,Advance Amt,Bill Discounted in Header.',
	'2',
	NULL,
	NULL);
INSERT INTO obj_forms (	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	qty_col,
	rate_col)
VALUES (
	'w_receivables_jv',
	'RcpAdv',
	'd_rcpadv_brow',
	'd_rcpadv_edit',
	'[-adj_amt][adj_amt][diff_amt__exch][diff_amt__exch_rdet+diff_amt__exch_radv+diff_amt__exch_repc]',
	'[3..D.adj_amt][3..D.adj_amt][3..D.diff_amt__exch][1.1.D.diff_amt__exch_rdet,1.1.D.diff_amt__exch_radv,1.1.D.diff_amt__exch_repc]',
	'[1.1.D.adv_amt__radv][1.1.D.advadj_amt][1.1.D.diff_amt__exch_radv][1.1.D.diff_amt__exch]',
	'Sets value for Advance Amt,Advance Adjusted,Difference Amount in Header. Reduces Advance Amount by Adjusted Amount of 2nd Child. Increases Advance Adjusted by Adjusted Amount.',
	'3',
	NULL,
	NULL);
INSERT INTO obj_forms (	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	qty_col,
	rate_col)
VALUES (
	'w_receivables_jv',
	'RcpEpc',
	'd_rcpepc_adj_brow',
	'd_rcpepc_adj_edit',
	'[amount][diff_amt__exch][diff_amt__exch_rdet+diff_amt__exch_radv+diff_amt__exch_repc]',
	'[4..D.amount][4..D.diff_amt__exch][1.1.D.diff_amt__exch_rdet,1.1.D.diff_amt__exch_radv,1.1.D.diff_amt__exch_repc]',
	'[1.1.D.efundadj_amt][1.1.D.diff_amt__exch_repc]1.1.D.diff_amt__exch]',
	'Sets value EPC Adj and Difference amount in Header.Increases value for EPC Adj by Amount of 3rd Child',
	'4',
	NULL,
	NULL);
INSERT INTO obj_forms (	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	qty_col,
	rate_col)
VALUES (
	'w_receivables_jv',
	'RcpAcct',
	'd_rcpacct_brow',
	'd_rcpacct_edit',
	'[((eff_bank.equals("N")) ? 1 : 0 )*(-amount)][amount][amount__bc][(!(eff_bank.equals("N")) ? 1 : 0)*(amount)]',
	'[5..S.eff_bank,5..D.amount][5..D.amount][5..D.amount__bc][5..S.eff_bank,5..D.amount]',
	'[1.1.D.adv_amt__ract][1.1.D.net_amt][1.1.D.net_amt__bc][1.1.D.oth_amt]',
	'Decreases Advance Amount of Header by Amount of 4th Child. Sets Net Amount increased by Amount of 4th Child. Net Amount Bc increased by Amount BC of Child.',
	'5',
	NULL,
	NULL);
-- 30/06/12

Insert into obj_forms (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA) 
values ('w_salesreturn_split_tr','Details','d_salesreturndet_brow','d_salesreturndet_edit',null,null,null,null,'2',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);

create or replace FUNCTION  FN_CUSTITEM_DSCR (ls_CUST_CODE CHAR,ls_ITEM_CODE CHAR,ls_cust_item__ref char)
   return varchar
   is
   ls_itmdescr  varchar2(40);
   begin
   select descr into ls_itmdescr from customeritem
   where cust_code =ls_cust_code
   and item_code =ls_item_code
   and item_code__ref = ls_cust_item__ref ;
   RETURN  ls_itmdescr;
   end;
 /
 
 INSERT INTO obj_itemchange (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'salesreturn_form_tr',
	'2',
	'itm_default',
	null);
INSERT INTO obj_itemchange (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'salesreturn_form_tr',
	'2',
	'quantity',
	null);


INSERT INTO obj_itemchange (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'salesreturn_form_tr',
	'1',
	'invoice_id',
	null);
  
INSERT INTO obj_itemchange (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'salesreturn_form_tr',
	'2',
	'invoice_id',
	null);


INSERT INTO messages(
	msg_no ,
	msg_str,
	msg_descr,
	msg_type,
	msg_opt,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'VTINVDATE1',
	'Invalide Invoice Id',
	'Tran Date can not be less than Invoice date',
	'E',
	'Y',
	sysdate,
	'base',
	'Base');

INSERT INTO messages(
	msg_no ,
	msg_str,
	msg_descr,
	msg_type,
	msg_opt,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'VTINVGRP',
	'Invalide Invoice Id',
	'Invoice group code not match with customer group code',
	'E',
	'Y',
	sysdate,
	'base',
	'Base');

INSERT INTO messages(
	msg_no ,
	msg_str,
	msg_descr,
	msg_type,
	msg_opt,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'VTINVGRP1',
	'Invalide Invoice Id',
	'Invoice group code not match with header Invoice group code',
	'E',
	'Y',
	sysdate,
	'base',
	'Base');
INSERT INTO MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT) VALUES ('VTLOCCOD10' , 'Invalid Location','Inventory unhold cannot be transfer to Pick location','E','Y');
--for Invalid customer code dlv in shipment detail transaction on 30/06/12
INSERT INTO MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT) VALUES ('VTDSPINV' , 'Invalid Reference Id','All Reference ID customer code delivery must be same','E','Y');
--02/07/12
alter table asn_det add no_pallet number(14); 
insert into obj_itemchange
(
obj_name,
form_no,
field_name
)
values
(
'asn',
'2',
'quantity'
);
--messages for post save

INSERT INTO MESSAGES (
	MSG_NO ,MSG_STR,MSG_DESCR,
	MSG_TYPE) 
VALUES
(
'VTQMM',
'QUANTITY MISMATCH',
'QUANTITY NOT EQUALS TO PORDDET  QUANTITY',
'E'); 
DELETE FROM OBJ_FORMS WHERE WIN_NAME = 'w_phy_item_scan' and form_no ='1';
INSERT INTO OBJ_FORMS (
	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata)
VALUES (
	'w_phy_item_scan',
	'Physical Item Scan',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Task Type:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>inv_stat</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL);

DELETE FROM OBJ_FORMS WHERE WIN_NAME = 'w_expired_stock_transfer' and form_no ='1';
INSERT INTO OBJ_FORMS (
	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata)
VALUES (
	'w_expired_stock_transfer',
	'Nexp/Exp Process',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Task Type:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>task_code</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL);

DELETE FROM OBJ_FORMS WHERE form_no = '2' AND win_name = 'w_phy_item_scan';
INSERT INTO OBJ_FORMS (
	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata)
VALUES (
	'w_phy_item_scan',
	'Detail',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN NO:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Scan Item Code-Lot No:</SCAN_LABEL><FIELDS SEPARATOR="D" DELIMITER="-"><FIELD ORDER="1">item_code</FIELD><FIELD ORDER="2">lot_no</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Physical Scan Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>qty_physical</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<descr>(<item_code>),<loc_code>,<lot_no>,<lot_sl>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL);

DELETE FROM ITM2MENU WHERE DESCR ='Physical Count Scan';
DELETE FROM ITM2MENU WHERE DESCR ='Physical Count';
alter table receipt_form add tran_id__adj char(10);
alter table rcpdet_form add ref_no__dr char(10);  	

Insert into obj_itemchange (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values
('rcp_tr','1','itm_defaultedit',null);
Insert into obj_itemchange (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values
('rcp_tr','2','itm_defaultedit',null);

INSERT INTO MESSAGES ( 	msg_no , 	msg_str , 	msg_descr , 	msg_type , 	msg_opt ,  	chg_date , 	chg_user , 	chg_term )
VALUES ( 	'VTODSPLIT', 	'Split success', 	'Saleorder form splitted successfully.', 	'P', 	'Y', 	fn_sysdate(), 	'ROHAN'  , 	'BASE ' 	);
-- 03/07/12

INSERT INTO MESSAGES ( 	msg_no , 	msg_str , 	msg_descr , 	msg_type , 	msg_opt ,  	chg_date , 	chg_user , 	chg_term )
VALUES ( 	'VTTRNNTCNF', 	'Verification Failed', 	'Salereturn form verification failed.', 	'P', 	'Y', 	fn_sysdate(), 	'ROHAN'  , 	'BASE ' 	);
INSERT INTO MESSAGES ( 	msg_no , 	msg_str , 	msg_descr , 	msg_type , 	msg_opt ,  	chg_date , 	chg_user , 	chg_term )
VALUES ( 	'VTTRNCONFM', 	'Verification successful', 	'Salereturn form verified successfully.', 	'P', 	'Y', 	fn_sysdate(), 	'ROHAN'  , 	'BASE ' 	);

Insert into obj_actions(OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('rcp_tr',4,'','Account','pre_account','a','F','Account','1','2',null,'U',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 ('rcp_tr','pre_account','1','preAccount',null,'0',to_timestamp('04-DEC-07','DD-MON-RR HH.MI.SSXFF AM'),'Base      ','Base','2','EJB','CRemittanceAccount',null);
Insert into system_event_services(SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM) values ('preAccount','Account','http://localhost:9090/axis/services/ActionHandlerService','Base Information','actionHandler','String','S',null,null, to_timestamp('04-DEC-07','DD-MON-RR HH.MI.SSXFF AM'),'base','Base206');

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('preAccount',1,'COMPONENT_TYPE','l','Component Type','C.String',null,to_timestamp('04-DEC-07','DD-MON-RR HH.MI.SSXFF AM'),'base','BASE206        ','EJB');
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('preAccount',2,'COMPONENT_NAME','l','Component Name','C.String',null,to_timestamp('04-DEC-07','DD-MON-RR HH.MI.SSXFF AM'),'base','BASE206        ','CRemittanceAccount');
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('preAccount',3,'ACTION_TYPE','l','Action Type','S',null,to_timestamp('04-DEC-07','DD-MON-RR HH.MI.SSXFF AM'),'Sudhir    ','BASE206        ','Stock');
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('preAccount',4,'XML_DATA','l','XML data of form no 2','S',null,to_timestamp('04-DEC-07','DD-MON-RR HH.MI.SSXFF AM'),'base','BASE206        ',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('preAccount',5,'XML_DATA_1','l','Object context','S',null,to_timestamp('04-DEC-07','DD-MON-RR HH.MI.SSXFF AM'),'base','BASE206        ',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('preAccount',6,'OBJ_CONTEXT','l','Extra Arguments','S',null,to_timestamp('04-DEC-07','DD-MON-RR HH.MI.SSXFF AM'),'base','BASE206        ',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('preAccount',7,'XTRA_PARAMS','l','Extra Arguments','S',null,to_timestamp('04-DEC-07','DD-MON-RR HH.MI.SSXFF AM'),'base','BASE206        ',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 ('salesreturn_form_tr','post_save','1','pos_sret_split',null,'0',sysdate,'Kunal','base','2','EJB','SreturnFormSplitPos',null);


Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_sret_split',1,'COMPONENT_TYPE','I',null,'S',null,sysdate,'Kunal','Kunal','EJB');

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_sret_split',2,'COMPONENT_NAME','I',null,'S',null,sysdate,'Kunal','Kunal','SreturnFormSplitPos');

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_sret_split',3,'XML_DATA_ALL','I',null,'S',null,sysdate,'Kunal','Kunal',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_sret_split',4,'<tran_id>','I',null,'B.String',null,sysdate,'Kunal','Kunal',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_sret_split',5,'EDIT_FLAG','I',null,'S',null,sysdate,'Kunal','Kunal',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_sret_split',6,'XTRA_PARAMS','I',null,'S',null,sysdate,'Kunal','Kunal',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_sret_split',7,'DB_CONN','I',null,'S.Connection',null,sysdate,'Kunal','Kunal',null);


Insert into system_event_services (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,RETURN_XFRM_XSL,CHG_DATE,CHG_USER,CHG_TERM) 

values ('pos_sret_split','post save','http://localhost:9090/axis/services/ValidatorService','BASE','postSave','String','S',null,null, EMPTY_BLOB(),sysdate,'Kunal','BASE');

-- 04/07/12

                                             
CREATE OR REPLACE FUNCTION CHECK_PHYSCAN_VALUE(LS_ITEM_CODE IN CHAR, LS_SITE_CODE IN CHAR, LS_LOC_CODE IN CHAR, LS_LOT_NO IN CHAR, LS_LOT_SL IN CHAR, LS_EXP_LOCK IN CHAR, LS_N_EXP_LOCK IN CHAR) 
RETURN NUMBER IS LS_NUM NUMBER ; 
   LS_CNT NUMBER; 
BEGIN 
 BEGIN 
   SELECT  COUNT(*) INTO LS_CNT FROM INV_HOLD_DET IHD , INV_HOLD IH
    WHERE TRIM(IHD.SITE_CODE) = TRIM(LS_SITE_CODE)
      AND TRIM(IHD.ITEM_CODE) = TRIM(LS_ITEM_CODE)
      AND TRIM(IHD.LOC_CODE) = TRIM(LS_LOC_CODE) 
      AND TRIM(IHD.LOT_NO) = TRIM(LS_LOT_NO)
      AND TRIM(IHD.LOT_SL) = TRIM(LS_LOT_SL)
      AND IHD.TRAN_ID = IH.TRAN_ID
      AND TRIM(IH.LOCK_CODE) IN (TRIM(LS_EXP_LOCK),TRIM(LS_N_EXP_LOCK))
      AND IHD.HOLD_STATUS = 'H';
 IF (LS_CNT  = 0) THEN 
   LS_NUM := 0 ; 
 ELSE 
   LS_NUM := 1; 
END IF ; 
EXCEPTION 
WHEN NO_DATA_FOUND  THEN 
LS_NUM := 0 ; 
END; 
RETURN LS_NUM ; 
END ;
/

INSERT INTO DISPARM (
	prd_code,
	var_name,
	var_type,
	var_value,
	descr,
	var_subs,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'999999',
	'FOR_LOGIN_SITE',
	'S',
	'YES',
	'YES For login site, Other than ''YES'' considering all site ',
	0,
	sysdate,
	'BASE      ',
	'Rohan      ');

update system_events  set obj_name = 'salesreturn_split_tr' where obj_name = 'salesreturn_form_tr' and event_code = 'post_save';
-- 04/07/12 2nd half
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 ('VTOAFEXIST',' Alrady Exist Reference Acc ','On account Reference Alrady Exist',
'E','Y',null,null,null,sysdate,'BASE      ','BASE           ',null,null);
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 (
	'VTALLSPLIT',
	'Already Split !',
	'Transaction is already Splitted',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'kunal',
	'kunal',
	NULL,
	NULL);
-- 04/07/12 19:05
update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Pick Location:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="4"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>quantity</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Case Label:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>case_label</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_active_pick' and form_no = '3';
-- 05/07/12
INSERT INTO DISPARM  (
	prd_code,
	var_name,
	var_type,
	var_value,
	descr,
	var_subs,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'999999',
	'FOR_INV_STAT',
	'S',
	'DSO,PSO',
	'INV_STAT should be comma (,) seperated and in upper case',
	NULL,
	sysdate,
	'sumit',
	'sumit');
	
update messages set msg_descr = 'Could not find Available Case Pick Location.Please add Available Locations in Location Master'
,msg_str = 'Case Pick Location Unavailable'
where msg_no='INVCPKLOC';
commit;

update messages set msg_descr = 'Could not find Available Active Pick Location.Please add Available Locations in Location Master'
,msg_str = 'Active Pick Loc Unavailable'
where msg_no='INVAPKLOC';

update messages set msg_descr = 'Could not find Available Dock Location.Please add Available Locations in Location Master'
,msg_str = 'Dock Location Unavailable'
where msg_no='INVDOCLOC';

update messages set msg_descr = 'Could not find Available Pick and Drop Location.Please add Available Locations in Location Master'
,msg_str = 'Pick and Drop Loc Unavailable'
where msg_no='INVPNDLOC';

alter table  distroutedet
add pin__fr varchar2(15);

alter table  distroutedet
add pin__to varchar2(15);

update distroutedet set pin__fr = ' ', pin__to = ' ';
commit;
alter table distroutedet modify pin__fr not null;

alter table distroutedet modify pin__to not null;
-- 05/07/12 21:30
alter table bom add  bracket_promotion char(1);
alter table bom add  cash_value_item number(14);

-- 06/07/12

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 (
	'EXPLOCAUSE',
	'Location To Not Valid',
	'Location code entered is not empty for expired location.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'sumit',
	'sumit',
	NULL,
	NULL);


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 (
	'NEXPLOCAUS',
	'Location To Not Valid',
	'Location code entered is not empty for Near expiry location.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'sumit',
	'sumit',
	NULL,
	NULL);
-- 07/07/12
alter table customer add asn_reqd char(1);
-- 09/07/12

insert into obj_itemChange (obj_name,form_no,field_name )
values('schemedef_tr','1','disc_type');

alter table misc_drcr_rcpinv add MRP_VALUE__ADJ number(14,3);

INSERT INTO
obj_itemchange
VALUES (
'voucher',
'1',
'bill_date',
NULL);
alter table crterm add acct_code__disc char(10);
alter table crterm add cctr_code__disc char(10);
alter table crterm modify cctr_code__disc varchar2(10);
update crterm set cctr_code__disc = trim(cctr_code__disc);
alter table crterm modify cctr_code__disc char(4);



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 (
	'VTSRSPLIT',
	'SR form splitted',
	'Sales return form splitted successfully',
	'P',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'sumit',
	'sumit',
	NULL,
	NULL);
-- 10/07/12
update messages set msg_descr = 'Rejected lines not forced as verified exist, update and split again'
where msg_no = 'VTDNTSPLIT';

INSERT INTO obj_itemchange (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'salesreturn_form_tr',
	'2',
	'reas_code',
	null);
	
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 (
	'REAS_CODE',
	'W_SALESRETURN_FORM_TR',
	'Reason code',
	'VUREASON',
	'Y',
	'C',
	null,
	NULL,
	'M',
	TO_TIMESTAMP('18-06-2012 15:21:11','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'localhost.local',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
iNSERT INTO gencodes
(	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3
)
 VALUES (
	'REAS_CODE',
	'W_SALESRETURN_FORM_TR',
	'SREXP',
	'Expired',
	'Expired',
	TO_TIMESTAMP('28-06-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	'Y',
	NULL,
	NULL,
	NULL);
insert into obj_itemchange values ('asn','2','lot_no',null);
--11/07/12
alter table bo add BRACKET_PROMOTION CHAR(1);
alter table bo add CASH_VALUE_ITEM NUMBER(14) ;

alter table sreturn_form add process_fee number(14,3);
alter table sreturn_form add error_code varchar2(100);
alter table sreturn_form add error_msg varchar2(4000);
alter table sreturn add process_fee number(14,3);


alter table sreturn_form_det add process_fee number(14,3);
alter table sreturn_form_det add rebate_reversal number(9,3);
alter table sreturn_form_det add return_condition char(1);

-- 12/07/12
alter table customer add return_allowed char(1);

alter table sreturn_form add order_ref char(10);
alter table sreturn_form_det add eff_date date;
alter table sreturn_form_det modify PHYSICAL_QTY NUMBER(14,3);
alter table sreturn_form_det add recall_flag char(1);

CREATE TABLE ITEM_LOT_INFO (ITEM_CODE CHAR(10) NOT NULL,
LOT_NO CHAR(15) NOT NULL,
GRADE CHAR(3),
CREA_DATE DATE,
EXP_DATE DATE,
MFG_DATE DATE,
RETEST_DATE DATE,
PACK_CODE CHAR(5),
POTENCY_PERC NUMBER(10,3),
SITE_CODE__MFG CHAR(5),
RATE NUMBER(15,4),
GROSS_RATE NUMBER(15,4),
ACCT_CODE__INV CHAR(10),
CCTR_CODE__INV CHAR(4),
BATCH_NO CHAR(20),
BATCH_SIZE NUMBER(14,3),
SUPP_CODE__MFG CHAR(10),
SHEL_LIFE__TYPE CHAR(1),
SALES_TERM CHAR(1),
stop_business char(1),
chg_user char(10),
chg_date date,
chg_term varchar2(15)
) tablespace itm_dis_d2;
ALTER TABLE ITEM_LOT_INFO ADD CONSTRAINT ITEM_LOT_INFO_X PRIMARY KEY ( 
ITEM_CODE, LOT_NO ) using index tablespace itm_dis_i1 ;
 
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 ( 'ERROR_CODE', 'W_SALESRETURN_FORM_TR', 'Sales Return Error', 'UV_SRERRCD', 'Y', 'C', null, NULL, 'M', sysdate , 'BASE ', 'localhost.local', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO gencodes ( fld_name , mod_name , fld_value , descr , sh_descr , chg_date , chg_user , chg_term , active , udf_str1 , udf_str2 , udf_str3 )
VALUES (  'ERROR_CODE', 'W_SALESRETURN_FORM_TR', 'DOL', 'Doller > $ 5000.00', 'Doller > $ 5000.00', SYSDATE, 'BASE ', 'BASE ', 'Y', 'W', NULL, NULL);
INSERT INTO gencodes ( fld_name , mod_name , fld_value , descr , sh_descr , chg_date , chg_user , chg_term , active , udf_str1 , udf_str2 , udf_str3 )
VALUES (  'ERROR_CODE', 'W_SALESRETURN_FORM_TR', 'DON', 'Donation', 'Donation', SYSDATE, 'BASE ', 'BASE ', 'Y', 'W', NULL, NULL);
INSERT INTO gencodes ( fld_name , mod_name , fld_value , descr , sh_descr , chg_date , chg_user , chg_term , active , udf_str1 , udf_str2 , udf_str3 )
VALUES (  'ERROR_CODE', 'W_SALESRETURN_FORM_TR', 'EAQ', 'Return Quantity > Purchase Quantity', 'Invalid Quantity', SYSDATE, 'BASE ', 'BASE ', 'Y', 'W', NULL, NULL);
INSERT INTO gencodes ( fld_name , mod_name , fld_value , descr , sh_descr , chg_date , chg_user , chg_term , active , udf_str1 , udf_str2 , udf_str3 )
VALUES (  'ERROR_CODE', 'W_SALESRETURN_FORM_TR', 'EXP', 'Over Expired Lot', 'Over Expired Lot', SYSDATE, 'BASE ', 'BASE ', 'Y', 'E', NULL, NULL);
INSERT INTO gencodes ( fld_name , mod_name , fld_value , descr , sh_descr , chg_date , chg_user , chg_term , active , udf_str1 , udf_str2 , udf_str3 )
VALUES (  'ERROR_CODE', 'W_SALESRETURN_FORM_TR', 'FUT', 'Within Valid Expir Date Range', 'Expir Date Range', SYSDATE, 'BASE ', 'BASE ', 'Y', 'E', NULL, NULL);
INSERT INTO gencodes ( fld_name , mod_name , fld_value , descr , sh_descr , chg_date , chg_user , chg_term , active , udf_str1 , udf_str2 , udf_str3 )
VALUES ( 'ERROR_CODE', 'W_SALESRETURN_FORM_TR', 'IND', 'No Indirect Price Found', 'No Indirect Price', SYSDATE, 'BASE ', 'BASE ', 'Y', 'W', NULL, NULL);
INSERT INTO gencodes ( fld_name , mod_name , fld_value , descr , sh_descr , chg_date , chg_user , chg_term , active , udf_str1 , udf_str2 , udf_str3 )
VALUES ( 'ERROR_CODE', 'W_SALESRETURN_FORM_TR', 'LOT', 'Invalid Lot', 'Invalid Lot', SYSDATE, 'BASE ', 'BASE ', 'Y', 'E', NULL, NULL);
INSERT INTO gencodes ( fld_name , mod_name , fld_value , descr , sh_descr , chg_date , chg_user , chg_term , active , udf_str1 , udf_str2 , udf_str3 )
VALUES ( 'ERROR_CODE', 'W_SALESRETURN_FORM_TR', 'NDC', 'Invalid NDC', 'Invalid NDC', SYSDATE, 'BASE ', 'BASE ', 'Y', 'E', NULL, NULL);
INSERT INTO gencodes ( fld_name , mod_name , fld_value , descr , sh_descr , chg_date , chg_user , chg_term , active , udf_str1 , udf_str2 , udf_str3 )
VALUES ( 'ERROR_CODE', 'W_SALESRETURN_FORM_TR', 'PAR', 'Partial Return', 'Partial Return', SYSDATE, 'BASE ', 'BASE ', 'Y', 'E', NULL, NULL);
INSERT INTO gencodes ( fld_name , mod_name , fld_value , descr , sh_descr , chg_date , chg_user , chg_term , active , udf_str1 , udf_str2 , udf_str3 )
VALUES ( 'ERROR_CODE', 'W_SALESRETURN_FORM_TR', 'PRC', 'No Price Found for Item / Customer', 'No Price for Item', SYSDATE, 'BASE ', 'BASE ', 'Y', 'W', NULL, NULL);
INSERT INTO gencodes ( fld_name , mod_name , fld_value , descr , sh_descr , chg_date , chg_user , chg_term , active , udf_str1 , udf_str2 , udf_str3 )
VALUES ( 'ERROR_CODE', 'W_SALESRETURN_FORM_TR', 'PRI', 'Private Label', 'Private Label', SYSDATE, 'BASE ', 'BASE ', 'Y', 'E', NULL, NULL);
INSERT INTO gencodes ( fld_name , mod_name , fld_value , descr , sh_descr , chg_date , chg_user , chg_term , active , udf_str1 , udf_str2 , udf_str3 )
VALUES ( 'ERROR_CODE', 'W_SALESRETURN_FORM_TR', 'RCL', 'Recalled Item', 'Recalled Item', SYSDATE, 'BASE ', 'BASE ', 'Y', 'W', NULL, NULL);
INSERT INTO gencodes ( fld_name , mod_name , fld_value , descr , sh_descr , chg_date , chg_user , chg_term , active , udf_str1 , udf_str2 , udf_str3 )
VALUES ( 'ERROR_CODE', 'W_SALESRETURN_FORM_TR', 'SHT', 'Short-Dated', 'Short-Dated', SYSDATE, 'BASE ', 'BASE ', 'Y', 'W', NULL, NULL);
INSERT INTO gencodes ( fld_name , mod_name , fld_value , descr , sh_descr , chg_date , chg_user , chg_term , active , udf_str1 , udf_str2 , udf_str3 )
VALUES ( 'ERROR_CODE', 'W_SALESRETURN_FORM_TR', 'ZER', 'Zero Quantity Return', 'Zero Quantity Return', SYSDATE, 'BASE ', 'BASE ', 'Y', 'E', NULL, NULL);
 
insert into messages (msg_no , msg_str, msg_descr, msg_type , msg_opt)
values ('VTVFLGCD', 'Cannot Change Varify Flag','Varify flag changes cannot be override','E','Y');

insert into messages (msg_no , msg_str, msg_descr, msg_type , msg_opt)
values ('VTFOVRFCD', 'Cannot Change Forced Flag','Forced flag changes cannot be override','E','Y');
Insert into obj_actions(OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('rcp_tr',6,null,'Action Button for Get Gate Pass','act_getGPList','a','R','GP List','2','4',null,'U',null,sysdate,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 ('rcp_tr','act_getGPList','1','agetGPList',null,'0',sysdate,'base ','BASE216','2','EJB','ReceiptAdvAct',null);

alter table itemser add acct_code__pfee char(10);
alter table itemser add cctr_code__pfee char(4);
alter table sordertype add (near_expiry char(1));
-- 16/07/12
INSERT INTO invstat VALUES (
        'PRSV',
        'Reserve - Partials ',
        'Y',
        'Y',
        'Y',
        'Y',
        TO_DATE('13-07-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'ASHISH',
        'ASHISH',
        'Y',
        'M',
        NULL);
-- 19/07/12

DELETE FROM POPHELP WHERE FIELD_NAME = 'PTCN' AND MOD_NAME = 'W_SHIPMENT';

INSERT INTO POPHELP (
	field_name,
	mod_name,
	sql_str,
	dw_object,
	msg_title,
	width,
	height,
	chg_date,
	chg_user,
	chg_term,
	dist_opt,
	filter_string,
	sql_input,
	default_col,
	pop_align,
	query_mode,
	page_context,
	pophelp_cols,
	pophelp_source,
	multi_opt,
	help_option)
VALUES (
	'PTCN',
	'W_SHIPMENT',
	'SELECT W.PTCN, D.SORD_NO, D.CUST_CODE, D.TRAN_CODE  FROM WAVE_TASK_DET W, DESPATCH D WHERE REF_ID = D.DESP_ID AND D.CONFIRMED != ''Y''',
	NULL,
	'PTCN',
	0,
	0,
	TO_DATE('1-06-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'MAHESH ',
	'BASE ',
	'1',
	NULL,
	NULL,
	1,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
	
	COMMIT;
	
	
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_grl',
	'pre_navigate_finish',
	'1',
	'prv_stock_transfer_grl',
	NULL,
	'0',
	TO_DATE('8-05-2012 13:26:13','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	'2',
	'EJB',
	'StockTransferGrlIC',
	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_grl',
	'pre_validate',
	'1',
	'prv_stock_transfer_grl',
	NULL,
	'0',
	TO_DATE('8-05-2012 13:26:13','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	'2',
	'EJB',
	'StockTransferGrlIC',
	NULL);
	
-- 19/07/12
Insert into system_events (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) 
values ('generate_receipt','post_item_change','1','poic_genReceipt',null,sysdate,'Kunal     ','Kunal','2','0','EJB','GenerateReceiptIC',null);

Insert into system_event_services (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM) 
values ('poic_genReceipt',' method for itemchange','http://localhost/axis/services/ValidatorService','BASE','itemChanged','String','S',null,null,sysdate,'Kunal     ','Kunal  ');

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('poic_genReceipt',1,'COMPONENT_TYPE','I',null,'C.String',null,sysdate,'Kunal     ','Kunal   ','EJB');

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('poic_genReceipt',2,'COMPONENT_NAME','I',null,'C.String',null,sysdate,'Kunal     ','Kunal   ','GenerateReceiptIC');

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE)
 values ('poic_genReceipt',3,'XML_DATA','I',null,'S',null,sysdate,'Kunal     ','Kunal',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('poic_genReceipt',4,'XML_DATA_1','I',null,'S',null,sysdate,'Kunal     ','Kunal  ',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('poic_genReceipt',5,'XML_DATA_ALL','I',null,'S',null,sysdate,'Kunal     ','Kunal  ',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE)
 values ('poic_genReceipt',6,'OBJ_CONTEXT','I',null,'S',null,sysdate,'Kunal     ','Kunal   ',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('poic_genReceipt',7,'FOCUSED_COLUMN','I',null,'S',null,sysdate,'Kunal     ','Kunal   ',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('poic_genReceipt',8,'EDIT_FLAG','I',null,'S',null,sysdate,'Kunal     ','Kunal   ',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('poic_genReceipt',9,'XTRA_PARAMS','I',null,'S',null,sysdate,'Kunal     ','Kunal   ',null);


insert into obj_itemchange(obj_name,form_no,field_name) 
values ('generate_receipt','1','itm_default');

insert into obj_itemchange(obj_name,form_no,field_name) 
values ('generate_receipt','1','cust_code__from');

insert into obj_itemchange(obj_name,form_no,field_name) 
values ('generate_receipt','1','tran_type');

-- 20/07/12
INSERT INTO itm2menu (application,
	level_1,
	level_2,
	level_3,
	level_4,
	level_5,
	win_name,
	descr,
	comments,
	menu_path,
	icon_path,
	close_icon,
	open_icon,
	obj_type,
	chg_date,
	chg_term,
	chg_user,
	mob_deploy)
VALUES (
	'FIN',
	4,
	31,
	6,
	0,
	0,
	'w_generate_receipt',
	'Automatic AR Settlement',
	NULL,
	'FIN.4.31.6.0.0',
	'itm_logo.ico',
	NULL,
	NULL,
	'P',
	NULL,
	NULL,
	NULL,
	NULL);
delete
 from system_service_args where service_code in ('agetData_GenerateReceipt','aprocessGenerateReceipt');
delete
 from system_event_services where service_code in ('agetData_GenerateReceipt','aprocessGenerateReceipt');
delete
 from system_events where service_code in ('agetData_GenerateReceipt','aprocessGenerateReceipt');

INSERT INTO system_event_services (service_code,
	service_descr,
	service_uri,
	method_name,
	return_value,
	return_type,
	return_descr,
	return_xfrm,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'agetData_GenerateReceipt',
	'Action to get the Data',
	'http://localhost/axis/services/ProcessService',
	'getData',
	'String',
	'S',
	NULL,
	NULL,
	TO_TIMESTAMP('21-03-2007 14:03:14','DD-MM-YYYY HH24:MI:SS'),
	'WASIM     ',
	'BASE005');
INSERT INTO system_event_services (service_code,
	service_descr,
	service_uri,
	method_name,
	return_value,
	return_type,
	return_descr,
	return_xfrm,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'aprocessGenerateReceipt',
	'Action to process the Data',
	'http://localhost/axis/services/ProcessService',
	'process',
	'String',
	'S',
	NULL,
	NULL,
	TO_TIMESTAMP('21-03-2007 14:03:14','DD-MM-YYYY HH24:MI:SS'),
	'WASIM     ',
	'BASE005');
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 (
	'generate_receipt',
	'get_data',
	'1',
	'agetData_GenerateReceipt',
	NULL,
	'0',
	TO_TIMESTAMP('4-12-2007 12:12:28','DD-MM-YYYY HH24:MI:SS'),
	'WASIM     ',
	'BASE005        ',
	'2',
	'EJB',
	'GenerateReceiptPrc',
	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 (
	'generate_receipt',
	'process',
	'1',
	'aprocessGenerateReceipt',
	NULL,
	'0',
	TO_TIMESTAMP('4-12-2007 12:12:28','DD-MM-YYYY HH24:MI:SS'),
	'WASIM     ',
	'BASE005        ',
	'2',
	'EJB',
	'GenerateReceiptPrc',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_GenerateReceipt',
	1,
	'COMPONENT_TYPE',
	'I',
	'Component Type',
	'S',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'WASIM     ',
	'BASE005        ',
	'WSR');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_GenerateReceipt',
	2,
	'COMPONENT_NAME',
	'I',
	'Component Name',
	'S',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'WASIM     ',
	'BASE005        ',
	'GenerateReceiptPrc');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_GenerateReceipt',
	3,
	'XML_DATA',
	'I',
	'XML data of form no 1',
	'S',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'WASIM     ',
	'BASE005        ',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_GenerateReceipt',
	4,
	'XML_DATA_1',
	'I',
	'XML data of form no 1',
	'S',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'WASIM     ',
	'BASE005        ',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_GenerateReceipt',
	5,
	'WINDOW_NAME',
	'I',
	'Window Name',
	'S',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'WASIM     ',
	'BASE005        ',
	'w_generate_receipt');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_GenerateReceipt',
	6,
	'XTRA_PARAMS',
	'I',
	'Extra Arguments',
	'S',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'WASIM     ',
	'BASE005        ',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'aprocessGenerateReceipt',
	1,
	'COMPONENT_TYPE',
	'I',
	'Component Type',
	'C.String',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'WASIM     ',
	'BASE005        ',
	'EJB');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'aprocessGenerateReceipt',
	2,
	'COMPONENT_NAME',
	'I',
	'Component Name',
	'C.String',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'WASIM     ',
	'BASE005        ',
	'GenerateReceiptPrc');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'aprocessGenerateReceipt',
	3,
	'XML_DATA_1',
	'I',
	'XML data of form no 1',
	'S',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'WASIM     ',
	'BASE005        ',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'aprocessGenerateReceipt',
	4,
	'XML_DATA_ALL',
	'I',
	'XML data of form no 1',
	'S',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'WASIM     ',
	'BASE005        ',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'aprocessGenerateReceipt',
	5,
	'OBJ_CONTEXT',
	'I',
	'Object Context',
	'S',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'WASIM     ',
	'BASE005        ',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'aprocessGenerateReceipt',
	6,
	'XTRA_PARAMS',
	'I',
	'Extra Arguments',
	'S',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'WASIM     ',
	'BASE005        ',
	NULL);
	
-- 20/07/12 - 2
alter table sreturn_form  add site_code__dlv char(5);	
alter table sreturn add site_code__dlv char(5);	
insert into obj_itemchange(obj_name,form_no,field_name) 
values ('generate_receipt','1','cust_code__to');
create or replace
function getRndamt(as_newQty number,as_round char,as_roundto number ) 
	Return NUMBER As
		--lcMultiply number(10) :=1;
    newQty   number(20,4);
Begin 
  if  as_newQty < 0 then
			  --  lcMultiply := -1;
				  newQty     := abs(as_newQty);
		elsif as_newQty = 0 then 
           newQty     := as_newQty;
   elsif as_round ='N' then
          newQty := as_newQty;
    elsif as_round = 'X' then 
          newQty := (as_newQty - (mod(as_newQty,as_roundto)) + as_roundto);
   elsif as_round = 'P' then
		    	newQty := (as_newQty - (mod(as_newQty,as_roundto)));
 		elsif as_round = 'R' then 
       if (mod(as_newQty,as_roundto)) < (as_roundto / 2)  then 
               newQty := (as_newQty - (mod(as_newQty,as_roundto)));
			  end if;
      else
					newQty :=(as_newQty - (mod(as_newQty,as_roundto)) + as_roundto);
  return newQty;
  end if;

      if    as_roundto = 0 then 
            newQty := ROUND(newQty); 
      elsif as_roundto = 1 then 
            newQty := ROUND(newQty); 
      elsif as_roundto = .1 then
      		  newQty := ROUND(newQty,1);
      elsif as_roundto = .01 then 
            newQty := ROUND(newQty,2);
  		elsif as_roundto =.001 then 
					  newQty := ROUND(newQty,3);
      elsif as_roundto = .0001 then 
					  newQty := ROUND(newQty,4);
      end if;
       return newQty;     
End;
/


create or replace function getconvquantityfact (as_fruom char,touom char,foritem char,toconvert number) 
    Return  Number As
    v_mConv  number(29,4); 
    v_mRound varchar2(100);
    v_mRndTo number(15,4); 
    v_newqty  number(29,4);
    msg  varchar2(1000):='Conversion factor not defined.';
begin   
    if as_fruom = touom then
        v_mConv  := 1;
        v_newqty := toconvert * v_mConv;
        return v_newqty;
    end if;
begin
   SELECT FACT, ROUND,ROUND_TO into v_mConv,v_mRound,v_mRndTo
        FROM   UOMCONV 
       WHERE   UNIT__FR    = as_fruom     
        AND    UNIT__TO    = touom 
        AND    ITEM_CODE   = foritem; 
              if v_mConv is not null and v_mRound is not null and v_mRndTo is not null then 
               v_newqty  := v_mConv*toconvert;
               v_newqty  :=getrndamt(v_newqty,v_mRound,v_mRndTo);
                 return v_newqty;
             else
                dbms_output.put_line(msg);
            end if;
            Exception 
              when no_data_found then
              Begin
                  SELECT  FACT,ROUND,ROUND_TO  into v_mConv,v_mRound,v_mRndTo
                  FROM    UOMCONV 
                  WHERE   UNIT__FR    =touom  
                  AND     UNIT__FR    =as_fruom  
                  AND     ITEM_CODE    =foritem;  
                     
                    if v_mConv is not null and v_mRound is not null and v_mRndTo is not null then 
                      v_newqty  := v_mConv/toconvert;
                      v_newqty  :=getrndamt(v_newqty,v_mRound,v_mRndTo);
                     return v_newqty;
                     else
                      dbms_output.put_line(msg);
                      end if;
                   Exception
                      when no_data_found then 
                      Begin
                          SELECT FACT, ROUND, ROUND_TO into v_mConv,v_mRound,v_mRndTo
                          FROM   UOMCONV 
                          WHERE  UNIT__FR    = as_fruom     
                          AND    UNIT__TO    = touom 
                          AND    ITEM_CODE   = 'X';  
                            if v_mConv is not null and v_mRound is not null and v_mRndTo is not null then 
                                  v_newqty  := v_mConv*toconvert;
                                  v_newqty  :=getrndamt(v_newqty,v_mRound,v_mRndTo);
                                  return v_newqty;
                                else
                                    dbms_output.put_line(msg);
                                end if;      
                           Exception 
                                when no_data_found then 
                                Begin
                                SELECT FACT, ROUND, ROUND_TO into v_mConv,v_mRound,v_mRndTo
                                FROM   UOMCONV 
                                WHERE  UNIT__FR    = touom      
                                AND    UNIT__TO    = as_fruom
                                AND    ITEM_CODE   = 'X';  
                                if v_mConv is not null and v_mRound is not null and v_mRndTo is not null then 
                                      v_newqty   := toconvert/v_mConv;
                                      v_newqty   :=getrndamt(v_newqty,v_mRound,v_mRndTo);
                                      return v_newqty;
                                    else
                                      dbms_output.put_line(msg); 
                                    end if;
                                exception 
                                  when no_data_found then 
                                  v_mConv :=0;
                                  v_mRound :=null;
                                  v_mRndTo :=0;                                    
                 
                     end;
              end;
        end;
  end;
  
   return v_newqty;
    
end;
/


create or replace
TRIGGER UPDATE_PHYSICALSCANDET
  before INSERT ON PHYSCANDET
    FOR EACH ROW
DECLARE
    VAL_PHY_INPUT INTEGER;
    VAL_PHY_HAN_BASIS CHAR;
    VAL_SHIPPER_SIZE INTEGER;
    VAL_GROSS_WEIGHT INTEGER;
    VAL_NET_WEIGHT INTEGER;
    VAL_LENGTH INTEGER;
    VAL_WIDTH INTEGER;
    VAL_HEIGHT INTEGER;
    VAL_MFR_PART_NO CHAR;
    VAL_VOLUME INTEGER;
    VAL_VAR_VALUE INTEGER;
    VAL_PHY_QUANTITY INTEGER;
 VAL_CONV__QTY_STDOUM INTEGER;
 VAL_COV_FACT INTEGER := 1;
BEGIN
    SELECT ILP.SHIPPER_SIZE, ILP.GROSS_WEIGHT,
          ILP.NET_WEIGHT, ILP.LENGTH,
          ILP.WIDTH, ILP.HEIGHT,
          I.MFR_PART_NO, I.VOLUME
          INTO
          VAL_SHIPPER_SIZE, VAL_GROSS_WEIGHT,
          VAL_NET_WEIGHT, VAL_LENGTH ,
          VAL_WIDTH, VAL_HEIGHT,
          VAL_MFR_PART_NO, VAL_VOLUME
          FROM ITEM I,  ITEM_LOT_PACKSIZE ILP
          WHERE ILP.ITEM_CODE = :NEW.ITEM_CODE
          AND I.ITEM_CODE = ILP.ITEM_CODE
          AND :NEW.LOT_NO BETWEEN LOT_NO__FROM AND LOT_NO__TO;
    SELECT VAR_VALUE INTO VAL_VAR_VALUE FROM DISPARM
          WHERE PRD_CODE ='999999'
          AND VAR_NAME ='PER_PALLET__VOLUME';

 SELECT CONV__QTY_STDUOM INTO VAL_CONV__QTY_STDOUM FROM STOCK
        WHERE SITE_CODE = :NEW.SITE_CODE
     AND ITEM_CODE = :NEW.ITEM_CODE
     AND LOT_NO = :NEW.LOT_NO
     AND LOC_CODE = :NEW.LOC_CODE
     AND LOT_SL = :NEW.LOT_SL;

    IF( VAL_CONV__QTY_STDOUM != 0 ) THEN
    VAL_COV_FACT := VAL_CONV__QTY_STDOUM;
 END IF;

    IF(:NEW.PHY_HAN_BASIS = 'L') THEN
       :new.QTY_PHYSICAL := (:NEW.PHY_INPUT * VAL_SHIPPER_SIZE);
    END IF;
    IF(:NEW.PHY_HAN_BASIS = 'I') THEN
      :new.QTY_PHYSICAL := (:NEW.PHY_INPUT);
    END IF;
    IF(:NEW.PHY_HAN_BASIS = 'U') THEN
       :new.QTY_PHYSICAL := getconvquantityfact ( :NEW.CONV_FACT,:NEW.UNIT,:NEW.ITEM_CODE,:NEW.PHY_INPUT) ;
    END IF;
    IF (:NEW.PHY_HAN_BASIS = 'P') THEN
       --:new.QTY_PHYSICAL := (:NEW.PHY_INPUT * VAL_SHIPPER_SIZE * VAL_VAR_VALUE )/(VAL_LENGTH * VAL_WIDTH * VAL_HEIGHT );
       :new.QTY_PHYSICAL := (floor((:NEW.PHY_INPUT  * VAL_VAR_VALUE )/(VAL_LENGTH * VAL_WIDTH * VAL_HEIGHT ) ) * VAL_SHIPPER_SIZE );
    END IF;
END;
/

INSERT INTO itm2menu  (
	application ,
	level_1 ,
	level_2 ,
	level_3 ,
	level_4 ,
	level_5 ,
	win_name ,
	descr ,
	comments ,
	menu_path ,
	icon_path,
	obj_type,
	chg_date ,
	chg_term ,
	chg_user)
VALUES (
	'DIS',
	3,
	51,
	0,
	0,
	0,
	'w_pick_iss_hdr',
	'Pick Issue',
	'pick Map List',
	'DIS.3.51.0.0.0',
	'e12_logo.gif',	
	'M',
	sysdate,
	'BASE',
	'Sankar');
INSERT INTO transetup (
	tran_window ,
	save_flag ,
	val_flag ,
	key_flag ,
	repeate_add ,
	chg_date ,
	chg_user ,
	chg_term ,
	edi_option ,
	confirm_mode ,
	mail_option ,
	garbage_opt ,
	table_name,
	application )
VALUES (
	'w_pick_iss_hdr',
	'2',
	'2',
	'M',
	'N',
	sysdate,
	'Sankar ',
	'BASE ',
	'0',
	'0',
	'0',
	'N',
	'pick_iss_hdr',
	'DIS');
	
INSERT INTO obj_forms (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	form_no)
VALUES (
	'w_pick_iss_hdr',
	'pick issue form Map',
	'',
	'',
	'1');

INSERT INTO obj_links (
	obj_name ,
	form_no ,
	field_name ,
	target_obj_name ,
	link_form_name ,
	link_title ,
	link_uri ,
	link_type ,
	link_arg ,
	update_flag ,
	link_name ,
	rights_char ,
	image )
VALUES (
	'despatch',
	'1',
	'site_code',
	'pick_iss_hdr',
	'pick_iss_hdr11',
	'Pick Issue Detail',
	NULL,
	'1',
	'sord_no.String',
	'0',
	NULL,
	'*',
	NULL);

ALTER TABLE REPL_ORD_DET ADD ACTUAL_QTY NUMBER(14,3);
ALTER TABLE PICK_ORD_DET ADD REPL_ORDER CHAR(10);
ALTER TABLE PICK_ORD_DET ADD LINE_NO__REPL NUMBER(14,3);

INSERT INTO DISPARM 
(
PRD_CODE,       
VAR_NAME,       
VAR_TYPE ,      
VAR_VALUE,
DESCR,     
VAR_SUBS,    
CHG_DATE,   
CHG_USER,    
CHG_TERM
)
VALUES
(
'999999',
'MASTER_PACK_SINGLE_PICK',
'S',
'Y',
'if value Y then single pick or as per exisitng logic',
NULL,
sysdate,
'BASE',
'BASE'
);

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 (
	'TRAN_TYPE',
	'W_GENERATE_RECEIPT',
	'Invalid Tran type',
	'UV_TRTYPE',
	'Y',
	'C',
	null,
	NULL,
	'M',
	TO_TIMESTAMP('18-06-2012 15:21:11','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'localhost.local',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO gencodes
(	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3
)
 VALUES (
	'TRAN_TYPE',
	'W_GENERATE_RECEIPT',
	'J',
	'JV',
	'JV',
	TO_TIMESTAMP('28-06-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	'Y',
	'J',
	NULL,
	NULL);
iNSERT INTO gencodes
(	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3
)
 VALUES (
	'TRAN_TYPE',
	'W_GENERATE_RECEIPT',
	'O',
	'Other',
	'Other',
	TO_TIMESTAMP('28-06-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	'Y',
	'O',
	NULL,
	NULL);
create or replace
function getconvquantityfact (as_fruom char,touom char,foritem char,toconvert number) 
    Return  Number As
    v_mConv  number(29,4); 
    v_mRound varchar2(100);
    v_mRndTo number(15,4); 
    v_newqty  number(29,4);
    msg  varchar2(1000):='Conversion factor not defined.';
begin   
    if as_fruom = touom then
        v_mConv  := 1;
        v_newqty := toconvert * v_mConv;
        return v_newqty;
    end if;
begin
   SELECT FACT, ROUND,ROUND_TO into v_mConv,v_mRound,v_mRndTo
        FROM   UOMCONV 
       WHERE   UNIT__FR    = as_fruom     
        AND    UNIT__TO    = touom 
        AND    ITEM_CODE   = foritem; 
              if v_mConv is not null and v_mRound is not null and v_mRndTo is not null then 
               v_newqty  := v_mConv*toconvert;
               v_newqty  :=getrndamt(v_newqty,v_mRound,v_mRndTo);
                 return v_newqty;
             Else
                 Dbms_Output.Put_Line(msg); 
            end if;
            Exception 
              when no_data_found then
              Begin
                  SELECT  FACT,ROUND,ROUND_TO  into v_mConv,v_mRound,v_mRndTo
                  FROM    UOMCONV 
                  WHERE   UNIT__FR    =touom  
                  AND     UNIT__FR    =as_fruom  
                  AND     ITEM_CODE    =foritem;  
                    if v_mConv is not null and v_mRound is not null and v_mRndTo is not null then 
                      v_newqty  := v_mConv/toconvert;
                      V_Newqty  :=Getrndamt(V_Newqty,V_Mround,V_Mrndto);
                     return v_newqty;
                     Else
                       Dbms_Output.Put_Line(msg); 
                      end if;
                   Exception
                      when no_data_found then 
                      Begin
                          SELECT FACT, ROUND, ROUND_TO into v_mConv,v_mRound,v_mRndTo
                          FROM   UOMCONV 
                          WHERE  UNIT__FR    = as_fruom     
                          AND    UNIT__TO    = TOUOM 
                          AND    ITEM_CODE   = 'X';  
                            IF V_MCONV IS NOT NULL AND V_MROUND IS NOT NULL AND V_MRNDTO IS NOT NULL THEN 
                                 Dbms_Output.Put_Line(V_MCONV||V_MROUND||V_MRNDTO); 
                                  v_newqty  := v_mConv*toconvert;
                                  v_newqty  :=getrndamt(v_newqty,v_mRound,v_mRndTo);
                                  return v_newqty;
                                Else
                                  Dbms_Output.Put_Line(msg); 
                                end if;      
                           Exception 
                                when no_data_found then 
                                Begin
                                SELECT FACT, ROUND, ROUND_TO into v_mConv,v_mRound,v_mRndTo
                                FROM   UOMCONV 
                                WHERE  UNIT__FR    = touom      
                                AND    UNIT__TO    = as_fruom
                                AND    ITEM_CODE   = 'X';  
                                if v_mConv is not null and v_mRound is not null and v_mRndTo is not null then 
                                      v_newqty   := toconvert/v_mConv;
                                      v_newqty   :=getrndamt(v_newqty,v_mRound,v_mRndTo);
                                      return v_newqty;
                                    Else  
                                      Dbms_Output.Put_Line(msg); 
                                    end if;
                                exception 
                                  When No_Data_Found Then 
                                  v_mConv :=0;
                                  v_mRound :=null;
                                  v_mRndTo :=0;  
                                  dbms_output.put_line(msg); 
                     end;
              end;
        end;
  end;
   return v_newqty;
end;
/

--23/07/12
INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'VTLPNNTVAL',
	'LPN No Exist',
	'LPN No not exist in stock.Please enter valid LPN No',
	'E',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE ');
	
INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'VTSTK2',
	'Stock Not Exist',
	'Stock not exist in GRL Location for Enter LPN No',
	'E',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE ');	
update system_service_args set arg_value = null where service_code = 'pr_default_1';	
update system_service_args set arg_name = 'DUMMY' where service_code = 'pr_default_1' and line_no = 4;	
update system_service_args set arg_name = 'XTRA_PARAMS' where service_code = 'pr_default_1' and line_no = 5;	
--24/07/12
Insert into itm2menu (APPLICATION,LEVEL_1,LEVEL_2,LEVEL_3,LEVEL_4,LEVEL_5,WIN_NAME,DESCR,COMMENTS,MENU_PATH,ICON_PATH,CLOSE_ICON,OPEN_ICON,OBJ_TYPE,CHG_DATE,CHG_TERM,CHG_USER,MOB_DEPLOY)
 values ('TRO',1,1,6,0,0,'w_lot_master','Lot Master',null,'TRO.1.1.6.0.0','e12_logo.gif',null,null,null,null,null,null,null);

Insert into transetup (TRAN_WINDOW,SAVE_FLAG,VAL_FLAG,KEY_FLAG,KEY_STRING,UDF_1,UDF_2,UDF_3,UDF_4,UDF_5,REPEATE_ADD,CHG_DATE,CHG_USER,CHG_TERM,EDI_OPTION,SITE_ACC_COL,CONFIRM_COL,CONFIRM_VAL,REPEAT_ADD_DET,LOAD_MODE,AUTO_CONFIRM,LEDG_POST_CONF,CHG_DATE_ON_CONF,TRAN_ID_COL,MAIL_OPTION,CONFIRM_MODE,GARBAGE_OPT,VAL_FLAG_EDI,VERIFY_PASSWORD,TABLE_NAME,APPLICATION,TABLE_DESC,TRAN_DATE_COL,SALES_PERS_ACC_COL,CUST_ACC_COL,SUPP_ACC_COL,ITEM_SER_ACC_COL,EMP_ACC_COL,WORKFLOW_OPT,TRAN_ID__FROM,TRAN_ID__TO,MULTITIRE_OPT,REF_SER,VIEW_MODE,TABLE_NAME_DET1,TABLE_NAME_DET2,TABLE_NAME_DET3,TAX_FORMS,SIGN_STATUS,USER_TRAN_WINDOW,CUSTOM_PREVIEW_OBJ,CHILDDATA_ARGOPT,IGNOREERRLIST_ONLOAD,EDIT_TMPLT,WRKFLW_INIT,FORMAL_ARGS,EDIT_OPT,AUDIT_TRAIL_OPT,EDITTAX,CACHE_OPT,OPTIMIZE_MODE,EDIT_EXPR,TRANSFER_MODE,RATE_COL,QTY_COL,RCP_CACHE_STATUS,PRINT_CONTROL,ITEM_SER_ACC_CODE,PROFILE_ID__RES,PERIOD_OPTION,TRAN_COMPL_MSG,WRKFLW_PRIORITY,EXEC_TYPE,DISP_META_DATA,START_FORM,ISATTACHMENT,ALLOW_ATTACH) 
values ('w_lot_master','2','2','M',null,
null,null,null,null,null,'Y',sysdate,'BASE ','1              ','0',null,null,null,'N',null,null,'N',null,'TRAN_ID',null,'0',null,null,null,null,null,null,null,null,null,null,null,null,'0',null,null,null,null,'F',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'M',null,null,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 ('lot_master','post_item_change','1','poic_default_ejb',null,'0',sysdate,'Kunal','Kunal','2','EJB','LotMasterIC',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 ('lot_master','pre_validate','1','prv_default_ejb',null,'0',sysdate,'Kunal','Kunal','2','EJB','LotMasterIC',null);


Insert into system_event_services (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM) 
values ('poic_default_ejb',' method for itemchange','http://localhost/axis/services/ValidatorService','BASE','itemChanged','String','S',null,null, sysdate,'Kunal  ','Kunal  ');
Insert into system_event_services (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM) 
values ('prv_default_ejb','method for validation','http://localhost/axis/services/ValidatorService','BASE','wfValData','String','S',null,null, sysdate,'Kunal  ','Kunal  ');

Insert into obj_forms (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA) 
values ('w_lot_master','Lot Master','d_lot_master_brow','d_lot_master_edit',null,null,null,null,'1',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);



Insert into obj_actions (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('lot_master',1,'add.gif','Adding New','a','a','A','Add','1',null,null,'S',null,null,null,null);
Insert into obj_actions (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('lot_master',2,'edit.gif','Editing Existing Record','a','a','E','Edit','1',null,null,'S',null,null,null,null);
Insert into obj_actions (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('lot_master',3,'save.gif','Saving','a','a','S','Save','1',null,null,'S',null,null,null,null);


INSERT INTO obj_itemchange (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'lot_master',
	'1',
	'item_code',
	null);
	
Insert into itm2menu (APPLICATION,LEVEL_1,LEVEL_2,LEVEL_3,LEVEL_4,LEVEL_5,WIN_NAME,DESCR,COMMENTS,MENU_PATH,ICON_PATH,CLOSE_ICON,OPEN_ICON,OBJ_TYPE,CHG_DATE,CHG_TERM,CHG_USER,MOB_DEPLOY)
 values ('TRO',2,1,4,0,0,'w_sorder_scheme','SOrder Scheme',null,'TRO.2.1.4.0.0','e12_logo.gif',null,null,null,null,null,null,null);

Insert into itm2menu (APPLICATION,LEVEL_1,LEVEL_2,LEVEL_3,LEVEL_4,LEVEL_5,WIN_NAME,DESCR,COMMENTS,MENU_PATH,ICON_PATH,CLOSE_ICON,OPEN_ICON,OBJ_TYPE,CHG_DATE,CHG_TERM,CHG_USER,MOB_DEPLOY)
 values ('TRO',2,1,5,0,0,'w_sorderdet_scheme','SOrder Detail Scheme',null,'TRO.2.1.5.0.0','e12_logo.gif',null,null,null,null,null,null,null);


Insert into obj_forms (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA) 
values ('w_sorder_scheme','Header','d_sorder_scheme11','d_sorder_scheme21',null,null,null,null,'1',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);

Insert into obj_forms (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA) 
values ('w_sorderdet_scheme','Header','d_sorderdet_scheme11','d_sorderdet_scheme21',null,null,null,null,'1',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);


Insert into obj_actions (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('sorder_scheme',1,'delete.gif','Deleting','a','a','D','Delete','1',null,null,'S',null,null,null,null);


Insert into obj_actions (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('sorderdet_scheme',1,'delete.gif','Deleting','a','a','D','Delete','1',null,null,'S',null,null,null,null);

Insert into obj_actions (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('sorder_scheme',2,'edit.gif','Editing Existing Record','a','a','E','Edit','1',null,null,'S',null,sysdate,'Kunal','Kunal');


Insert into obj_actions (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('sorderdet_scheme',2,'edit.gif','Editing Existing Record','a','a','E','Edit','1',null,null,'S',null,sysdate,'Kunal','Kunal');

Insert into TRANSETUP (TRAN_WINDOW,SAVE_FLAG,VAL_FLAG,KEY_FLAG,KEY_STRING,UDF_1,UDF_2,UDF_3,UDF_4,UDF_5,REPEATE_ADD,CHG_DATE,CHG_USER,CHG_TERM,EDI_OPTION,SITE_ACC_COL,CONFIRM_COL,CONFIRM_VAL,REPEAT_ADD_DET,LOAD_MODE,AUTO_CONFIRM,LEDG_POST_CONF,CHG_DATE_ON_CONF,TRAN_ID_COL,MAIL_OPTION,CONFIRM_MODE,GARBAGE_OPT,VAL_FLAG_EDI,VERIFY_PASSWORD,TABLE_NAME,APPLICATION,TABLE_DESC,TRAN_DATE_COL,SALES_PERS_ACC_COL,CUST_ACC_COL,SUPP_ACC_COL,ITEM_SER_ACC_COL,EMP_ACC_COL,WORKFLOW_OPT,TRAN_ID__FROM,TRAN_ID__TO,MULTITIRE_OPT,REF_SER,VIEW_MODE,TABLE_NAME_DET1,TABLE_NAME_DET2,TABLE_NAME_DET3,TAX_FORMS,SIGN_STATUS,USER_TRAN_WINDOW,CUSTOM_PREVIEW_OBJ,CHILDDATA_ARGOPT,IGNOREERRLIST_ONLOAD,EDIT_TMPLT,WRKFLW_INIT,FORMAL_ARGS,EDIT_OPT,AUDIT_TRAIL_OPT,EDITTAX,CACHE_OPT,OPTIMIZE_MODE,EDIT_EXPR,TRANSFER_MODE,RATE_COL,QTY_COL,RCP_CACHE_STATUS,PRINT_CONTROL,ITEM_SER_ACC_CODE,PROFILE_ID__RES,PERIOD_OPTION,TRAN_COMPL_MSG,WRKFLW_PRIORITY,EXEC_TYPE,DISP_META_DATA,START_FORM,ISATTACHMENT,ALLOW_ATTACH) 
values ('w_sorder_scheme','2','2','M',null,null,null,null,null,null,'N',sysdate,'Kunal','Kunal','0',null,null,null,null,null,null,null,null,null,'0','0','N',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'F',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'M',null,null,null,null,null,null,null);

Insert into TRANSETUP (TRAN_WINDOW,SAVE_FLAG,VAL_FLAG,KEY_FLAG,KEY_STRING,UDF_1,UDF_2,UDF_3,UDF_4,UDF_5,REPEATE_ADD,CHG_DATE,CHG_USER,CHG_TERM,EDI_OPTION,SITE_ACC_COL,CONFIRM_COL,CONFIRM_VAL,REPEAT_ADD_DET,LOAD_MODE,AUTO_CONFIRM,LEDG_POST_CONF,CHG_DATE_ON_CONF,TRAN_ID_COL,MAIL_OPTION,CONFIRM_MODE,GARBAGE_OPT,VAL_FLAG_EDI,VERIFY_PASSWORD,TABLE_NAME,APPLICATION,TABLE_DESC,TRAN_DATE_COL,SALES_PERS_ACC_COL,CUST_ACC_COL,SUPP_ACC_COL,ITEM_SER_ACC_COL,EMP_ACC_COL,WORKFLOW_OPT,TRAN_ID__FROM,TRAN_ID__TO,MULTITIRE_OPT,REF_SER,VIEW_MODE,TABLE_NAME_DET1,TABLE_NAME_DET2,TABLE_NAME_DET3,TAX_FORMS,SIGN_STATUS,USER_TRAN_WINDOW,CUSTOM_PREVIEW_OBJ,CHILDDATA_ARGOPT,IGNOREERRLIST_ONLOAD,EDIT_TMPLT,WRKFLW_INIT,FORMAL_ARGS,EDIT_OPT,AUDIT_TRAIL_OPT,EDITTAX,CACHE_OPT,OPTIMIZE_MODE,EDIT_EXPR,TRANSFER_MODE,RATE_COL,QTY_COL,RCP_CACHE_STATUS,PRINT_CONTROL,ITEM_SER_ACC_CODE,PROFILE_ID__RES,PERIOD_OPTION,TRAN_COMPL_MSG,WRKFLW_PRIORITY,EXEC_TYPE,DISP_META_DATA,START_FORM,ISATTACHMENT,ALLOW_ATTACH) 
values ('w_sorderdet_scheme','2','2','M',null,null,null,null,null,null,'N',sysdate,'Kunal','Kunal','0',null,null,null,null,null,null,null,null,null,'0','0','N',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'F',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'M',null,null,null,null,null,null,null);
-- 27/07/12
INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'SUCCAPSCH',
	'Scheme applied successfully',
	'Schemes applied successfully',
	'P',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE ');
-- 28/07/12
update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Pallet Number :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no</FIELD></FIELDS></MAPPING_SCAN></SCAN_INFO>'
where win_name = 'w_checksheet' and form_no = '2';

update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Pick Location:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="4"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>quantity</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_active_pick' and form_no = '3';

pdate obj_links set link_arg='sale_order.String,sale_order.String'
where obj_name='sorder' and target_obj_name='sorderscheme';

--Error Message for Duplicat Debit Memo in Sales Return Form

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 ('VTRETREFNO','Debit Memo Already Exists!','Debit Memo Already
exists for
Customer.','E','Y',null,null,null,to_timestamp('22-06-10','DD-MM-RR
HH12:MI:SSXFF AM'),'BASE      ','BASE           ',null,null);

--Column added to check private level in Sales Return Form

alter table customeritem add ret_flag char(1);

--Number of Article Type changed to number for Saes Return Form

ALTER TABLE SRETURN_FORM_DET MODIFY NO_ART NUMBER(15);
-- 30/07/12
update obj_forms 
set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Pick Location:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Number of Cases:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>no_art</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
disp_metadata = 'checkedImage@img<loc_code>, <item_code>,<lot_no>, <lot_sl>, <no_art>, <unit>'
where win_name = 'w_case_pick' and form_no = '3';

update obj_forms 
set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location From:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>New LPN:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl__new</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_active_repl_iss' and form_no = '2';

INSERT INTO obj_forms (	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata)
VALUES (
	'w_active_repl_iss',
	'Active Pick Location',
	NULL,
	NULL,
	'3',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Active Pick Location :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'<loc_code__to>');
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 (
	'CONVQTYNFD',
	'Convert factor not found',
	'Please enter convert quantity factor in UOMCONV table',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'sumit',
	'sumit',
	NULL,
	NULL);
	
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 (
	'SCANTYPE',
	'Handle basis is null',
	'Please enter handle basis in LOCATION master',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'sumit',
	'sumit',
	NULL,
	NULL);
	
commit;



DELETE FROM OBJ_FORMS WHERE win_name = 'w_checksheet' AND form_no ='2';
INSERT INTO OBJ_FORMS  (
	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata ,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata)
VALUES (
	'w_checksheet',
	'Detail',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Pallet / Carton Number :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no</FIELD></FIELDS></MAPPING_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img Pallet Number ------: <pallet_no> (item_code,lot_no,lot_sl,quantity)<item_list>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL);
	
delete from transetup where tran_window ='w_distroute';
INSERT INTO transetup (
	tran_window ,
	save_flag ,
	val_flag ,
	key_flag ,
	key_string ,
	udf_1 ,
	udf_2 ,
	udf_3,
	udf_4 ,
	udf_5 ,
	repeate_add,
	chg_date ,
	chg_user ,
	chg_term ,
	edi_option ,
	site_acc_col ,
	confirm_col ,
	confirm_val ,
	repeat_add_det ,
	repeatadddet ,
	load_mode ,
	auto_confirm ,
	ledg_post_conf ,
	chg_date_on_conf,
	tran_id_col ,
	mail_option ,
	confirm_mode,
	garbage_opt ,
	val_flag_edi ,
	verify_password ,
	cust_acc_col ,
	sales_pers_acc_col ,
	supp_acc_col ,
	item_ser_acc_code ,
	emp_acc_col ,
	item_ser_acc_col ,
	workflow_opt ,
	table_name ,
	application ,
	table_desc ,
	tran_date_col ,
	tran_id__from ,
	tran_id__to ,
	table_name_det1 ,
	table_name_det2 ,
	table_name_det3 ,
	multitire_opt ,
	ref_ser ,
	view_mode ,
	tax_forms,
	sign_status ,
	user_tran_window ,
	custom_preview_obj ,
	ignoreerrlist_onload ,
	childdata_argopt ,
	edit_tmplt ,
	wrkflw_init ,
	edittax ,
	formal_args ,
	audit_trail_opt ,
	edit_opt,
	cache_opt ,
	optimize_mode,
	edit_expr ,
	rate_col ,
	qty_col ,
	edit_expr_inp ,
	rcp_cache_status ,
	print_control ,
	transfer_mode ,
	profile_id__res ,
	tran_compl_msg ,
	period_option,
	wrkflw_priority ,
	exec_type ,
	disp_meta_data ,
	allow_attach ,
	start_form ,
	isattachment )
 VALUES (
	'w_distroute',
	'2',
	'2',
	'A',
	'seq05',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'N',
	sysdate,
	'BASE      ',
	'BASE           ',
	'0',
	NULL,
	NULL,
	NULL,
	'N',
	NULL,
	NULL,
	'N',
	'N',
	NULL,
	'DIST_ROUTE',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'DISTROUTE',
	'DIS',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'D-RTE',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	NULL,
	NULL,
	NULL,
	NULL,
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'M',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
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 (
	'STNCDFRBK ',
	'Invild Station Code From',
	'Station Code From should not be blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'Base      ',
	'Base           ',
	NULL,
	NULL);
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 (
	'STNCODTOBK',
	'Invalid Station Code to',
	'Station code To can not be blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'Base      ',
	'Base           ',
	NULL,
	NULL);
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 (
	'VFRAMTBK  ',
	'Invalid Frt Amount',
	' Freight Amount can not be blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'base      ',
	'base           ',
	NULL,
	NULL);
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 (
	'VTLOCINV  ',
	'Location Type not Found',
	'Entered Location type not found in Gencodes Master',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'Base      ',
	'Base           ',
	NULL,
	NULL);
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 (
	'VTMAXWTBK ',
	'Invalid Maiximum Weight',
	'Maximum Weight can not be Blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'Base      ',
	'Base           ',
	NULL,
	NULL);
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 (
	'VTMINWTBK ',
	'Invalid minimum weight',
	'Minimum Weight can not be Blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'Base      ',
	'Base           ',
	NULL,
	NULL);
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 (
	'VTPINFRBK ',
	'Invalid Pin Code From',
	'Pin Code From can not be blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'Base      ',
	'Base           ',
	NULL,
	NULL);
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 (
	'VTPINTOBK ',
	'Invalid Pin Code To',
	'Pin Code To can not be blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'Base      ',
	'Base           ',
	NULL,
	NULL);
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 (
	'VTSTAN    ',
	'Station To not Found',
	'Entered Station To not Exist in the Station master',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'Base      ',
	'Base           ',
	NULL,
	NULL);
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 (
	'VTSTATBK  ',
	'Invalid State Code From',
	'State Code From can not be Blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'Base      ',
	'Base           ',
	NULL,
	NULL);
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 (
	'VTSTATE2  ',
	'Staet Code To Not Found',
	'Entered State Code To not found in the state master',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'Base      ',
	'Base           ',
	NULL,
	NULL);
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 (
	'VTSTATEBK ',
	'Invalid State Code To',
	'State Code To can not be blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'Base      ',
	'Base           ',
	NULL,
	NULL);
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 (
	'VTFRVAL   ',
	'Invalid StancdFr,StatFrPinFr ',
	'Station Code From,State Code From, Pin Code From Should not be Blank  ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);
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 (
	'VTTOVAL   ',
	'Invalid StancdTo,StanToPinTo ',
	'Station Code To,State Code To, Pin Code To Should not be Blank  ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);
INSERT INTO obj_links (
	obj_name ,
	form_no ,
	field_name ,
	target_obj_name ,
	link_form_name ,
	link_title ,
	link_uri ,
	link_type ,
	link_arg ,
	update_flag ,
	link_name ,
	rights_char ,
	image )
 VALUES (
	'view_porcp_stock',
	'1',
	'item_code',
	'lock_code',
	'lock_code11',
	'Lock Code',
	NULL,
	'1',
	'item_code.String,site_code.String,loc_code.String,lot_no.String,lot_sl.String',
	'0',
	NULL,
	'*',
	NULL);

INSERT INTO transetup (
	tran_window,
	save_flag,
	val_flag,
	key_flag,
	key_string,
	repeate_add,
	chg_date,
	chg_user,
	chg_term,
	edi_option,
	site_acc_col,
	confirm_col,
	confirm_val,
	repeat_add_det,
	repeatadddet,
	auto_confirm,
	ledg_post_conf,
	tran_id_col,
	sales_pers_acc_col,
	supp_acc_col,
	item_ser_acc_code,
	emp_acc_col,
	item_ser_acc_col,
	workflow_opt,
	table_name,
	application,
	table_desc,ref_ser )
select 
	'w_porder_insert',
	save_flag,
	val_flag,
	key_flag,
	key_string,
	repeate_add,
	chg_date,
	chg_user,
	chg_term,
	edi_option,
	site_acc_col,
	confirm_col,
	confirm_val,
	repeat_add_det,
	repeatadddet,
	auto_confirm,
	ledg_post_conf,
	tran_id_col,
	sales_pers_acc_col,
	supp_acc_col,
	item_ser_acc_code,
	emp_acc_col,
	item_ser_acc_col,
	workflow_opt,
	table_name,
	application,
	table_desc,ref_ser  from transetup where tran_window = 'w_porder';

INSERT INTO obj_forms (
	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode)
select
	'w_porder_insert',
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode from obj_forms where win_name  ='w_porder';
	INSERT INTO obj_itemchange (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'sorder_scheme',
	'1',
	'itm_defaultedit',
	null);

INSERT INTO obj_itemchange (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'sorderdet_scheme',
	'1',
	'itm_defaultedit',
	null);

create or replace trigger SORDER_CHECK_SCHEME BEFORE
DELETE ON SORDER_SCHEME FOR EACH ROW
declare
ll_detcnt number(3) := 0;
BEGIN
select count(1) into ll_detcnt from despatch where sord_no=:old.tran_id;
if ll_detcnt > 0 then
  raise_application_error( -20601, 'Despatch already has been done for Sales Order');
  end if;
  END;
 /
  create or replace trigger SORDDET_CHECK_SCHEME BEFORE
DELETE ON SORDERDET_SCHEME FOR EACH ROW
declare
ll_detcnt number(3) := 0;
BEGIN
select count(1) into ll_detcnt from despatch where sord_no=:old.tran_id;
if ll_detcnt > 0 then
  raise_application_error( -20601, 'Despatch already has been done for Sales Order');
  end if;
  END;
/

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 (
	'VMSORDBK',
	'Invalid Sales Order',
	'Sales Order can not be Blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'kunal',
	'kunal',
	NULL,
	NULL);

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 (
	'VMSORDNT',
	'Invalid Sales Order',
	'Sales order number entered does not exist in Sales order ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'kunal',
	'kunal',
	NULL,
	NULL);

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 (
	'VMDESPSORD',
	'Invalid Sales Order',
	'Despatch already has been done for Sales Order',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'kunal',
	'kunal',
	NULL,
	NULL);




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 (
	'VMSORDLNNT',
	'Invalid Sales Order Line No',
	'Invalid Sales Order Line Number',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'kunal',
	'kunal',
	NULL,
	NULL);

--SELECTION MODE IMPLEMENTATION
ALTER TABLE OBJ_FORMS
ADD SELECTION_MODE CHAR(1);

--DEFAULT VIEW IMPLEMENTATION FOR FILTER FEEDS
ALTER TABLE OBJ_FORMS
ADD DEFAULT_VIEW CHAR(1);

-- <view> - A for ALL; S for Selected , U for Unselected.
--<obj_name>  - respective objname name
--<form_no> - respective form no
--UPDATE OBJ_FORMS SET DEFAULT_VIEW = <view> WHERE WIN_NAME = w_<obj_name> AND FORM_NO = <form_no> ; 
UPDATE OBJ_FORMS SET DEFAULT_VIEW = 'U' WHERE WIN_NAME =  'w_porcp_wiz' AND FORM_NO ='3'; 

UPDATE TRANSETUP SET SAVE_FLAG = 'A' WHERE TRAN_WINDOW = 'w_porcp_wiz';
	
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 (
	'VTQMM',
	'Invalid Quantity',
	'Quantity is not matching with ASN quantity',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'kunal',
	'kunal',
	NULL,
	NULL);
--31/07/12

delete from obj_links where obj_name='view_porcp_stock';

INSERT INTO obj_links(
	obj_name ,
	form_no ,
	field_name ,
	target_obj_name ,
	link_form_name ,
	link_title ,
	link_uri ,
	link_type ,
	link_arg ,
	update_flag ,
	link_name ,
	rights_char ,
	image )
 VALUES (
	'view_porcp_stock',
	'1',
	'item_code',
	'lock_code',
	'lock_code11',
	'Lock Code',
	NULL,
	'1',
	'item_code.String,site_code.String,loc_code.String,lot_no.String,lot_sl.String',
	'0',
	NULL,
	'*',
	NULL);
alter table  pallet_no add status char(1); 
delete from obj_forms where win_name = 'w_active_pick' and form_no = '4';

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 (
	'INVREPLORD',
	'Invalid task',
	'Invalid replenishment task',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'kunal',
	'kunal',
	NULL,
	NULL);
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 (
	'REPISSCNF1',
	'Invalid task',
	'Replenishment task is already complete',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'kunal',
	'kunal',
	NULL,
	NULL);
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 (
	'INVPICKORD',
	'Invalid pick task',
	'Pick task is already complete',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'kunal',
	'kunal',
	NULL,
	NULL);
--01/08/12
INSERT INTO refser (
	ref_ser,
	descr,
	type,
	sys_ser,
	prefix,
	chg_date,
	chg_user,
	chg_term,
	seq_name,
	tax_form_reqd,
	trans_type)
VALUES (
	'R-CAPK',
	'Case to Active Picking',
	'S',
	'R-CAPK',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'Base           ',
	NULL,
	NULL,
	NULL);
delete from obj_forms where win_name = 'w_active_repl_iss' and form_no = '4';
INSERT INTO obj_forms (	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata)
VALUES (
	'w_active_repl_iss',
	'Active Pick Location',
	NULL,
	NULL,
	'3',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Active Pick Location :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'<loc_code__to>');
delete from obj_actions where obj_name = 'active_repl_iss';
INSERT INTO obj_actions (obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
VALUES (
	'active_repl_iss',
	1,
	NULL,
	'Saving',
	NULL,
	NULL,
	'S',
	'Finish',
	'3',
	NULL,
	NULL,
	'U',
	NULL,
	TO_TIMESTAMP('8-05-2012 13:26:08','DD-MM-YYYY HH24:MI:SS'),
	'BASE           ',
	'Gulzar    ');
INSERT INTO obj_actions (obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
VALUES (
	'active_repl_iss',
	2,
	NULL,
	'Prev',
	'a',
	'a',
	'P',
	'Previous',
	'2',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions (obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
VALUES (
	'active_repl_iss',
	3,
	NULL,
	'Next',
	'a',
	'a',
	'N',
	'Next',
	'1',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions (obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
VALUES (
	'active_repl_iss',
	4,
	'confirm~normal.gif',
	'Confirming records',
	'pre_confirm',
	'a',
	'F',
	'Confirm',
	'2',
	'2',
	'1',
	'S',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions (obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
VALUES (
	'active_repl_iss',
	5,
	NULL,
	'Prev',
	NULL,
	NULL,
	'P',
	'Previous',
	'3',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions (obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
VALUES (
	'active_repl_iss',
	6,
	NULL,
	'Next',
	NULL,
	NULL,
	'N',
	'Next',
	'2',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
--02/08/12
update obj_forms set title = 'Stock to Dock'
where win_name = 'w_repl_iss_dock' and form_no = '2';
--02/08/12 Column added in Policy Master
alter table policymst add price_order varchar2(60);	
ALTER TABLE PORCPDET ADD PART_QTY NUMBER(14,3); 
--UPDATE OBJ_FORMS SET SCAN_METADATA= '<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>ASN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>asn_no</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Location Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>' WHERE WIN_NAME ='w_porcp_wiz' AND FORM_NO = 1;
--UPDATE OBJ_FORMS SET SCAN_METADATA= '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Number of Cases:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>no_art</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="3"><SCAN_LABEL>Partial Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>part_qty</FIELD></FIELDS></INPUT_SCAN></INPUT_SCAN><INPUT_SCAN ORDER="4"><SCAN_LABEL>Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>quantity</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>' WHERE WIN_NAME ='w_porcp_wiz' AND FORM_NO = 3;
--UPDATE OBJ_FORMS SET SCAN_METADATA= '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Number of Cases:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>no_art</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="3"><SCAN_LABEL>Partial Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>part_qty</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="4"><SCAN_LABEL>Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>quantity</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>' WHERE WIN_NAME ='w_porcp_wiz' AND FORM_NO = 3;

UPDATE  OBJ_FORMS SET disp_metadata = 'checkedImage@img Pallet Number ------: <pallet_no> (Item Code, Lot No, LPN No, Quantity)<item_list>' 
WHERE win_name = 'w_checksheet' AND form_no ='2';


--sql for delete confirm from form no 4 
INSERT INTO TRANSETUP (	tran_window,save_flag ,	val_flag ,	key_flag ,	key_string ,	repeate_add ,	chg_date ,	chg_user ,	chg_term ,	edi_option ,	workflow_opt 	) 
VALUES ('w_dock_tran',	'2',	'2',	'A',	'seq10',	'Y',	sysdate,	'chitranjan',	'chitranjan ',	'0',	'2'	);
insert into obj_actions (obj_name ,line_no ,description ,service_code ,	interactive ,rights_char ,title ,form_no ,action_type )
VALUES ('dock_tran',1,'Next','a','a','N','Next','1','U');
insert into obj_actions (obj_name ,line_no ,description ,service_code ,	interactive ,rights_char ,title ,form_no ,action_type )
VALUES ('dock_tran',2,'Previous','a','a','N','Prev','1','U');
INSERT INTO ITM2MENU (APPLICATION,	LEVEL_1,	LEVEL_2,	LEVEL_3,	LEVEL_4,	LEVEL_5,	WIN_NAME,	DESCR,	COMMENTS,	MENU_PATH,	ICON_PATH,	OBJ_TYPE,	CHG_USER,	CHG_TERM,	CHG_DATE,	OPEN_ICON,	CLOSE_ICON)
VALUES(	'WMS',	1,37,0,0,0,'w_dock_tran','Dock Transfer',null,	'WMS.1.37.0.0.0',	null,	'W',	null,	null,	null,	null,	null);
Insert Into system_events(obj_name ,	event_code ,event_context ,service_code ,method_rule ,	chg_date ,chg_user ,chg_term ,result_handle ,overwrite_core ,comp_type ,comp_name ,comm_format )
VALUES ('dock_tran','pre_validate',	'1','prv_default_ejb',NULL,	sysdate,'BASE ','BASE',	'2',	'0','EJB','PalletNoIC',	NULL);
insert into POPHELP (FIELD_NAME,MOD_NAME,SQL_STR,MSG_TITLE) VALUES('DOCK_TRAN','W_DOCK_TRAN','select pallet_no from pallet_no','E');
DELETE FROM obj_actions WHERE obj_name = 'active_pick' and line_no = '6' and service_code = 'pre_confirm';
insert into  obj_actions (obj_name ,line_no ,image ,description ,service_code ,	interactive ,rights_char ,title ,form_no ,service_handler ,placement ,action_type  )
VALUES ('active_pick',	6,'confirm~normal.gif',	'Confirming records','pre_confirm','a',	'F','Confirm','3','2',	'1',	'S');
DELETE FROM obj_actions WHERE obj_name = 'active_pick' and line_no = '5' and form_no = '4';
INSERT INTO obj_actions (obj_name ,line_no ,	description ,	rights_char ,	title ,	form_no ,action_type )  
VALUES ('active_pick',5,'Saving','S','Finish','3','U');
--SQL FOR ERROR MESSAGES
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 ('VTREPLISS2','Repacement is not don','Repacement order is not confirmed ','E',null,null,null,null,sysdate,'CHITRANJAN','BASE',null,null);
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 ('INVPLTNO1','Invalid pallat no','Pallat not exist in master ','E',null,null,null,null,sysdate,'CHITRANJAN','BASE',null,null);
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 ('INVPLTNO2','Invalid pallat no','Pallat not available for picking','E',null,null,null,null,sysdate,'CHITRANJAN','BASE',null,null);
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 ('NULLPLTNO1','PALLAT NO IS NULL','PLEASE ENTER PALLAT NO','E',null,null,null,null,sysdate,'CHITRANJAN','BASE',null,null);

ALTER TABLE LOCATION
ADD PHY_HAN_BASIS CHAR(1);

ALTER TABLE LOCATION ADD PHY_HAN_UOM CHAR(3);

ALTER TABLE PHYSCANDET ADD
PHY_INPUT NUMBER (14,3);

ALTER TABLE PHYSCANDET ADD CONV_FACT CHAR(3);

delete from obj_forms where win_name = 'w_dock_tran';

insert into obj_forms (	win_name ,
title,
form_no,
scr_flag,
scan_metadata,
disp_metadata,
assisted_mode )
VALUES ('w_dock_tran',
'Pallet Number',
'1',
'F',
'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Pallete Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no</FIELD></FIELDS></MAPPING_SCAN></SCAN_INFO>',
'checkedImage@img<pallate_no>',
'E');

insert into obj_forms (	win_name ,
title,
form_no,
scr_flag,
scan_metadata,
disp_metadata,
assisted_mode )
VALUES ('w_dock_tran',
'Transfer Location',
'2',
'T',
'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Destination Location:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></MAPPING_SCAN></SCAN_INFO>',
'checkedImage@img<loc_code__to>',
'E');
alter table item_lot_info
add alt_lot_no char(15);

insert into messages(
MSG_NO,         
MSG_STR ,       
MSG_DESCR,      
MSG_TYPE,
MSG_OPT,
chg_date,
chg_user,
chg_term
)
values(
'VMLOTINFVL',
'Invalid  Lot No',
'Item Code and Lot No Combination is duplicate',
'E',
'Y',
sysdate,
'base',
'base'
);

insert into messages(
MSG_NO,         
MSG_STR ,       
MSG_DESCR,      
MSG_TYPE,
MSG_OPT,
chg_date,
chg_user,
chg_term
)
values(
'VMLOTINFVL',
'Invalid Alternate Lot No',
'Item Code and Alternate Lot No Combination is duplicate',
'E',
'Y',
sysdate,
'base',
'base'
);
ALTER  TABLE DESPATCHDET ADD PALLET_NO   VARCHAR2(25);
update itm2menu set descr = 'Sale Order Scheme' where win_name = 'w_sorder_scheme';
update itm2menu set descr = 'Sale Order Detail Scheme' where win_name = 'w_sorderdet_scheme';

delete from itm2menu where win_name='W_INV_HOLD_REL_GEN';

delete from system_events where obj_name = 'inv_hold_rel_gen';

delete from obj_forms where win_name ='W_INV_HOLD_REL_GEN';

delete from obj_actions where obj_name = 'inv_hold_rel_gen';

Insert into itm2menu (APPLICATION,LEVEL_1,LEVEL_2,LEVEL_3,LEVEL_4,LEVEL_5,WIN_NAME,DESCR,COMMENTS,MENU_PATH,ICON_PATH,CLOSE_ICON,OPEN_ICON,OBJ_TYPE,CHG_DATE,CHG_TERM,CHG_USER,MOB_DEPLOY)
 values ('WMS',1,30,0,0,0,'w_inv_hold_rel_gen','InvHoldRelGen',null,'WMS.1.30.0.0.0',null,null,null,'P',null,null,null,null);

Insert into transetup (TRAN_WINDOW,SAVE_FLAG,VAL_FLAG,KEY_FLAG,KEY_STRING,UDF_1,UDF_2,UDF_3,UDF_4,UDF_5,REPEATE_ADD,CHG_DATE,CHG_USER,CHG_TERM,EDI_OPTION,SITE_ACC_COL,CONFIRM_COL,CONFIRM_VAL,REPEAT_ADD_DET,REPEATADDDET,LOAD_MODE,AUTO_CONFIRM,LEDG_POST_CONF,CHG_DATE_ON_CONF,TRAN_ID_COL,MAIL_OPTION,CONFIRM_MODE,GARBAGE_OPT,VAL_FLAG_EDI,VERIFY_PASSWORD,CUST_ACC_COL,SALES_PERS_ACC_COL,SUPP_ACC_COL,ITEM_SER_ACC_CODE,EMP_ACC_COL,ITEM_SER_ACC_COL,WORKFLOW_OPT,TABLE_NAME,APPLICATION,TABLE_DESC,TRAN_DATE_COL,TRAN_ID__FROM,TRAN_ID__TO,TABLE_NAME_DET1,TABLE_NAME_DET2,TABLE_NAME_DET3,MULTITIRE_OPT,REF_SER,VIEW_MODE,TAX_FORMS,SIGN_STATUS,USER_TRAN_WINDOW,CUSTOM_PREVIEW_OBJ,IGNOREERRLIST_ONLOAD,CHILDDATA_ARGOPT,EDIT_TMPLT,WRKFLW_INIT,EDITTAX,FORMAL_ARGS,AUDIT_TRAIL_OPT,EDIT_OPT,CACHE_OPT,OPTIMIZE_MODE,EDIT_EXPR,RATE_COL,QTY_COL,EDIT_EXPR_INP,RCP_CACHE_STATUS,PRINT_CONTROL,TRANSFER_MODE,PROFILE_ID__RES,TRAN_COMPL_MSG,PERIOD_OPTION,WRKFLW_PRIORITY,EXEC_TYPE,DISP_META_DATA,ALLOW_ATTACH,START_FORM,ISATTACHMENT) 
values ('w_inv_hold_rel_gen','2','2','A','seq10',null,null,null,null,null,'N',sysdate,'BASE','Base','0',null,null,'Y','N',null,null,null,null,null,'tran_id',null,null,null,null,null,null,null,null,null,null,null,'0','inv_hold',null,null,null,null,null,null,null,null,null,'INV-HO',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'M',null,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 ('inv_hold_rel_gen','get_data','1','agetData_inv_hold_rel_gen',null,'0',sysdate,'BASE','BASE','2','EJB','InvHoldRelGen',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 ('inv_hold_rel_gen','process','1','prc_inv_hold_rel',null,'0',sysdate,'BASE','BASE','2','EJB','InvHoldRelGen',null);

Insert into obj_forms (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_inv_hold_rel_gen','header',null,null,null,null,null,null,'1',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);

Insert into obj_forms (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_inv_hold_rel_gen','Data',null,null,null,null,null,null,'2',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);

Insert into obj_actions (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('inv_hold_rel_gen',7,null,'Action Button for getting data','get_data','a','R','GetData','2','3',null,'U',null,null,null,null);

Insert into obj_actions (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('inv_hold_rel_gen',8,null,'Action Button for processing the data','process','a','R','Process','2','3',null,'U',null,null,null,null);

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 ('VMSCDTFRNU','Sch. Rel. Date From Null','Please Enter Schedule Release Date From. ','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

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 ('SCDTTOINV','Sch. Rel. Date To Invalid','Schedule Release Date To must be greater than Schedule Release Date From. ','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

update obj_forms set assisted_mode = 'E' where win_name ='w_active_repl_iss' and form_no ='3';

INSERT INTO system_events (obj_name ,event_code ,event_context ,service_code ,overwrite_core ,chg_date ,chg_user ,chg_term ,result_handle ,comp_type ,comp_name	) VALUES ('dock_tran','post_save','1','pos_pick_iss','0',sysdate,'chitranjan','BASE','2','EJB','DockTranPos');
insert into  obj_actions(obj_name ,line_no ,image ,description ,service_code ,	interactive ,rights_char ,title ,form_no ,service_handler ,placement ,action_type  )
VALUES ('dock_tran',	5,'confirm~normal.gif',	'Confirming records','pre_confirm','a',	'F','Finish','2','2',	'1',	'S');
-- 07/08/12

--IF not executed then execute following SQLs 
--SELECTION MODE IMPLEMENTATION
--ALTER TABLE OBJ_FORMS
--ADD SELECTION_MODE CHAR(1);

--DEFAULT VIEW IMPLEMENTATION FOR FILTER FEEDS
--ALTER TABLE OBJ_FORMS
--ADD DEFAULT_VIEW CHAR(1);

-- <view> - A for ALL; S for Selected , U for Unselected.
--<obj_name>  - respective objname name
--<form_no> - respective form no
--UPDATE OBJ_FORMS SET DEFAULT_VIEW = <view> WHERE WIN_NAME = w_<obj_name> AND FORM_NO = <form_no> ; 
--UPDATE OBJ_FORMS SET DEFAULT_VIEW = 'U' WHERE WIN_NAME =  'w_porcp_wiz' AND FORM_NO ='3'; 

--For AutoSave - form level saving.
UPDATE TRANSETUP SET SAVE_FLAG = 'A' WHERE TRAN_WINDOW = 'w_porcp_wiz';
-----HEADER_FORM_NO
ALTER TABLE TRANSETUP 
ADD ( HEADER_FORM_NO VARCHAR2(10)	);	--	Indicates START FORM number for TranID generation started from this form number in wizard i.e. TranID generation entry form
update transetup set HEADER_FORM_NO = '2' where tran_window = 'w_porcp_wiz';
UPDATE OBJ_FORMS SET SCR_FLAG = 'T' WHERE WIN_NAME='w_active_repl_iss' and
form_no=3;

--Added for Receiving points [request id :WM2DSUN001] [START]
UPDATE OBJ_FORMS SET SCAN_METADATA= '<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>ASN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>asn_no</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Location Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>' WHERE WIN_NAME ='w_porcp_wiz' AND FORM_NO = 1;
UPDATE OBJ_FORMS SET SCAN_METADATA= '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Number of Cases:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>no_art</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="3"><SCAN_LABEL>Partial Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>part_qty</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="4"><SCAN_LABEL>Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>quantity</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>' WHERE WIN_NAME ='w_porcp_wiz' AND FORM_NO = 3;

INSERT INTO DISPARM 
(
	PRD_CODE,                                                                                                                                                                                        
	VAR_NAME,                                                                                                                                                                                     
	VAR_TYPE ,                                                                                                                                                                                        
	VAR_VALUE ,                                                                                                                                                                                
	DESCR ,                                                                                                                                                                                 
	VAR_SUBS,                                                                                                                                                                                     
	CHG_DATE ,                                                                                                                                                                                          
	CHG_USER ,                                                                                                                                                                                      
	CHG_TERM
)
VALUES
(
	'999999',
	'MAINTAIN_LOT_MASTER',
	'S',
	'Y',
	'For maintaining lot master ie. ITEM_LOT_INFO',
	NULL,
	sysdate,
	'BASE',
	'BASE'
);

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
(
	'INVLOTNMST',
	'Invalid Lot No',
	'Lot No Does not exist in lot master ',
	'E',
	NULL,
	NULL,
	NULL,
	NULL,
	sysdate,
	'BASE',
	'BASE',
	NULL,
	NULL
);

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
(
	'VTNTCNF',
	'Receipt can not be confirm',
	'Receipt can not be confirm as Quantity is not matching with ASN quantity',
	'P',
	NULL,
	NULL,
	NULL,
	NULL,
	sysdate,
	'BASE',
	'BASE',
	NULL,
	NULL
);

UPDATE MESSAGES SET MSG_DESCR ='Quantity is greater than ASN quantity' WHERE MSG_NO ='VTQMM';

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
(
	'NULLLOCCD',
	'Location Code can not be null',
	'Location Code can not be null , Please specify appropriate location code ',
	'E',
	NULL,
	NULL,
	NULL,
	NULL,
	sysdate,
	'BASE',
	'BASE',
	NULL,
	NULL
);


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
(
	'NULLLPNNO',
	'LPN No can not be null',
	'LPN No can not be null , Please specify appropriate LPN Number ',
	'E',
	NULL,
	NULL,
	NULL,
	NULL,
	sysdate,
	'BASE',
	'BASE',
	NULL,
	NULL
);
--Added for Receiving points [request id :WM2DSUN001] [END]

--Added for Active Replenishment Issue for request [WM1ESUN007] on 08/08/12

UPDATE OBJ_FORMS SET SCR_FLAG = 'T' WHERE WIN_NAME='w_active_repl_iss' and form_no=3;

UPDATE OBJ_FORMS SET 
SCAN_METADATA = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>LPN:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Active Pick Location :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>', 
DISP_METADATA = 'checkedImage@img<loc_code> <item_code>, <lot_no>, <lot_sl>'
WHERE WIN_NAME='w_active_repl_iss' and form_no=3;

--INSERT NEW RECORDS FOR PHYSICAL ITEM SCAN MANUALLY TRANSACTION on 08/08/12

Insert into ITM2MENU (APPLICATION,LEVEL_1,LEVEL_2,LEVEL_3,LEVEL_4,LEVEL_5,WIN_NAME,DESCR,COMMENTS,MENU_PATH,ICON_PATH,CLOSE_ICON,OPEN_ICON,OBJ_TYPE,CHG_DATE,CHG_TERM,CHG_USER,MOB_DEPLOY) 
values ('WMS',1,31,0,0,0,'w_phy_item_mscan','Physical Item Scan Manually','Physical Item Scan Manually','WMS.1.31.0.0.0','e12_logo.gif',null,null,'W',null,'MAHESH','Mahesh',null);

Insert into TRANSETUP (TRAN_WINDOW,SAVE_FLAG,VAL_FLAG,KEY_FLAG,KEY_STRING,UDF_1,UDF_2,UDF_3,UDF_4,UDF_5,REPEATE_ADD,CHG_DATE,CHG_USER,CHG_TERM,EDI_OPTION,SITE_ACC_COL,CONFIRM_COL,CONFIRM_VAL,REPEAT_ADD_DET,REPEATADDDET,LOAD_MODE,AUTO_CONFIRM,LEDG_POST_CONF,CHG_DATE_ON_CONF,TRAN_ID_COL,MAIL_OPTION,CONFIRM_MODE,GARBAGE_OPT,VAL_FLAG_EDI,VERIFY_PASSWORD,CUST_ACC_COL,SALES_PERS_ACC_COL,SUPP_ACC_COL,ITEM_SER_ACC_CODE,EMP_ACC_COL,ITEM_SER_ACC_COL,WORKFLOW_OPT,TABLE_NAME,APPLICATION,TABLE_DESC,TRAN_DATE_COL,TRAN_ID__FROM,TRAN_ID__TO,TABLE_NAME_DET1,TABLE_NAME_DET2,TABLE_NAME_DET3,MULTITIRE_OPT,REF_SER,VIEW_MODE,TAX_FORMS,SIGN_STATUS,USER_TRAN_WINDOW,CUSTOM_PREVIEW_OBJ,IGNOREERRLIST_ONLOAD,CHILDDATA_ARGOPT,EDIT_TMPLT,WRKFLW_INIT,EDITTAX,FORMAL_ARGS,AUDIT_TRAIL_OPT,EDIT_OPT,CACHE_OPT,OPTIMIZE_MODE,EDIT_EXPR,RATE_COL,QTY_COL,EDIT_EXPR_INP,RCP_CACHE_STATUS,PRINT_CONTROL,TRANSFER_MODE,PROFILE_ID__RES,TRAN_COMPL_MSG,PERIOD_OPTION,WRKFLW_PRIORITY,EXEC_TYPE,DISP_META_DATA,ALLOW_ATTACH,START_FORM,ISATTACHMENT) 
values ('w_phy_item_mscan','2','2','A','seq10',null,null,null,null,null,'N','09-JUN-12','Mahesh','Mahesh','0','site_code','CONFIRMED','Y',null,null,null,null,null,null,'TRAN_ID','0','0','N',null,null,null,null,null,null,null,null,null,'PHYSCAN','WMS',null,null,null,null,null,null,null,null,'PSCAN','F',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'M',null,null,null,null,null,null);

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_phy_item_mscan','Physical Item Scan',null,null,null,null,null,null,'1','F',null,null,'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Task Type:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>inv_stat</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,null,null,null,null,'E',null,null,null);

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_phy_item_mscan','Detail',null,null,null,null,null,null,'2','T',null,null,'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN NO:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Scan Item Code-Lot No:</SCAN_LABEL><FIELDS SEPARATOR="D" DELIMITER="-"><FIELD ORDER="1">item_code</FIELD><FIELD ORDER="2">lot_no</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Case Count:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>phy_input</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,'checkedImage@img<descr>(<item_code>),<loc_code>,<lot_no>,<lot_sl>',null,null,null,'E',null,null,null);

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('phy_item_mscan',1,null,'Saving',null,null,'S','Finish','3',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('phy_item_mscan',2,null,'Prev','a','a','P','Next','2',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('phy_item_mscan',3,null,'Next','a','a','N','Next','2',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('phy_item_mscan',4,null,'Prev','a','a','P','Prev','3',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('phy_item_mscan',5,'confirm~normal.gif','Confirming records','pre_confirm','a','F','Confirm','3','2','1','S',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('phy_item_mscan',6,null,'Next',null,null,'N','Next','1',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

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 ('phy_item_mscan','default_data_wiz','1','phy_scan_default_data',null,'0','03-AUG-12','Mahesh','BASE','2','EJB','MPhyItemScanIC',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 ('phy_item_mscan','pre_validate','1','prv_phy_scan',null,'0','03-AUG-12','Mahesh','BASE','2','EJB','MPhyItemScanIC',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 ('phy_item_mscan','pre_navigate_next','1','prv_phy_scan',null,'0','03-AUG-12','Mahesh','BASE','2','EJB','MPhyItemScanIC',null);

update obj_forms 
set
scan_metadata='<SCAN_INFO> <MAPPING_SCAN ORDER="1"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>	item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>LPN NO:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN></SCAN_INFO>'
where win_name = 'w_phy_item_mscan' and form_no='2';


update obj_forms 
set
scan_metadata='<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_phy_item_mscan' and form_no='1';



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 ('phy_item_mscan','post_save','1','pos_phy_scan',null,'0','08-MAY-12','Mahesh','BASE','2','EJB','MPhyItemScanPos',null);

Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,RETURN_XFRM_XSL,CHG_DATE,CHG_USER,CHG_TERM) 
values ('pos_phy_scan','Validation','http://localhost:9090/axis/services/ValidatorService','BASE','postSave','String','S',null,null, EMPTY_BLOB(),'08-MAY-12','Mahesh','BASE');

Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_phy_scan',1,'COMPONENT_TYPE','I',null,'S',null,'08-MAY-12','Mahesh','Mahesh','EJB');

Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_phy_scan',2,'COMPONENT_NAME','I',null,'S',null,'08-MAY-12','Mahesh','Mahesh','MPhyItemScanPos');

Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_phy_scan',3,'XML_DATA_ALL','I',null,'S',null,'08-MAY-12','Mahesh','Mahesh',null);

Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_phy_scan',4,'<tran_id>','I',null,'B.String',null,'08-MAY-12','Mahesh','Mahesh',null);

Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_phy_scan',5,'EDIT_FLAG','I',null,'S',null,'08-MAY-12','Mahesh','Mahesh',null);

Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_phy_scan',6,'XTRA_PARAMS','I',null,'S',null,'08-MAY-12','Mahesh','Mahesh',null);

Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_phy_scan',7,'DB_CONN','I',null,'S.Connection',null,'08-MAY-12','Mahesh','Mahesh',null);

--INSERT NEW RECORDS FOR PHYSICAL ITEM SCAN MANUALLY TRANSACTION on 08/08/12

Insert into ITM2MENU (APPLICATION,LEVEL_1,LEVEL_2,LEVEL_3,LEVEL_4,LEVEL_5,WIN_NAME,DESCR,COMMENTS,MENU_PATH,ICON_PATH,CLOSE_ICON,OPEN_ICON,OBJ_TYPE,CHG_DATE,CHG_TERM,CHG_USER,MOB_DEPLOY) 
values ('WMS',1,31,0,0,0,'w_phy_item_mscan','Physical Item Scan Manually','Physical Item Scan Manually','WMS.1.31.0.0.0','e12_logo.gif',null,null,'W',null,'MAHESH','Mahesh',null);

Insert into TRANSETUP (TRAN_WINDOW,SAVE_FLAG,VAL_FLAG,KEY_FLAG,KEY_STRING,UDF_1,UDF_2,UDF_3,UDF_4,UDF_5,REPEATE_ADD,CHG_DATE,CHG_USER,CHG_TERM,EDI_OPTION,SITE_ACC_COL,CONFIRM_COL,CONFIRM_VAL,REPEAT_ADD_DET,REPEATADDDET,LOAD_MODE,AUTO_CONFIRM,LEDG_POST_CONF,CHG_DATE_ON_CONF,TRAN_ID_COL,MAIL_OPTION,CONFIRM_MODE,GARBAGE_OPT,VAL_FLAG_EDI,VERIFY_PASSWORD,CUST_ACC_COL,SALES_PERS_ACC_COL,SUPP_ACC_COL,ITEM_SER_ACC_CODE,EMP_ACC_COL,ITEM_SER_ACC_COL,WORKFLOW_OPT,TABLE_NAME,APPLICATION,TABLE_DESC,TRAN_DATE_COL,TRAN_ID__FROM,TRAN_ID__TO,TABLE_NAME_DET1,TABLE_NAME_DET2,TABLE_NAME_DET3,MULTITIRE_OPT,REF_SER,VIEW_MODE,TAX_FORMS,SIGN_STATUS,USER_TRAN_WINDOW,CUSTOM_PREVIEW_OBJ,IGNOREERRLIST_ONLOAD,CHILDDATA_ARGOPT,EDIT_TMPLT,WRKFLW_INIT,EDITTAX,FORMAL_ARGS,AUDIT_TRAIL_OPT,EDIT_OPT,CACHE_OPT,OPTIMIZE_MODE,EDIT_EXPR,RATE_COL,QTY_COL,EDIT_EXPR_INP,RCP_CACHE_STATUS,PRINT_CONTROL,TRANSFER_MODE,PROFILE_ID__RES,TRAN_COMPL_MSG,PERIOD_OPTION,WRKFLW_PRIORITY,EXEC_TYPE,DISP_META_DATA,ALLOW_ATTACH,START_FORM,ISATTACHMENT) 
values ('w_phy_item_mscan','2','2','A','seq10',null,null,null,null,null,'N','09-JUN-12','Mahesh','Mahesh','0','site_code','CONFIRMED','Y',null,null,null,null,null,null,'TRAN_ID','0','0','N',null,null,null,null,null,null,null,null,null,'PHYSCAN','WMS',null,null,null,null,null,null,null,null,'PSCAN','F',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'M',null,null,null,null,null,null);

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_phy_item_mscan','Physical Item Scan',null,null,null,null,null,null,'1','F',null,null,'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Task Type:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>inv_stat</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,null,null,null,null,'E',null,null,null);

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_phy_item_mscan','Detail',null,null,null,null,null,null,'2','T',null,null,'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN NO:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Scan Item Code-Lot No:</SCAN_LABEL><FIELDS SEPARATOR="D" DELIMITER="-"><FIELD ORDER="1">item_code</FIELD><FIELD ORDER="2">lot_no</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Case Count:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>phy_input</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,'checkedImage@img<descr>(<item_code>),<loc_code>,<lot_no>,<lot_sl>',null,null,null,'E',null,null,null);

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('phy_item_mscan',1,null,'Saving',null,null,'S','Finish','3',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('phy_item_mscan',2,null,'Prev','a','a','P','Next','2',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('phy_item_mscan',3,null,'Next','a','a','N','Next','2',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('phy_item_mscan',4,null,'Prev','a','a','P','Prev','3',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('phy_item_mscan',5,'confirm~normal.gif','Confirming records','pre_confirm','a','F','Confirm','3','2','1','S',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('phy_item_mscan',6,null,'Next',null,null,'N','Next','1',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

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 ('phy_item_mscan','default_data_wiz','1','phy_scan_default_data',null,'0','03-AUG-12','Mahesh','BASE','2','EJB','MPhyItemScanIC',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 ('phy_item_mscan','pre_validate','1','prv_phy_scan',null,'0','03-AUG-12','Mahesh','BASE','2','EJB','MPhyItemScanIC',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 ('phy_item_mscan','pre_navigate_next','1','prv_phy_scan',null,'0','03-AUG-12','Mahesh','BASE','2','EJB','MPhyItemScanIC',null);

update obj_forms 
set
scan_metadata='<SCAN_INFO> <MAPPING_SCAN ORDER="1"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>	item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>LPN NO:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN></SCAN_INFO>'
where win_name = 'w_phy_item_mscan' and form_no='2';


update obj_forms 
set
scan_metadata='<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_phy_item_mscan' and form_no='1';

update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>LPN NO:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Physical Input:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>phy_input</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>' where win_name = 'w_phy_item_mscan' and form_no = 2;


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 ('phy_item_mscan','post_save','1','pos_phy_scan',null,'0','08-MAY-12','Mahesh','BASE','2','EJB','MPhyItemScanPos',null);

Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,RETURN_XFRM_XSL,CHG_DATE,CHG_USER,CHG_TERM) 
values ('pos_phy_scan','Validation','http://localhost:9090/axis/services/ValidatorService','BASE','postSave','String','S',null,null, EMPTY_BLOB(),'08-MAY-12','Mahesh','BASE');

Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_phy_scan',1,'COMPONENT_TYPE','I',null,'S',null,'08-MAY-12','Mahesh','Mahesh','EJB');

Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_phy_scan',2,'COMPONENT_NAME','I',null,'S',null,'08-MAY-12','Mahesh','Mahesh','MPhyItemScanPos');

Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_phy_scan',3,'XML_DATA_ALL','I',null,'S',null,'08-MAY-12','Mahesh','Mahesh',null);

Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_phy_scan',4,'<tran_id>','I',null,'B.String',null,'08-MAY-12','Mahesh','Mahesh',null);

Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_phy_scan',5,'EDIT_FLAG','I',null,'S',null,'08-MAY-12','Mahesh','Mahesh',null);

Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_phy_scan',6,'XTRA_PARAMS','I',null,'S',null,'08-MAY-12','Mahesh','Mahesh',null);

Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_phy_scan',7,'DB_CONN','I',null,'S.Connection',null,'08-MAY-12','Mahesh','Mahesh',null);
-- 09/08/12  from SUN
ALTER TABLE LOCATION ADD DROP_GROUP CHAR(5);

CREATE OR REPLACE FUNCTION FN_DROPGROUP(VAL_INV_STAT IN CHAR, VAL_DROP_GROUP IN CHAR )
RETURN NUMBER IS LS_NUM NUMBER ;
   LS_CNT NUMBER;
BEGIN
 BEGIN
   IF( VAL_INV_STAT = 'DSO') THEN
		SELECT  COUNT(*) INTO LS_CNT FROM LOCATION WHERE LOC_GROUP = VAL_DROP_GROUP AND INV_STAT = 'PND';
		IF (LS_CNT  > 0 ) THEN
			LS_NUM := 1 ;
		ELSE
			LS_NUM := 0;
		END IF ;
    ELSE
       LS_NUM := 2;
    END IF ;
EXCEPTION
WHEN NO_DATA_FOUND  THEN
LS_NUM := 3 ;
END;
RETURN LS_NUM ;
END ;
/

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 (
	'DROP_GROUP',
	'W_LOCATION',
	'Drop group can not be blank for DSO',
	'NULORINVDG',
	'Y',
	'C',
	'SELECT (CASE WHEN FN_DROPGROUP( ? , ? ) = 0 THEN 0 ELSE 1 END) FROM DUAL',
	'1',
	'Q',
	TO_DATE('10-07-2012 17:22:50','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	':0.inv_stat,:0.drop_group',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);


INSERT INTO POPHELP (
	field_name,
	mod_name,
	sql_str,
	dw_object,
	msg_title,
	width,
	height,
	chg_date,
	chg_user,
	chg_term,
	dist_opt,
	filter_string,
	sql_input,
	default_col,
	pop_align,
	query_mode,
	page_context,
	pophelp_cols,
	pophelp_source,
	multi_opt,
	help_option)
VALUES (
	'DROP_GROUP',
	'W_LOCATION',
	'SELECT DISTINCT LOC_GROUP FROM LOCATION',
	NULL,
	NULL,
	0,
	0,
	TO_DATE('1-08-2012 13:02:10','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);


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 (
	'NULORINVDG',
	'Null or invalid DROP Group',
	'If inventory status is ''DSO'' then Drop group should not be null or invalid',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('8-08-2012 15:27:48','DD-MM-YYYY HH24:MI:SS'),
	'sumit     ',
	'sumit          ',
	NULL,
	NULL);
INSERT INTO refser (
	ref_ser,
	descr,
	type,
	sys_ser,
	prefix,
	chg_date,
	chg_user,
	chg_term,
	seq_name,
	tax_form_reqd,
	trans_type)
VALUES (
	'R-DSA ',
	'Case to Active Picking',
	'S',
	'R-DSA ',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'Base           ',
	NULL,
	NULL,
	NULL);
insert into disparm (prd_code,var_name,var_type,var_value,descr,var_subs,chg_date,chg_user,chg_term) 
values ('999999','STAGING_LOC','S','INTR','STAGING LOCATION',0,SYSDATE,'BASE','BASE');	
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 (
	'dock_tran',
	'default_data_wiz',
	'1',
	'poic_default_ejb',
	NULL,
	'0',
	TO_TIMESTAMP('8-05-2012 13:26:06','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	'2',
	'EJB',
	'PalletNoIC',
	NULL);

update transetup set audit_trail_opt = '0'
where tran_window = 'w_dock_tran';

--added on 09/08/12 for update obj_form for win name w_phy_item_mscan

update obj_forms set   SCAN_METADATA = '<SCAN_INFO><MAPPING_SCAN
ORDER="1"><SCAN_LABEL>LPN NO:</SCAN_LABEL><FIELDS SEPARATOR=""
DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN>
<MAPPING_SCAN
ORDER="2"><SCAN_LABEL>Scan Item Code-Lot No</SCAN_LABEL>
<FIELDS SEPARATOR="D" DELIMITER="-">
<FIELD ORDER="1">item_code</FIELD>
<FIELD ORDER="2">lot_no</FIELD></FIELDS></MAPPING_SCAN>
<INPUT_SCAN
ORDER="1"><SCAN_LABEL>Physical Input:</SCAN_LABEL><FIELDS SEPARATOR=""
DELIMITER=""><FIELD>phy_input</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>' WHERE WIN_NAME ='w_phy_item_mscan' AND FORM_NO =2;

--added by chitranjan pandey on 09/08/12 for dock transfer  
update transetup set key_flag = 'M' where tran_window = 'w_dock_tran';
update transetup set repeate_add = 'N' where tran_window = 'w_dock_tran';
update transetup set PERIOD_OPTION = 'M' where tran_window = 'w_dock_tran';
update transetup set garbage_opt = 'N' where tran_window = 'w_dock_tran';
update system_events set service_code = 'prso_load' where obj_name
='dock_tran' and event_code = 'post_save';
update obj_actions set action_type = 'U' where obj_name = 'dock_tran' and
form_no = '2' and line_no = '5';
update obj_actions set rights_char = 'N' where obj_name = 'dock_tran' and
line_no = '2';
--system entry for itemchange ejb
NSERT INTO system_events (obj_name ,event_code ,event_context
,service_code ,overwrite_core ,chg_date ,chg_user ,chg_term
,result_handle ,comp_type ,comp_name )
VALUES('dock_tran','default_data_wiz','1','pick_iss_default_data','0',sysdate,'chitranjan','BASE','2','EJB','PalletNoIC');

ALTER TABLE inv_lock ADD std_days number(3);


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 ('VTINQTY09','quantity is zero','quantity against item code,site code,lot no,lot sl in stock should be greater than zero.','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

update messages set MSG_STR = 'Invalid Quantity.'  WHERE MSG_NO='VTINQTY09';
update messages set MSG_DESCR ='Quantity against item code, site code, lot no, lot sl in stock should be greater than zero.'  WHERE MSG_NO='VTINQTY09';

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 ('VMINVITMST','Invalid Item','Stock not found for this Item, Enter valid Item.','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

update system_service_args set arg_name = 'XML_DATA__ALL' where service_code =  'prv_master_pack' and line_no = 3; 
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 ('VMINVITMST','Invalid Item','Stock not found for this Item, Enter valid Item.','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

--Added By Manoj Sharma dtd 11/08/12 to remove error in Background Processing
ALTER TABLE BACKGROUND_JOB ADD QUEUE_ID                                CHAR(15) ;
ALTER TABLE BACKGROUND_JOB ADD LOGIN_SITE                              CHAR(5);

--Added by Manoj Sharma dtd 11/08/12 to add Location Zone in Location Master and Item Master
ALTER TABLE LOCATION ADD LOC_ZONE NUMBER(3);
ALTER TABLE ITEM ADD LOC_ZONE__PREF NUMBER(3);

--Added By Manoj Sharma dtd 11/08/12 to Add Cycle Criteria to Item Master
ALTER TABLE ITEM ADD CYCLE_CRITERIA CHAR(1);
-- 13/08/12

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 (
	'REPISSCNF1',
	'Task is Done',
	'The Task is already Completed',
	'E',
	'Y',
	NULL,
	NULL,
	' ',
	sysdate,
	'Base',
	'Base',
	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 (
	'case_pick',
	'pre_navigate_next',
	'1',
	'prv_pick_iss',
	NULL,
	'0',
	sysdate,
	'Gulzar    ',
	'BASE',
	'2',
	'EJB',
	'PickIssIC',
	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 (
	'repl_iss',
	'pre_navigate_next',
	'1',
	'prv_repl_iss',
	NULL,
	'0',
	 sysdate,
	'Gulzar    ',
	'BASE',
	'2',
	'EJB',
	'ReplIssIC',
	NULL);
alter table wave_task_det add wave_status char(1);
delete from obj_actions where obj_name = 'shipment' and service_code = 'pre_confirm';


--added on 13/08/12 
update transetup set save_flag = 'A' where tran_window = 'w_phy_item_mscan'

ALTER TABLE WAVE_TASK ADD HOLD_STATUS CHAR(1);

alter table packing 
add 
(
	length number(14,3),
	width number(14,3),
	height number(14,3) 
);

--added on 14/08/12 for physical item verification

Insert into ITM2MENU (APPLICATION,LEVEL_1,LEVEL_2,LEVEL_3,LEVEL_4,LEVEL_5,WIN_NAME,DESCR,COMMENTS,MENU_PATH,ICON_PATH,CLOSE_ICON,OPEN_ICON,OBJ_TYPE,CHG_DATE,CHG_TERM,CHG_USER,MOB_DEPLOY) 
values ('WMS',1,37,0,0,0,'w_phy_scan_verify','Physical Scan Verification','Physical Scan Verification','WMS.1.37.0.0.0','e12_logo.gif',null,null,'W',null,'BASE','Mahesh',null);

Insert into TRANSETUP (TRAN_WINDOW,SAVE_FLAG,VAL_FLAG,KEY_FLAG,KEY_STRING,UDF_1,UDF_2,UDF_3,UDF_4,UDF_5,REPEATE_ADD,CHG_DATE,CHG_USER,CHG_TERM,EDI_OPTION,SITE_ACC_COL,CONFIRM_COL,CONFIRM_VAL,REPEAT_ADD_DET,REPEATADDDET,LOAD_MODE,AUTO_CONFIRM,LEDG_POST_CONF,CHG_DATE_ON_CONF,TRAN_ID_COL,MAIL_OPTION,CONFIRM_MODE,GARBAGE_OPT,VAL_FLAG_EDI,VERIFY_PASSWORD,CUST_ACC_COL,SALES_PERS_ACC_COL,SUPP_ACC_COL,ITEM_SER_ACC_CODE,EMP_ACC_COL,ITEM_SER_ACC_COL,WORKFLOW_OPT,TABLE_NAME,APPLICATION,TABLE_DESC,TRAN_DATE_COL,TRAN_ID__FROM,TRAN_ID__TO,TABLE_NAME_DET1,TABLE_NAME_DET2,TABLE_NAME_DET3,MULTITIRE_OPT,REF_SER,VIEW_MODE,TAX_FORMS,SIGN_STATUS,USER_TRAN_WINDOW,CUSTOM_PREVIEW_OBJ,IGNOREERRLIST_ONLOAD,CHILDDATA_ARGOPT,EDIT_TMPLT,WRKFLW_INIT,EDITTAX,FORMAL_ARGS,AUDIT_TRAIL_OPT,EDIT_OPT,CACHE_OPT,OPTIMIZE_MODE,EDIT_EXPR,RATE_COL,QTY_COL,EDIT_EXPR_INP,RCP_CACHE_STATUS,PRINT_CONTROL,TRANSFER_MODE,PROFILE_ID__RES,TRAN_COMPL_MSG,PERIOD_OPTION,WRKFLW_PRIORITY,EXEC_TYPE,DISP_META_DATA,ALLOW_ATTACH,START_FORM,ISATTACHMENT,HEADER_FORM_NO) 
values ('w_phy_scan_verify','A','2','A','seq10',null,null,null,null,null,'N','09-JUN-12','Mahesh','BASE','0','site_code','CONFIRMED','Y',null,null,null,null,null,null,'TRAN_ID','0','0','N',null,null,null,null,null,null,null,null,null,'PHYSCAN','WMS',null,null,null,null,null,null,null,null,'PSCAN','F',null,null,null,null,null,null,null,null,null,null,'0',null,null,null,null,null,null,null,null,null,null,null,null,'M',null,null,null,null,null,null,'1');


Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_phy_scan_verify','Header',null,null,null,null,null,null,'1','F',null,null,'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Tran Date:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>tran_date</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,null,null,null,null,'E',null,null,null);

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_phy_scan_verify','Detail',null,null,null,null,null,null,'2','T',null,null,'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN NO:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>Scan Item Code-Lot No</SCAN_LABEL><FIELDS SEPARATOR="D" DELIMITER="-"> <FIELD ORDER="1">item_code</FIELD> <FIELD ORDER="2">lot_no</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Physical Input:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>phy_input</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,'checkedImage@img<descr>(<item_code>),<loc_code>,<lot_no>,<lot_sl>',null,null,null,'E',null,null,null);

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('phy_scan_verify',1,null,'Saving',null,null,'S','Finish','3',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('phy_scan_verify',2,null,'Prev','a','a','P','Prev','3',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('phy_scan_verify',3,'confirm~normal.gif','Confirming records','pre_confirm','a','F','Confirm','3','2','1','S',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('phy_scan_verify',4,null,'Next',null,null,'N','Next','1',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('phy_scan_verify',5,null,'Next',null,null,'N','Next','2',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('phy_scan_verify',6,null,'Prev','a','a','P','Prev','2',null,null,'U',null,'03-AUG-12','BASE','Mahesh');


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 ('phy_scan_verify','default_data_wiz','1','phy_scan_default_data',null,'0','03-AUG-12','Mahesh','BASE','2','EJB','PhyScanVerifyIC',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 ('phy_scan_verify','pre_navigate_next','1','prv_phy_scan',null,'0','03-AUG-12','Mahesh','BASE','2','EJB','PhyScanVerifyIC',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 ('phy_scan_verify','pre_validate','1','prv_phy_scan',null,'0','03-AUG-12','Mahesh','BASE','2','EJB','PhyScanVerifyIC',null);

update obj_forms set form_no = 3,scan_metadata='' where  win_name = 'w_phy_scan_verify' and form_no=2;
update obj_forms set form_no = 2 where  win_name = 'w_phy_scan_verify' and form_no=1;

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_phy_scan_verify','Header',null,null,null,null,null,null,'1','F',null,null,'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Tran Date:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>tran_date</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,null,null,null,null,'E',null,null,null);

update obj_forms set Scan_metadata='<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN NO:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>Scan Item Code-Lot No</SCAN_LABEL><FIELDS SEPARATOR="D" DELIMITER="-"> <FIELD ORDER="1">item_code</FIELD> <FIELD ORDER="2">lot_no</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Physical Input:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>phy_input</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>' where  win_name = 'w_phy_scan_verify' and form_no=3;
update obj_forms set Scan_metadata='' where  win_name = 'w_phy_scan_verify' and form_no=2;

update transetup set header_form_no='2' where tran_window ='w_phy_scan_verify';

/*FOR RECEIVING POINT [WM2DSUN001]*/
UPDATE MESSAGES SET MSG_TYPE ='E' WHERE MSG_NO='NULLLOCCD';
UPDATE MESSAGES SET MSG_DESCR='ASN No can not be blank, please enter valid ASN no!' WHERE MSG_NO='NULLASNNO';

--Added on dtd 14082012 by Manoj Sharma for Physical count Schedule (WM1FSUN008)

insert into system_events(obj_name,event_code,event_context,service_code,overwrite_core,chg_date,chg_user,chg_term,result_handle,comp_type,comp_name) 
values ('phy_item_scan','post_save','1','pos_phy_scan',0,sysdate,'base','base','2','EJB','PhyItemScanPos') ;

INSERT INTO MESSAGES(MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,CHG_DATE,CHG_USER,CHG_TERM)
VALUES('NOTMATCH','Quantity Mismatch','Physical Quantity is not Equals to Stock Quantity','E','Y',SYSDATE,'BASE','BASE')


update obj_forms set scan_metadata='<SCAN_INFO>
<MAPPING_SCAN ORDER="1">
<SCAN_LABEL>Location Code:</SCAN_LABEL>
<FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS>
</MAPPING_SCAN>
<MAPPING_SCAN ORDER="2">
<SCAN_LABEL>LPN NO:</SCAN_LABEL>
<FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS>
</MAPPING_SCAN>
<MAPPING_SCAN ORDER="3">
<SCAN_LABEL>Scan Item Code-Lot No:</SCAN_LABEL>
<FIELDS SEPARATOR="D" DELIMITER="-">
<FIELD ORDER="1">item_code</FIELD>
<FIELD ORDER="2">lot_no</FIELD></FIELDS>
</MAPPING_SCAN>
<INPUT_SCAN ORDER="1">
<SCAN_LABEL>Case Count:</SCAN_LABEL>
<FIELDS SEPARATOR="" DELIMITER=""><FIELD>phy_input</FIELD></FIELDS>
</INPUT_SCAN>
<SCAN_CONDITION field="loc_code">parseInt(quantity) > 0</SCAN_CONDITION></SCAN_INFO>' where win_name='w_phy_item_scan'
and form_no='2'

update transetup set save_flag = 'A' where tran_window = 'w_phy_item_scan';

ALTER TABLE PHYSCANDET ADD EMP_CODE__USER CHAR(10);

ALTER TABLE PHYSCANDET ADD STATUS CHAR(1);
ALTER TABLE PHYSCANDET ADD ANALYSIS_CLASS CHAR(1) ;
ALTER TABLE PHYSCANDET ADD PRIORITY_SEQ NUMBER(3, 0) ;
ALTER TABLE PHYSCANDET ADD   CYCLE_CRITERIA                          CHAR(1);


Insert into ITM2MENU (APPLICATION,LEVEL_1,LEVEL_2,LEVEL_3,LEVEL_4,LEVEL_5,WIN_NAME,DESCR,COMMENTS,MENU_PATH,ICON_PATH,CLOSE_ICON,OPEN_ICON,OBJ_TYPE,CHG_DATE,CHG_TERM,CHG_USER,MOB_DEPLOY) values ('WMS',1,40,0,0,0,'w_empty_loc_scan','Empty Location Scan','Empty Location Scan','WMS.1.40.0.0.0','e12_logo.gif',null,null,'W',null,'BASE           ','BASE',null);
INSERT INTO transetup(
tran_window,
save_flag,
val_flag,
key_flag,
key_string,
repeate_add,
chg_date,
chg_user,
chg_term,
edi_option,
site_acc_col,
confirm_col,
confirm_val,
tran_id_col,
mail_option,
confirm_mode,
garbage_opt,
table_name,
application,
ref_ser,
view_mode,
audit_trail_opt,
period_option,
header_form_no)
values('w_empty_loc_scan',
'2',
'2',
'A',
'seq10',
'N',
SYSDATE,
'BASE',
'BASE',
'0',
'site_code',
'CONFIRMED',
'Y',
'TRAN_ID',
'0',
'0',
'N',
'PHYSCAN',
'WMS',
'PSCAN',
'F',
'0',
'M',
'1');

Insert into obj_actions (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('empty_loc_scan',1,null,'Saving',null,null,'S','Finish','3',null,null,'U',sysdate,'BASE           ','BASE');
Insert into obj_actions (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('empty_loc_scan',2,null,'Prev','a','a','P','Next','2',null,null,'U',sysdate,'BASE           ','BASE');
Insert into obj_actions (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('empty_loc_scan',3,null,'Next','a','a','N','Next','2',null,null,'U',sysdate,'BASE           ','BASE');
Insert into obj_actions (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('empty_loc_scan',4,null,'Prev','a','a','P','Prev','3',null,null,'U',sysdate,'BASE           ','BASE');
Insert into obj_actions (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('empty_loc_scan',5,'confirm~normal.gif','Confirming records','pre_confirm','a','F','Confirm','3','2','1','S',sysdate,'BASE           ','BASE');
Insert into obj_actions (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('empty_loc_scan',6,null,'Next',null,null,'N','Next','1',null,null,'U',sysdate,'BASE           ','BASE');

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 ('empty_loc_scan','default_data_wiz','1','phy_scan_default_data',null,'0',SYSDATE,'BASE','BASE','2','EJB','PhyItemScanIC',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 ('empty_loc_scan','post_save','1','pos_phy_scan',null,'0',SYSDATE,'base      ','base','2','EJB','PhyItemScanPos',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 ('empty_loc_scan','pre_validate','1','prv_phy_scan',null,'0',SYSDATE,'BASE','BASE','2','EJB','PhyItemScanIC',null);


Insert into obj_forms (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) values ('w_empty_loc_scan','Empty Location Scan',null,null,null,null,null,null,'1','F',null,null,'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Task Type:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>inv_stat</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,null,null,null,null,'E',null,null,null);
Insert into obj_forms (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) values ('w_empty_loc_scan','Detail',null,null,null,null,null,null,'2','T',null,null,'<SCAN_INFO> 
<MAPPING_SCAN ORDER="1"> 
<SCAN_LABEL>Location Code:</SCAN_LABEL> 
<FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS> 
</MAPPING_SCAN> 
<INPUT_SCAN ORDER="1"> 
<SCAN_LABEL>Is Empty :</SCAN_LABEL> 
<FIELDS SEPARATOR="" DELIMITER=""><FIELD>isempty</FIELD></FIELDS> 
</INPUT_SCAN> 
<INPUT_SCAN ORDER="2"> 
<SCAN_LABEL>LPN No :</SCAN_LABEL> 
<FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS> 
</INPUT_SCAN> 
<INPUT_SCAN ORDER="3"> 
<SCAN_LABEL>Item Code :</SCAN_LABEL> 
<FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS> 
</INPUT_SCAN> 
<INPUT_SCAN ORDER="4"> 
<SCAN_LABEL>Lot No :</SCAN_LABEL> 
<FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS> 
</INPUT_SCAN> 
<INPUT_SCAN ORDER="5">
<SCAN_LABEL>Case Count:</SCAN_LABEL>
<FIELDS SEPARATOR="" DELIMITER=""><FIELD>phy_input</FIELD></FIELDS>
</INPUT_SCAN>
 <SCAN_CONDITION field="isempty">isempty.indexOf("N") != -1</SCAN_CONDITION>
<SCAN_CONDITION field="lot_sl">isempty.indexOf("N") != -1</SCAN_CONDITION>
<SCAN_CONDITION field="item_code">isempty.indexOf("N") != -1</SCAN_CONDITION>
<SCAN_CONDITION field="lot_no">isempty.indexOf("N") != -1</SCAN_CONDITION>
<SCAN_CONDITION field="phy_input">isempty.indexOf("N") != -1</SCAN_CONDITION>
</SCAN_INFO>',null,null,null,null,null,null,null,null,null,'checkedImage@img<descr>(<item_code>),<loc_code>,<lot_no>,<lot_sl>',null,null,null,'E',null,null,'U');
-- 16/08/12
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 (
	'pick_order',
	'post_save_rec_2',
	'1',
	'posr_pick_order_2',
	NULL,
	'0',
	fn_sysdate(),
	'Rohan     ',
	'Base',
	'2',
	'EJB',
	'PickOrderPos',
	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 (
	'pick_order',
	'pre_save_rec_2',
	'1',
	'prsr_pick_order_2',
	NULL,
	'0',
	fn_sysdate(),
	'Rohan     ',
	'Base',
	'2',
	'EJB',
	'PickOrderPrs',
	NULL);
		
	
	
INSERT INTO system_event_services (
	service_code,
	service_descr,
	service_uri,
	service_provider,
	method_name,
	return_value,
	return_type,
	return_descr,
	return_xfrm,
	chg_date,
	chg_user,
	chg_term)

VALUES (
	'posr_pick_order_2',
	'Execution Transaction for each Record',
	'http://localhost/axis/services/ValidatorService',
	'Base Information',
	'postSaveRec',
	'String',
	'S',
	NULL,
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'BASE2');
	
INSERT INTO system_event_services (
	service_code,
	service_descr,
	service_uri,
	service_provider,
	method_name,
	return_value,
	return_type,
	return_descr,
	return_xfrm,
	chg_date,
	chg_user,
	chg_term)

VALUES (
		'prsr_pick_order_2',
	'Execution Transaction for each Record',
	'http://localhost/axis/services/ValidatorService',
	'Base Information',
	'preSaveRec',
	'String',
	'S',
	NULL,
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'BASE218');

	
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'posr_pick_order_2',
	1,
	'COMPONENT_TYPE',
	'I',
	'Component Type',
	'C.String',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'BASE218        ',
	'EJB');

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'posr_pick_order_2',
	2,
	'COMPONENT_NAME',
	'I',
	'Component Name',
	'C.String',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'BASE218        ',
	'PickOrderPos');
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'posr_pick_order_2',
	3,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'BASE218        ',
	NULL);

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'posr_pick_order_2',
	4,
	'FOCUSED_ROW_NO',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'BASE218        ',
	NULL);

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'posr_pick_order_2',
	5,
	'OBJ_CONTEXT',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'BASE218        ',
	NULL);

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'posr_pick_order_2',
	6,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'BASE218        ',
	NULL);
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'posr_pick_order_2',
	7,
	'XTRA_PARAMS',
	'I',
	'Extra Arguments',
	'S',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'BASE218        ',
	NULL);
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'posr_pick_order_2',
	8,
	'DB_CONN',
	'I',
	NULL,
	'S.Connection',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'BASE218        ',
	NULL);



	
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prsr_pick_order_2',
	1,
	'COMPONENT_TYPE',
	'I',
	'Component Type',
	'C.String',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'BASE218        ',
	'EJB');
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prsr_pick_order_2',
	2,
	'COMPONENT_NAME',
	'I',
	'Component Name',
	'C.String',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'BASE218        ',
	'PickOrderPrs');
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prsr_pick_order_2',
	3,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'BASE218        ',
	NULL);

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prsr_pick_order_2',
	4,
	'FOCUSED_ROW_NO',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'BASE218        ',
	NULL);
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prsr_pick_order_2',
	5,
	'OBJ_CONTEXT',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'BASE218        ',
	NULL);
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prsr_pick_order_2',
	6,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'BASE218        ',
	NULL);

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prsr_pick_order_2',
	7,
	'XTRA_PARAMS',
	'I',
	'Extra Arguments',
	'S',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'BASE218        ',
	NULL);
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prsr_pick_order_2',
	8,
	'DB_CONN',
	'I',
	NULL,
	'S.Connection',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'BASE218        ',
	NULL);


INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'VTSACN',
	'Task scan already',
	'One of the Task is already Scan.Wave Reversal is not possible.',
	'E',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE ');
	
INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'VTHOLDTASK',
	'Wave Task is on Hold.',
	'Wave Task is on Hold.Wave Reversal is not possible.',
	'E',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE ');	
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 (
	'VTLOCCODE1',
	'Invalid location',
	'Location is not empty, another LPN exists in the location',
	'E',
	'Y',
	NULL,
	NULL,
	' ',
	sysdate,
	'Base',
	'Base',
	NULL,
	NULL);
	
ALTER TABLE SHIPMENT MODIFY REMARKS  VARCHAR2(200);
--- 28/07/12 added by shamim 
INSERT INTO MESSAGES (
	MSG_NO ,MSG_STR,MSG_DESCR,
	MSG_TYPE) 
VALUES
(
'VTPTCNNC',
'All Activity not Completed',
'All PTCN Activity not Completed',
'E'); 

--17/08/12 added by Kunal  
Insert into USER_RIGHTS (PROFILE_ID,APPLICATION,MENU_ROW,MENU_COL,MENU_SUBCOL,LEVEL_4,LEVEL_5,MENU_NAME,RIGHTS,ACC_FILT,DEF_FILT,OBJ_NAME,FAV_OPTION,FAV_ORDER) 
values ('WMS','WMS',1,17,0,0,0,'Loading','*',null,null,'checksheet',null,null);

update obj_actions set form_no = '1'  where obj_name = 'checksheet' and line_no = '3';

update transetup set header_form_no = '2'  where tran_window = 'w_case_pick';

update system_events set obj_name = 'case_pick_1' where obj_name = 'case_pick' and event_code = 'pre_save';

UPDATE TRANSETUP SET SAVE_FLAG = 'A' WHERE TRAN_WINDOW = 'w_case_pick' ;

UPDATE TRANSETUP SET SAVE_FLAG = 'A' WHERE TRAN_WINDOW = 'w_active_pick' ;

update system_service_args set arg_name = 'XML_DATA__ALL' where service_code =  'prv_master_pack' and line_no = 3; 

--17/08/12 added by Kunal for Loading 
update system_events set event_code = 'pre_navigate_next' where obj_name = 'checksheet' and  event_code = 'pre_navigate'; 

insert into messages(
MSG_NO,         
MSG_STR ,       
MSG_DESCR,      
MSG_TYPE,
MSG_OPT,
chg_date,
chg_user,
chg_term
)
values(
'NULLSHIPID',
'Invalid Shipment Id',
'Shipment Id can not be Blank or Null',
'E',
'Y',
sysdate,
'kunal',
'base'
);

insert into messages(
MSG_NO,         
MSG_STR ,       
MSG_DESCR,      
MSG_TYPE,
MSG_OPT,
chg_date,
chg_user,
chg_term
)
values(
'INVSHIPID',
'Invalid Shipment Id',
'Shipment Id not exists in Shipment Table',
'E',
'Y',
sysdate,
'kunal',
'base'
);

-- added on 20/08/12 from SUN 
alter table carton_master
add 
(
	pack_code char(5) 
);

alter table carton_master
modify carton_no varchar2(20);

--added by manoj dtd 20/08/12 to create index for table physcan
CREATE INDEX PHYSCAN_X ON PHYSCAN (TRAN_DATE);


ALTER TABLE SHIPMENT ADD PRO_NO varchar2(40);

ALTER TABLE SHIPMENT MODIFY REMARKS VARCHAR2(200);


--added by chitranjan dtd 21/08/12 to view previous button on second form
update obj_actions set rights_char = 'P' where obj_name = 'dock_tran'
and line_no = '2' and form_no = '2';

-- added by Kunal on 21-08-20 for audit trail option
UPDATE TRANSETUP SET AUDIT_TRAIL_OPT = '0' WHERE TRAN_WINDOW = 'w_case_pick';

UPDATE TRANSETUP SET AUDIT_TRAIL_OPT = '0' WHERE TRAN_WINDOW = 'w_master_pack';

UPDATE TRANSETUP SET AUDIT_TRAIL_OPT = '0' WHERE TRAN_WINDOW = 'w_repl_iss';

--- added by Kunal on 21-08-20 for master packing 
ALTER TABLE  PACK_HDR
MODIFY OUTER_CARTON_NO  VARCHAR2(20);

--- added by Kunal on 22-08-20 for loading
insert into messages(
MSG_NO,         
MSG_STR ,       
MSG_DESCR,      
MSG_TYPE,
MSG_OPT,
chg_date,
chg_user,
chg_term
)
values(
'VTPLTSCN',
'All Pallets Not Scanned',
'All Pallets Not Scanned',
'E',
'Y',
sysdate,
'kunal',
'base'
);
--Added SQL for Pallet Merging on 22/08/12

Insert into ITM2MENU (APPLICATION,LEVEL_1,LEVEL_2,LEVEL_3,LEVEL_4,LEVEL_5,WIN_NAME,DESCR,COMMENTS,MENU_PATH,ICON_PATH,CLOSE_ICON,OPEN_ICON,OBJ_TYPE,CHG_DATE,CHG_TERM,CHG_USER,MOB_DEPLOY) 
values ('WMS',1,38,0,0,0,'w_palletmerge','Pallet Merging','Pallet Merging','WMS.1.38.0.0.0','e12_logo.gif',null,null,'W',null,'MAHESH','Mahesh',null);

Insert into TRANSETUP (TRAN_WINDOW,SAVE_FLAG,VAL_FLAG,KEY_FLAG,KEY_STRING,UDF_1,UDF_2,UDF_3,UDF_4,UDF_5,REPEATE_ADD,CHG_DATE,CHG_USER,CHG_TERM,EDI_OPTION,SITE_ACC_COL,CONFIRM_COL,CONFIRM_VAL,REPEAT_ADD_DET,REPEATADDDET,LOAD_MODE,AUTO_CONFIRM,LEDG_POST_CONF,CHG_DATE_ON_CONF,TRAN_ID_COL,MAIL_OPTION,CONFIRM_MODE,GARBAGE_OPT,VAL_FLAG_EDI,VERIFY_PASSWORD,CUST_ACC_COL,SALES_PERS_ACC_COL,SUPP_ACC_COL,ITEM_SER_ACC_CODE,EMP_ACC_COL,ITEM_SER_ACC_COL,WORKFLOW_OPT,TABLE_NAME,APPLICATION,TABLE_DESC,TRAN_DATE_COL,TRAN_ID__FROM,TRAN_ID__TO,TABLE_NAME_DET1,TABLE_NAME_DET2,TABLE_NAME_DET3,MULTITIRE_OPT,REF_SER,VIEW_MODE,TAX_FORMS,SIGN_STATUS,USER_TRAN_WINDOW,CUSTOM_PREVIEW_OBJ,IGNOREERRLIST_ONLOAD,CHILDDATA_ARGOPT,EDIT_TMPLT,WRKFLW_INIT,EDITTAX,FORMAL_ARGS,AUDIT_TRAIL_OPT,EDIT_OPT,CACHE_OPT,OPTIMIZE_MODE,EDIT_EXPR,RATE_COL,QTY_COL,EDIT_EXPR_INP,RCP_CACHE_STATUS,PRINT_CONTROL,TRANSFER_MODE,PROFILE_ID__RES,TRAN_COMPL_MSG,PERIOD_OPTION,WRKFLW_PRIORITY,EXEC_TYPE,DISP_META_DATA,ALLOW_ATTACH,START_FORM,ISATTACHMENT) 
values ('w_palletmerge','2','2','A','seq10',null,null,null,null,null,'N','09-JUN-12','Mahesh','Mahesh','0',null,null,null,null,null,null,null,null,null,null,'0','0','N',null,null,null,null,null,null,null,null,null,null,'WMS',null,null,null,null,null,null,null,null,null,'F',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'M',null,null,null,null,null,null);

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_palletmerge','Header',null,null,null,null,null,null,'1','F',null,null,'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Pallet No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,null,null,null,null,'E',null,null,null);

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_palletmerge','Detail',null,null,null,null,null,null,'2','F',null,null,'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>New Pallet No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no__new</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,null,null,null,null,'E',null,null,null);

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('palletmerge',1,null,'Saving',null,null,'S','Finish','3',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('palletmerge',2,null,'Prev','a','a','P','Prev','2',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('palletmerge',5,'confirm~normal.gif','Confirming records','pre_confirm','a','F','Confirm','3','2','1','S',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('palletmerge',6,null,'Next',null,null,'N','Next','1',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

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 ('palletmerge','default_data_wiz','1','phy_scan_default_data',null,'0','03-AUG-12','Mahesh','BASE','2','EJB','PalletMergeIC',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 ('palletmerge','pre_validate','1','prv_phy_scan',null,'0','03-AUG-12','Mahesh','BASE','2','EJB','PalletMergeIC',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 ('palletmerge','post_save','1','pos_phy_scan',null,'0','08-MAY-12','Mahesh','BASE','2','EJB','PalletMergePos',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 ('palletmerge','pre_navigate_next','1','prv_phy_scan',null,'0','08-MAY-12','Mahesh','BASE','2','EJB','PalletMergeIC',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 ('palletmerge','pre_navigate_finish','1','prv_phy_scan',null,'0','08-MAY-12','Mahesh','BASE','2','EJB','PalletMergeIC',null);

insert into messages(msg_no , msg_str, msg_descr, msg_type, msg_opt) values('VTPLTNO','Invalid Pallet No ','There is no cases for this pallet','E','Y');

update transetup set key_flag = 'M',ref_ser = 'M-PALT',audit_trail_opt='0' where tran_window = 'w_palletmerge';
-- sql from Unique team received on 21/08/12 merged on 22/08/12
ALTER TABLE SORD_ALLOC ADD WAVE_FLAG CHAR(1);

alter table carton_master modify column carton_no varchar2(20);

ALTER TABLE SORD_ALLOC ADD WAVE_FLAG CHAR(1);
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 (
	'INVORDQTY ',
	'Invalid ord Qty',
	'Invalid order Quantity.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE      ',
	'BASE ',
	NULL,
	NULL);

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 (
	'DUPDETAIL2',
	'Invalid detail',
	'Combination of ITEM_CODE, SITE_CODE, LOC_CODE, LOT_NO, LOT_SL is already inserted.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'sumit',
	'sumit',
	NULL,
	NULL);
	
	
create or replace
FUNCTION FN_CHECK_MANUAL_STOCK_ALLOC(SI_SALE_ORDER IN CHAR )
  RETURN number is FLAG number ;
  CNT NUMBER;
  CNT1 NUMBER;
  BEGIN
   BEGIN
    SELECT count(*) INTO CNT FROM SORD_ALLOC WHERE SALE_ORDER = SI_SALE_ORDER AND CONFIRMED = 'Y' ;
    IF (CNT  > 0 ) THEN      
      SELECT count(*) INTO CNT1 FROM SORD_ALLOC WHERE SALE_ORDER = SI_SALE_ORDER AND CONFIRMED = 'Y' AND WAVE_FLAG ='Y';
      IF( CNT1 >0 ) THEN
        FLAG := 1;
      ELSE
       FLAG := 0 ;
      END IF;
    ELSE
      FLAG :=3;
    END IF;
  EXCEPTION
  WHEN NO_DATA_FOUND  THEN
   FLAG :=2;
  END;
  RETURN FLAG;
  END;
  /
 
 
 alter table carton_master
add 
(
	pack_code char(5) 
);

create table WAVE_TYPE
(
     WAVE_TYPE                                  VARCHAR2(5),
     MASTER_PACK_ALLOW                          CHAR(1),
     ACTIVE_PICK_ALLOW                          CHAR(1),
     STOCK_TO_DOCK_ALLOW                        CHAR(1),
	 CHG_USER 									char(10) not null,
	 CHG_DATE 									date not null,
	 CHG_TERM 									varchar2(15) not null

)
tablespace itm_dis_d2;
alter table WAVE_TYPE add constraint PK_WAVE_CODE primary key (WAVE_TYPE) ;
using index tablespace itm_dis_i1;
CREATE UNIQUE INDEX WAVE_TYPE_UINDEX ON WAVE_TYPE ( MASTER_PACK_ALLOW, ACTIVE_PICK_ALLOW, STOCK_TO_DOCK_ALLOW ) ;

INSERT INTO itm2menu (
	application ,
	level_1 ,
	level_2 ,
	level_3 ,
	level_4 ,
	level_5 ,
	win_name ,
	descr ,
	comments ,
	menu_path ,
	icon_path ,
	close_icon ,
	open_icon ,
	obj_type ,
	chg_date ,
	chg_term ,
	chg_user ,
	mob_deploy )
 VALUES (
	'WMS',
	1,
	38,
	0,
	0,
	0,
	'w_wave_type',
	'Wave Type',
	'Define Wave Type',
	'WMS.1.38.0.0.0',
	'e12_logo.gif',
	NULL,
	NULL,
	NULL,
	sysdate,
	'Base           ',
	'Sankara   ',
	NULL);

INSERT INTO transetup (
	tran_window ,
	save_flag ,
	val_flag ,
	key_flag ,
	key_string ,
	udf_1 ,
	udf_2 ,
	udf_3 ,
	udf_4 ,
	udf_5 ,
	repeate_add ,
	chg_date ,
	chg_user ,
	chg_term ,
	edi_option ,
	site_acc_col ,
	confirm_col ,
	confirm_val ,
	repeat_add_det ,
	repeatadddet ,
	load_mode ,
	auto_confirm ,
	ledg_post_conf ,
	chg_date_on_conf ,
	tran_id_col ,
	mail_option ,
	confirm_mode ,
	garbage_opt ,
	val_flag_edi ,
	verify_password ,
	cust_acc_col ,
	sales_pers_acc_col ,
	supp_acc_col ,
	item_ser_acc_code ,
	emp_acc_col ,
	item_ser_acc_col ,
	workflow_opt ,
	table_name ,
	application ,
	table_desc ,
	tran_date_col ,
	tran_id__from ,
	tran_id__to ,
	table_name_det1 ,
	table_name_det2 ,
	table_name_det3 ,
	multitire_opt ,
	ref_ser ,
	view_mode ,
	tax_forms ,
	sign_status ,
	user_tran_window ,
	custom_preview_obj ,
	ignoreerrlist_onload ,
	childdata_argopt ,
	edit_tmplt ,
	wrkflw_init ,
	edittax ,
	formal_args ,
	audit_trail_opt ,
	edit_opt ,
	cache_opt ,
	optimize_mode ,
	edit_expr ,
	rate_col ,
	qty_col ,
	edit_expr_inp ,
	rcp_cache_status ,
	print_control ,
	transfer_mode ,
	profile_id__res ,
	tran_compl_msg ,
	period_option ,
	wrkflw_priority ,
	exec_type ,
	disp_meta_data ,
	allow_attach ,
	start_form ,
	isattachment )
 VALUES (
	'w_wave_type',
	'2',
	'2',
	'M',
	'seq05',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'N',
	sysdate,
	'Base      ',
	'Sankara        ',
	'0',
	NULL,
	NULL,
	NULL,
	'N',
	NULL,
	NULL,
	'N',
	'N',
	NULL,
	'WAVE_TYPE',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'WAVE_TYPE',
	'WMS',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'D-RTE',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO obj_forms(
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_wave_type',
	'Wave Type',
	'd_wave_type11',
	'd_wave_type21',
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO obj_actions (
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES (
	'wave_type',
	1,
	'add.gif',
	'Adding New',
	'a',
	'a',
	'A',
	'Add',
	'1',
	NULL,
	NULL,
	'S',
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO obj_actions (
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES (
	'wave_type',
	2,
	'edit.gif',
	'Editing Existing Record',
	'a',
	'a',
	'E',
	'Edit',
	'1',
	NULL,
	NULL,
	'S',
	NULL,
	NULL,
	NULL,
	NULL);
	
	INSERT INTO wave_type(
	wave_type ,
	master_pack_allow ,
	active_pick_allow ,
	stock_to_dock_allow ,
	chg_user ,
	chg_date ,
	chg_term )
 VALUES (
	'WA001',
	'Y',
	'Y',
	'Y',
	'BASE      ',
	sysdate,
	'sun-PC20');
INSERT INTO wave_type(
	wave_type ,
	master_pack_allow ,
	active_pick_allow ,
	stock_to_dock_allow ,
	chg_user ,
	chg_date ,
	chg_term )
 VALUES (
	'B0507',
	'Y',
	'N',
	'N',
	'BASE      ',
	sysdate,
	'sun-PC20');
INSERT INTO wave_type(
	wave_type ,
	master_pack_allow ,
	active_pick_allow ,
	stock_to_dock_allow ,
	chg_user ,
	chg_date ,
	chg_term )
 VALUES (
	'G0500',
	'N',
	'N',
	'Y',
	'BASE      ',
	sysdate,
	'sun-PC20');
INSERT INTO wave_type(
	wave_type ,
	master_pack_allow ,
	active_pick_allow ,
	stock_to_dock_allow ,
	chg_user ,
	chg_date ,
	chg_term )
 VALUES (
	'SA002',
	'N',
	'N',
	'N',
	'BASE      ',
	sysdate,
	'sun-PC20');
INSERT INTO wave_type(
	wave_type ,
	master_pack_allow ,
	active_pick_allow ,
	stock_to_dock_allow ,
	chg_user ,
	chg_date ,
	chg_term )
 VALUES (
	'D000',
	'N',
	'Y',
	'N',
	'BASE      ',
	sysdate,
	'sun-PC20');
INSERT INTO wave_type(
	wave_type ,
	master_pack_allow ,
	active_pick_allow ,
	stock_to_dock_allow ,
	chg_user ,
	chg_date ,
	chg_term )
VALUES (
	'YYNRB',
	'Y',
	'Y',
	'N',
	'BASE      ',
	sysdate,
	'sun-PC20');
INSERT INTO wave_type(
	wave_type ,
	master_pack_allow ,
	active_pick_allow ,
	stock_to_dock_allow ,
	chg_user ,
	chg_date ,
	chg_term )
 VALUES (
	'YNYWT',
	'Y',
	'N',
	'Y',
	'BASE      ',
	sysdate,
	'sun-PC20');
INSERT INTO wave_type(
	wave_type ,
	master_pack_allow ,
	active_pick_allow ,
	stock_to_dock_allow ,
	chg_user ,
	chg_date ,
	chg_term )
 VALUES (
	'D0001',
	'N',
	'Y',
	'Y',
	'BASE      ',
	sysdate,
	'sun-PC20');


ALTER TABLE CUSTOMER ADD WAVE_TYPE CHAR(5);
-- end of unique sql

-- added by Kunal 22/08/12 for master pack
UPDATE TRANSETUP SET SAVE_FLAG = 'A' WHERE TRAN_WINDOW = 'w_master_pack';

UPDATE  SYSTEM_EVENTS SET OBJ_NAME ='master_pack_1'  WHERE OBJ_NAME = 'master_pack' AND EVENT_CODE = 'pre_save';

--Added by Manoj dtd 22/08/2012 for Receipt

update transetup set audit_trail_opt='0' where tran_window='w_porcp_wiz';
update SYSTEM_EVENTS set event_code='pre_navigate_finish' WHERE OBJ_NAME='porcp_wiz' and event_code='post_save';
UPDATE SYSTEM_EVENT_SERVICES SET METHOD_NAME='postSaveForm' WHERE SERVICE_CODE='pos_porcp_wiz';
delete from system_service_args where service_code='pos_porcp_wiz';
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pos_porcp_wiz',1,'COMPONENT_TYPE','I',null,'S',null,SYSDATE,'Gulzar    ','Gulzar','EJB');
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pos_porcp_wiz',2,'COMPONENT_NAME','I',null,'S',null,SYSDATE,'Gulzar    ','Gulzar','PoRcpPos');
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pos_porcp_wiz',3,'XML_DATA_ALL','I',null,'S',null,SYSDATE,'Gulzar    ','Gulzar',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pos_porcp_wiz',4,'<tran_id>','I',null,'B.String',null,SYSDATE,'Gulzar    ','Gulzar',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pos_porcp_wiz',5,'OBJ_CONTEXT','I',null,'B.String',null,SYSDATE,'Gulzar    ','Gulzar',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pos_porcp_wiz',6,'EDIT_FLAG','I',null,'S',null,SYSDATE,'Gulzar    ','Gulzar',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pos_porcp_wiz',7,'XTRA_PARAMS','I',null,'S',null,SYSDATE,'Gulzar    ','Gulzar',null);

--Added by Kunal on 22/08/12 for master pack

alter table pack_det
modify carton_no varchar2(20);

--Added by Manoj dtd 22/08/2012 to Add Column in Rcpdet_form
 ALTER TABLE RCPDET_FORM ADD PRIMARY_REF_NO VARCHAR2(40);
 ALTER TABLE RCPDET_FORM ADD REMARKS VARCHAR2(120);

 --Added by Kunal on 22/08/12 for master pack
 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 ('master_pack','pre_navigate_finish','1','prv_master_pack',null,'0',sysdate,'Kunal','BASE','2','EJB','MasterPackIC',null);

--cpatil

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 ('VTPRONONUL','PRO NO Null','Please select another transporter.','E','Y',null,null,null,null,null,null,null,null);

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 ('VMPRONOCD','PRO NO INVALID','Pro No should be in between Pro No from and Pro No To.','E','Y',null,null,null,null,null,null,null,null);

--Adde By Mahesh Patidar on 23/08/12 for case transfer transaction

create table PALLETMERGE
(TRAN_ID CHAR(10) NOT NULL,
TRAN_DATE DATE NOT NULL,
SITE_CODE CHAR(5) NOT NULL,
CHG_DATE DATE,
CHG_TERM CHAR(15),
CHG_USER CHAR(10) ,
PALLET_NO__FR CHAR(25),
PALLET_NO__TO CHAR(25), 
CONFIRMED CHAR(1),
CONF_DATE DATE,
CONSTRAINT PALLETMERGE_X PRIMARY KEY (TRAN_ID) );

create table PALLETMERGE_DET
(TRAN_ID CHAR(10) NOT NULL,
LINE_NO CHAR(3) NOT NULL,
CARTON_NO VARCHAR2(20),
PICK_ORDER CHAR(10) , 
LINE_NO__PICK NUMBER(3),
DESP_ID CHAR(10),
LINE_NO__DESP CHAR(3),
LINE_NO__DESP_NEW CHAR(3),
ITEM_CODE CHAR(10) NOT NULL,
LOT_NO CHAR(15) NOT NULL,
LOT_SL CHAR(15) NOT NULL,
CHG_DATE DATE,
CHG_TERM CHAR(15),
CHG_USER CHAR(10), 
CONSTRAINT PALLETMERGE_DET_X PRIMARY KEY
-- 23/08/12 from sun unique
UPDATE REFSER SET DESCR='Active Picking' WHERE REF_SER='A-PICK';
UPDATE REFSER SET DESCR='Case Picking' WHERE REF_SER='C-PICK';
UPDATE REFSER SET DESCR='Replenishment Task ( PSO)' WHERE REF_SER='R-TASK';
UPDATE REFSER SET DESCR='Master Pack' WHERE REF_SER='M-PACK';
UPDATE REFSER SET DESCR='Replenishment Task ( DSO)' WHERE REF_SER='R-DSO';
UPDATE REFSER SET DESCR='Replenishment Task ( PND)' WHERE REF_SER='R-PSO';
UPDATE REFSER SET DESCR='ReplenishmentTask Stock-DOCK(PND-DOCK)' WHERE REF_SER='RP-PSO';
UPDATE REFSER SET DESCR='Replenishment Task ( DSO to PND)' WHERE REF_SER='RS-DSO';
UPDATE REFSER SET DESCR='Case Pick (Master pack)' WHERE REF_SER='M-PICK';
UPDATE REFSER SET DESCR='Replenishment Task - Stock to Dock (PSO)' WHERE REF_SER='S-DOC';
UPDATE REFSER SET DESCR='Replenishment Task -  Case to Actives' WHERE REF_SER='R-DSA';


create or replace
FUNCTION FN_MANUAL_STOCK_FOR_EACHITEM(SI_SALE_ORDER IN CHAR, SI_LINE_NO IN CHAR)
  RETURN char is FLAG char;
  CNT NUMBER;
  CNT1 NUMBER;
  BEGIN
   BEGIN
    SELECT count(*) INTO CNT FROM SORD_ALLOC SA, SORD_ALLOC_DET SAD 
      WHERE SA.SALE_ORDER = SAD.SALE_ORDER
      AND SA.SALE_ORDER = SI_SALE_ORDER 
      AND SA.CONFIRMED = 'Y'
      AND SAD.LINE_NO__SORD = SI_LINE_NO ;
    IF (CNT  > 0 ) THEN      
      FLAG := 'M';
    ELSE
      FLAG := 'N';
    END IF;
  EXCEPTION
  WHEN NO_DATA_FOUND  THEN
   FLAG :='E';
  END;
  RETURN FLAG;
  END;
  /
-- end 23/08/12 from sun unique
--Added by manoj dtd 23/08/2012 for Customer remittance
  Insert into finparm (PRD_CODE,VAR_NAME,VAR_TYPE,VAR_VALUE,CHG_DATE,CHG_USER,CHG_TERM,DESCR,VAR_SUBS,ADDL_VALUE) values ('999999','RCP_FORM_ACCOUNT    ','S','A',SYSDATE,'BASE      ','base-PC        ','rc  account code',null,null);
  
 --added by Kunal on 23/08/12 for master pack 

  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 (
	'CONFPCKISS',
	'Pick issue already confirmed',
	'Picking issue already generated and confirmed for entered pick task id',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'Kunal',
	'BASE',
	NULL,
	NULL);

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 (
	'NULLCARTNO',
	'Carton no is blank!',
	'Carton no can not be blank, please enter or scan valid carton no',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'Kunal',
	'BASE',
	NULL,
	NULL);

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 ('VTREPLISS1','Repacement is not don','Repacement order is not confirmed ','E',null,null,null,null,sysdate,'Kunal','BASE',null,null);


insert into messages(
MSG_NO,         
MSG_STR ,       
MSG_DESCR,      
MSG_TYPE,
MSG_OPT,
chg_date,
chg_user,
chg_term
)
values
(
'VTWGTEXD',
'Weight is Exid',
'Master Carton Weight Or No. Of Cases is Exid',
'E',
'Y',
sysdate,
'base',
'base'
);


--INSERT NEW RECORDS FOR CASE TRANSFER TRANSACTION ON 23/08/12

create table PALLETMERGE
(TRAN_ID CHAR(10) NOT NULL,
TRAN_DATE DATE NOT NULL,
SITE_CODE CHAR(5) NOT NULL,
CHG_DATE DATE,
CHG_TERM CHAR(15),
CHG_USER CHAR(10) ,
PALLET_NO__FR CHAR(25),
PALLET_NO__TO CHAR(25), 
CONFIRMED CHAR(1),
CONF_DATE DATE,
CONSTRAINT PALLETMERGE_X PRIMARY KEY (TRAN_ID) );

create table PALLETMERGE_DET
(TRAN_ID CHAR(10) NOT NULL,
LINE_NO CHAR(3) NOT NULL,
CARTON_NO VARCHAR2(20),
PICK_ORDER CHAR(10) , 
LINE_NO__PICK NUMBER(3),
DESP_ID CHAR(10),
LINE_NO__DESP CHAR(3),
LINE_NO__DESP_NEW CHAR(3),
ITEM_CODE CHAR(10) NOT NULL,
LOT_NO CHAR(15) NOT NULL,
LOT_SL CHAR(15) NOT NULL,
CHG_DATE DATE,
CHG_TERM CHAR(15),
CHG_USER CHAR(10), 
CONSTRAINT PALLETMERGE_DET_X PRIMARY KEY
(TRAN_ID,LINE_NO) );

ALTER TABLE CARTON_MASTER ADD  PALLET_NO VARCHAR2(25);

Insert into ITM2MENU (APPLICATION,LEVEL_1,LEVEL_2,LEVEL_3,LEVEL_4,LEVEL_5,WIN_NAME,DESCR,COMMENTS,MENU_PATH,ICON_PATH,CLOSE_ICON,OPEN_ICON,OBJ_TYPE,CHG_DATE,CHG_TERM,CHG_USER,MOB_DEPLOY) 
values ('WMS',1,39,0,0,0,'w_case_transfer','Case Transfer','Case Transfer','WMS.1.39.0.0.0','e12_logo.gif',null,null,'W',null,'MAHESH','Mahesh',null);

Insert into TRANSETUP (TRAN_WINDOW,SAVE_FLAG,VAL_FLAG,KEY_FLAG,KEY_STRING,UDF_1,UDF_2,UDF_3,UDF_4,UDF_5,REPEATE_ADD,CHG_DATE,CHG_USER,CHG_TERM,EDI_OPTION,SITE_ACC_COL,CONFIRM_COL,CONFIRM_VAL,REPEAT_ADD_DET,REPEATADDDET,LOAD_MODE,AUTO_CONFIRM,LEDG_POST_CONF,CHG_DATE_ON_CONF,TRAN_ID_COL,MAIL_OPTION,CONFIRM_MODE,GARBAGE_OPT,VAL_FLAG_EDI,VERIFY_PASSWORD,CUST_ACC_COL,SALES_PERS_ACC_COL,SUPP_ACC_COL,ITEM_SER_ACC_CODE,EMP_ACC_COL,ITEM_SER_ACC_COL,WORKFLOW_OPT,TABLE_NAME,APPLICATION,TABLE_DESC,TRAN_DATE_COL,TRAN_ID__FROM,TRAN_ID__TO,TABLE_NAME_DET1,TABLE_NAME_DET2,TABLE_NAME_DET3,MULTITIRE_OPT,REF_SER,VIEW_MODE,TAX_FORMS,SIGN_STATUS,USER_TRAN_WINDOW,CUSTOM_PREVIEW_OBJ,IGNOREERRLIST_ONLOAD,CHILDDATA_ARGOPT,EDIT_TMPLT,WRKFLW_INIT,EDITTAX,FORMAL_ARGS,AUDIT_TRAIL_OPT,EDIT_OPT,CACHE_OPT,OPTIMIZE_MODE,EDIT_EXPR,RATE_COL,QTY_COL,EDIT_EXPR_INP,RCP_CACHE_STATUS,PRINT_CONTROL,TRANSFER_MODE,PROFILE_ID__RES,TRAN_COMPL_MSG,PERIOD_OPTION,WRKFLW_PRIORITY,EXEC_TYPE,DISP_META_DATA,ALLOW_ATTACH,START_FORM,ISATTACHMENT,HEADER_FORM_NO) 
values ('w_case_transfer','A','2','A','seq10',null,null,null,null,null,'N','09-JUN-12','MAHESH','BASE','0','site_code','CONFIRMED','Y',null,null,null,null,null,null,'TRAN_ID','0','0','N',null,null,null,null,null,null,null,null,null,'PALLETMERGE','WMS',null,null,null,null,null,null,null,null,'PSCAN','F',null,null,null,null,null,null,null,null,null,null,'0',null,null,null,null,null,null,null,null,null,null,null,null,'M',null,null,null,null,null,null,'1');

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_case_transfer','Header',null,null,null,null,null,null,'1','F',null,null,'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Pallet No From :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no__fr</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,null,null,null,null,'E',null,null,null);

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_case_transfer','Detail',null,null,null,null,null,null,'2','T',null,null,'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Carton No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>carton_no</FIELD></FIELDS></MAPPING_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,'checkedImage@img<carton_no>(<item_code>,<lot_no>,<lot_sl>)',null,null,null,'E',null,null,null);

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_case_transfer','Detail',null,null,null,null,null,null,'3','F',null,null,'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Pallet No To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,null,null,null,null,'E',null,null,null);

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('case_transfer',1,null,'Saving',null,null,'S','Finish','3',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('case_transfer',2,null,'Prev','a','a','P','Prev','3',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('case_transfer',3,null,'Next',null,null,'N','Next','2',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('case_transfer',4,null,'Prev','a','a','P','Prev','2',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('case_transfer',5,'confirm~normal.gif','Confirming records','pre_confirm','a','F','Confirm','3','2','1','S',null,'03-AUG-12','BASE','Mahesh');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('case_transfer',6,null,'Next',null,null,'N','Next','1',null,null,'U',null,'03-AUG-12','BASE','Mahesh');

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 ('case_transfer','default_data_wiz','1','phy_scan_default_data',null,'0','03-AUG-12','Mahesh','BASE','2','EJB','CaseTransferIC',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 ('case_transfer','pre_validate','1','prv_phy_scan',null,'0','03-AUG-12','Mahesh','BASE','2','EJB','CaseTransferIC',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 ('case_transfer','post_save','1','pos_phy_scan',null,'0','08-MAY-12','Mahesh','BASE','2','EJB','CaseTransferPos',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 ('case_transfer','pre_navigate_next','1','prv_phy_scan',null,'0','08-MAY-12','Mahesh','BASE','2','EJB','CaseTransferIC',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 ('case_transfer','pre_navigate_finish','1','prv_phy_scan',null,'0','08-MAY-12','Mahesh','BASE','2','EJB','CaseTransferIC',null);

--- added by Kunal for msater pack 
update system_service_args set arg_name = 'XML_DATA' where service_code =  'prv_master_pack' and line_no = 3; 

-- added by Kunal on 23/08/12 for prv_nevigate_next n  prv_nevigate_finish 


Insert into system_event_services (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM) 
values ('prv_nevigate_ejb','Validation','http://localhost:9090/axis/services/ValidatorService','BASE','wfValData','String','S',null,null,sysdate,'Kunal','BASE');

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('prv_nevigate_ejb',1,'COMPONENT_TYPE','I',null,'S',null,sysdate,'Kunal','BASE',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('prv_nevigate_ejb',2,'COMPONENT_NAME','I',null,'S',null,sysdate,'Kunal','BASE',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('prv_nevigate_ejb',3,'XML_DATA__ALL','l',null,'S',null,sysdate,'Kunal','BASE',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('prv_nevigate_ejb',4,'XML_DATA_1','l',null,'S',null,sysdate,'Kunal','BASE',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('prv_nevigate_ejb',5,'XML_DATA_ALL','l',null,'S',null,sysdate,'Kunal','BASE',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('prv_nevigate_ejb',6,'OBJ_CONTEXT','l',null,'S',null,sysdate,'Kunal','BASE',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('prv_nevigate_ejb',7,'EDIT_FLAG','l',null,'S',null,sysdate,'Kunal','BASE',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('prv_nevigate_ejb',8,'XTRA_PARAMS','l',null,'S',null,sysdate,'Kunal','BASE',null);


update system_events set service_code = 'prv_nevigate_ejb' where obj_name in  ('master_pack','case_pick','active_pick','master_pick')  and event_code in ('pre_navigate_finish','pre_navigate_next');


-- added by Kunal on 24/08/12 for master pack
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 (
	'PACKCONF',
	'Mater Pack already confirmed',
	'Mater Pack already confirmed',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'Kunal',
	'BASE',
	NULL,
	NULL);
 
--PUTAWAY PARTIAL GRL REQUREMENTS [WM2ESUN009]  ADDED BY ASHISH SONAWANE  [START]

UPDATE OBJ_FORMS SET SCAN_METADATA= '<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location Code To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>LPN No :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl__to</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="3"><SCAN_LABEL>Quantity :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>quantity</FIELD></FIELDS></INPUT_SCAN><SCAN_CONDITION field="lot_sl__to">ispartial.indexOf("Y") != -1</SCAN_CONDITION><SCAN_CONDITION field="quantity">ispartial.indexOf("Y") != -1</SCAN_CONDITION></SCAN_INFO>' WHERE WIN_NAME ='w_stock_transfer_grl' AND FORM_NO = 3;

INSERT INTO DISPARM 
(
	PRD_CODE,                                                                                                                                                                                        
	VAR_NAME,                                                                                                                                                                                     
	VAR_TYPE ,                                                                                                                                                                                        
	VAR_VALUE ,                                                                                                                                                                                
	DESCR ,                                                                                                                                                                                 
	VAR_SUBS,                                                                                                                                                                                     
	CHG_DATE ,                                                                                                                                                                                          
	CHG_USER ,                                                                                                                                                                                      
	CHG_TERM
)
VALUES
(
	'999999',
	'PGRL_INVSTAT',
	'S',
	'PGRL',
	'Partial GRL Location',
	NULL,
	sysdate,
	'BASE',
	'BASE'
);

INSERT INTO DISPARM 
(
	PRD_CODE,                                                                                                                                                                                        
	VAR_NAME,                                                                                                                                                                                     
	VAR_TYPE ,                                                                                                                                                                                        
	VAR_VALUE ,                                                                                                                                                                                
	DESCR ,                                                                                                                                                                                 
	VAR_SUBS,                                                                                                                                                                                     
	CHG_DATE ,                                                                                                                                                                                          
	CHG_USER ,                                                                                                                                                                                      
	CHG_TERM
)
VALUES
(
	'999999',
	'PRSRV_INVSTAT',
	'S',
	'PRSV',
	'Partial Reserve Location',
	NULL,
	sysdate,
	'BASE',
	'BASE'
);

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
(
	'VTLOCCOD11',
	'Invalid Location Code',
	'Entered or scanned location code is not a partial GRL location, please enter or scan valid location',
	'E',
	NULL,
	NULL,
	NULL,
	NULL,
	sysdate,
	'BASE',
	'BASE',
	NULL,
	NULL
);

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
(
	'VTLOCCOD12',
	'Invalid Location Code',
	'Entered or scanned location code is not a partial reserve location, please enter or scan valid location',
	'E',
	NULL,
	NULL,
	NULL,
	NULL,
	sysdate,
	'BASE',
	'BASE',
	NULL,
	NULL
);



INSERT INTO LOCATION
(
	LOC_CODE,                                                                                                                                                                                       
	DESCR,                                                                                                                                                                                  
	SH_DESCR,                                                                                                                                                                                  
	LOC_TYPE,                                                                                                                                                                                   
	INV_STAT,                                                                                                                                                                                       
	ONE_ITEM ,                                                                                                                                                                                       
	CAPACITY ,                                                                                                                                                                                  
	CAP_UOM  ,                                                                                                                                                                                       
	LOC_GROUP ,                                                                                                                                                                                       
	TEMP,                                                                                                                                                                                       
	SITE_CODE,                                                                                                                                                                                       
	SITE_CODE__OWN,                                                                                                                                                                                       
	ITEM_CODE,                                                                                                                                                                                      
	EFF_FROM,                                                                                                                                                                                          
	VALID_UPTO,                                                                                                                                                                                          
	HIRE_CHARGE,                                                                                                                                                                                  
	USABLE,                                                                                                                                                                                       
	CHG_DATE,                                                                                                                                                                                          
	CHG_USER,                                                                                                                                                                                      
	CHG_TERM,                                                                                                                                                                                      
	ZONE,                                                                                                                                                                                   
	PALLET_BASED,                                                                                                                                                                                       
	SINGLE_LOT_SL,                                                                                                                                                                                       
	ITEM_LOT_OPT,                                                                                                                                                                                       
	CYCLE_COUNT_REQD,                                                                                                                                                                                       
	PHY_HAN_BASIS,                                                                                                                                                                                       
	PHY_HAN_UOM,                                                                                                                                                                                       
	DROP_GROUP,                                                                                                                                                                                       
	LOC_ZONE
)
VALUES 
(
	'PGRL',
	'Partial General Receipt',
	'PART GENERAL RECEIPT',
	'C',
	'PGRL',
	'Y',
	999999999,
	NULL,
	'S',
	'N',
	'TA821',
	NULL,
	NULL,
	TO_TIMESTAMP('31-05-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	TO_TIMESTAMP('1-01-1949 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	NULL,
	'Y',
	SYSDATE,
	'BASE',
	'BASE',
	NULL,
	'Y',
	'Y',
	'0',
	'N',
	'I',
	NULL,
	NULL,
	NULL
);

INSERT INTO INVSTAT
(
	INV_STAT,                                                                                                                                                                                       
	DESCR,                                                                                                                                                                                  
	AVAILABLE,                                                                                                                                                                                       
	OVERISS,                                                                                                                                                                                       
	PLAN_PROD,                                                                                                                                                                                       
	RECORD ,                                                                                                                                                                                       
	CHG_DATE,                                                                                                                                                                                          
	CHG_USER ,                                                                                                                                                                                      
	CHG_TERM ,                                                                                                                                                                                      
	USABLE  ,                                                                                                                                                                                       
	STAT_TYPE,                                                                                                                                                                                       
	REPORT_TYPE
)
VALUES 
(
	'PGRL',
	'Part General receipt',
	'Y',
	'N',
	'N',
	'Y',
	sysdate,
	'BASE      ',
	'localhost.local',
	'Y',
	'M',
	NULL
);
--PUTAWAY PARTIAL GRL REQUREMENTS [WM2ESUN009]  ADDED BY ASHISH SONAWANE [END]

-- cpatil -- pickissIC

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 ('INVITMQTST','Invalid Item','Hold Quantity present against entered Item in Stock.','E','Y',null,null,null,null,null,null,null,null);

--Added by manoj dtd 24/08/2012 for Auto Save Receipt
DELETE FROM SYSTEM_SERVICE_ARGS WHERE SERVICE_CODE='prv_phy_scan';

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_phy_scan',1,'COMPONENT_TYPE','I',null,'S',null,SYSDATE,'Rohan     ','BASE','EJB');
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_phy_scan',2,'COMPONENT_NAME','I',null,'S',null,SYSDATE,'Rohan     ','BASE','PhyItemScanIC');
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_phy_scan',3,'XML_DATA__ALL','l',null,'S',null,SYSDATE,'Rohan     ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_phy_scan',4,'XML_DATA_1','l',null,'S',null,SYSDATE,'Rohan     ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_phy_scan',5,'XML_DATA_ALL','l',null,'S',null,SYSDATE,'Rohan     ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_phy_scan',6,'OBJ_CONTEXT','l',null,'S',null,SYSDATE,'Rohan     ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_phy_scan',7,'EDIT_FLAG','l',null,'S',null,SYSDATE,'Rohan     ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_phy_scan',8,'XTRA_PARAMS','l',null,'S',null,SYSDATE,'Rohan     ','BASE',null);

--Added By mahesh Patidar on 25/08/12 for case transfer

UPDATE system_events set service_code = 'prv_nevigate_ejb' where obj_name = 'case_transfer' and event_code = 'pre_navigate_next'
UPDATE system_events set service_code = 'prv_nevigate_ejb' where obj_name = 'case_transfer' and event_code = 'pre_navigate_finish'
-- from sun unique merged on 27/08/12

update messages set msg_str='Wave is on Hold',msg_descr='The wave task is on hold, Replenishment cannot be done.' where msg_no='PRCESHLD';

update messages set msg_str='Wave is on Hold',msg_descr=' The Selected Wave is on Hold'  where msg_no='WAVEHOLD';

update messages set msg_str='Wave is Release',msg_descr=' The Selected Wave Released'  where msg_no='WAVERELS';

update disparm set var_value = 'wave_task_main' where var_name = 'WAVE_REP_OBJ_NAME';

--Added by Manoj dtd 27/08/12 for Stock Allocation Default set
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 ('sordalloc','post_item_change','1','poic_default_ejb',null,'0',sysdate,'BASE      ','BASE','2','EJB','SordallocIC',null);
insert into obj_itemchange values('sordalloc','1','itm_default',null);
--Added by manoj for Policy Master
insert into obj_itemchange values('policy_mst','1','scenario_type',null);

-- Added by Kunal on 27/08/12 for sales order form taro

	insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('salesreturn_form_tr','1','site_code__dlv',null);
	
-- Added by Kunal on 27/08/12 for sales order form taro  

	ALTER TABLE SRETURN_FORM_DET
ADD BASIC_RATE NUMBER(15,4);


insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values
('salesreturn_form_tr','2','basic_rate',null);

insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values
('salesreturn_form_tr','1','cust_code__bill',null);

Insert into  pophelp (FIELD_NAME,MOD_NAME,SQL_STR,DW_OBJECT,MSG_TITLE,WIDTH,HEIGHT,CHG_DATE,CHG_USER,CHG_TERM,DIST_OPT,FILTER_STRING,SQL_INPUT)
values ('SCHEME_CODE','W_SORDER_SCHEME',
'SELECT B.SCHEME_CODE,A.DESCR,A.ITEM_CODE,A.DISC_TYPE
 FROM BOM A,  
 SCHEME_APPLICABILITY B,SCHEME_APPLICABILITY_DET C,SORDER E, CUSTOMER F     
 WHERE A.BOM_CODE=B.SCHEME_CODE    
 AND B.SCHEME_CODE=C.SCHEME_CODE  
 AND F.CUST_CODE = E.CUST_CODE__DLV 
 AND (B.CUST_TYPE IS NULL OR F.CUST_TYPE = B.CUST_TYPE) 
AND A.PROMO_TERM IN(''2'',''3'')  
AND (SELECT SUM(nvl(NET_AMT,0)) FROM INVOICE I WHERE I.CUST_CODE =E.CUST_CODE AND I.TRAN_DATE >= (select fr_date from acctprd where sysdate  between fr_date and to_date ) ) >= NVL(B.MIN_YTD_SALES,0)
AND ( E.CUST_CODE__DLV IN(SELECT CUST_CODE FROM BRACKET_GROUP BG WHERE BG.BRACKET_GRP=B.BRACKET_GRP) OR B.BRACKET_GRP IS NULL )
AND (E.SITE_CODE=C.SITE_CODE OR C.SITE_CODE IS NULL) 
AND (C.STAN_CODE=F.PIN OR C.STAN_CODE IS NULL)  
AND E.SALE_ORDER = ''?''',
null,'Scheme Code',null,null,sysdate,'Kunal','Base ',null,null,':tran_id');



Insert into  pophelp (FIELD_NAME,MOD_NAME,SQL_STR,DW_OBJECT,MSG_TITLE,WIDTH,HEIGHT,CHG_DATE,CHG_USER,CHG_TERM,DIST_OPT,FILTER_STRING,SQL_INPUT)
values ('SCHEME_CODE','W_SORDERDET_SCHEME',
'SELECT B.SCHEME_CODE,A.DESCR,A.ITEM_CODE,A.DISC_TYPE
   FROM BOM A, 
   SCHEME_APPLICABILITY B,SCHEME_APPLICABILITY_DET C,SORDDET D,SORDER E , CUSTOMER F  
   WHERE    A.BOM_CODE=B.SCHEME_CODE   
   AND B.SCHEME_CODE=C.SCHEME_CODE  
   AND D.SALE_ORDER=E.SALE_ORDER  
   AND (B.CUST_TYPE IS NULL OR F.CUST_TYPE = B.CUST_TYPE)  
   AND D.QUANTITY BETWEEN A.MIN_QTY AND A.MAX_QTY    AND D.NET_AMT BETWEEN A.MIN_AMT AND A.MAX_AMT  
    AND (SELECT SUM(nvl(NET_AMT,0)) FROM INVOICE I WHERE I.CUST_CODE =E.CUST_CODE AND I.TRAN_DATE >= (select fr_date from acctprd where sysdate  between fr_date and to_date) ) >= NVL(B.MIN_YTD_SALES,0)
   AND ((E.CUST_CODE__DLV IN(SELECT CUST_CODE FROM BRACKET_GROUP BG WHERE BG.BRACKET_GRP=B.BRACKET_GRP) OR B.BRACKET_GRP IS NULL) 
   OR  (E.CUST_CODE__DLV=F.CUST_CODE AND trim(B.CUST_GRP)=trim(F.GROUP_CODE) OR B.CUST_GRP IS NULL ) )  
  AND (B.ITEM_CODE=D.ITEM_CODE OR B.ITEM_CODE = ''X'') 
   AND (B.ITEM_DIS IS NULL OR ( B.ITEM_DIS =  (SELECT  ITEM_DIS  FROM ITEM I WHERE I.ITEM_CODE=D.ITEM_CODE )  ) ) 
   AND A.PROMO_TERM IN(''0'',''1'')  
   AND D.SALE_ORDER= ''?'' 
    AND E.CUST_CODE__DLV = F.CUST_CODE(+) 
   AND ((C.SITE_CODE IS NULL OR E.SITE_CODE IN ('',C.SITE_CODE)) OR (C.STATE_CODE IS NULL OR F.STATE_CODE IN ('',C.STATE_CODE)) OR (C.COUNT_CODE IS NULL OR F.COUNT_CODE IN ('',C.COUNT_CODE)) OR (C.STAN_CODE IS NULL OR F.STAN_CODE IN ('',C.STAN_CODE))) 
',
null,'Scheme Code',null,null,sysdate,'Kunal','Base ',null,null,':tran_id');



-- 28/08/12 from sun unique
ALTER TABLE REPL_ORD_DET
ADD REPL_TYPE CHAR(3);
ALTER TABLE SORD_ALLOC
DROP COLUMN WAVE_FLAG;

COMMIT;

ALTER TABLE SORD_ALLOC_DET
ADD WAVE_FLAG CHAR(1);
COMMIT;

create or replace
FUNCTION FN_CHECK_MANUAL_STOCK_ALLOC(SI_SALE_ORDER IN CHAR, SI_LINE_NO IN CHAR )
  RETURN number is FLAG number ;
  CNT NUMBER;
  CNT1 NUMBER;
  BEGIN
   BEGIN
    SELECT count(*) INTO CNT FROM SORD_ALLOC SA, SORD_ALLOC_DET SAD
      WHERE SA.SALE_ORDER = SAD.SALE_ORDER
      AND SA.SALE_ORDER = SI_SALE_ORDER
      AND SA.CONFIRMED = 'Y'
      AND SAD.LINE_NO__SORD = SI_LINE_NO ;
    IF (CNT  > 0 ) THEN
      SELECT count(*) INTO CNT1 FROM SORD_ALLOC SA, SORD_ALLOC_DET SAD
      WHERE SA.SALE_ORDER = SI_SALE_ORDER
      AND SA.SALE_ORDER = SAD.SALE_ORDER
      AND SAD.LINE_NO__SORD = SI_LINE_NO
      AND SA.CONFIRMED = 'Y'
      AND SAD.WAVE_FLAG ='Y';
      IF( CNT1 >0 ) THEN
        FLAG := 1;
      ELSE
       FLAG := 0 ;
      END IF;
    ELSE
      FLAG :=3;
    END IF;
  EXCEPTION
  WHEN NO_DATA_FOUND  THEN
   FLAG :=2;
  END;
  RETURN FLAG;
  END;
  /

commit;



-----added by akhilesh S on 27/AUG/12

alter table sordertype add returnable  char(1);
alter table sordertype add reas_code  char(5);

insert into  POPHELP
(
field_name,
mod_name,
sql_str,
msg_title,
sql_input,
chg_date,
chg_user,
chg_term,
dist_opt
)
values
(
'REAS_CODE',
'W_SORDER_TYPE',
'select fld_value,descr from gencodes',
'REAS CODE',
NULL,
sysdate,
'BASE',
'BASE',
'1'
);


-- these two field not found in taro added by akhilesh on 27/AUG/12
alter table sordertype add fmode CHAR(1);
alter table sordertype add tax_class CHAR(5);

--- added sql pravin 27-08-12 -- 
alter table min_rate_history
add ( RETURNABLE CHAR(1),
      REAS_CODE CHAR(5)) ;

 -- added by cpatil

alter table policymst add APPLY_SER varchar2(100);
alter table policymst add NOAPPLY_SER varchar2(100);

--Added By Manoj Sharma dtd 29082012
delete from obj_actions where obj_name='sorder_scheme';
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('sorder_scheme',1,'add.gif','Adding New','a','a','A','Add','1',null,null,'S',null,SYSDATE,'Kunal          ','Kunal     ');
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('sorder_scheme',2,'edit.gif','Editing Existing Record','a','a','E','Edit','1',null,null,'S',null,SYSDATE,'Kunal          ','Kunal     ');
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('sorder_scheme',3,'delete.gif','Deleting','a','a','D','Delete','1',null,null,'S',null,null,null,null);
delete from obj_actions where obj_name='sorderdet_scheme';
Insert into obj_actions (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('sorderdet_scheme',1,'add.gif','Adding New','a','a','A','Add','1',null,null,'S',null,SYSDATE,'Kunal          ','Kunal     ');
Insert into obj_actions (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('sorderdet_scheme',2,'edit.gif','Editing Existing Record','a','a','E','Edit','1',null,null,'S',null,SYSDATE,'Kunal          ','Kunal     ');
Insert into obj_actions (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('sorderdet_scheme',3,'delete.gif','Deleting','a','a','D','Delete','1',null,null,'S',null,null,null,null);

--Added by Ashish Sonawane on 29/08/12 for wavegeneration from SUN

CREATE TABLE SORDITEM_TEMP
( 
    SALE_ORDER CHAR(10), 
    LINE_NO CHAR(3), 
    REAS_DETAIL VARCHAR2(120),
    PART_QTY CHAR(1)
) ;

--Added By Manoj Sharma dtd 30/08/2012 to Store  Scheme Discount Amount in Sale Order
ALTER TABLE SORDER ADD (ORD_BILLBACK_AMT NUMBER(14,3),ORD_OFFINV_AMT NUMBER(14,3),
LINE_BILLBACK_AMT NUMBER(14,3),LINE_OFFINV_AMT NUMBER(14,3));

ALTER TABLE SORDDET ADD (BILLBACK_AMT NUMBER(14,3),OFFINV_AMT NUMBER(14,3));
-- 31/08/12

alter table porcpdet add partial_yn char(1);

-- Added By Kunal on 31/8/12 for repl iss new framework 
update transetup set audit_trail_opt = '0' where tran_window = 'w_active_repl_iss';

update transetup set header_form_no = '2' where tran_window in ('w_active_repl_iss','w_repl_iss');

update transetup set save_flag = 'A'  where tran_window  in ('w_repl_iss','w_active_repl_iss');

update system_events set obj_name = 'active_repl_iss_1' where obj_name = 'active_repl_iss' and event_code = 'pre_save';

update system_events set obj_name = 'repl_iss_1' where obj_name = 'repl_iss' and event_code = 'pre_save';

-- Added By Kunal on 31/8/12 for repl iss new framework 


delete  from obj_actions where obj_name in ( 'repl_iss' ,'active_repl_iss');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER)
 values ('active_repl_iss',1,null,'Saving',null,null,'S','Finish','4',null,null,'U',null,sysdate,'BASE','KUNAL');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('active_repl_iss',2,null,'Prev','a','a','P','Previous','2',null,null,'U',null,null,null,null);

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('active_repl_iss',3,null,'Next','a','a','N','Next','1',null,null,'U',null,null,null,null);

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER)
 values ('active_repl_iss',4,'confirm~normal.gif','Confirming records','pre_confirm','a','F','Confirm','2','2','1','S',null,null,null,null);

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('active_repl_iss',5,null,'Prev',null,null,'P','Previous','3',null,null,'U',null,null,null,null);

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('active_repl_iss',6,null,'Next',null,null,'N','Next','2',null,null,'U',null,null,null,null);

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER)
 values ('active_repl_iss',7,null,'Next','a','a','N','Next','3',null,null,'U',null,null,null,null);

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER)
 values ('repl_iss',1,null,'Saving',null,null,'S','Finish','4',null,null,'U',null,sysdate,'BASE','KUNAL');

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('repl_iss',2,null,'Prev','a','a','P','Prev','2',null,null,'U',null,null,null,null);

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER)
 values ('repl_iss',3,null,'Next','a','a','N','Next','1',null,null,'U',null,null,null,null);

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('repl_iss',4,'confirm~normal.gif','Confirming records','pre_confirm','a','F','Confirm','3','2','1','S',null,null,null,null);

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('repl_iss',5,null,'Next','a','a','N','Next','2',null,null,'U',null,null,null,null);

Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('repl_iss',6,null,'Prev','a','a','P','Prev','3',null,null,'U',null,null,null,null);


delete  from OBJ_FORMS where WIN_NAME in ( 'w_repl_iss' ,'w_active_repl_iss');

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_active_repl_iss','Replenishment Task',null,null,null,null,null,null,'1','F',null,null,'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Replenishment Task ID:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>repl_order</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,null,null,null,null,'E',null,null,null);

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW)
 values ('w_active_repl_iss','Replenishment Task',null,null,null,null,null,null,'2','F',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'E',null,null,null);

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_active_repl_iss','Replenish Inventory',null,null,null,null,null,null,'3','T',null,null,'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location From:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>New LPN:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl__new</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,'checkedImage@img<loc_code><item_code>, <lot_no>, <lot_sl>, <quantity> <unit> = <loc_code__to> <lot_sl__new>',null,null,null,'E',null,null,'U');

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_active_repl_iss','Active Pick Location',null,null,null,null,null,null,'4','T',null,null,'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>LPN:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Active Pick Location :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,'checkedImage@img<loc_code> <item_code>, <lot_no>, <lot_sl>',null,null,null,'E',null,null,'U');

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_repl_iss','Replenishment Task',null,null,null,null,null,null,'1','F',null,null,'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Replenishment Task ID:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>repl_order</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,null,null,null,null,'E',null,null,null);

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW)
 values ('w_repl_iss','Replenishment Task',null,null,null,null,null,null,'2','F',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'E',null,null,null);

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_repl_iss','Replenish Inventory',null,null,null,null,null,null,'3','T',null,null,'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location From:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location Code To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,'checkedImage@img<loc_code>,<item_code>, <lot_no>, <lot_sl>, <quantity> <unit> = <loc_code__to>',null,null,null,'E',null,null,'U');
-- sun unique
INSERT INTO MESSAGES(MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,CHG_DATE,CHG_USER,CHG_TERM) 
VALUES('NULLEXPDT','NULL EXPIRY DATE','Expiry Date can`t be null','E','Y','30-AUG-2012','Ameya','Base');
-- end sun unique

-- added by cpatil for shipment conf validation
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 ('VMSHIPACON','Shipment already confirmed.','This shipment is alredy Confirmed. ','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);
-- end

-- added for group pricelist from request DI1FSUN002  by cpatil start
--- added by cpatil

delete from system_events where obj_name='group_pricelist' and event_code='post_validate';

update pophelp set sql_str='select price_list from pricelist union select price_list__parent from pricelist' where field_name='PRICE_LIST' and mod_name='W_GROUP_PRICELIST';



---end

DELETE FROM OBJ_FORMS WHERE win_name = 'w_checksheet' AND form_no ='2';
INSERT INTO OBJ_FORMS  (
	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata ,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata)
VALUES (
	'w_checksheet',
	'Detail',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Pallet / Carton Number :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no</FIELD></FIELDS></MAPPING_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img Pallet Number ------: <pallet_no> (item_code,lot_no,lot_sl,quantity)<item_list>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL);
	
-- 01/09/12
alter table item drop column NMFC_CODE;
alter table item drop column  NMFC_DESCR;

--01/09/12 Added by Manoj for Receipt Validation and Conditional Scanning
delete from obj_forms where win_name='w_porcp_wiz' and form_no='3';
Insert into obj_forms (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) values ('w_porcp_wiz','Receipt Inventory',null,null,null,null,null,null,'3','T',null,null,'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Number of Cases:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>no_art</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="3"><SCAN_LABEL>Is Partial?:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>partial_yn</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="4"><SCAN_LABEL>Partial Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>part_qty</FIELD></FIELDS></INPUT_SCAN><SCAN_CONDITION field="part_qty">partial_yn.indexOf("Y") != -1</SCAN_CONDITION></SCAN_INFO>',null,null,null,null,null,null,null,null,null,'checkedImage@img<item_descr>(<item_code>) , <lot_no> , <unit> = <lot_sl> , <loc_code>',null,null,null,'E',null,null,'A');
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 ('CASNTMT ','Case Count Mismatch','Input Number of cases are not Equals to Capacity','W','Y',null,null,null,SYSDATE,'BASE','BASE',null,null);
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 ('QTYNTMT ','Quantity Mismatch','Quantity Mismatch','W','Y',null,null,null,SYSDATE,'BASE','BASE',null,null);
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 ('INVALIDQTY','Invalid Quantity','Input Quantity can not be greater than ASN Quantity ','E','Y',null,null,null,SYSDATE,'BASE','BASE',null,null);
--01/09/12 Added by shamim 
update pophelp set SQL_STR ='SELECT B.SCHEME_CODE,A.DESCR,A.ITEM_CODE,A.DISC_TYPE
 FROM BOM A,  
 SCHEME_APPLICABILITY B,SCHEME_APPLICABILITY_DET C,SORDER E, CUSTOMER F ,SORDER_SCHEME S      
 WHERE A.BOM_CODE=B.SCHEME_CODE    
 AND B.SCHEME_CODE=C.SCHEME_CODE  
 AND F.CUST_CODE = E.CUST_CODE__DLV 
 AND (B.CUST_TYPE IS NULL OR F.CUST_TYPE = B.CUST_TYPE) 
AND A.PROMO_TERM IN(''2'',''3'')  
AND (SELECT SUM(nvl(NET_AMT,0)) FROM INVOICE I WHERE I.CUST_CODE =E.CUST_CODE AND I.TRAN_DATE >= (select fr_date from acctprd where sysdate  between fr_date and to_date ) ) >= NVL(B.MIN_YTD_SALES,0)
AND ( E.CUST_CODE__DLV IN(SELECT CUST_CODE FROM BRACKET_GROUP BG WHERE BG.BRACKET_GRP=B.BRACKET_GRP) OR B.BRACKET_GRP IS NULL )
AND (E.SITE_CODE=C.SITE_CODE OR C.SITE_CODE IS NULL) 
AND (C.STAN_CODE=F.PIN OR C.STAN_CODE IS NULL)  
AND E.SALE_ORDER = ''?'' AND  B.SCHEME_CODE NOT IN (SELECT SCHEME_CODE FROM SORDER_SCHEME WHERE TRAN_ID = E.SALE_ORDER   )'
WHERE FIELD_NAME ='SCHEME_CODE' AND MOD_NAME = 'W_SORDER_SCHEME';


update pophelp set SQL_STR ='SELECT B.SCHEME_CODE,A.DESCR,A.ITEM_CODE,A.DISC_TYPE
   FROM BOM A, 
   SCHEME_APPLICABILITY B,SCHEME_APPLICABILITY_DET C,SORDDET D,SORDER E , CUSTOMER F  ,SORDERDET_SCHEME S 
   WHERE    A.BOM_CODE=B.SCHEME_CODE   
   AND B.SCHEME_CODE=C.SCHEME_CODE  
   AND D.SALE_ORDER=E.SALE_ORDER  
   AND (B.CUST_TYPE IS NULL OR F.CUST_TYPE = B.CUST_TYPE)  
   AND D.QUANTITY BETWEEN A.MIN_QTY AND A.MAX_QTY    AND D.NET_AMT BETWEEN A.MIN_AMT AND A.MAX_AMT  
    AND (SELECT SUM(nvl(NET_AMT,0)) FROM INVOICE I WHERE I.CUST_CODE =E.CUST_CODE AND I.TRAN_DATE >= (select fr_date from acctprd where sysdate  between fr_date and to_date) ) >= NVL(B.MIN_YTD_SALES,0)
   AND ((E.CUST_CODE__DLV IN(SELECT CUST_CODE FROM BRACKET_GROUP BG WHERE BG.BRACKET_GRP=B.BRACKET_GRP) OR B.BRACKET_GRP IS NULL) 
   OR  (E.CUST_CODE__DLV=F.CUST_CODE AND trim(B.CUST_GRP)=trim(F.GROUP_CODE) OR B.CUST_GRP IS NULL ) )  
  AND (B.ITEM_CODE=D.ITEM_CODE OR B.ITEM_CODE = ''X'') 
   AND (B.ITEM_DIS IS NULL OR ( B.ITEM_DIS =  (SELECT  ITEM_DIS  FROM ITEM I WHERE I.ITEM_CODE=D.ITEM_CODE )  ) ) 
   AND A.PROMO_TERM IN(''0'',''1'')  
   AND D.SALE_ORDER= ''?'' 
AND (B.SCHEME_CODE || D.SALE_ORDER || D.LINE_NO ) NOT IN (SELECT SCHEME_CODE || TRAN_ID || LINE_NO_FORM FROM SORDERDET_SCHEME WHERE TRAN_ID =D.SALE_ORDER) 
    AND E.CUST_CODE__DLV = F.CUST_CODE(+) 
   AND ((C.SITE_CODE IS NULL OR E.SITE_CODE IN ('',C.SITE_CODE)) OR (C.STATE_CODE IS NULL OR F.STATE_CODE IN ('',C.STATE_CODE)) OR (C.COUNT_CODE IS NULL OR F.COUNT_CODE IN ('',C.COUNT_CODE)) OR (C.STAN_CODE IS NULL OR F.STAN_CODE IN ('',C.STAN_CODE))) 
' WHERE FIELD_NAME ='SCHEME_CODE' AND MOD_NAME = 'W_SORDERDET_SCHEME';

--- manual stock allocate/deallocate
INSERT INTO itm2menu (application,
	level_1,
	level_2,
	level_3,
	level_4,
	level_5,
	win_name,
	descr,
	comments,
	menu_path,
	icon_path,
	close_icon,
	open_icon,
	obj_type,
	chg_date,
	chg_term,
	chg_user,
	mob_deploy)
VALUES (
	'TRO',
	2,
	1,
	6,
	0,
	0,
	'w_sordalloc',
	'Manual Stock allocation to Order',
	NULL,
	'TRO.2.1.6.0.0',
	'e12_logo.gif',
	NULL,
	NULL,
	'P',
	NULL,
	NULL,
	NULL,
	NULL);


delete from obj_actions where obj_name = 'sordalloc';
delete from system_events where obj_name = 'sordalloc' and event_code in ('get_data','process');
delete from system_service_args where service_code in ('agetData_sordalloc','aprocessSordalloc');
delete from system_event_services where service_code in ('agetData_sordalloc','aprocessSordalloc');

INSERT INTO system_event_services (	service_code,
	service_descr,
	service_uri,
	service_provider,
	method_name,
	return_value,
	return_type,
	return_descr,
	return_xfrm,
	chg_date,
	chg_user)
VALUES (
	'agetData_sordalloc',
	'Action To get the Data',
	'http://localhost:9090/axis/services/ProcessService',
	'Base Information',
	'getData',
	'String',
	'S',
	NULL,
	NULL,
	TO_TIMESTAMP('20-11-2008 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'Dharmen   ');
INSERT INTO system_event_services (	service_code,
	service_descr,
	service_uri,
	service_provider,
	method_name,
	return_value,
	return_type,
	return_descr,
	return_xfrm,
	chg_date,
	chg_user)
VALUES (
	'aprocessSordalloc',
	'Action To process the Data',
	'http://localhost:9090/axis/services/ProcessService',
	'Base Information',
	'process',
	'String',
	'S',
	NULL,
	NULL,
	TO_TIMESTAMP('20-11-2008 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ');


INSERT INTO system_events (obj_name,
	event_code,
	event_context,
	service_code,
	method_rule,
	chg_date,
	chg_user,
	chg_term,
	result_handle,
	overwrite_core,
	comp_type,
	comp_name,
	comm_format)
VALUES (
	'sordalloc',
	'get_data',
	'1',
	'agetData_sordalloc',
	NULL,
	TO_TIMESTAMP('21-11-2008 13:53:20','DD-MM-YYYY HH24:MI:SS'),
	'20-NOV-08 ',
	'BASE29',
	'2',
	'0',
	'EJB',
	'StockAllocationPrc',
	NULL);
INSERT INTO system_events (obj_name,
	event_code,
	event_context,
	service_code,
	method_rule,
	chg_date,
	chg_user,
	chg_term,
	result_handle,
	overwrite_core,
	comp_type,
	comp_name,
	comm_format)
VALUES (
	'sordalloc',
	'process',
	'1',
	'aprocessSordalloc',
	NULL,
	TO_TIMESTAMP('21-11-2008 13:53:20','DD-MM-YYYY HH24:MI:SS'),
	'20-NOV-08 ',
	'BASE216',
	'2',
	'0',
	'EJB',
	'StockAllocationPrc',
	NULL);

INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_sordalloc',
	1,
	'COMPONENT_TYPE',
	'I',
	'Component Type',
	'S',
	NULL,
	TO_TIMESTAMP('20-11-2008 19:10:57','DD-MM-YYYY HH24:MI:SS'),
	'AVIPRASH  ',
	'BASE216        ',
	'EJB');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_sordalloc',
	2,
	'COMPONENT_NAME',
	'I',
	'Component Name',
	'S',
	NULL,
	TO_TIMESTAMP('20-11-2008 19:10:57','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29         ',
	'StockAllocationPrc');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_sordalloc',
	3,
	'XML_DATA',
	'I',
	'XML data of form no 1',
	'S',
	NULL,
	TO_TIMESTAMP('20-11-2008 19:10:57','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29         ',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_sordalloc',
	4,
	'XML_DATA_1',
	'I',
	'XML data of form no All',
	'S',
	NULL,
	TO_TIMESTAMP('20-11-2008 19:10:57','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29         ',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_sordalloc',
	5,
	'WINDOW_NAME',
	'I',
	'Window Name',
	'S',
	NULL,
	TO_TIMESTAMP('20-11-2008 19:10:57','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29         ',
	'w_sordalloc');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_sordalloc',
	6,
	'XTRA_PARAMS',
	'I',
	'Extra Arguments',
	'S',
	NULL,
	TO_TIMESTAMP('20-11-2008 19:10:57','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29         ',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'aprocessSordalloc',
	1,
	'COMPONENT_TYPE',
	'I',
	'Component Type',
	'C.String',
	NULL,
	TO_TIMESTAMP('20-11-2008 19:10:57','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE216        ',
	'EJB');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'aprocessSordalloc',
	2,
	'COMPONENT_NAME',
	'I',
	'Component Name',
	'C.String',
	NULL,
	TO_TIMESTAMP('20-11-2008 19:10:57','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE216        ',
	'StockAllocationPrc');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'aprocessSordalloc',
	3,
	'XML_DATA_1',
	'I',
	'XML data of form no 1',
	'S',
	NULL,
	TO_TIMESTAMP('20-11-2008 19:10:57','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE216        ',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'aprocessSordalloc',
	4,
	'XML_DATA__ALL',
	'I',
	'XML data of form no 1',
	'S',
	NULL,
	TO_TIMESTAMP('20-11-2008 19:10:57','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE216        ',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'aprocessSordalloc',
	5,
	'OBJ_CONTEXT',
	'I',
	'Object Context',
	'S',
	NULL,
	TO_TIMESTAMP('20-11-2008 19:10:57','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE216        ',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'aprocessSordalloc',
	6,
	'XTRA_PARAMS',
	'I',
	'Extra Arguments',
	'S',
	NULL,
	TO_TIMESTAMP('20-11-2008 19:10:57','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE216        ',
	NULL);
delete from obj_forms where win_name = 'w_sordalloc';
INSERT INTO obj_forms (	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info)
VALUES (
	'w_sordalloc',
	'Stock Detail',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_forms (	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info)
VALUES (
	'w_sordalloc',
	'Stock Item',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO obj_actions (	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
VALUES (
	'sordalloc',
	7,
	NULL,
	'Action Button for getting data',
	'get_data',
	'a',
	'R',
	'GetData',
	'2',
	'3',
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions (	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
VALUES (
	'sordalloc',
	8,
	NULL,
	'Action Button for processing the data',
	'process',
	'a',
	'R',
	'Process',
	'2',
	'3',
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
delete from itm2menu where application = 'TRO' and level_1 = 2 and level_2 = 1 and level_3 = 7;
INSERT INTO itm2menu (application,
	level_1,
	level_2,
	level_3,
	level_4,
	level_5,
	win_name,
	descr,
	comments,
	menu_path,
	icon_path,
	obj_type)
VALUES (
	'TRO',
	2,
	1,
	7,
	0,
	0,
	'w_sord_dealloc',
	'F. Manual Stock De-Allocation',
	'Manual Stock De-Allocation',
	'TRO.2.1.7.0.0',
	'itm_logo.ico',
	'P');
delete from obj_actions where obj_name = 'sord_dealloc';
INSERT INTO obj_actions (obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
VALUES (
	'sord_dealloc',
	7,
	NULL,
	'Action Button for getting data',
	'get_data',
	'a',
	'R',
	'GetData',
	'2',
	'3',
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions (obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
VALUES (
	'sord_dealloc',
	8,
	NULL,
	'Action Button for processing the data',
	'process',
	'a',
	'R',
	'Process',
	'2',
	'3',
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);

delete from obj_forms where win_name = 'w_sord_dealloc';
INSERT INTO obj_forms (win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	form_no)
VALUES (
	'w_sord_dealloc',
	'Stock Item',
	NULL,
	NULL,
	'1');
INSERT INTO obj_forms (win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	form_no)
VALUES (
	'w_sord_dealloc',
	'Stock Detail',
	NULL,
	NULL,
	'2');
delete from system_events where obj_name = 'sord_dealloc';
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 (
	'sord_dealloc',
	'get_data',
	'1',
	'agetData_sord_dealloc',
	NULL,
	'0',
	TO_TIMESTAMP('4-12-2007 12:12:28','DD-MM-YYYY HH24:MI:SS'),
	'Dharmen   ',
	'BASE29',
	'2',
	'EJB',
	'StockDeallocationPrc',
	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 (
	'sord_dealloc',
	'post_validate',
	'1',
	'post_gen_val',
	NULL,
	'0',
	TO_TIMESTAMP('4-12-2007 12:12:28','DD-MM-YYYY HH24:MI:SS'),
	'system    ',
	'system',
	'2',
	'EJB',
	'GenValidate',
	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 (
	'sord_dealloc',
	'process',
	'1',
	'aprocess_sord_dealloc',
	NULL,
	'0',
	TO_TIMESTAMP('4-12-2007 12:12:28','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29',
	'2',
	'EJB',
	'StockDeallocationPrc',
	NULL);
delete from system_event_services where service_code in ('agetData_sord_dealloc','aprocess_sord_dealloc');
INSERT INTO system_event_services (service_code,
	service_descr,
	service_uri,
	service_provider,
	method_name,
	return_value,
	return_type,
	return_descr,
	return_xfrm,
	chg_date,
	chg_user, chg_term) VALUES (
	'agetData_sord_dealloc',
	'Action To get the Data',
	'http://localhost/axis/services/ProcessService',
	'BASE',
	'getData',
	'String',
	'S',
	NULL,
	NULL,
	TO_TIMESTAMP('21-03-2007 14:03:14','DD-MM-YYYY HH24:MI:SS'),
	'Dharmen   ','m');
INSERT INTO system_event_services (service_code,
	service_descr,
	service_uri,
	service_provider,
	method_name,
	return_value,
	return_type,
	return_descr,
	return_xfrm,
	chg_date,
	chg_user,chg_term) VALUES (
	'aprocess_sord_dealloc',
	'Action To process the Data',
	'http://localhost/axis/services/ProcessService',
	'BASE',
	'process',
	'String',
	'S',
	NULL,
	NULL,
	TO_TIMESTAMP('21-03-2007 14:03:14','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ','m');
delete from system_service_args where service_code in ('agetData_sord_dealloc','aprocess_sord_dealloc');

INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_sord_dealloc',
	1,
	'COMPONENT_TYPE',
	'I',
	'Component Type',
	'S',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29         ',
	'EJB');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_sord_dealloc',
	2,
	'COMPONENT_NAME',
	'I',
	'Component Name',
	'S',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29         ',
	'StockDeallocationPrc');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_sord_dealloc',
	3,
	'XML_DATA',
	'I',
	'XML data of form no 1',
	'S',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29         ',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_sord_dealloc',
	4,
	'XML_DATA_1',
	'I',
	'XML data of form no All',
	'S',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29         ',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_sord_dealloc',
	5,
	'WINDOW_NAME',
	'I',
	'Window Name',
	'S',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29         ',
	'w_sord_dealloc');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_sord_dealloc',
	6,
	'XTRA_PARAMS',
	'I',
	'Extra Arguments',
	'S',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29         ',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'aprocess_sord_dealloc',
	1,
	'COMPONENT_TYPE',
	'I',
	'Component Type',
	'C.String',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29         ',
	'EJB');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'aprocess_sord_dealloc',
	2,
	'COMPONENT_NAME',
	'I',
	'Component Name',
	'C.String',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29         ',
	'StockDeallocationPrc');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'aprocess_sord_dealloc',
	3,
	'XML_DATA_1',
	'I',
	'XML data of form no 1',
	'S',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29         ',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'aprocess_sord_dealloc',
	4,
	'XML_DATA__ALL',
	'I',
	'XML data of form no 1',
	'S',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29         ',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'aprocess_sord_dealloc',
	5,
	'OBJ_CONTEXT',
	'I',
	'Object Context',
	'S',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29         ',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'aprocess_sord_dealloc',
	6,
	'XTRA_PARAMS',
	'I',
	'Extra Arguments',
	'S',
	NULL,
	TO_TIMESTAMP('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29         ',
	NULL);
delete from transetup where tran_window = 'w_sord_dealloc';
INSERT INTO transetup (tran_window,
	save_flag,
	val_flag,
	key_flag,
	key_string,
	chg_date,
	chg_user,
	chg_term,
	edi_option,
	site_acc_col,
	confirm_col,
	confirm_val,
	ledg_post_conf,
	tran_id_col,
	ref_ser)
VALUES (
	'w_sord_dealloc',
	'2',
	'2',
	'A',
	'seq10',
	TO_TIMESTAMP('17-06-2006 17:28:58','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'1              ',
	'1',
	NULL,
	NULL,
	'Y',
	'N',
	'TRAN_ID',
	'D-ALOC');
-- end stock allocatin/deallocation

---Added By Ashish Sonawane on 01/09/12 for PGRL location in putaway [START]

UPDATE LOCATION SET SINGLE_LOT_SL ='N', ITEM_LOT_OPT ='2' WHERE LOC_CODE ='PGRL';

---Added By Ashish Sonawane on 01/09/12 for PGRL location in putaway [END]


---01/09/2012 Added by Manoj for Scheme Amount calculation 
drop trigger SORDER_CHECK_SCHEME;
drop trigger SORDDET_CHECK_SCHEME;

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 ('sorder_scheme','post_save','1','pos_scheme_amt',null,'0',sysdate,'Gulzar    ','BASE','2','EJB','SchemePos',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 ('sorderdet_scheme','post_save','1','pos_scheme_amt',null,'0',sysdate,'Gulzar    ','BASE','2','EJB','SchemePos',null);
Insert into system_event_services (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM) values ('pos_scheme_amt','postSave','http://192.168.0.124/BaseE12DotNetService6-3-0-002/E12BusinessLogic6-3-0-002.asmx','BASE','postSave','String','S',null,null,sysdate,'Gulzar    ','Gulzar');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pos_scheme_amt',1,'COMPONENT_TYPE','I',null,'S',null,SYSDATE,'Gulzar    ','Gulzar','EJB');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pos_scheme_amt',2,'COMPONENT_NAME','I',null,'S',null,SYSDATE,'Gulzar    ','Gulzar','SchemePos');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pos_scheme_amt',3,'XML_DATA_ALL','I',null,'S',null,SYSDATE,'Gulzar    ','Gulzar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pos_scheme_amt',4,'<tran_id>','I',null,'B.String',null,SYSDATE,'Gulzar    ','Gulzar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pos_scheme_amt',5,'EDIT_FLAG','I',null,'S',null,SYSDATE,'Gulzar    ','Gulzar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pos_scheme_amt',6,'XTRA_PARAMS','I',null,'S',null,SYSDATE,'Gulzar    ','Gulzar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pos_scheme_amt',7,'DB_CONN','I',null,'S.Connection',null,SYSDATE,'Gulzar    ','Gulzar',null);

	
delete from obj_actions where obj_name in('sorder_scheme','sorderdet_scheme') and  description like '%Deleting%'
 
Insert into obj_actions(OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('sorder_scheme',5,'null','Detele','act_sordSch','1','R','Delete','1','2',null,'U',null,sysdate,'BASE','BASE');

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 ('sorder_scheme','act_sordSch','1','act_sordSch_so',null,'0',SYSDATE,'BASE','BASE','2','EJB','SorderSchemeDel',null);

Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM) values ('act_sordSch_so','Action to Delete','http://192.168.0.124/BaseE12DotNetService6-3-0-003/E12BusinessLogic6-3-0-003.asmx','Base Information','actionHandler','String','S',null,null,SYSDATE,'BASE','BASE31');

Insert into system_service_args(SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('act_sordSch_so',1,'COMPONENT_TYPE','I',null,'S',null,sysdate,'BASE','BASE107','EJB');
Insert into system_service_args(SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('act_sordSch_so',2,'COMPONENT_NAME',null,null,'S',null,sysdate,'BASE','BASE107','SorderSchemeDel');
Insert into system_service_args(SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('act_sordSch_so',3,'<tran_id>',null,null,'B.String',null,sysdate,'BASE','BASE107',null);
Insert into system_service_args(SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('act_sordSch_so',4,'XTRA_PARAMS',null,null,'S',null,sysdate,'BASE','BASE107',null);
Insert into system_service_args(SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('act_sordSch_so',5,'FORCED_FLAG',null,null,'S',null,sysdate,'BASE','BASE107',null);

--detete button and ejb entry for sale order scheme Detail 

Insert into obj_actions(OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('sorderdet_scheme',5,'null','Detele','act_sordDetSch','1','R','Delete','1','2',null,'U',null,sysdate,'BASE','BASE');

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 ('sorderdet_scheme','act_sordDetSch','1','act_sordDetSch_so',null,'0',SYSDATE,'BASE','BASE','2','EJB','SorderSchemeDetDel',null);

Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM) values ('act_sordDetSch_so','Action to Delete','http://192.168.0.124/BaseE12DotNetService6-3-0-003/E12BusinessLogic6-3-0-003.asmx','Base Information','actionHandler','String','S',null,null,SYSDATE,'BASE','BASE31');

Insert into system_service_args(SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('act_sordDetSch_so',1,'COMPONENT_TYPE','I',null,'S',null,sysdate,'BASE','BASE107','EJB');
Insert into system_service_args(SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('act_sordDetSch_so',2,'COMPONENT_NAME',null,null,'S',null,sysdate,'BASE','BASE107','SorderSchemeDetDel');
Insert into system_service_args(SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('act_sordDetSch_so',3,'<tran_id>',null,null,'B.String',null,sysdate,'BASE','BASE107',null);
Insert into system_service_args(SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('act_sordDetSch_so',4,'XTRA_PARAMS',null,null,'S',null,sysdate,'BASE','BASE107',null);
Insert into system_service_args(SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('act_sordDetSch_so',5,'FORCED_FLAG',null,null,'S',null,sysdate,'BASE','BASE107',null);

--message for delete 

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 ('VTDELETE','Transaction delete!','Scheme is successfully Deleted.','P','N',1,null,null,sysdate,'BASE','BASE',null,null);
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 ('VTDECPDN','Dispatch Already Done!','Dispatch Already Done for This Sale Order!.','E','N',1,null,null,sysdate,'BASE','BASE',null,null);


Insert into obj_itemchange (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values
('customer','1','group_code',null);

Insert into obj_itemchange (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values
('customer','1','cust_code__bil',null);
update pophelp set sql_str = 'select order_type ,descr from sordertype' where field_name = 'ORDER_TYPE' and mod_name = 'W_SORDER';
--ADDED BY SHAMIM ITEM DISC GROUP
CREATE TABLE ITEMDIS_GRP
(
TRAN_ID  CHAR(10) NOT NULL,
ITEM_DIS CHAR(5) NOT NULL,
ITEM_CODE CHAR(10) NOT NULL,
CHG_DATE DATE NOT NULL,
CHG_USER CHAR (10) NOT NULL,
CHG_TERM CHAR (15) NOT NULL
);
ALTER TABLE ITEMDIS_GRP ADD CONSTRAINTS ITEMDIS_GRP_X PRIMARY KEY (TRAN_ID);

INSERT INTO ITM2MENU 
(APPLICATION,LEVEL_1,LEVEL_2,LEVEL_3,LEVEL_4,LEVEL_5,WIN_NAME,DESCR,
COMMENTS,MENU_PATH,ICON_PATH,OBJ_TYPE,CHG_USER,CHG_TERM,CHG_DATE,OPEN_ICON,CLOSE_ICON) 
VALUES ('TRO',1,1,7,0,0,'w_itemdisc_group','Item Discount Group',
null,'TRO.1.1.7.0.0',null,null,null,null,null,null,null);

INSERT INTO OBJ_FORMS 
(WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,
EXPR_COMMENT,FORM_NO,SCR_FLAG,SCAN_FLAG,SCAN_METADATA,AUTO_ACCEPT_SCAN,PROPERTY_INFO,
SCAN_DELIMITER,AUTO_ACCEPT_WEIGHDATA,COLUMN_ON_SAVE,AFTER_SAVE,EXT_COM,EXT_METADATA,EXT_SETUP) 
VALUES ('w_itemdisc_group','Header',null,null,null,null,null,null,'1',
null,null,null,null,null,null,null,null,null,null,null,null);


INSERT INTO OBJ_ACTIONS 
(OBJ_NAME ,LINE_NO ,RIGHTS_CHAR,INTERACTIVE,SERVICE_CODE,DESCRIPTION,TITLE,IMAGE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,
TRAN_TYPE)
VALUES 
('itemdisc_group','1','A','a','a','Adding New','Add','add.gif','1',NULL,NULL,'S',NULL);
	
INSERT INTO OBJ_ACTIONS 
(OBJ_NAME ,	LINE_NO, RIGHTS_CHAR, INTERACTIVE, SERVICE_CODE, DESCRIPTION, TITLE, IMAGE, FORM_NO, SERVICE_HANDLER,
PLACEMENT, ACTION_TYPE,	TRAN_TYPE)
VALUES 
('itemdisc_group','2','E','a','a','Editing Existing Record','Edit','edit.gif','1',NULL,NULL,'S',NULL);
--TRANSETUP

INSERT INTO TRANSETUP
(TRAN_WINDOW,SAVE_FLAG,VAL_FLAG,KEY_FLAG,KEY_STRING,REPEATE_ADD,CHG_DATE,CHG_USER,CHG_TERM,
 EDI_OPTION,CONFIRM_COL,CONFIRM_VAL,REPEAT_ADD_DET,LEDG_POST_CONF,TRAN_ID_COL,
 CONFIRM_MODE,MAIL_OPTION,TABLE_NAME,APPLICATION,REF_SER,VIEW_MODE) 
VALUES 
('w_itemdisc_group','2','2','A','seq10','N',fn_sysdate(),'Shamim','BASE215',
 '0','','','N','N','tran_id',
 '0','0','','','I-DGP','F');	
--SYSTEM_EVENTS
 
INSERT INTO SYSTEM_EVENTS
(OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,
OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT)
VALUES 
('itemdisc_group','pre_validate','1','prv_default_ejb1',null,fn_sysdate(),'Shamim','Shamim','2','0','EJB','ItemDiscGrp',NULL);

-- itemChange SYSTEM_EVENTS

INSERT INTO SYSTEM_EVENTS
(OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,
OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT)
VALUES 
('itemdisc_group','post_item_change','1','poic_default_ejb1',null,fn_sysdate(),'Shamim','Shamim','2','0','EJB','ItemDiscGrp',NULL);
insert into obj_itemchange
(
obj_name,
form_no,
field_name
)
values
(
'itemdisc_group',
'1',
'item_code'
);
insert into refser ( ref_ser, descr, type ,sys_ser,chg_date ,chg_user,chg_term)
values
( 'I-DGP',
'item discount group',
'S',
'I-DGP',
fn_sysdate(),
'Shamim',
'Shamim'
);
INSERT INTO MESSAGES (
	MSG_NO ,MSG_STR,MSG_DESCR,
	MSG_TYPE) 
VALUES
(
'EAIC',
'ENTER A ITEM CODE',
'PLEASE ENTER A ITEM CODE',
'E'); 
INSERT INTO MESSAGES (
	MSG_NO ,MSG_STR,MSG_DESCR,
	MSG_TYPE) 
VALUES
(
'IVIC',
'IN VALID ITEM CODE',
'ENTER A NEW ITEM CODE',
'E'); 
INSERT INTO POPHELP  
(
FIELD_NAME,MOD_NAME,
SQL_STR,
MSG_TITLE
) 
VALUES(	
'ITEM_CODE','X',
'SELECT ITEM_CODE, DESCR FROM ITEM',
'ITEM CODE '
);
--ADDED BY SHAMIM ON 2 sep
INSERT INTO MESSAGES (
	MSG_NO ,MSG_STR,MSG_DESCR,
	MSG_TYPE) 
VALUES
(
'EAID',
'ENTER A ITEM DISCOUNT',
'PLEASE ENTER A ITEM DISCOUNT',
'E'); 
INSERT INTO MESSAGES (
	MSG_NO ,MSG_STR,MSG_DESCR,
	MSG_TYPE) 
VALUES
(
'EAIDIC',
'COMBINATION ALREADY EXISIT',
'ENTER A NEW ITEM, ITEM-DISCOUNT GROUP COMBINATION',
'E'); 
INSERT INTO POPHELP  
(
FIELD_NAME,MOD_NAME,
SQL_STR,
MSG_TITLE
) 
VALUES(	
'ITEM_DIS','X',
'SELECT ITEM_DIS FROM ITEMDIS_GRP',
'ITEM DISCOUNT GROUP '
);
--02/09/2012 Item Change entry for Sale Order Scheme Add

Insert into obj_itemchange (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('sorder_scheme','1  ','itm_default',null);
Insert into obj_itemchange (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('sorder_scheme','1  ','scheme_code',null);
Insert into obj_itemchange (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('sorder_scheme','1  ','tran_id',null);
Insert into obj_itemchange (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('sorderdet_scheme','1  ','item_code',null);
Insert into obj_itemchange (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('sorderdet_scheme','1  ','itm_default',null);
Insert into obj_itemchange (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('sorderdet_scheme','1  ','line_no_form',null);
Insert into obj_itemchange (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('sorderdet_scheme','1  ','scheme_code',null);
Insert into obj_itemchange (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('sorderdet_scheme','1  ','tran_id',null);

--02/09/2012 Item Change entry for Sale Order Scheme Add

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 ('sorder_scheme','post_item_change','1','poic_default_ejb',null,'0',sysdate,'Kunal','Kunal','2','EJB','SOrderSchemeIC',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 ('sorder_scheme','pre_validate','1','prv_default_ejb',null,'0',sysdate,'Kunal','Kunal','2','EJB','SOrderSchemeIC',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 ('sorderdet_scheme','post_item_change','1','poic_default_ejb',null,'0',sysdate,'Kunal','Kunal','2','EJB','SOrderSchemeDetIC',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 ('sorderdet_scheme','pre_validate','1','prv_default_ejb',null,'0',sysdate,'Kunal','Kunal','2','EJB','SOrderSchemeDetIC',null);

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 (
	'VMSORDBK',
	'Invalid Sales Order',
	'Sales Order can not be Blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'kunal',
	'kunal',
	NULL,
	NULL);

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 (
	'VMSORDNT',
	'Invalid Sales Order',
	'Sales order number entered does not exist in Sales order ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'kunal',
	'kunal',
	NULL,
	NULL);

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 (
	'VMDESPSORD',
	'Invalid Sales Order',
	'Despatch already has been done for Sales Order',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'kunal',
	'kunal',
	NULL,
	NULL);




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 (
	'VMSORDLNNT',
	'Invalid Sales Order Line No',
	'Invalid Sales Order Line Number',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'kunal',
	'kunal',
	NULL,
	NULL);
	

	INSERT INTO obj_itemchange (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'sorderdet_scheme',
	'1',
	'item_code',
	null);


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 (
	'VMSOITEM',
	'Invalid Item Code',
	'Item Code entered is not valid for Sales Order.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'kunal',
	'kunal',
	NULL,
	NULL);
  

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 (
	'VMSCHMV',
	'Invalid Scheme Code',
	'Scheme Code entered is already already exists for Sales Order.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'kunal',
	'kunal',
	NULL,
	NULL);
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 (
	'VMSOITM1',
	'Invalid Scheme Code',
	'Scheme Code entered is already already exists for Sales Order.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'kunal',
	'kunal',
	NULL,
	NULL);
	

---Added By Ashish Sonawane on 01/09/12 for PGRL location in putaway [START]

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
(
	'QTYMSMTCH',
	'Invalid Quantity',
	'Entered or scanned Quantity is not a matching with partial quantity, please enter or scan apropriate quantity',
	'E',
	NULL,
	NULL,
	NULL,
	NULL,
	sysdate,
	'BASE',
	'BASE',
	NULL,
	NULL
);

---Added By Ashish Sonawane on 01/09/12 for PGRL location in putaway [END]	

	--02/09/2012 Updated PopHelp Updated for Sale Order Scheme
	update pophelp set SQL_STR ='SELECT B.SCHEME_CODE,A.DESCR,A.ITEM_CODE,A.DISC_TYPE
 FROM BOM A,  
 SCHEME_APPLICABILITY B,SCHEME_APPLICABILITY_DET C,SORDER E, CUSTOMER F       
 WHERE A.BOM_CODE=B.SCHEME_CODE    
 AND B.SCHEME_CODE=C.SCHEME_CODE  
 AND F.CUST_CODE = E.CUST_CODE__DLV 
 AND (B.CUST_TYPE IS NULL OR F.CUST_TYPE = B.CUST_TYPE) 
AND A.PROMO_TERM IN(''2'',''3'')  
AND (SELECT SUM(nvl(NET_AMT,0)) FROM INVOICE I WHERE I.CUST_CODE =E.CUST_CODE AND I.TRAN_DATE >= (select fr_date from acctprd where sysdate  between fr_date and to_date ) ) >= NVL(B.MIN_YTD_SALES,0)
AND ( E.CUST_CODE__DLV IN(SELECT CUST_CODE FROM BRACKET_GROUP BG WHERE BG.BRACKET_GRP=B.BRACKET_GRP) OR B.BRACKET_GRP IS NULL )
AND (E.SITE_CODE=C.SITE_CODE OR C.SITE_CODE IS NULL) 
AND (C.STAN_CODE=F.PIN OR C.STAN_CODE IS NULL)  
AND E.SALE_ORDER = ''?'' AND  B.SCHEME_CODE NOT IN (SELECT SCHEME_CODE FROM SORDER_SCHEME WHERE TRAN_ID = E.SALE_ORDER   )'
WHERE FIELD_NAME ='SCHEME_CODE' AND MOD_NAME = 'W_SORDER_SCHEME';


update pophelp set SQL_STR ='SELECT B.SCHEME_CODE,A.DESCR,A.ITEM_CODE,A.DISC_TYPE
   FROM BOM A, 
   SCHEME_APPLICABILITY B,SCHEME_APPLICABILITY_DET C,SORDDET D,SORDER E , CUSTOMER F   
   WHERE    A.BOM_CODE=B.SCHEME_CODE   
   AND B.SCHEME_CODE=C.SCHEME_CODE  
   AND D.SALE_ORDER=E.SALE_ORDER  
   AND (B.CUST_TYPE IS NULL OR F.CUST_TYPE = B.CUST_TYPE)  
   AND D.QUANTITY BETWEEN A.MIN_QTY AND A.MAX_QTY    AND D.NET_AMT BETWEEN A.MIN_AMT AND A.MAX_AMT  
    AND (SELECT SUM(nvl(NET_AMT,0)) FROM INVOICE I WHERE I.CUST_CODE =E.CUST_CODE AND I.TRAN_DATE >= (select fr_date from acctprd where sysdate  between fr_date and to_date) ) >= NVL(B.MIN_YTD_SALES,0)
   AND ((E.CUST_CODE__DLV IN(SELECT CUST_CODE FROM BRACKET_GROUP BG WHERE BG.BRACKET_GRP=B.BRACKET_GRP) OR B.BRACKET_GRP IS NULL) 
   OR  (E.CUST_CODE__DLV=F.CUST_CODE AND trim(B.CUST_GRP)=trim(F.GROUP_CODE) OR B.CUST_GRP IS NULL ) )  
  AND (B.ITEM_CODE=D.ITEM_CODE OR B.ITEM_CODE = ''X'') 
   AND (B.ITEM_DIS IS NULL OR ( B.ITEM_DIS =  (SELECT  ITEM_DIS  FROM ITEM I WHERE I.ITEM_CODE=D.ITEM_CODE )  ) ) 
   AND A.PROMO_TERM IN(''0'',''1'')  
   AND D.SALE_ORDER= ''?'' 
AND (B.SCHEME_CODE || D.SALE_ORDER || TO_NUMBER(D.LINE_NO) ) NOT IN (SELECT SCHEME_CODE || TRAN_ID || LINE_NO_FORM FROM SORDERDET_SCHEME WHERE TRAN_ID =D.SALE_ORDER) 
    AND E.CUST_CODE__DLV = F.CUST_CODE(+) 
   AND ((C.SITE_CODE IS NULL OR E.SITE_CODE IN ('',C.SITE_CODE)) OR (C.STATE_CODE IS NULL OR F.STATE_CODE IN ('',C.STATE_CODE)) OR (C.COUNT_CODE IS NULL OR F.COUNT_CODE IN ('',C.COUNT_CODE)) OR (C.STAN_CODE IS NULL OR F.STAN_CODE IN ('',C.STAN_CODE))) 
' WHERE FIELD_NAME ='SCHEME_CODE' AND MOD_NAME = 'W_SORDERDET_SCHEME';

alter table item add NMFC_DESCR varchar2(40);
alter table item add  HARMONIZATION_descr varchar2(120);



-----------------------------------------
Added by rutuja on 03-09-12

update pophelp set sql_str = 'select order_type ,descr from sordertype' where field_name = 'ORDER_TYPE' and mod_name = 'W_SORDER';

---Added by Ashish Sonawane on 04-Sep-12 [mail send by Sumit Sarkar from SUN] [START]
INSERT INTO DISPARM  (
	prd_code,
	var_name,
	var_type,
	var_value,
	descr,
	var_subs,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'999999',
	'WAVE_PRINT_MODE',
	'S',
	'JSP',
	'Written mode Exp: JSP OR PRINTER( PDF OR PHYSICAL PRINTER)',
	NULL,
	TO_DATE('6-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'SUMIT          ');
	
	
INSERT INTO DISPARM  (
	prd_code,
	var_name,
	var_type,
	var_value,
	descr,
	var_subs,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'999999',
	'WAVE_PRINTER',
	'S',
	'PDFCreator',
	'Path of printer exp:  \\000.000.000.000\PDFCreator',
	0,
	TO_DATE('2-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ');
	
	
INSERT INTO DISPARM  (
	prd_code,
	var_name,
	var_type,
	var_value,
	descr,
	var_subs,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'999999',
	'WAVE_REP_OBJ_NAME',
	'S',
	'wave_task_main',
	'Object name of Report',
	0,
	TO_DATE('2-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ');
	
	
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 (
	'REPCOMPL  ',
	'REPORT GENERATED!',
	'Report Printed Successfully',
	'P',
	NULL,
	NULL,
	NULL,
	NULL,
	TO_DATE('7-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);
	
	
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 (
	'REPJSPCOMP',
	'REPORT GENERATED!',
	'Report Generated Successfully in JSP File',
	'P',
	NULL,
	NULL,
	NULL,
	NULL,
	TO_DATE('7-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);
	
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 (
	'PRINOTDEF',
	'Print Mode Null',
	'Please enter print mode in disparm',
	'P',
	NULL,
	NULL,
	NULL,
	NULL,
	TO_DATE('7-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);

---Added by Ashish Sonawane on 04-Sep-12 [mail send by Sumit Sarkar from SUN] [END]
--added on 04/09/12 by shamim
Insert into DISPARM (PRD_CODE,VAR_NAME,VAR_TYPE,VAR_VALUE,DESCR,VAR_SUBS,CHG_DATE,CHG_USER,CHG_TERM) values ('999999','SORD_AUTO_CONF','S','N','DEFINE WHETHER AFTER SPLITTING CONFIRMED OR UNCONFIRMED SALE ORDER FORM GENRATE ',null,fn_sysdate(),'base','base');
DELETE POPHELP WHERE FIELD_NAME='ITEM_DIS' AND MOD_NAME='X';
INSERT INTO POPHELP  
(
FIELD_NAME,MOD_NAME,
SQL_STR,
MSG_TITLE
) 
VALUES(	
'ITEM_DIS','X',
'SELECT ITEM_DIS FROM ITEMDIS_GRP',
'ITEM DISCOUNT GROUP '
);
-- added on  05/09/12 for icon
update itm2menu set ICON_PATH='e12_logo.gif' where WIN_NAME='w_edibatchload';
update itm2menu set ICON_PATH='e12_logo.gif' where WIN_NAME='w_itemdisc_group';	

--Added by Manoj dtd 05/09/2012 Changes Received from SUN


create table wave_seq
(
  ref_ser  char(6),
  priority number(2)
);

alter table wave_seq add ( constraint px_wa_se primary key (ref_ser));
commit;


INSERT INTO wave_seq (
	ref_ser,
	priority)
VALUES (
	'A-PICK',
	3);
	
INSERT INTO wave_seq (
	ref_ser,
	priority)
VALUES (
	'C-PICK',
	2);
	
INSERT INTO wave_seq (
	ref_ser,
	priority)
VALUES (
	'M-PACK',
	2);
	
INSERT INTO wave_seq (
	ref_ser,
	priority)
VALUES (
	'M-PICK',
	2);
	
INSERT INTO wave_seq (
	ref_ser,
	priority)
VALUES(
	'R-CAPK',
	3);
	
	
INSERT INTO wave_seq (
	ref_ser,
	priority)
VALUES (
	'R-DSA ',
	3);
	
INSERT INTO wave_seq (
	ref_ser,
	priority)
VALUES (
	'R-DSO ',
	1);
	
INSERT INTO wave_seq (
	ref_ser,
	priority)
VALUES (
	'RP-PSO',
	1);
	
INSERT INTO wave_seq (
	ref_ser,
	priority)
VALUES (
	'R-PSO ',
	1);
	
INSERT INTO wave_seq (
	ref_ser,
	priority)
VALUES(
	'RS-DSO',
	1);
	
INSERT INTO wave_seq (
	ref_ser,
	priority)
VALUES (
	'R-TASK',
	1);
	
INSERT INTO wave_seq (
	ref_ser,
	priority)
VALUES (
	'S-DOC ',
	2);
	
INSERT INTO wave_seq (
	ref_ser,
	priority)
VALUES (
	'S-DSP ',
	4);
--Added By Manoj dtd 05/09/12 Received from SUN
update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Number of Cases:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>no_art</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="3"><SCAN_LABEL>Partial Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>part_qty</FIELD></FIELDS></INPUT_SCAN><SCAN_CONDITION field="part_qty">partial_yn.indexOf("Y") != -1</SCAN_CONDITION></SCAN_INFO>'
where win_name = 'w_porcp_wiz' and form_no = '3';
--Added By Manoj dtd 05/09/12 Received from SUN
delete from obj_actions where obj_name = 'repl_iss'  and  title = 'Finish';
--Added By Manoj dtd 05/09/12 Received from SUN
update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Number of Cases:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>no_art</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="3"><SCAN_LABEL>Partial Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>part_qty</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_porcp_wiz' and form_no = '3';
--Added by Manoj dtd 05/09/2012 to add Column in Physcandet table
ALTER TABLE PHYSCANDET ADD ISEMPTY CHAR(1);
--Added by Manoj dtd 05/09/2012 to USE ITEMDIS_GRP 
update pophelp set SQL_STR ='SELECT B.SCHEME_CODE,A.DESCR,A.ITEM_CODE,A.DISC_TYPE
   FROM BOM A, 
   SCHEME_APPLICABILITY B,SCHEME_APPLICABILITY_DET C,SORDDET D,SORDER E , CUSTOMER F   
   WHERE    A.BOM_CODE=B.SCHEME_CODE   
   AND B.SCHEME_CODE=C.SCHEME_CODE  
   AND D.SALE_ORDER=E.SALE_ORDER  
   AND (B.CUST_TYPE IS NULL OR F.CUST_TYPE = B.CUST_TYPE)  
   AND D.QUANTITY BETWEEN A.MIN_QTY AND A.MAX_QTY    AND D.NET_AMT BETWEEN A.MIN_AMT AND A.MAX_AMT  
    AND (SELECT SUM(nvl(NET_AMT,0)) FROM INVOICE I WHERE I.CUST_CODE =E.CUST_CODE AND I.TRAN_DATE >= (select fr_date from acctprd where sysdate  between fr_date and to_date) ) >= NVL(B.MIN_YTD_SALES,0)
   AND ((E.CUST_CODE__DLV IN(SELECT CUST_CODE FROM BRACKET_GROUP BG WHERE BG.BRACKET_GRP=B.BRACKET_GRP) OR B.BRACKET_GRP IS NULL) 
   OR  (E.CUST_CODE__DLV=F.CUST_CODE AND trim(B.CUST_GRP)=trim(F.GROUP_CODE) OR B.CUST_GRP IS NULL ) )  
  AND (B.ITEM_CODE=D.ITEM_CODE OR B.ITEM_CODE = ''X'') 
  AND (B.ITEM_DIS IS NULL OR ( B.ITEM_DIS =  (SELECT  G.ITEM_DIS  FROM ITEMDIS_GRP G WHERE G.ITEM_CODE=D.ITEM_CODE AND G.ITEM_DIS = B.ITEM_DIS)  ) )  
   AND A.PROMO_TERM IN(''0'',''1'')  
   AND D.SALE_ORDER= ''?'' 
AND (B.SCHEME_CODE || D.SALE_ORDER || TO_NUMBER(D.LINE_NO) ) NOT IN (SELECT SCHEME_CODE || TRAN_ID || LINE_NO_FORM FROM SORDERDET_SCHEME WHERE TRAN_ID =D.SALE_ORDER) 
    AND E.CUST_CODE__DLV = F.CUST_CODE(+) 
   AND ((C.SITE_CODE IS NULL OR E.SITE_CODE IN ('',C.SITE_CODE)) OR (C.STATE_CODE IS NULL OR F.STATE_CODE IN ('',C.STATE_CODE)) OR (C.COUNT_CODE IS NULL OR F.COUNT_CODE IN ('',C.COUNT_CODE)) OR (C.STAN_CODE IS NULL OR F.STAN_CODE IN ('',C.STAN_CODE))) 
' WHERE FIELD_NAME ='SCHEME_CODE' AND MOD_NAME = 'W_SORDERDET_SCHEME';

--Added by manoj dtd 06092012 to delete pre save system entry for Physical item Scan transaction
delete from SYSTEM_EVENTS where obj_name='phy_item_scan' and service_code='prsr_phy_item_scan';
delete from system_event_services where service_code='prsr_phy_item_scan';
delete from system_service_args where service_code='prsr_phy_item_scan';

--- adding sql for inv_hold_rel_gen by cpatil 06-sept-12


Insert into system_event_services (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,RETURN_XFRM_XSL,CHG_DATE,CHG_USER,CHG_TERM)
 values ('agetData_inv_hold_rel_gen','Action To get the Data','http://192.168.0.130/BaseE12DotNetService6-3-0-003/E12BusinessLogic6-3-0-003.asmx','BASE','getData','String','S',null,null, EMPTY_BLOB(),sysdate,'BASE','BASE');

Insert into system_event_services (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,RETURN_XFRM_XSL,CHG_DATE,CHG_USER,CHG_TERM)
 values ('prc_inv_hold_rel','Action To process the Data','http://192.168.0.130/BaseE12DotNetService6-3-0-003/E12BusinessLogic6-3-0-003.asmx','BASE','process','String','S',null,null, EMPTY_BLOB(),sysdate,'BASE','BASE');

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('prc_inv_hold_rel',1,'COMPONENT_TYPE','I','Component Type','C.String',null,sysdate,'BASE','BASE','EJB');

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE)
 values ('prc_inv_hold_rel',2,'COMPONENT_NAME','I','Component Name','C.String',null,sysdate,'BASE','BASE','InvHoldRelGen');

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('prc_inv_hold_rel',3,'XML_DATA_1','I','XML data of form no 1','S',null,sysdate,'BASE','BASE',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('prc_inv_hold_rel',4,'XML_DATA__ALL','I','XML data of form no 1','S',null,sysdate,'BASE      ','BASE',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('prc_inv_hold_rel',5,'OBJ_CONTEXT','I','Object Context','S',null,sysdate,'BASE','BASE',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('prc_inv_hold_rel',6,'XTRA_PARAMS','I','Extra Arguments','S',null,sysdate,'BASE','BASE',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('agetData_inv_hold_rel_gen',1,'COMPONENT_TYPE','I','Component Type','S',null,sysdate,'BASE','BASE','EJB');

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE)
 values ('agetData_inv_hold_rel_gen',2,'COMPONENT_NAME','I','Component Name','S',null,sysdate,'BASE','BASE','InvHoldRelGen');

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('agetData_inv_hold_rel_gen',3,'XML_DATA','I','XML data of form no 1','S',null,sysdate,'BASE','BASE',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE)
 values ('agetData_inv_hold_rel_gen',4,'XML_DATA_1','I','XML data of form no All','S',null,sysdate,'BASE','BASE',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE)
 values ('agetData_inv_hold_rel_gen',5,'WINDOW_NAME','I','Window Name','S',null,sysdate,'BASE','BASE','w_inv_hold_rel_gen');

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE)
 values ('agetData_inv_hold_rel_gen',6,'XTRA_PARAMS','I','Extra Arguments','S',null,sysdate,'BASE','BASE',null);

--- end
--Added by Manoj dtd 06/09/12 received from sun to change obj_form entry for Physical item scan
update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN NO:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="1">item_code</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="1">lot_no</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="3"><SCAN_LABEL>Case Count:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>phy_input</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_phy_item_scan' and form_no ='2';

--Added by Manoj dtd 06/09/2012 to set pophelp for sceheme 
	update pophelp set SQL_STR ='SELECT B.SCHEME_CODE,A.DESCR,A.ITEM_CODE,A.DISC_TYPE
 FROM BOM A,  
 SCHEME_APPLICABILITY B,SCHEME_APPLICABILITY_DET C,SORDER E, CUSTOMER F       
 WHERE A.BOM_CODE=B.SCHEME_CODE    
 AND B.SCHEME_CODE=C.SCHEME_CODE  
 AND F.CUST_CODE = E.CUST_CODE__DLV 
 AND (B.CUST_TYPE IS NULL OR F.CUST_TYPE = B.CUST_TYPE) 
AND A.PROMO_TERM IN(''2'',''3'')  
AND (SELECT SUM(nvl(NET_AMT,0)) FROM INVOICE I WHERE I.CUST_CODE =E.CUST_CODE AND I.TRAN_DATE >= (select fr_date from acctprd where sysdate  between fr_date and to_date ) ) >= NVL(B.MIN_YTD_SALES,0)
AND (( E.CUST_CODE IN(SELECT CUST_CODE FROM BRACKET_GROUP BG WHERE BG.BRACKET_GRP=B.BRACKET_GRP) OR B.BRACKET_GRP IS NULL )
OR  (E.CUST_CODE=F.CUST_CODE AND (trim(B.CUST_GRP)=trim(F.GROUP_CODE) OR B.CUST_GRP IS NULL) ) )  
AND (E.SITE_CODE=C.SITE_CODE OR C.SITE_CODE IS NULL) 
AND (C.STAN_CODE=F.PIN OR C.STAN_CODE IS NULL)  
AND E.SALE_ORDER = ''?'' AND  B.SCHEME_CODE NOT IN (SELECT SCHEME_CODE FROM SORDER_SCHEME WHERE TRAN_ID = E.SALE_ORDER   )'
WHERE FIELD_NAME ='SCHEME_CODE' AND MOD_NAME = 'W_SORDER_SCHEME';

update pophelp set SQL_STR ='SELECT B.SCHEME_CODE,A.DESCR,A.ITEM_CODE,A.DISC_TYPE
   FROM BOM A, 
   SCHEME_APPLICABILITY B,SCHEME_APPLICABILITY_DET C,SORDDET D,SORDER E , CUSTOMER F   
   WHERE    A.BOM_CODE=B.SCHEME_CODE   
   AND B.SCHEME_CODE=C.SCHEME_CODE  
   AND D.SALE_ORDER=E.SALE_ORDER  
   AND (B.CUST_TYPE IS NULL OR F.CUST_TYPE = B.CUST_TYPE)  
   AND D.QUANTITY BETWEEN A.MIN_QTY AND A.MAX_QTY    AND D.NET_AMT BETWEEN A.MIN_AMT AND A.MAX_AMT  
    AND (SELECT SUM(nvl(NET_AMT,0)) FROM INVOICE I WHERE I.CUST_CODE =E.CUST_CODE AND I.TRAN_DATE >= (select fr_date from acctprd where sysdate  between fr_date and to_date) ) >= NVL(B.MIN_YTD_SALES,0)
   AND ((E.CUST_CODE IN(SELECT CUST_CODE FROM BRACKET_GROUP BG WHERE BG.BRACKET_GRP=B.BRACKET_GRP) OR B.BRACKET_GRP IS NULL) 
   OR  (E.CUST_CODE=F.CUST_CODE AND (trim(B.CUST_GRP)=trim(F.GROUP_CODE) OR B.CUST_GRP IS NULL) ) )  
  AND (B.ITEM_CODE=D.ITEM_CODE OR B.ITEM_CODE = ''X'') 
  AND (B.ITEM_DIS IS NULL OR ( B.ITEM_DIS =  (SELECT  G.ITEM_DIS  FROM ITEMDIS_GRP G WHERE G.ITEM_CODE=D.ITEM_CODE AND G.ITEM_DIS = B.ITEM_DIS)  ) )  
   AND A.PROMO_TERM IN(''0'',''1'')  
   AND D.SALE_ORDER= ''?'' 
AND (B.SCHEME_CODE || D.SALE_ORDER || TO_NUMBER(D.LINE_NO) ) NOT IN (SELECT SCHEME_CODE || TRAN_ID || LINE_NO_FORM FROM SORDERDET_SCHEME WHERE TRAN_ID =D.SALE_ORDER) 
    AND E.CUST_CODE__DLV = F.CUST_CODE(+) 
   AND ((C.SITE_CODE IS NULL OR E.SITE_CODE IN ('',C.SITE_CODE)) OR (C.STATE_CODE IS NULL OR F.STATE_CODE IN ('',C.STATE_CODE)) OR (C.COUNT_CODE IS NULL OR F.COUNT_CODE IN ('',C.COUNT_CODE)) OR (C.STAN_CODE IS NULL OR F.STAN_CODE IN ('',C.STAN_CODE))) 
' WHERE FIELD_NAME ='SCHEME_CODE' AND MOD_NAME = 'W_SORDERDET_SCHEME';

--Updated by manoj dtd 06/09/2012 received from sun
update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN NO:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>Item Code :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="1">item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="4"><SCAN_LABEL>Lot No :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="1">lot_no</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Physical Input:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>phy_input</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where win_name = 'w_phy_item_mscan' and form_no ='2';

update messages set MSG_DESCR= 'Storage location type of the item code entered, and storage location type of the entered location is not matching'
where msg_no = 'VMLOC1';
--Added By Manoj dtd 06/09/2012 for Sale Order Type system entry

INSERT INTO ITM2MENU 
(
	APPLICATION,
	LEVEL_1,
	LEVEL_2,
	LEVEL_3,
	LEVEL_4,
	LEVEL_5,
	WIN_NAME,
	DESCR,
	COMMENTS,
	MENU_PATH,
	ICON_PATH,
	OBJ_TYPE,
	CHG_USER,
	CHG_TERM,
	CHG_DATE,
	OPEN_ICON,
	CLOSE_ICON
)
VALUES
(
	'DIS',
	2,31,1,0,0,
	'w_sorder_type',
	'A.Sales Order Type',
	null,
	'DIS.2.31.1.0.0',
	null,
	null,
	null,
	null,
	null,
	null,
	null
);


INSERT INTO TRANSETUP
(TRAN_WINDOW,SAVE_FLAG,VAL_FLAG,KEY_FLAG,KEY_STRING,REPEATE_ADD,CHG_DATE,CHG_USER,CHG_TERM,
 EDI_OPTION,SITE_ACC_COL,CONFIRM_COL,CONFIRM_VAL,LEDG_POST_CONF,CHG_DATE_ON_CONF,TRAN_ID_COL,
 CONFIRM_MODE,MAIL_OPTION,GARBAGE_OPT,REF_SER,VIEW_MODE) 
VALUES 
('w_sorder_type','2','2','M','site_code,tran_date,seq04','Y',sysdate,'BASE','BASE',
 null,'SITE_CODE',null,null,'N','Y','TRAN_ID',
 '0','0','N','S-STK',null);	

INSERT INTO OBJ_FORMS
(
win_name,
title,
obj_brow_name,
obj_edit_name,	
form_no,
auto_accept_scan,
scan_metadata,
scan_flag,
scan_delimiter,
auto_accept_weighdata
)
values (
'w_sorder_type',
'header',
'd_sorder_type11',
'd_sorder_type21',
'1',
null,
null,
null,
null,
null
);	


INSERT INTO OBJ_ACTIONS 
(	
	OBJ_NAME ,
	LINE_NO ,
	RIGHTS_CHAR,
	INTERACTIVE,
	SERVICE_CODE,
	DESCRIPTION,
	TITLE,
	IMAGE,
	ACTION_TYPE,
	FORM_NO,
	SERVICE_HANDLER,
	PLACEMENT,
	TRAN_TYPE
) VALUES (
	'sorder_type',
	'1',
	'A',
	'a',
	'a',
	'Adding New',
	'Add',
	'add.gif',
	'S',
	'1',
	NULL,
	NULL,
	NULL
);
	
INSERT INTO OBJ_ACTIONS 
(
	OBJ_NAME ,
	LINE_NO,
	RIGHTS_CHAR,
	INTERACTIVE, 
	SERVICE_CODE, 
	DESCRIPTION, 
	TITLE, 
	IMAGE,
	ACTION_TYPE,		
	FORM_NO, 
	SERVICE_HANDLER,
	PLACEMENT,
	TRAN_TYPE
) VALUES (
	'sorder_type',
	'2',
	'E',
	'a',
	'a',
	'Editing Existing Record',
	'EDIT',
	'edit.gif',
	'S',
	'1',
	NULL,
	NULL,
	NULL
);



INSERT INTO SYSTEM_EVENTS
(
	OBJ_NAME,
	EVENT_CODE,
	EVENT_CONTEXT,
	SERVICE_CODE,
	METHOD_RULE,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	RESULT_HANDLE,
	OVERWRITE_CORE,
	COMP_TYPE,
	COMP_NAME,
	COMM_FORMAT
) VALUES (
	'sorder_type',
	'pre_validate',
	'1',
	'prv_default_ejb',
	null,
	sysdate,
	'BASE',
	'BASE',
	'2',
	'0',
	'EJB',
	'SOrderType',
	NULL
);

INSERT INTO SYSTEM_EVENTS
(	
	OBJ_NAME,
	EVENT_CODE,
	EVENT_CONTEXT,
	SERVICE_CODE,
	METHOD_RULE,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	RESULT_HANDLE,
	OVERWRITE_CORE,
	COMP_TYPE,
	COMP_NAME,
	COMM_FORMAT
) VALUES (
	'sorder_type',
	'post_item_change',
	'1',
	'poic_default_ejb',
	null,
	sysdate,
	'BASE',
	'BASE',
	'2',
	'0',
	'EJB',
	'SOrderType',
	NULL
);

insert into messages(
MSG_NO,         
MSG_STR ,       
MSG_DESCR,      
MSG_TYPE,
MSG_OPT,
chg_date,
chg_user,
chg_term
)
values(
'VMORTYBK',
'Invalid Order Type',
'Order Type can not be blank',
'E',
'Y',
sysdate,
'base',
'base'
);

insert into messages(
MSG_NO,         
MSG_STR ,       
MSG_DESCR,      
MSG_TYPE,
MSG_OPT,
chg_date,
chg_user,
chg_term
)
values(
'VMREPRTBK',
'Invalid Replacement Rate',
'Replacement can not be blank',
'E',
'Y',
sysdate,
'base',
'base'
);



insert into messages(
MSG_NO,         
MSG_STR ,       
MSG_DESCR,      
MSG_TYPE,
MSG_OPT,
chg_date,
chg_user,
chg_term
)
values(
'VMORTYDB',
'Invalid Order Type',
'Order Type  allready exist in master',
'E',
'Y',
sysdate,
'base',
'base'
);

insert into  POPHELP
(
field_name,
mod_name,
sql_str,
msg_title,
sql_input,
chg_date,
chg_user,
chg_term,
dist_opt
)
values
(
'PRICE_LIST__CLG',
'W_SORDER_TYPE',
'select price_list,descr from pricelist_mst',
'Price List',
NULL,
sysdate,
'BASE',
'BASE',
'1'
);



alter table sordertype add returnable  char(1);
alter table sordertype add reas_code  char(5);

insert into  POPHELP
(
field_name,
mod_name,
sql_str,
msg_title,
sql_input,
chg_date,
chg_user,
chg_term,
dist_opt
)
values
(
'REAS_CODE',
'W_SORDER_TYPE',
'select fld_value,descr from gencodes',
'REAS CODE',
NULL,
sysdate,
'BASE',
'BASE',
'1'
);


alter table sordertype add fmode CHAR(1);
alter table sordertype add tax_class CHAR(5);

--added by Kunal on 06/09/12 for add  Post Save in sales order

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 ('sorder','post_save','1','pos_sorder',null,'0',sysdate,'kunal','BASE','2','EJB','SOrderPos',null);


Insert into system_event_services (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM) 
values ('pos_sorder','Validation','http://localhost:9090/axis/services/ValidatorService','BASE','postSave','String','S',null,null,sysdate,'kunal','BASE');


Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_sorder',1,'COMPONENT_TYPE','I',null,'S',null,sysdate,'kunal','kunal','EJB');

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_sorder',2,'COMPONENT_NAME','I',null,'S',null,sysdate,'kunal','kunal','SOrderPos');

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_sorder',3,'XML_DATA_ALL','I',null,'S',null,sysdate,'kunal','kunal',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_sorder',4,'<sale_order>','I',null,'B.String',null,sysdate,'kunal','kunal',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_sorder',5,'EDIT_FLAG','I',null,'S',null,sysdate,'kunal','kunal',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) 
values ('pos_sorder',6,'XTRA_PARAMS','I',null,'S',null,sysdate,'kunal','kunal',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE)
 values ('pos_sorder',7,'DB_CONN','I',null,'S.Connection',null,sysdate,'kunal','kunal',null);

 
--Merged By Ashish Sonawane [mail send by Rohan Bhogale] On 07-sep-12 [START]

delete from transetup where tran_window='w_repl_iss_dock';
delete from obj_actions where obj_name='repl_iss_dock';
delete from obj_forms where win_name='w_repl_iss_dock';
delete from system_events where obj_name='repl_iss_dock';



INSERT INTO transetup(
	tran_window,
	save_flag,
	val_flag,
	key_flag,
	key_string,
	udf_1,
	udf_2,
	udf_3,
	udf_4,
	udf_5,
	repeate_add,
	chg_date,
	chg_user,
	chg_term,
	edi_option,
	site_acc_col,
	confirm_col,
	confirm_val,
	repeat_add_det,
	repeatadddet,
	load_mode,
	auto_confirm,
	ledg_post_conf,
	chg_date_on_conf,
	tran_id_col,
	mail_option,
	confirm_mode,
	garbage_opt,
	val_flag_edi,
	verify_password,
	cust_acc_col,
	sales_pers_acc_col,
	supp_acc_col,
	item_ser_acc_code,
	emp_acc_col,
	item_ser_acc_col,
	workflow_opt,
	table_name,
	application,
	table_desc,
	tran_date_col,
	tran_id__from,
	tran_id__to,
	table_name_det1,
	table_name_det2,
	table_name_det3,
	multitire_opt,
	ref_ser,
	view_mode,
	tax_forms,
	sign_status,
	user_tran_window,
	custom_preview_obj,
	ignoreerrlist_onload,
	childdata_argopt,
	edit_tmplt,
	wrkflw_init,
	edittax,
	formal_args,
	audit_trail_opt,
	edit_opt,
	cache_opt,
	optimize_mode,
	edit_expr,
	rate_col,
	qty_col,
	edit_expr_inp,
	rcp_cache_status,
	print_control,
	transfer_mode,
	profile_id__res,
	tran_compl_msg,
	period_option,
	wrkflw_priority,
	exec_type,
	disp_meta_data,
	allow_attach,
	start_form,
	isattachment,
	header_form_no)
 VALUES (
	'w_repl_iss_dock',
	'2',
	'2',
	'A',
	'seq10',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'N',
	fn_sysdate(),
	'Gulzar    ',
	'BASE           ',
	'0',
	'site_code',
	'CONFIRMED',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'TRAN_ID',
	'0',
	'0',
	'N',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'repl_iss_hdr',
	'WMS',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'REPISS',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'M',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2');
	

	
INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
	'repl_iss_dock',
	1,
	NULL,
	'Saving',
	NULL,
	NULL,
	'S',
	'Finish',
	'3',
	NULL,
	NULL,
	'U',
	NULL,
	fn_sysdate(),
	'BASE           ',
	'Gulzar    ');
INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
	'repl_iss_dock',
	2,
	NULL,
	'Prev',
	'a',
	'a',
	'P',
	'Prev',
	'2',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
	'repl_iss_dock',
	3,
	NULL,
	'Next',
	'a',
	'a',
	'N',
	'Next',
	'1',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
	'repl_iss_dock',
	4,
	'confirm~normal.gif',
	'Confirming records',
	'pre_confirm',
	'a',
	'F',
	'Confirm',
	'3',
	'2',
	'1',
	'S',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
	'repl_iss_dock',
	5,
	NULL,
	'Next',
	'a',
	'a',
	'N',
	'Next',
	'2',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES (
	'repl_iss_dock',
	6,
	NULL,
	'Prev',
	'a',
	'a',
	'P',
	'Prev',
	'3',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);



	
INSERT INTO obj_forms  (
	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata,
	selection_mode,
	default_view)
VALUES (
	'w_repl_iss_dock',
	'Replenishment Task',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Replenishment Task ID:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>repl_order</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Carton Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>carton_no</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	NULL);
INSERT INTO obj_forms  (
	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata,
	selection_mode,
	default_view)
VALUES (
	'w_repl_iss_dock',
	'Replenishment Task',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	NULL);
INSERT INTO obj_forms  (
	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata,
	selection_mode,
	default_view)
VALUES (
	'w_repl_iss_dock',
	'Stock to Dock',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location Code To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<loc_code>,<item_code>, <lot_no>, <lot_sl>, <quantity> <unit> = <loc_code__to>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'U');
	
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 (
	'repl_iss_dock',
	'default_data_wiz',
	'1',
	'repl_iss_default_data',
	NULL,
	'0',
	fn_sysdate(),
	'Gulzar    ',
	'BASE',
	'2',
	'EJB',
	'ReplIssIC',
	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 (
	'repl_iss_dock',
	'post_save',
	'1',
	'pos_repl_iss',
	NULL,
	'0',
	fn_sysdate(),
	'chaitali  ',
	'BASE',
	'2',
	'EJB',
	'ReplIssPos',
	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 (
	'repl_iss_dock',
	'pre_navigate_next',
	'1',
	'prv_repl_iss',
	NULL,
	'0',
	fn_sysdate(),
	'Gulzar    ',
	'BASE',
	'2',
	'EJB',
	'ReplIssIC',
	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 (
	'repl_iss_dock',
	'pre_validate',
	'1',
	'prv_repl_iss',
	NULL,
	'0',
	fn_sysdate(),
	'Gulzar    ',
	'BASE',
	'2',
	'EJB',
	'ReplIssIC',
	NULL);
	

INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'PRVTASK',
	'Previous task not complete',
	'Depended previous task is not complete.Please scan Pervious task',
	'E',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE ');

INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'REPLPICK',
	'Stock-To-Dock allow only',
	'Replanishment Stock-To-Dock allow only.',
	'E',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE ');
 
 
--Merged By Ashish Sonawane [mail send by Rohan Bhogale] On 07-sep-12 [END] 

--Merged By Ashish Sonawane [mail send by Sumit Sarkar] On 07-sep-12 [START] 
	
INSERT INTO obj_actions (
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES (
	'wave_task',
	4,
	'hold.release~normal.gif',
	'Hold release wave',
	'pre_confirm',
	'a',
	'C',
	'Hold/Rel',
	'1',
	'2',
	NULL,
	'U',
	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 (
	'wave_task',
	'pre_confirm',
	'1',
	'prcm_default_wave',
	NULL,
	'0',
	sysdate,
	'Base      ',
	'Base      ',
	'2',
	'EJB',
	'WaveHoldEJB',
	NULL);
INSERT INTO system_event_services (
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,
	return_descr ,
	return_xfrm ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'prcm_default_wave',
	NULL,
	'http://localhost:9090/axis/services/ActionHandlerService',
	NULL,
	'confirm',
	NULL,
	NULL,
	NULL,
	NULL,
	sysdate,
	'Sankara   ',
	'sankara');
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prcm_default_wave',
	1,
	'COMPONENT_TYPE',
	'I',
	'COMPONENT_TYPE',
	'C.String',
	NULL,
	sysdate,
	'BASE      ',
	'BASE      ',
	'EJB');
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prcm_default_wave',
	2,
	'COMPONENT_NAME',
	'I',
	'COMPONENT_NAME',
	'C.String',
	NULL,
	sysdate,
	'BASE      ',
	'BASE      ',
	'WaveHoldEJB');
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prcm_default_wave',
	3,
	'<wave_id>',
	'I',
	'Tran Id Wave',
	'C.String',
	NULL,
	sysdate,
	'BASE      ',
	'BASE      ',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prcm_default_wave',
	4,
	'XTRA_PARAMS',
	'I',
	'XTRA_PARAMS',
	'S',
	NULL,
	sysdate,
	'BASE      ',
	'BASE      ',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prcm_default_wave',
	5,
	'FORCED_FLAG',
	'I',
	'FORCED_FLAG',
	'S',
	NULL,
	sysdate,
	'BASE      ',
	'BASE      ',
	NULL);
	
	
--Merged By Ashish Sonawane [mail send by Sumit Sarkar] On 07-sep-12 [END]

--Added by Manoj dtd 07/09/2012 to set pophelp for sceheme 
	update pophelp set SQL_STR ='SELECT B.SCHEME_CODE,A.DESCR,A.ITEM_CODE,A.DISC_TYPE
 FROM BOM A,  
 SCHEME_APPLICABILITY B,SCHEME_APPLICABILITY_DET C,SORDER E, CUSTOMER F       
 WHERE A.BOM_CODE=B.SCHEME_CODE    
 AND B.SCHEME_CODE=C.SCHEME_CODE  
 AND F.CUST_CODE = E.CUST_CODE 
 AND (B.CUST_TYPE IS NULL OR F.CUST_TYPE = B.CUST_TYPE) 
AND A.PROMO_TERM IN(''2'',''3'')  
AND (SELECT SUM(nvl(NET_AMT,0)) FROM INVOICE I WHERE I.CUST_CODE =E.CUST_CODE AND I.TRAN_DATE >= (select fr_date from acctprd where sysdate  between fr_date and to_date ) ) >= NVL(B.MIN_YTD_SALES,0)
AND (( E.CUST_CODE IN(SELECT CUST_CODE FROM BRACKET_GROUP BG WHERE BG.BRACKET_GRP=B.BRACKET_GRP) OR B.BRACKET_GRP IS NULL )
OR  (E.CUST_CODE=F.CUST_CODE AND (trim(B.CUST_GRP)=trim(F.GROUP_CODE) OR B.CUST_GRP IS NULL) ) )  
AND (E.SITE_CODE=C.SITE_CODE OR C.SITE_CODE IS NULL) 
AND (C.STAN_CODE=F.PIN OR C.STAN_CODE IS NULL)  
AND E.SALE_ORDER = ''?'' AND  B.SCHEME_CODE NOT IN (SELECT SCHEME_CODE FROM SORDER_SCHEME WHERE TRAN_ID = E.SALE_ORDER   )'
WHERE FIELD_NAME ='SCHEME_CODE' AND MOD_NAME = 'W_SORDER_SCHEME';

update pophelp set SQL_STR ='SELECT B.SCHEME_CODE,A.DESCR,A.ITEM_CODE,A.DISC_TYPE
   FROM BOM A, 
   SCHEME_APPLICABILITY B,SCHEME_APPLICABILITY_DET C,SORDDET D,SORDER E , CUSTOMER F   
   WHERE    A.BOM_CODE=B.SCHEME_CODE   
   AND B.SCHEME_CODE=C.SCHEME_CODE  
   AND D.SALE_ORDER=E.SALE_ORDER  
   AND (B.CUST_TYPE IS NULL OR F.CUST_TYPE = B.CUST_TYPE)  
   AND D.QUANTITY BETWEEN A.MIN_QTY AND A.MAX_QTY    AND D.NET_AMT BETWEEN A.MIN_AMT AND A.MAX_AMT  
    AND (SELECT SUM(nvl(NET_AMT,0)) FROM INVOICE I WHERE I.CUST_CODE =E.CUST_CODE AND I.TRAN_DATE >= (select fr_date from acctprd where sysdate  between fr_date and to_date) ) >= NVL(B.MIN_YTD_SALES,0)
   AND ((E.CUST_CODE IN(SELECT CUST_CODE FROM BRACKET_GROUP BG WHERE BG.BRACKET_GRP=B.BRACKET_GRP) OR B.BRACKET_GRP IS NULL) 
   OR  (E.CUST_CODE=F.CUST_CODE AND (trim(B.CUST_GRP)=trim(F.GROUP_CODE) OR B.CUST_GRP IS NULL) ) )  
  AND (B.ITEM_CODE=D.ITEM_CODE OR B.ITEM_CODE = ''X'') 
  AND (B.ITEM_DIS IS NULL OR ( B.ITEM_DIS =  (SELECT  G.ITEM_DIS  FROM ITEMDIS_GRP G WHERE G.ITEM_CODE=D.ITEM_CODE AND G.ITEM_DIS = B.ITEM_DIS)  ) )  
   AND A.PROMO_TERM IN(''0'',''1'')  
   AND D.SALE_ORDER= ''?'' 
AND (B.SCHEME_CODE || D.SALE_ORDER || TO_NUMBER(D.LINE_NO) ) NOT IN (SELECT SCHEME_CODE || TRAN_ID || LINE_NO_FORM FROM SORDERDET_SCHEME WHERE TRAN_ID =D.SALE_ORDER) 
    AND E.CUST_CODE = F.CUST_CODE(+) 
   AND ((C.SITE_CODE IS NULL OR E.SITE_CODE IN ('',C.SITE_CODE)) OR (C.STATE_CODE IS NULL OR F.STATE_CODE IN ('',C.STATE_CODE)) OR (C.COUNT_CODE IS NULL OR F.COUNT_CODE IN ('',C.COUNT_CODE)) OR (C.STAN_CODE IS NULL OR F.STAN_CODE IN ('',C.STAN_CODE))) 
' WHERE FIELD_NAME ='SCHEME_CODE' AND MOD_NAME = 'W_SORDERDET_SCHEME';
	
--added by cpandey for manual stock allocation 
--system entry for validation 

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 (
	'sordalloc',
	'pre_validate',
	'1',
	'prv_default_ejb',
	NULL,
	'0',
	sysdate,
	'BASE      ',
	'BASE',
	'2',
	'EJB',
	'SordallocIC',
	NULL);
--system entry for itemchange  
INSERT INTO obj_itemchange 
(
	obj_name ,
	form_no ,
	field_name ,
	mandatory 
)
 VALUES 
(
	'sordalloc',
	'1  ',
	'sale_order__from',
	NULL
);
INSERT INTO obj_itemchange 
(
	obj_name ,
	form_no ,
	field_name ,
	mandatory 
)
 VALUES
 (
	'sordalloc',
	'1  ',
	'sale_order__to',
	NULL
);


--system entry for messages 
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 (
	'VTITMSSER1',
	'Invaid item series',
	'Item series from not exist in master ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate,
	'chitranjan',
	'chitranjan',
	NULL,
	NULL);
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 (
	'VTITMSSER2',
	'Invaid item series',
	'Item series to not exist in master ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate,
	'chitranjan',
	'chitranjan',
	NULL,
	NULL);
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 (
	'VTINVCUST1',
	'Invaid customer code ',
	'customer code from not exist in master ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate,
	'chitranjan',
	'chitranjan',
	NULL,
	NULL);
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 (
	'VTINVCUST2',
	'Invaid customer code ',
	'customer code to not exist in master ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate,
	'chitranjan',
	'chitranjan',
	NULL,
	NULL);
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 (
	'VTINVSORD1',
	'Invaid Saleorder ',
	'Saleorder from does not exist ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate,
	'chitranjan',
	'chitranjan',
	NULL,
	NULL
	);
	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 (
	'VTINVSORD2',
	'Invaid Saleorder ',
	'Saleorder to does not exist   ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate,
	'chitranjan',
	'chitranjan',
	NULL,
	NULL
	);
	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 (
	'VTINVDDATE',
	'Invalid date range',
	'Due date to can not be less than due date from  ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate,
	'chitranjan',
	'chitranjan',
	NULL,
	NULL
	);
--end of additioon 
	
--added by Kunal on 07/09/12 add error message for repl iss 
INSERT INTO MESSAGES(MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,CHG_DATE,CHG_USER,CHG_TERM)
VALUES('INVPNDLOC','Invalid Location Code','This PND location is not associated to this DSO location','E','Y',SYSDATE,'Kunal','Kunal');

-- added by Kunal on 07/09/12 for Physical item Scan post save entry 
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 ('phy_scan_verify','post_save','1','pos_phy_scan',null,'0',sysdate,'Kunal','Kunal','2','EJB','PhyItemScanPos',null);

update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1"> <SCAN_LABEL>Location Code:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="2"> <SCAN_LABEL>LPN NO:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="3"> <SCAN_LABEL>Item Code:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="4"> <SCAN_LABEL>Lot No:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS> </MAPPING_SCAN> <INPUT_SCAN ORDER="1"> <SCAN_LABEL>Case Count:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>phy_input</FIELD></FIELDS> </INPUT_SCAN> <SCAN_CONDITION field="loc_code">parseInt(quantity) != 0</SCAN_CONDITION></SCAN_INFO>'  
where win_name = 'w_phy_item_scan'  and form_no = '2';

update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1"> <SCAN_LABEL>Location Code:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="2"> <SCAN_LABEL>LPN NO:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="3"> <SCAN_LABEL>Item Code:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="4"> <SCAN_LABEL>Lot No:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS> </MAPPING_SCAN> <INPUT_SCAN ORDER="1"> <SCAN_LABEL>Case Count:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>phy_input</FIELD></FIELDS> </INPUT_SCAN> <SCAN_CONDITION field="loc_code">parseInt(quantity) != 0</SCAN_CONDITION></SCAN_INFO>'  
where win_name = 'w_phy_item_mscan'  and form_no = '2';

update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1"> <SCAN_LABEL>Location Code:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="2"> <SCAN_LABEL>LPN NO:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="3"> <SCAN_LABEL>Item Code:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="4"> <SCAN_LABEL>Lot No:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS> </MAPPING_SCAN> <INPUT_SCAN ORDER="1"> <SCAN_LABEL>Case Count:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>phy_input</FIELD></FIELDS> </INPUT_SCAN> <SCAN_CONDITION field="loc_code">parseInt(quantity) != 0</SCAN_CONDITION></SCAN_INFO>'  
where win_name = 'w_phy_scan_verify'  and form_no = '3';

--Added by Ashish Sonawane on 08-sep-12 [mail send by Pragyan] [START]

INSERT INTO DISPARM (
	prd_code,
	var_name,
	var_type,
	var_value,
	descr,
	var_subs,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'999999',
	'REPORT_SAVE_TYPE',
	'S',
	'PDF',
	'Report save type i.e NATIVE OR PDF (in case of null NATIVE will set as a default)',
	0,
	TO_DATE('2-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ');
	INSERT INTO refser (
	ref_ser,
	descr,
	type,
	sys_ser,
	prefix,
	chg_date,
	chg_user,
	chg_term,
	seq_name,
	tax_form_reqd,
	trans_type)
 VALUES (
	'R-PND ',
	'Replenishment Task ( PND)',
	'S',
	'R-PND ',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL,
	NULL);
	
INSERT INTO refser (
	ref_ser,
	descr,
	type,
	sys_ser,
	prefix,
	chg_date,
	chg_user,
	chg_term,
	seq_name,
	tax_form_reqd,
	trans_type)
 VALUES (
	'RP-PND',
	'ReplenishmentTask Stock-DOCK(PND-DOCK)',
	'S',
	'RP-PND',
	NULL,
	fn_sysdate(),
	'base      ',
	'base           ',
	NULL,
	NULL,
	NULL);
--Added by Ashish Sonawane on 08-sep-12 [mail send by Pragyan] [END]

	
--Added by Ashish Sonawane on 10-sep-12 [mail send by Sumit Sarkar] [START]	

UPDATE TRANSETUP SET HEADER_FORM_NO = '1' where tran_window = 'w_expired_stock_transfer';
COMMIT;

UPDATE OBJ_FORMS  SET FORM_NO = 3 WHERE WIN_NAME = 'w_expired_stock_transfer' AND FORM_NO = 2;
UPDATE OBJ_FORMS  SET FORM_NO = 2 WHERE WIN_NAME = 'w_expired_stock_transfer' AND FORM_NO = 1;
INSERT INTO OBJ_FORMS  (
	win_name,
	title ,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata,
	selection_mode,
	default_view)
VALUES (
	'w_expired_stock_transfer',
	'Nexp/Exp Process',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Lock Type:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lock_type</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	NULL);
	
COMMIT;

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 (
	'expired_stock_transfer',
	'pre_navigate_next',
	'1',
	'prv_expired_stock_transfer',
	NULL,
	'0',
	TO_DATE('29-06-2012 08:54:39','DD-MM-YYYY HH24:MI:SS'),
	'Rohan     ',
	'BASE',
	'2',
	'EJB',
	'ExpStockTransferIC',
	NULL);
	
COMMIT;

	
	
--Added by Ashish Sonawane on 10-sep-12 [mail send by Sumit Sarkar] [END]

--Added by Ashish Sonawane on 10-sep-12 [PICKING ISSUE] [START]

ALTER TABLE PICK_ORD_HDR ADD STATUS CHAR(1);

ALTER TABLE PICK_ORD_DET ADD STATUS CHAR(1);

--Added by Ashish Sonawane on 10-sep-12 [PICKING ISSUE] [END]


-- Added By Ashish Sonawane on 10-sep-12 [mail from Bharat Marathe] [START]

DELETE FROM MESSAGES WHERE MSG_NO IN ('WAVEHOLD','WAVERELS');


INSERT INTO MESSAGES VALUES (
        'WAVEHOLD',
        'Wave Held',
        'The Selected Wave is put on HOLD',
        'P',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('22-10-2000 11:59:45','DD-MM-YYYY HH24:MI:SS'),
        'Base      ',
        'Base           ',
        NULL,
        NULL);
INSERT INTO MESSAGES VALUES (
        'WAVERELS',
        'Wave Released',
        'The Selected Wave is RELEASED',
        'P',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('22-10-2000 11:59:45','DD-MM-YYYY HH24:MI:SS'),
        'Base      ',
        'Base           ',
        NULL,
        NULL);
-- Added By Ashish Sonawane on 10-sep-12 [mail from Bharat Marathe] [END]

-- start added by pravin change suggested by manoharan in item master
alter table item
modify harmonization_no varchar2(15);

-- end added by pravin change suggested by manoharan in item master

--Added by manoj Sharma dtd 10/09/2012 to get pophelp data from server
update pophelp set POPHELP_SOURCE='S' WHERE Mod_name IN('W_SORDER_SCHEME','W_SORDERDET_SCHEME');

--- added for shipment
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 ('VMTRANCDIF','Transporter Code Mismatch','Tansporter Code Of Detail does not Match with Transporter Code of Header. Please Select another PTCN.','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

--added by kunal on 10/09/2012 

alter table physcandet add phy_han_basis  char(1);

--Added by Ashish Sonawane (changes done at SUN -mail by Sumit Sarkar) [START]

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 (
	'INVLOCKTP ',
	'Invalid Lock Type',
	'Lock type entered does not valid, please enter valid code',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('8-05-2012 13:25:59','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);
  
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(
	'NULLLOCTP ',
	'Null Lock Type',
	'Entered lock type can not be blank, please enter valid Lock type',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('8-05-2012 13:25:59','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);

	--Added by Ashish Sonawane (changes done at SUN -mail by Sumit Sarkar) [END]
-- 11/09/12 manoharan
delete from obj_actions where obj_name = 'active_pick' and form_no = '4';
delete from obj_actions where obj_name = 'active_pick' and form_no = '3' and title = 'Next';
update obj_forms set scan_metadata = '<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Pallete Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
where  win_name = 'w_dock_tran' and form_no = '1';

delete from system_events where obj_name = 'case_transfer' and event_code = 'post_save';
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 (
	'case_transfer',
	'post_save',
	'1',
	'pos_phy_casetrf',
	NULL,
	'0',
	TO_TIMESTAMP('8-05-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'Mahesh    ',
	'BASE',
	'2',
	'EJB',
	'CaseTransferPos',
	NULL);
INSERT INTO system_event_services (service_code,
	service_uri,
	service_provider,
	method_name,
	return_value,
	return_type,
	return_xfrm,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'pos_phy_casetrf',
	'http://localhost:9090/axis/services/ValidatorService',
	'BASE',
	'postSave',
	'String',
	'S',
	NULL,
	TO_TIMESTAMP('8-05-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'Mahesh    ',
	'BASE');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_phy_casetrf',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('8-05-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'Mahesh    ',
	'Mahesh',
	'EJB');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_phy_casetrf',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('8-05-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'Mahesh    ',
	'Mahesh',
	'MPhyItemScanPos');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_phy_casetrf',
	3,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('8-05-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'Mahesh    ',
	'Mahesh',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_phy_casetrf',
	4,
	'<tran_id>',
	'I',
	NULL,
	'B.String',
	NULL,
	TO_TIMESTAMP('8-05-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'Mahesh    ',
	'Mahesh',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_phy_casetrf',
	5,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('8-05-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'Mahesh    ',
	'Mahesh',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_phy_casetrf',
	6,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	TO_TIMESTAMP('8-05-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'Mahesh    ',
	'Mahesh',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_phy_casetrf',
	7,
	'DB_CONN',
	'I',
	NULL,
	'S.Connection',
	NULL,
	TO_TIMESTAMP('8-05-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'Mahesh    ',
	'Mahesh',
	NULL);

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 ('VMPICKORD','Invalid Pick Task Id','Pick Task Id Not Exist. Please Enter Another Pick Task Id.','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

-- added by Kunal sun sql marge mail by sumit 11/09/12

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  (
	'ALOCQTYPRE',
	'Quantity Allocated',
	'Please deallocate , quantity allocated.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('22-10-2000 11:59:45','DD-MM-YYYY HH24:MI:SS'),
	'Base      ',
	'Base           ',
	NULL,
	NULL);

-- 12/09/12 

alter table sorddet add hold_flag char(1);

-------Added By Rutuja on 12-09-12-----------------------------------------------------------------------------------
insert into disparm (
PRD_CODE  ,
 VAR_NAME  ,
 VAR_TYPE   ,
 VAR_VALUE ,
 DESCR        ,
 VAR_SUBS  ,
 CHG_DATE  ,
 CHG_USER ,
 CHG_TERM  
)
values
(
'999999',
'PROCESS_FEE_REASON',
'S',
NULL,
'Specify the value for which reason porcess fee will be update' , 
NULL,
fn_SYSDATE(),
'BASE',
'BASE'
);
-------Ended By Rutuja on 12-09-12 ____-----------------------------------------------------------------------------------

--added by Kunal sun sql marge mail by sumit 13/09/12

UPDATE SYSTEM_SERVICE_ARGS SET ARG_NAME = 'XML_DATA__ALL' WHERE SERVICE_CODE = 'prv_expired_stock_transfer' AND LINE_NO = 3;
--Added by manoj dtd 13/09/2012 to add rating column in item master
alter table item add rating varchar2(20);
--Added by manoj dtd 13/09/2012 to add Free_allowed column in sordertype master
ALTER TABLE SORDERTYPE ADD FREE_ALLOWED CHAR(1);

/*Added by Ashish Sonawane on 13-SEP-12 for error message of alredy close pick order [START] */

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
(
	'CLSPCKORD',
	'Invalid Pick Order',
	'Pick Order/Task already completed , Please specify appropriate Pick Order/Task ',
	'E',
	NULL,
	NULL,
	NULL,
	NULL,
	sysdate,
	'BASE',
	'BASE',
	NULL,
	NULL
);

/*Added by Ashish Sonawane on 13-SEP-12 for error message of alredy close pick order [END] */

--Added By Manoj dtd 13/09/12 to add Columns in Sales Return form
 ALTER TABLE SRETURN_FORM_DET ADD ISS_DATE DATE;
ALTER TABLE SRETURN_FORM_DET ADD PROCESS_DATE DATE;
ALTER TABLE SRETURN_FORM_DET ADD TRANSMIT_DATE DATE;
--Added By Manoj dtd 13/09/12 to add Columns in Sales Return form
ALTER TABLE SRETURN_FORM ADD DLV_DRUG_LIC_NO_1 VARCHAR2(30);
ALTER TABLE SRETURN_FORM ADD BILL_DRUG_LIC_NO_1 VARCHAR2(30);
--added by akhilesh dtd 13/09/12 to item change of cust_code__dlv
Insert into obj_itemchange(OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values('salesreturn_form_tr','1','cust_code__dlv','');

ALTER TABLE SORDFORM ADD ORDER_TYPE VARCHAR2(3);
ALTER TABLE SORDFORMDET ADD CUST_RATE NUMBER(16,4);

----added by Kunal sun sql marge mail by ppatro 14/09/12 
 update packing set pack_type='B' where pack_type='P';
 
 INSERT INTO DISPARM (
	prd_code ,
	var_name,
	var_type,
	var_value,
	descr,
	var_subs,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'999999',
	'NEXPR_INVSTAT',
	'S',
	'NEXP',
	'Expired location',
	NULL,
	TO_DATE('2-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ');
	
	
INSERT INTO DISPARM (
	prd_code ,
	var_name,
	var_type,
	var_value,
	descr,
	var_subs,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'999999',
	'EXPR_INVSTAT',
	'S',
	'EXPR',
	'Near expiry location.',
	NULL,
	TO_DATE('2-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ');
	
----added by Kunal sun sql marge mail by ppatro 14/09/12 

	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 (
	'EDONETHACT',
	'Scan with Active Replenishmnet',
	'DSO to PND Actives can not scan from Normal Replenishment',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('12-09-2012 12:08:34','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);
	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 (
	'IDONETHNOM',
	'Scan with Normal Replenishment',
	'PND to Actives can not be scan from Active Replenishment',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('12-09-2012 12:08:34','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);

--Added by Ashish Sonawane [mail send by Manoharan sir] [START]
delete from pick_iss_det where not exists (select 1 from pick_iss_hdr
where pick_iss_hdr.tran_id = pick_iss_det.tran_id);
alter table pick_iss_det add constraint fk_pick_hdr foreign key (tran_id)
references pick_iss_hdr on delete cascade;
--Added by Ashish Sonawane [mail send by Manoharan sir] [END]

--added by Kunal on 14/09/12 for Manual Cycle Count 

Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM)
 values ('VTINVLOC','Invalid Location','Location code does not exist in stock for this site and item code','E','Y',null,null,null,sysdate,'BASE','BASE');

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 ('empty_loc_scan','pre_navigate_next','1','prv_phy_scan',null,'0',sysdate,'KUNAL','BASE','2','EJB','PhyItemScanIC',null);

update obj_forms set SCAN_METADATA = '<SCAN_INFO><MAPPING_SCAN ORDER="1"> <SCAN_LABEL>LPN NO:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="2"> <SCAN_LABEL>Item Code:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="3"> <SCAN_LABEL>Lot No:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS> </MAPPING_SCAN> <INPUT_SCAN ORDER="1"> <SCAN_LABEL>Case Count:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>phy_input</FIELD></FIELDS> </INPUT_SCAN> <SCAN_CONDITION field="loc_code">parseInt(quantity) != 0</SCAN_CONDITION></SCAN_INFO>' 
WHERE WIN_NAME = 'w_phy_item_mscan'  and  form_no = '2';

--Added by Ashish Sonawane on 14-sep-12 [mail send by Manoharan sir] [START]

alter table pick_iss_hdr add trf_status char(1);
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
(	'VTPLTTRF',
	'Pallet transferred',
	'The pallet is already transferred from the staging area',
	'E',
	NULL,
	NULL,
	NULL,
	NULL,
	sysdate,
	'BASE',
	'BASE',
	NULL,
	NULL
);

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
(	'VTPKORDC',
	'Pick task completed',
	'The pick task is already completed',
	'E',
	NULL,
	NULL,
	NULL,
	NULL,
	sysdate,
	'BASE',
	'BASE',
	NULL,
	NULL
);

--Added by Ashish Sonawane on 14-sep-12 [mail send by Manoharan sir] [END]

--- cpandey sql  start on 14-09-12 for SchemSordAllocPrc

Insert into transetup (TRAN_WINDOW,SAVE_FLAG,VAL_FLAG,KEY_FLAG,KEY_STRING,UDF_1,UDF_2,UDF_3,UDF_4,UDF_5,REPEATE_ADD,CHG_DATE,CHG_USER,CHG_TERM,EDI_OPTION,SITE_ACC_COL,CONFIRM_COL,CONFIRM_VAL,REPEAT_ADD_DET,REPEATADDDET,LOAD_MODE,AUTO_CONFIRM,LEDG_POST_CONF,CHG_DATE_ON_CONF,TRAN_ID_COL,MAIL_OPTION,CONFIRM_MODE,REF_SER,VIEW_MODE) 
values ('w_schemealloc','2','2','A','seq10',null,null,null,null,null,null,sysdate,'BASE ','1   ','1',null,null,'Y',null,null,null,null,'N',null,'TRAN_ID','0','0','D-ALOC','F');

Insert into itm2menu (APPLICATION,LEVEL_1,LEVEL_2,LEVEL_3,LEVEL_4,LEVEL_5,WIN_NAME,DESCR,COMMENTS,MENU_PATH,ICON_PATH,CLOSE_ICON,OPEN_ICON,OBJ_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('TRO',2,1,8,0,0,'w_schemealloc','Scheme allocation for Sale Order',null,'TRO.2.1.8.0.0','e12_logo.gif',null,null,'P',SYSDATE,'BASE','BASE');

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 ('schemealloc','get_data','1','agetData_sordalloc',null,'0',SYSDATE,'Base','BASE','2','EJB','SchemSordAllocPrc',null);

Insert into obj_actions (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER)
values ('schemealloc',1,null,'Action Button for getting data','get_data','a','R','GetData','2','3',null,'U',null,SYSDATE,'BASE','BASE');

Insert into obj_actions (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) 
values ('schemealloc',2,null,'Action Button for processing the data','process','a','R','Process','2','3',null,'U',null,SYSDATE,'BASE','BASE');

Insert into obj_forms (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO) 
values ('w_schemealloc','Header',null,null,null,null,null,null,'1');

Insert into obj_forms ( WIN_NAME,TITLE,FORM_NO ) values ( 'w_schemealloc','Data','2' );

Insert into obj_forms (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO) 
values ('w_schemealloc','Header',null,null,null,null,null,null,'1');

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 ('INVSALEORD','Invaid sale order ','Despatch already define for this saleorder','E','Y',	NULL,NULL,NULL,sysdate,'chitranjan',	'chitranjan',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 ('schemealloc','process','1','aprocessSordalloc1',null,'0',SYSDATE,'Base','BASE','2','EJB','SchemSordAllocPrc',null);

--- cpandey sql end


--- added by cpatil 14-09-12 [ pandey work ...SchemSordAllocPrc ]
delete from system_events where obj_name = 'schemealloc' and event_code ='process';

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 ('schemealloc','process','1','aprocessSchemealloc',null,'0',sysdate,'Base','BASE','2','EJB','SchemSordAllocPrc',null);


Insert into system_event_services (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,RETURN_XFRM_XSL,CHG_DATE,CHG_USER,CHG_TERM) 
values ('aprocessSchemealloc','Action To process the Data','http://localhost/axis/services/ProcessService','Base Information','process','String','S',null,null, EMPTY_BLOB(),sysdate,'BASE','BASE');

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('aprocessSchemealloc',1,'COMPONENT_TYPE','I','Component Type','C.String',null,sysdate,'BASE','BASE','EJB');
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('aprocessSchemealloc',2,'COMPONENT_NAME','I','Component Name','C.String',null,sysdate,'BASE','BASE','SchemSordAllocPrc');
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('aprocessSchemealloc',3,'XML_DATA_1','I','XML data of form no 1','S',null,sysdate,'BASE','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('aprocessSchemealloc',4,'XML_DATA__ALL','I','XML data of form no 1','S',null,sysdate,'BASE','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('aprocessSchemealloc',5,'OBJ_CONTEXT','I','Object Context','S',null,sysdate,'BASE','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('aprocessSchemealloc',6,'XTRA_PARAMS','I','Extra Arguments','S',null,sysdate,'BASE','BASE',null);

---- cpatil end

--added by Kunal add error message for wrong PND Location in Repl. Issue.
INSERT INTO MESSAGES(MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,CHG_DATE,CHG_USER,CHG_TERM)
VALUES('INVPNDLOC1','Invalid Location Code','This PND location is not associated to this DSO location','E','Y',SYSDATE,'Kunal','Kunal');

--Added by Ashish Sonawane on 17-sep-12 from SUN [mail from manoharan sir] [START] 
update obj_forms set scan_metadata = '<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Is Empty :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>isempty</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>LPN NO:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="3"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="4"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="5"><SCAN_LABEL>Case Count:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>phy_input</FIELD></FIELDS></INPUT_SCAN><SCAN_CONDITION field="isempty">isempty.indexOf("N") != -1</SCAN_CONDITION><SCAN_CONDITION field="lot_sl">isempty.indexOf("N") != -1</SCAN_CONDITION><SCAN_CONDITION field="item_code">isempty.indexOf("N") != -1</SCAN_CONDITION><SCAN_CONDITION field="lot_no">isempty.indexOf("N") != -1</SCAN_CONDITION><SCAN_CONDITION field="phy_input">isempty.indexOf("N") != -1</SCAN_CONDITION></SCAN_INFO>'
where win_name = 'w_phy_item_mscan' and form_no = '2';

--Added by Ashish Sonawane on 17-sep-12 from SUN [mail from manoharan sir] [END] 

--Added By Manoj dtd 18/09/2012 for Physical item scan manual

alter table physcandet modify (
ITEM_CODE  null,
LOC_CODE  null,
LOT_NO null,
LOT_SL null,
QUANTITY  null,
UNIT null);
ALTER TABLE PHYSCAN ADD TRAN_TYPE CHAR(1) NOT NULL;

update obj_forms set scan_metadata='<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Is Empty:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>isempty</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>' where win_name='w_phy_item_mscan' and form_no='1' ;

--Added By Manoj dtd 20/09/2012 received from sun

CREATE OR REPLACE FUNCTION FN_po_dlv_qty ( as_tranid in char, 
 as_linenoord   in char) 
return number is 
lc_dlvqty number(14,3); 
begin 
	begin
		select p.dlv_qty into lc_dlvqty from porddet p, asn_hdr h, asn_det d
		where h.tran_id = d.tran_id and p.purc_order = h.purc_order and (d.line_no__ord) = (p.line_no)
		and h.tran_id = as_tranid;
	exception when others then
		lc_dlvqty := 0;
	end;
	if lc_dlvqty is null then
		lc_dlvqty := 0;
	end if;
	return lc_dlvqty; 
end ; 

-- added by Kunal 20/09/12 for manual item scan 
Insert into messages (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM) 
values ('INVISEMTY','Invalid IsEmpty Field','Invalid IsEmpty Field. Please enter either Y or N.','E','Y',null,null,null,sysdate,'Kunal','Kunal');
--Added by Manoj to set default value n to column confirmed

alter table physcan modify confirmed default 'N';

----added by Kunal sun sql marge mail by sumit sarkar 24/09/12 start


--added by sumit
	--- added by sankara
UPDATE OBJ_FORMS SET SCAN_METADATA = ''
WHERE WIN_NAME='w_repl_iss' AND FORM_NO = '1';

	INSERT INTO pophelp (
		field_name,
		mod_name,
		sql_str,
		dw_object,
		msg_title,
		width,
		height,
		chg_date,
		chg_user,
		chg_term,
		dist_opt,
		filter_string,
		sql_input,
		default_col,
		pop_align,
		query_mode,
		page_context,
		pophelp_cols,
		pophelp_source,
		multi_opt,
		help_option)
	 VALUES (
		'REPL_ORDER',
		'W_REPL_ISS',
		'SELECT DISTINCT(R.REPL_ORDER) FROM REPL_ORD_DET R,WAVE_TASK_DET W,LOCATION L  WHERE R.REPL_ORDER = W.REF_ID AND W.STATUS = ''N'' AND R.LOC_CODE = L.LOC_CODE AND L.INV_STAT = ''?''',
		NULL,
		'Repl Order',
		0,
		NULL,
		fn_sysdate(),
		'SUN       ',
		'BASE           ',
		'0',
		NULL,
		':1.repl_order',
		NULL,
		NULL,
		NULL,
		NULL,
		NULL,
		NULL,
		NULL,
		NULL);
		
		
UPDATE OBJ_FORMS SET SCAN_METADATA = ''
WHERE WIN_NAME='w_active_repl_iss' AND FORM_NO = '1';

	INSERT INTO pophelp (
		field_name,
		mod_name,
		sql_str,
		dw_object,
		msg_title,
		width,
		height,
		chg_date,
		chg_user,
		chg_term,
		dist_opt,
		filter_string,
		sql_input,
		default_col,
		pop_align,
		query_mode,
		page_context,
		pophelp_cols,
		pophelp_source,
		multi_opt,
		help_option)
	 VALUES (
		'REPL_ORDER',
		'W_ACTIVE_REPL_ISS',
		'SELECT DISTINCT(R.REPL_ORDER) FROM REPL_ORD_DET R,WAVE_TASK_DET W,LOCATION L  WHERE R.REPL_ORDER = W.REF_ID AND W.STATUS = ''N'' AND R.LOC_CODE = L.LOC_CODE AND L.INV_STAT = ''?''',
		NULL,
		'Repl Order',
		0,
		NULL,
		fn_sysdate(),
		'SUN       ',
		'BASE           ',
		'0',
		NULL,
		':1.repl_order',
		NULL,
		NULL,
		NULL,
		NULL,
		NULL,
		NULL,
		NULL,
		NULL);
		
	
UPDATE OBJ_FORMS SET SCAN_METADATA = ''
WHERE WIN_NAME='w_repl_iss_dock' AND FORM_NO = '1';

INSERT INTO pophelp (
	field_name,
	mod_name,
	sql_str,
	dw_object,
	msg_title,
	width,
	height,
	chg_date,
	chg_user,
	chg_term,
	dist_opt,
	filter_string,
	sql_input,
	default_col,
	pop_align,
	query_mode,
	page_context,
	pophelp_cols,
	pophelp_source,
	multi_opt,
	help_option)
 VALUES (
	'REPL_ORDER',
	'W_REPL_ISS_DOCK',
	'SELECT DISTINCT(R.REPL_ORDER) FROM REPL_ORD_DET R,WAVE_TASK_DET W,LOCATION L  WHERE R.REPL_ORDER = W.REF_ID AND W.STATUS = ''N'' AND R.LOC_CODE = L.LOC_CODE AND L.INV_STAT = ''?''',
	NULL,
	'Repl Order',
	0,
	NULL,
	fn_sysdate(),
	'SUN       ',
	'BASE           ',
	'0',
	NULL,
	':1.repl_order',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

	commit;	
	
	
	-- added by sumit
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 (
	'CHSINGLELT',
	'Customer Parameter',
	'You are changing existing parameter of Customer ',
	'W',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('18-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);
	

INSERT INTO OBJ_ITEMCHANGE (
	obj_name,
	form_no ,
	field_name ,
	mandatory )
 VALUES (
	'wavegen',
	'1  ',
	'cust_code__from',
	'Y');
	
INSERT INTO OBJ_ITEMCHANGE (
	obj_name,
	form_no ,
	field_name ,
	mandatory )
 VALUES (
	'wavegen',
	'1  ',
	'cust_code__to',
	'Y');

INSERT INTO SYSTEM_EVENT_SERVICES (
	service_code ,
	service_descr ,
	service_uri ,
	service_provider,
	method_name ,
	return_value ,
	return_type ,
	return_descr ,
	return_xfrm ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'prv_wavegen',
	'Validation',
	'http://localhost:9090/axis/services/ValidatorService',
	'BASE',
	'wfValData',
	'String',
	'S',
	NULL,
	NULL,
	TO_DATE('18-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE');
	
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 (
	'wavegen',
	'pre_validate',
	'1',
	'prv_wavegen',
	NULL,
	'0',
	TO_DATE('8-05-2012 13:26:05','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'2',
	'EJB',
	'WaveGenerationIC',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )	
 VALUES (
	'prv_wavegen',
	1,
	'COMPONENT_TYPE',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('18-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'EJB');
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )	
 VALUES (
	'prv_wavegen',
	2,
	'COMPONENT_NAME',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('18-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'WaveGenerationIC');
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )	
 VALUES (
	'prv_wavegen',
	3,
	'XML_DATA',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('18-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )	
 VALUES (
	'prv_wavegen',
	4,
	'XML_DATA_1',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('18-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )	
 VALUES (
	'prv_wavegen',
	5,
	'XML_DATA_ALL',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('18-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
	
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )	
 VALUES (
	'prv_wavegen',
	6,
	'OBJ_CONTEXT',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('18-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )	
 VALUES (
	'prv_wavegen',
	7,
	'OBJ_CONTEXT',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('18-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )	
 VALUES (
	'prv_wavegen',
	8,
	'XTRA_PARAMS',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('18-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);

	commit;
	
INSERT INTO DISPARM (
	prd_code,
	var_name ,
	var_type,
	var_value ,
	descr ,
	var_subs ,
	chg_date ,
	chg_user ,
	chg_term)
VALUES (
	'999999',
	'STOCK_TO_DOCK_OBJ_NAME',
	'S',
	'Stock_to_Dock_label',
	'Report name of Stock to dock',
	NULL,
	TO_DATE('18-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ');
	
INSERT INTO DISPARM (
	prd_code,
	var_name ,
	var_type,
	var_value ,
	descr ,
	var_subs ,
	chg_date ,
	chg_user ,
	chg_term)
VALUES(
	'999999',
	'STOCK_TO_DOCK_PRINTER',
	'S',
	'PDFCreator',
	'Path of printer exp:  \\000.000.000.000\PDFCreator',
	NULL,
	TO_DATE('18-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ');
	
	
	COMMIT;


	
CREATE TABLE shipment_content 
(
    SHIPMENT_ID CHAR(10),
    LINE_NO CHAR(3),
    CARTON_NO VARCHAR2(20),
    GROSS_WEIGHT VARCHAR2(20),
    TRACKING_NO VARCHAR2(20),
    FRT_AMT NUMBER(14,3)
);
ALTER TABLE shipment_content ADD ( CONSTRAINT PK_SHIP_ID PRIMARY KEY ( SHIPMENT_ID,LINE_NO )) ;

commit;

alter TABLE shipment add
(
    CONSIGNEE_NAME VARCHAR2(40),
    ADDR1  VARCHAR2(40),
    ADDR2 VARCHAR2(40),
    ADDR3 VARCHAR2(40),
    CITY VARCHAR2(20),
    PIN VARCHAR2(10),
	no_art number(6),
	no_pallet number(6)    
);


COMMIT;

INSERT INTO OBJ_FORMS (
	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no ,
	scr_flag ,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode,
	storage_key_metadata,
	selection_mode,
	default_view)
VALUES (
	'w_shipment',
	'Shipment Content',
	'd_shipment13',
	'd_shipment23',
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
	
COMMIT;

	-- added  by Rohan
INSERT INTO system_service_args(
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prcm_cancel_wave',
	4,
	'XTRA_PARAMS',
	'I',
	'XTRA_PARAMS',
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:01','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE      ',
	NULL);
INSERT INTO system_service_args(
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prcm_cancel_wave',
	5,
	'FORCED_FLAG',
	'I',
	'FORCED_FLAG',
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:01','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE      ',
	NULL);

COMMIT;	

-- added by pragyan
UPDATE MESSAGES SET MSG_STR='Weight is Exceeded',MSG_DESCR='Master Carton Weight Or No. Of Cases is Exceeded' WHERE MSG_NO='VTWGTEXD';

UPDATE MESSAGES SET MSG_STR='Master Pack already confirmed',MSG_DESCR='Master Pack already confirmed' WHERE MSG_NO='PACKCONF';

----added by Kunal sun sql marge mail by sumit sarkar 24/09/12 end

--Added by manoj dtd 24/09/2012 for Sales return creation through wizard

Insert into ITM2MENU (APPLICATION,LEVEL_1,LEVEL_2,LEVEL_3,LEVEL_4,LEVEL_5,WIN_NAME,DESCR,COMMENTS,MENU_PATH,ICON_PATH,CLOSE_ICON,OPEN_ICON,OBJ_TYPE,CHG_DATE,CHG_TERM,CHG_USER,MOB_DEPLOY) values ('TRO',2,1,9,0,0,'w_salesreturn_wiz','Sales Return',null,'TRO.2.1.9.0.0','e12_logo.gif',null,null,'W',null,null,null,null);

Insert into transetup (TRAN_WINDOW,SAVE_FLAG,VAL_FLAG,KEY_FLAG,KEY_STRING,UDF_1,UDF_2,UDF_3,UDF_4,UDF_5,REPEATE_ADD,CHG_DATE,CHG_USER,CHG_TERM,EDI_OPTION,SITE_ACC_COL,CONFIRM_COL,CONFIRM_VAL,REPEAT_ADD_DET,REPEATADDDET,LOAD_MODE,AUTO_CONFIRM,LEDG_POST_CONF,CHG_DATE_ON_CONF,TRAN_ID_COL,MAIL_OPTION,CONFIRM_MODE,GARBAGE_OPT,VAL_FLAG_EDI,VERIFY_PASSWORD,CUST_ACC_COL,SALES_PERS_ACC_COL,SUPP_ACC_COL,ITEM_SER_ACC_CODE,EMP_ACC_COL,ITEM_SER_ACC_COL,WORKFLOW_OPT,TABLE_NAME,APPLICATION,TABLE_DESC,TRAN_DATE_COL,TRAN_ID__FROM,TRAN_ID__TO,TABLE_NAME_DET1,TABLE_NAME_DET2,TABLE_NAME_DET3,MULTITIRE_OPT,REF_SER,VIEW_MODE,TAX_FORMS,SIGN_STATUS,USER_TRAN_WINDOW,CUSTOM_PREVIEW_OBJ,IGNOREERRLIST_ONLOAD,CHILDDATA_ARGOPT,EDIT_TMPLT,WRKFLW_INIT,EDITTAX,FORMAL_ARGS,AUDIT_TRAIL_OPT,EDIT_OPT,CACHE_OPT,OPTIMIZE_MODE,EDIT_EXPR,RATE_COL,QTY_COL,EDIT_EXPR_INP,RCP_CACHE_STATUS,PRINT_CONTROL,TRANSFER_MODE,PROFILE_ID__RES,TRAN_COMPL_MSG,PERIOD_OPTION,WRKFLW_PRIORITY,EXEC_TYPE,DISP_META_DATA,ALLOW_ATTACH,START_FORM,ISATTACHMENT,HEADER_FORM_NO) values ('w_salesreturn_wiz','A','2','A','seq10','Y',null,null,null,null,'N',to_timestamp('08-08-00','DD-MM-RR HH12:MI:SSXFF AM'),'SUN       ','JAIN''S         ','0','SITE_CODE','CONFIRMED','Y',null,null,null,null,'Y','Y','TRAN_ID','0','0','N',null,null,null,null,null,null,null,null,null,'Sreturn',null,null,'TRAN_DATE',null,null,null,null,null,null,'S-RET','F','2',null,null,null,null,'2',null,null,null,null,'0',null,null,null,null,null,null,null,null,null,null,null,null,'M',null,null,null,null,null,null,'2');


Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('salesreturn_wiz',1,null,'Saving',null,null,'S','Finish','3',null,null,'U',null,sysdate,'BASE           ','Mahesh    ');
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('salesreturn_wiz',5,'confirm~normal.gif','Confirming records','pre_confirm','a','F','Confirm','3','2','1','S',null,sysdate,'BASE           ','Mahesh    ');
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('salesreturn_wiz',2,null,'Prev','a','a','P','Next','2',null,null,'U',null,sysdate,'BASE           ','Mahesh    ');
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('salesreturn_wiz',3,null,'Next','a','a','N','Next','2',null,null,'U',null,sysdate,'BASE           ','Mahesh    ');
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('salesreturn_wiz',4,null,'Prev','a','a','P','Prev','3',null,null,'U',null,sysdate,'BASE           ','Mahesh    ');
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER) values ('salesreturn_wiz',6,null,'Next',null,null,'N','Next','1',null,null,'U',null,sysdate,'BASE           ','Mahesh    ');

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) values ('w_salesreturn_wiz','Header',null,null,null,null,null,null,'1','F',null,null,'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Tran Id:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>salesreturnform</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,null,null,null,null,'E',null,null,null);
Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) values ('w_salesreturn_wiz','Header',null,null,null,null,null,null,'2','F',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'E',null,null,null);
Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) values ('w_salesreturn_wiz','Detail',null,null,null,null,null,null,'3','T',null,null,'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Item:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>Lot Sl:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="4"><SCAN_LABEL>Location:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,'checkedImage@img<item_code>,<loc_code>,<lot_no>,<lot_sl>',null,null,null,'E',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 ('salesreturn_wiz','pre_navigate_next','1','prv_salesreturn_wiz',null,'0',sysdate,'Mahesh    ','BASE','2','EJB','SreturnWizIC',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 ('salesreturn_wiz','default_data_wiz','1','salesreturn_wiz_default_data',null,'0',sysdate,'Mahesh    ','BASE','2','EJB','SreturnWizIC',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 ('salesreturn_wiz','pre_validate','1','prv_salesreturn_wiz',null,'0',sysdate,'Mahesh    ','BASE','2','EJB','SreturnWizIC',null);

Insert into system_event_services (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM) values ('salesreturn_wiz_default_data','Default Data','http://localhost:9090/axis/services/ValidatorService','BASE','itemChanged','String','S',null,null,sysdate,'Rohan     ','BASE');
Insert into system_event_services (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM) values ('prv_salesreturn_wiz','Validation','http://localhost:9090/axis/services/ValidatorService','BASE','wfValData','String','S',null,null,sysdate,'Rohan     ','BASE');

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('salesreturn_wiz_default_data',1,'COMPONENT_TYPE','I',null,'S',null,sysdate,'Rohan     ','BASE','EJB');
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('salesreturn_wiz_default_data',2,'COMPONENT_NAME','I',null,'S',null,sysdate,'Rohan     ','BASE','PhyItemScanIC');
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('salesreturn_wiz_default_data',3,'XML_DATA','I',null,'S',null,sysdate,'Rohan     ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('salesreturn_wiz_default_data',4,'XML_DATA_1','I',null,'S',null,sysdate,'Rohan     ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('salesreturn_wiz_default_data',5,'XML_DATA_ALL','I',null,'S',null,sysdate,'Rohan     ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('salesreturn_wiz_default_data',6,'OBJ_CONTEXT','I',null,'S',null,sysdate,'Rohan     ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('salesreturn_wiz_default_data',7,'FOCUSED_COLUMN','I',null,'S',null,sysdate,'Rohan     ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('salesreturn_wiz_default_data',8,'EDIT_FLAG','I',null,'S',null,sysdate,'Rohan     ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('salesreturn_wiz_default_data',9,'XTRA_PARAMS','I',null,'S',null,sysdate,'Rohan     ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_salesreturn_wiz',1,'COMPONENT_TYPE','I',null,'S',null,sysdate,'Rohan     ','BASE','EJB');
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_salesreturn_wiz',2,'COMPONENT_NAME','I',null,'S',null,sysdate,'Rohan     ','BASE','PhyItemScanIC');
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_salesreturn_wiz',3,'XML_DATA__ALL','l',null,'S',null,sysdate,'Rohan     ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_salesreturn_wiz',4,'XML_DATA_1','l',null,'S',null,sysdate,'Rohan     ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_salesreturn_wiz',5,'XML_DATA_ALL','l',null,'S',null,sysdate,'Rohan     ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_salesreturn_wiz',6,'OBJ_CONTEXT','l',null,'S',null,sysdate,'Rohan     ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_salesreturn_wiz',7,'EDIT_FLAG','l',null,'S',null,sysdate,'Rohan     ','BASE',null);
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_salesreturn_wiz',8,'XTRA_PARAMS','l',null,'S',null,sysdate,'Rohan     ','BASE',null);


UPDATE TRANSETUP SET HEADER_FORM_NO=2 WHERE TRAN_WINDOW='w_salesreturn_wiz';
update transetup set key_string='seq10' where TRAN_WINDOW='w_salesreturn_wiz'



Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pos_sret_wiz',1,'COMPONENT_TYPE','I',null,'S',null,sysdate,'Kunal','Kunal','EJB');

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pos_sret_wiz',2,'COMPONENT_NAME','I',null,'S',null,sysdate,'Kunal','Kunal','SreturnWizPos');
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pos_sret_wiz',3,'XML_DATA_ALL','I',null,'S',null,sysdate,'Kunal','Kunal',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pos_sret_wiz',4,'<tran_id>','I',null,'B.String',null,sysdate,'Kunal','Kunal',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pos_sret_wiz',5,'EDIT_FLAG','I',null,'S',null,sysdate,'Kunal','Kunal',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pos_sret_wiz',6,'XTRA_PARAMS','I',null,'S',null,sysdate,'Kunal','Kunal',null);

Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pos_sret_wiz',7,'DB_CONN','I',null,'S.Connection',null,sysdate,'Kunal','Kunal',null);


Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,CHG_DATE,CHG_USER,CHG_TERM) values ('pos_sret_wiz','Validation','http://localhost:9090/axis/services/ValidatorService','BASE','postSave','String','S',null,sysdate,'Kunal','BASE');



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 ('salesreturn_wiz','post_save','1','pos_sret_wiz',null,'0',sysdate,'Kunal','Kunal','2','EJB','SreturnWizPos',null);



-- addad by akhilesh on 24/09/12
alter table sreturn
add form_no char(10);


----added by Kunal sun sql marge mail by sumit sarkar 25/09/12 
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 (
	'SHIPALLCON',
	'Invalid Shipment Id',
	'Entered shipment id is already confirmed.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('24-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE   ',
	'BASE   ',
	NULL,
	NULL);
--Added by manoj dtd 25/09/2012 to rename drug license number
ALTER TABLE SRETURN_FORM RENAME COLUMN BILL_DRUG_LIC_NO_1 TO BILL_DRUG_LIC_NO;
ALTER TABLE SRETURN_FORM RENAME COLUMN DLV_DRUG_LIC_NO_1 TO DLV_DRUG_LIC_NO;
--Added by manoj dtd 25/09/2012 to add Shipment lead time to Site Customer table
alter table site_customer add SHIPMENT_LEAD__TIME number(10);

----added by Kunal sun sql marge mail by S Manoharan Sir  25/09/12 start

-- 22/09/12
update obj_forms set scan_metadata = '<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>LPN No To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl__to</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Location Code To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="3"><SCAN_LABEL>Number of Cases:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>no_art</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="4"><SCAN_LABEL>Active Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>quantity</FIELD></FIELDS></INPUT_SCAN><SCAN_CONDITION field="quantity">no_art == "null" || no_art == "0" || no_art == ""</SCAN_CONDITION></SCAN_INFO>'
where  win_name = 'w_stock_transfer_wiz' and form_no = '3';
update system_service_args set arg_value = null where service_code = 'posr_stock_transfer_2' and line_no < 3;
INSERT INTO obj_actions (obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
VALUES (
	'pick_order',
	2,
	'edit.gif',
	'Editing Existing Record',
	'a',
	'a',
	'E',
	'Edit',
	'1',
	NULL,
	NULL,
	'S',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO pophelp (field_name,
	mod_name,
	sql_str,
	dw_object,
	msg_title,
	width,
	height,
	chg_date,
	chg_user,
	chg_term,
	dist_opt,
	filter_string,
	sql_input,
	default_col,
	pop_align,
	query_mode,
	page_context,
	pophelp_cols,
	pophelp_source,
	multi_opt,
	help_option)
VALUES (
	'LOT_SL',
	'W_PICK_ORDER',
	'SELECT LOT_SL, QUANTITY, LOC_CODE, ITEM_CODE, SITE_CODE  FROM STOCK WHERE  ITEM_CODE = ''?'' AND SITE_CODE = ''?''  AND  LOT_NO = ''?'' AND QUANTITY - ALLOC_QTY > 0',
	NULL,
	'LOT SL NO',
	0,
	0,
	TO_DATE('22-10-2000 12:16:25','DD-MM-YYYY HH24:MI:SS'),
	'SUN       ',
	'HDP            ',
	'0',
	NULL,
	':1.ITEM_CODE,0:site_code,1:lot_no',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO pophelp (field_name,
	mod_name,
	sql_str,
	dw_object,
	msg_title,
	width,
	height,
	chg_date,
	chg_user,
	chg_term,
	dist_opt,
	filter_string,
	sql_input,
	default_col,
	pop_align,
	query_mode,
	page_context,
	pophelp_cols,
	pophelp_source,
	multi_opt,
	help_option)
VALUES (
	'LOT_NO',
	'W_PICK_ORDER',
	'SELECT LOT_NO, LOT_SL, QUANTITY, LOC_CODE, ITEM_CODE, SITE_CODE  FROM STOCK WHERE  ITEM_CODE = ''?''  AND SITE_CODE = ''?'' AND QUANTITY - ALLOC_QTY > 0',
	NULL,
	'Lot No',
	0,
	0,
	TO_DATE('22-10-2000 12:16:29','DD-MM-YYYY HH24:MI:SS'),
	'SUN       ',
	'HDP            ',
	'0',
	NULL,
	':1.ITEM_CODE,:0.SITE_CODE',
	1,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

 CREATE OR REPLACE function fn_vics_chk_digit (as_crtn_plt in char,as_prono in char) 
 return varchar2 is 
 ls_prono varchar2(20) := as_prono; 
 len number := 0; 
 m number(17,2); 
 rem number(17,2); 
 c number; 
 sumodd number := 0; 
 sumeven number := 0; 
begin 
 len := length(trim(ls_prono)); 
 m := -1; 
 for i in reverse 1..len loop 
  c := substr(ls_prono,m,1); 
  if mod(c,2) = 0   then sumodd :=  sumodd + c;  end if; 
  if mod(c,2) <> 0  then sumeven := sumeven + c; end if; 
  m := m-1; 
 end loop; 
 sumOdd := sumOdd * 3; 
 ls_prono :=  as_crtn_plt || ls_prono || trim(to_char(10 - mod((sumEven + sumOdd), 10))) ; 
 return ls_prono ; 
end;
/
-- 24/09/12
ALTER TABLE WAVE_TASK ADD CANCEL CHAR(1);


INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'WAVENTREV',
	'Task scan already',
	'One of the Task is already Scan.Wave Reversal is not possible.',
	'E',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE ');

INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'WAVEREV',
	'Wave Reversal complete',
	'Wave Reversal Complete successfully.',
	'E',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE ');	

INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'NTWAVEREV',
	'Wave Reversal not complete',
	'Wave Reversal not Complete.',
	'E',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE ');

INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'WAVECANCEL',
	'Wave Reversal already done',
	'Wave reversal already done.You can not Reverse wave again.',
	'E',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE ');
alter table pack_hdr add  ptcn char(10);
ALTER TABLE CARTON_MASTER ADD MASTER_CARTON VARCHAR2(20);
INSERT INTO itm2menu (
	application ,
	level_1 ,
	level_2 ,
	level_3 ,
	level_4 ,
	level_5 ,
	win_name ,
	descr ,
	comments ,
	menu_path ,
	icon_path ,
	close_icon ,
	open_icon ,
	obj_type ,
	chg_date ,
	chg_term ,
	chg_user ,
	mob_deploy )
 VALUES (
	'WMS',
	1,
	44,
	0,
	0,
	0,
	'w_carton_master',
	'Carton Master',
	'Carton Master link',
	'WMS.1.44.0.0.0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO transetup (
	tran_window ,
	save_flag ,
	val_flag ,
	key_flag ,
	key_string ,
	udf_1 ,
	udf_2 ,
	udf_3 ,
	udf_4 ,
	udf_5 ,
	repeate_add ,
	chg_date ,
	chg_user ,
	chg_term ,
	edi_option ,
	site_acc_col ,
	confirm_col ,
	confirm_val ,
	repeat_add_det ,
	repeatadddet ,
	load_mode ,
	auto_confirm ,
	ledg_post_conf ,
	chg_date_on_conf ,
	tran_id_col ,
	mail_option ,
	confirm_mode ,
	garbage_opt ,
	val_flag_edi ,
	verify_password ,
	cust_acc_col ,
	sales_pers_acc_col ,
	supp_acc_col ,
	item_ser_acc_code ,
	emp_acc_col ,
	item_ser_acc_col ,
	workflow_opt ,
	table_name ,
	application ,
	table_desc ,
	tran_date_col ,
	tran_id__from ,
	tran_id__to ,
	table_name_det1 ,
	table_name_det2 ,
	table_name_det3 ,
	multitire_opt ,
	ref_ser ,
	view_mode ,
	tax_forms ,
	sign_status ,
	user_tran_window ,
	custom_preview_obj ,
	ignoreerrlist_onload ,
	childdata_argopt ,
	edit_tmplt ,
	wrkflw_init ,
	edittax ,
	formal_args ,
	audit_trail_opt ,
	edit_opt ,
	cache_opt ,
	optimize_mode ,
	edit_expr ,
	rate_col ,
	qty_col ,
	edit_expr_inp ,
	rcp_cache_status ,
	print_control ,
	transfer_mode ,
	profile_id__res ,
	tran_compl_msg ,
	period_option ,
	wrkflw_priority ,
	exec_type ,
	disp_meta_data ,
	allow_attach ,
	start_form ,
	isattachment ,
	header_form_no )
 VALUES (
	'w_carton_master',
	'2',
	'2',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'N',
	TO_DATE('6-10-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'Base      ',
	'Base           ',
	'0',
	NULL,
	NULL,
	'Y',
	'Y',
	NULL,
	NULL,
	'N',
	'N',
	NULL,
	'tran_id',
	NULL,
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'0',
	'CARTON_MASTER',
	'WMS',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'B-TRO',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'M',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO obj_forms(
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_carton_master',
	'Carton Master',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO obj_links (
	obj_name ,
	form_no ,
	field_name ,
	target_obj_name ,
	link_form_name ,
	link_title ,
	link_uri ,
	link_type ,
	link_arg ,
	update_flag ,
	link_name ,
	rights_char ,
	image )
 VALUES (
	'wave_task',
	'2',
	'ptcn',
	'carton_master',
	'carton_master11',
	'Master Pack',
	NULL,
	'1',
	'ref_id.String',
	'0',
	NULL,
	'*',
	NULL);
	
	INSERT INTO itm2menu (
	application ,
	level_1 ,
	level_2 ,
	level_3 ,
	level_4 ,
	level_5 ,
	win_name ,
	descr ,
	comments ,
	menu_path ,
	icon_path ,
	close_icon ,
	open_icon ,
	obj_type ,
	chg_date ,
	chg_term ,
	chg_user ,
	mob_deploy )
 VALUES (
	'WMS',
	1,
	42,
	0,
	0,
	0,
	'w_packhdr',
	'Master Packing Order',
	'Define Packing Master',
	'WMS.1.42.0.0.0',
	'e12_logo.gif',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO transetup (
	tran_window ,
	save_flag ,
	val_flag ,
	key_flag ,
	key_string ,
	udf_1 ,
	udf_2 ,
	udf_3 ,
	udf_4 ,
	udf_5 ,
	repeate_add ,
	chg_date ,
	chg_user ,
	chg_term ,
	edi_option ,
	site_acc_col ,
	confirm_col ,
	confirm_val ,
	repeat_add_det ,
	repeatadddet ,
	load_mode ,
	auto_confirm ,
	ledg_post_conf ,
	chg_date_on_conf ,
	tran_id_col ,
	mail_option ,
	confirm_mode ,
	garbage_opt ,
	val_flag_edi ,
	verify_password ,
	cust_acc_col ,
	sales_pers_acc_col ,
	supp_acc_col ,
	item_ser_acc_code ,
	emp_acc_col ,
	item_ser_acc_col ,
	workflow_opt ,
	table_name ,
	application ,
	table_desc ,
	tran_date_col ,
	tran_id__from ,
	tran_id__to ,
	table_name_det1 ,
	table_name_det2 ,
	table_name_det3 ,
	multitire_opt ,
	ref_ser ,
	view_mode ,
	tax_forms ,
	sign_status ,
	user_tran_window ,
	custom_preview_obj ,
	ignoreerrlist_onload ,
	childdata_argopt ,
	edit_tmplt ,
	wrkflw_init ,
	edittax ,
	formal_args ,
	audit_trail_opt ,
	edit_opt ,
	cache_opt ,
	optimize_mode ,
	edit_expr ,
	rate_col ,
	qty_col ,
	edit_expr_inp ,
	rcp_cache_status ,
	print_control ,
	transfer_mode ,
	profile_id__res ,
	tran_compl_msg ,
	period_option ,
	wrkflw_priority ,
	exec_type ,
	disp_meta_data ,
	allow_attach ,
	start_form ,
	isattachment ,
	header_form_no )
 VALUES (
	'w_packhdr',
	'2',
	'2',
	'A',
	'seq10',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'N',
	sysdate,
	'BASE      ',
	'BASE           ',
	'0',
	NULL,
	NULL,
	NULL,
	'N',
	NULL,
	NULL,
	'N',
	'N',
	NULL,
	'TRAN_ID',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'PACK_HDR',
	'WMS',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'D-RTE',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	NULL,
	NULL,
	NULL,
	NULL,
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'M',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
	
INSERT INTO obj_forms(
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_packhdr',
	'Pack Header',
	'd_pack_hdr_brow',
	'd_pack_hdr_edit',
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO obj_forms(
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
VALUES (
	'w_packhdr',
	'Pack Detail ',
	'd_pack_det_brow',
	'd_pack_det_edit',
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
	
INSERT INTO obj_actions (
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES (
	'packhdr',
	2,
	'edit.gif',
	'Editing Existing Record',
	'a',
	'a',
	'E',
	'Edit',
	'1',
	NULL,
	NULL,
	'S',
	NULL,
	NULL,
	NULL,
	NULL);
	
INSERT INTO pophelp (
	field_name ,
	mod_name ,
	sql_str ,
	dw_object ,
	msg_title ,
	width ,
	height ,
	chg_date ,
	chg_user ,
	chg_term ,
	dist_opt ,
	filter_string ,
	sql_input ,
	default_col ,
	pop_align ,
	query_mode ,
	page_context ,
	pophelp_cols ,
	pophelp_source ,
	multi_opt ,
	help_option );
 VALUES (
	'PTCN',
	'W_PACKHDR',
	'SELECT DISTINCT PTCN FROM PACK_HDR',
	NULL,
	'Ptcn',
	0,
	0,
	TO_DATE('10-11-2004 15:02:10','DD-MM-YYYY HH24:MI:SS'),
	'Base      ',
	'Base           ',
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

----added by Kunal sun sql marge mail by S Manoharan Sir 25/09/12 kunal

-- addad by akhilesh on 25/09/12
alter table sreturn_form_det add NO_PALLET NUMBER(14);

----- added missing sql for inv_hold_rel_gen by cpatil

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 ('VMTRIDFRNU','Tan Id From Null','Please Enter Tran Id From.
','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

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 ('TRIDFRINV','Tan Id From Invalid','Please Enter Tran Id From Master
','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

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 ('VMTRIDTONU','Tan Id To Null','Please Enter Tran Id To.
','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

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 ('TRIDTOINV','Tan Id To Invalid','Please Enter Tran Id To Master
','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

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 ('SCDTTOINV','Sch. Rel. Date From Invalid','Schedule Release Date
From must be less than Schedule Release Date To.
','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

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 ('VMSCDTTONU','Sch. Rel. Date To Null','Please Enter Schedule Release
Date To. ','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);

----end
--Added By Manoj dtd 28/09/2012 to show item descr,unit,itemseries in pophelp

update pophelp set SQL_STR ='SELECT B.SCHEME_CODE,A.DESCR,A.ITEM_CODE,CASE WHEN I.DESCR IS NULL THEN '' '' ELSE I.DESCR END ITEM_DESCR,CASE WHEN I.UNIT IS NULL THEN '' '' ELSE I.UNIT END UNIT,CASE WHEN I.ITEM_SER IS NULL THEN '' '' ELSE I.ITEM_SER END ITEM_SER, A.DISC_TYPE 
   FROM BOM A, 
   SCHEME_APPLICABILITY B,SCHEME_APPLICABILITY_DET C,SORDDET D,SORDER E , CUSTOMER F,ITEM I   
   WHERE    A.BOM_CODE=B.SCHEME_CODE   
   AND B.SCHEME_CODE=C.SCHEME_CODE  
   AND D.SALE_ORDER=E.SALE_ORDER  
   AND (B.CUST_TYPE IS NULL OR F.CUST_TYPE = B.CUST_TYPE)  
   AND D.QUANTITY BETWEEN A.MIN_QTY AND A.MAX_QTY    AND D.NET_AMT BETWEEN A.MIN_AMT AND A.MAX_AMT  
    AND (SELECT SUM(nvl(NET_AMT,0)) FROM INVOICE I WHERE I.CUST_CODE =E.CUST_CODE AND I.TRAN_DATE >= (select fr_date from acctprd where sysdate  between fr_date and to_date) ) >= NVL(B.MIN_YTD_SALES,0)
   AND ((E.CUST_CODE IN(SELECT CUST_CODE FROM BRACKET_GROUP BG WHERE BG.BRACKET_GRP=B.BRACKET_GRP) OR B.BRACKET_GRP IS NULL) 
   OR  (E.CUST_CODE=F.CUST_CODE AND (trim(B.CUST_GRP)=trim(F.GROUP_CODE) OR B.CUST_GRP IS NULL) ) )  
  AND (B.ITEM_CODE=D.ITEM_CODE OR B.ITEM_CODE = ''X'') 
  AND B.ITEM_CODE=I.ITEM_CODE(+)   
  AND (B.ITEM_DIS IS NULL OR ( B.ITEM_DIS =  (SELECT  G.ITEM_DIS  FROM ITEMDIS_GRP G WHERE G.ITEM_CODE=D.ITEM_CODE AND G.ITEM_DIS = B.ITEM_DIS)  ) )  
   AND A.PROMO_TERM IN(''0'',''1'')  
   AND D.SALE_ORDER= ''?'' 
AND (B.SCHEME_CODE || D.SALE_ORDER || TO_NUMBER(D.LINE_NO) ) NOT IN (SELECT SCHEME_CODE || TRAN_ID || LINE_NO_FORM FROM SORDERDET_SCHEME WHERE TRAN_ID =D.SALE_ORDER) 
    AND E.CUST_CODE = F.CUST_CODE(+) 
   AND ((C.SITE_CODE IS NULL OR E.SITE_CODE IN ('',C.SITE_CODE)) OR (C.STATE_CODE IS NULL OR F.STATE_CODE IN ('',C.STATE_CODE)) OR (C.COUNT_CODE IS NULL OR F.COUNT_CODE IN ('',C.COUNT_CODE)) OR (C.STAN_CODE IS NULL OR F.STAN_CODE IN ('',C.STAN_CODE))) 
' WHERE FIELD_NAME ='SCHEME_CODE' AND MOD_NAME = 'W_SORDERDET_SCHEME';

---added by Kunal on 02/10/12 for sales return wiz edit mode. 

delete from  system_events where obj_name = 'salesreturn_wiz' and event_code = 'post_save';

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 ('salesreturn_wiz','pre_navigate_finish','1','pos_sret_wiz',null,'0',sysdate,'Kunal','Kunal','2','EJB','SreturnWizPos',null);

update system_service_args set ARG_NAME = 'OBJ_CONTEXT' where service_code = 'pos_sret_wiz' and line_no = 5;

update system_service_args set ARG_NAME = 'EDIT_FLAG' where service_code = 'pos_sret_wiz' and line_no = 6;

update system_service_args set ARG_NAME = 'XTRA_PARAMS', ARG_TYPE = 'S' where service_code = 'pos_sret_wiz' and line_no = 7;

--Added by manoj dtd 02102012 received from unique

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 (
	'REPLCANCEL',
	'Replenishment id Canceled',
	'Entered replenishment id is canceled, Please enter valid replenishment id.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('28-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);
	
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 (
	'PICKCANCEL',
	'Picking id Canceled',
	'Entered picking id is canceled, Please enter valid picking id.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('28-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);
	
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 (
	'PACKCANCEL',
	'Packing id Canceled',
	'Entered packing id is canceled, Please enter valid packing id.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('28-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);
	
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 (
	'INVISEMTY',
	'invalid isempty value',
	'Input value of isempty should be Y or N .',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('28-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);

	INSERT INTO OBJ_ACTIONS(
	obj_name,
	line_no,
	image,
	description,
	service_code ,
	interactive ,
	rights_char,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES (
	'shipment',
	3,
	'confirm~normal.gif',
	'Confirming records',
	'pre_confirm',
	'a',
	'C',
	'Confirm',
	'1',
	'2',
	'1',
	'U',
	NULL,
	NULL,
	NULL,
	NULL);

COMMIT;

/////////////////////////////02OCT12//////////////////////////////////////////////////

INSERT INTO obj_links (
	obj_name ,
	form_no ,
	field_name ,
	target_obj_name ,
	link_form_name ,
	link_title ,
	link_uri ,
	link_type ,
	link_arg ,
	update_flag ,
	link_name ,
	rights_char ,
	image )
 VALUES (
	'wave_task',
	'1',
	'wave_id',
	'wave_task_main',
	'wave_task_main',
	'View Wave Task Report',
	NULL,
	'5',
	'wave_id.String:p_wave_id',
	'0',
	NULL,
	'S',
	NULL);
--Added by manoj dtd 03102012 sql received from unique for merging

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 (
	'SDSPCONFIR',
	'invalid Shipment id ',
	'Shipment should be confirmed by loading ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('28-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);

	
	alter table inv_lock 
	add lock_type char(1);
	
	UPDATE MESSAGES SET msg_str= 'Invalid wave task', msg_descr ='Wave Reversal is not possible, wave task is on hold or canceled or both' 
where msg_no='VTHOLDTASK';

----added by Kunal sun sql marge mail by Sumit Sarkar  03/10/12 

alter table shipment_content add PALLET_NO VARCHAR2(25);

commit;

----added by Rohan on 04-10-12 sql form unque.
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 (
	'SDSPCONFIR',
	'invalid Shipment id ',
	'Shipment should be confirmed by loading ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('28-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);

	
	alter table inv_lock 
	add lock_type char(1);
	
	UPDATE MESSAGES SET msg_str= 'Invalid wave task', msg_descr ='Wave Reversal is not possible, wave task is on hold or canceled or both' 
where msg_no='VTHOLDTASK';


DELETE FROM DISPARM WHERE var_name='STAGING_LOC';

INSERT INTO DISPARM (
	prd_code,
	var_name,
	var_type,
	var_value,
	descr,
	var_subs,
	chg_date,
	chg_user,
	chg_term )
 VALUES (
	'999999',
	'STAGING_LOC',
	'S',
	'ASTAG',
	'STAGING LOCATION ACTIVE PICK',
	0,
	TO_DATE('20-08-2012 17:54:50','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ');
INSERT INTO DISPARM (
	prd_code,
	var_name,
	var_type,
	var_value,
	descr,
	var_subs,
	chg_date,
	chg_user,
	chg_term )
 VALUES (
	'999999',
	'STAGING_LOC_MPK',
	'S',
	'MSTAG',
	'STAGING LOCATION MATSER PACK',
	0,
	TO_DATE('20-08-2012 17:54:50','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE      ');
	ALTER TABLE ASN_LOT_STAT ADD LOCK_CODE CHAR(10);
	
	ALTER TABLE LOCATION ADD ALLOC_PREF CHAR(1);
	
	ALTER TABLE INVSTAT ADD ALLOC_PREF CHAR(1);
	 
	
	INSERT INTO LOCATION (
	loc_code ,
	descr ,
	sh_descr ,
	loc_type ,
	inv_stat ,
	one_item ,
	capacity ,
	cap_uom ,
	loc_group ,
	temp ,
	site_code ,
	site_code__own ,
	item_code ,
	eff_from ,
	valid_upto ,
	hire_charge ,
	usable ,
	chg_date ,
	chg_user ,
	chg_term ,
	zone ,
	pallet_based ,
	single_lot_sl ,
	item_lot_opt ,
	cycle_count_reqd ,
	phy_han_basis ,
	phy_han_uom ,
	drop_group ,
	loc_zone ,
	alloc_pref )
VALUES (
	'ASTAG   ',
	'STAGING LOCATION FOR ACTIVES',
	'STAGING LOCATION FOR',
	'N',
	'STAG ',
	'N',
	999999999,
	NULL,
	'S    ',
	'N',
	'TA821',
	NULL,
	NULL,
	NULL,
	NULL,
	0,
	'N',
	TO_DATE('11-09-2012 11:43:16','DD-MM-YYYY HH24:MI:SS'),
	'ASHISH    ',
	'sunmisstock    ',
	NULL,
	NULL,
	'N',
	'2',
	'N',
	'L',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO LOCATION (
	loc_code ,
	descr ,
	sh_descr ,
	loc_type ,
	inv_stat ,
	one_item ,
	capacity ,
	cap_uom ,
	loc_group ,
	temp ,
	site_code ,
	site_code__own ,
	item_code ,
	eff_from ,
	valid_upto ,
	hire_charge ,
	usable ,
	chg_date ,
	chg_user ,
	chg_term ,
	zone ,
	pallet_based ,
	single_lot_sl ,
	item_lot_opt ,
	cycle_count_reqd ,
	phy_han_basis ,
	phy_han_uom ,
	drop_group ,
	loc_zone ,
	alloc_pref )
 VALUES (
	'MSTAG   ',
	'STAGING LOCATION FOR MASTER PACK',
	'STAGING LOC -  MP',
	'N',
	'STAG ',
	'N',
	999999999.000,
	NULL,
	'S    ',
	'N',
	'TA821',
	NULL,
	NULL,
	NULL,
	NULL,
	0,
	'N',
	TO_DATE('2-10-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'ASHISH    ',
	'sunmisstock    ',
	NULL,
	NULL,
	'N',
	'2',
	'N',
	'L',
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO INVSTAT (inv_stat ,
	descr ,
	available ,
	overiss ,
	plan_prod ,
	record ,
	chg_date ,
	chg_user ,
	chg_term ,
	usable ,
	stat_type ,
	report_type ,
	alloc_pref )
 VALUES ('STAG ',
	'Staging Area',
	'Y',
	'N',
	'N',
	'Y',
	TO_DATE('2-10-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'ASHISH    ',
	'ASHISH         ',
	'Y',
	'M',
	NULL,
	NULL);
	
CREATE OR REPLACE function fn_prono (as_trancode in char,as_prono in char) 
return varchar2 is 
 ls_prono varchar2(20) := as_prono; 
 len number := 0; 
 m number(17,2); 
 rem number(17,2); 
 c number; 
 sumodd number := 0; 
 sumeven number := 0; 
begin 
 if trim(as_trancode) in ('FEDEX') --('VC0010') 
 then 
 m := as_prono / 7; 
 rem := m-trunc(m); 
 if     rem = 0                 then ls_prono := as_prono||'0'; 
 elsif  rem = .14               then ls_prono := as_prono||'1'; 
 elsif (rem = .28 or rem = .29) then ls_prono := as_prono||'2'; 
 elsif (rem = .42 or rem = .43) then ls_prono := as_prono||'3'; 
 elsif  rem = .57               then ls_prono := as_prono||'4'; 
 elsif  rem = .71               then ls_prono := as_prono||'5'; 
 elsif (rem = .85 or rem = .86) then ls_prono := as_prono||'6'; 
 end if; 
 end if; 
 /*if as_trancode not in ('VC0010') 
 then 
 len := length(trim(ls_prono)); 
 m := -1; 
 for i in reverse 1..len loop 
  c := substr(ls_prono,m,1); 
  if mod(c,2) = 0   then sumodd :=  sumodd + c;  end if; 
  if mod(c,2) <> 0  then sumeven := sumeven + c; end if; 
  m := m-1; 
 end loop; 
 sumOdd := sumOdd * 3; 
 ls_prono :=  ls_prono || trim(to_char(10 - mod((sumEven + sumOdd), 10))) ; 
 end if; */ 
return ls_prono ; 
end;
/
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 (
	'SDSPCONFIR',
	'invalid Shipment id ',
	'Shipment should be confirmed by loading ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('28-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);

	
	alter table inv_lock 
	add lock_type char(1);
	
	UPDATE MESSAGES SET msg_str= 'Invalid wave task', msg_descr ='Wave Reversal is not possible, wave task is on hold or canceled or both' 
where msg_no='VTHOLDTASK';
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 (
	'INVPRINTER',
	'Invalid Printer Service ',
	'Please enter valid printer service name ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('28-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);

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 (
	'NOOFPALLET',
	'Invalid Shipment Content',
	'Number of pallet in header is not macthing with number of detail in shipment content table.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('28-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);
	
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 (
	'NLLPRINTER',
	'Null Printer',
	'Please insert printer service name.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('28-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);
	
INSERT INTO POPHELP (
	field_name,
	mod_name,
	sql_str ,
	dw_object ,
	msg_title ,
	width ,
	height ,
	chg_date ,
	chg_user ,
	chg_term ,
	dist_opt,
	filter_string ,
	sql_input ,
	default_col ,
	pop_align,
	query_mode,
	page_context,
	pophelp_cols ,
	pophelp_source,
	multi_opt ,
	help_option)
VALUES (
	'PRINTER',
	'W_WAVEGEN',
	'SELECT DESCR AS PRINTER_NAME FROM GENCODES WHERE MOD_NAME =''W_WAVEGEN''',
	NULL,
	'Printer Service name',
	0,
	0,
	TO_DATE('3-10-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO GENCODES (
	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3 )
 VALUES (
	'PRINTER',
	'W_WAVEGEN',
	'P1',
	'PDFCreator',
	NULL,
	TO_DATE('10-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	'Y',
	NULL,
	NULL,
	NULL);
	
INSERT INTO GENCODES (
	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3 )
 VALUES  (
	'PRINTER',
	'W_WAVEGEN',
	'P2',
	'\\192.000.000.00',
	NULL,
	TO_DATE('10-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL,
	NULL,
	NULL);

update MESSAGES set msg_str = 'Invalid Shipment Id ' where msg_no ='SDSPCONFIR';

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 (
	'INVPRINTER',
	'Invalid Printer Service ',
	'Please enter valid printer service name ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('28-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);
INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'VTINVLPN',
	'Invalid Lpn No.',
	'Invalid Lpn No.Lpn no must start with NJ or CN.',
	'E',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE ');
	
INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'VTINVLEN',
	'Invalid Lpn No.',
	'Invalid Lpn No.Lpn no should be 10 character.',
	'E',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE ');
	
INSERT INTO refser (
	ref_ser,
	descr,
	type,
	sys_ser,
	prefix,
	chg_date,
	chg_user,
	chg_term,
	seq_name,
	tax_form_reqd,
	trans_type)
 VALUES (
	'R-ACT ',
	'Replenishment Task - Actives',
	'S',
	'R-ACT ',
	NULL,
	fn_sysdate(),
	'Rohan',
	'Base ',
	NULL,
	NULL,
	NULL);
	
COMMIT;

----Added by Unique Base 08-Oct-12

alter table ship_docs add desp_confirmed char(1) DEFAULT 'N';
alter table ship_docs add error_msg varchar2(1200);

INSERT INTO WAVE_SEQ (
	ref_ser ,
	priority )
 VALUES (
	'R-ACT ',
	0);

update messages set msg_str = 'Already Confirmed', msg_descr = 'Reference Id was already confirmed' where msg_no ='VTDSPCON';

ALTER TABLE ASN_LOT_STAT  DROP COLUMN  LOCK_CODE;

ALTER TABLE ASN_LOT_STATDET ADD LOCK_CODE CHAR(10);


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 (
	'asn_lot_stat',
	'post_item_change',
	'1',
	'poic_default_ejb',
	NULL,
	'0',
	TO_DATE('8-05-2012 11:32:32','DD-MM-YYYY HH24:MI:SS'),
	'Chaitali  ',
	'BASE',
	'2',
	'EJB',
	'AsnLotStatIC',
	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 (
	'asn_lot_stat',
	'post_save',
	'1',
	'pos_asnlotstat',
	NULL,
	'0',
	TO_DATE('8-05-2012 11:32:32','DD-MM-YYYY HH24:MI:SS'),
	'chaitali  ',
	'chaitali',
	'2',
	'EJB',
	'AsnLotStatConf',
	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 (
	'asn_lot_stat',
	'pre_validate',
	'1',
	'prv_default_ejb',
	NULL,
	'0',
	TO_DATE('8-05-2012 11:32:32','DD-MM-YYYY HH24:MI:SS'),
	'Chaitali  ',
	'BASE',
	'2',
	'EJB',
	'AsnLotStatIC',
	NULL);

INSERT INTO system_event_services(
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,
	return_descr ,
	return_xfrm ,
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'pos_asnlotstat',
	'postSave',
	'http://localhost:9090/axis/services/ValidatorService',
	'BASE',
	'postSave',
	'String',
	'S',
	NULL,
	NULL,
	TO_DATE('8-05-2012 11:32:32','DD-MM-YYYY HH24:MI:SS'),
	'chaitali  ',
	'chaitali');
	
INSERT INTO system_event_services(
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,
	return_descr ,
	return_xfrm ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'poic_default_ejb',
	NULL,
	'http://localhost:9090/axis/services/ValidatorService',
	NULL,
	'itemChanged',
	'String',
	'S',
	NULL,
	NULL,
	TO_DATE('1-06-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'Subrata   ',
	'Subu');
	
INSERT INTO system_event_services(
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,
	return_descr ,
	return_xfrm ,
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'prv_default_ejb',
	NULL,
	'http://localhost:9090/axis/services/ProcessService',
	NULL,
	'wfValData',
	'String',
	'S',
	NULL,
	NULL,
	TO_DATE('1-06-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'Subrata   ',
	'Subu');

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_default_ejb',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_default_ejb',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_default_ejb',
	3,
	'XML_DATA',
	'I',
	NULL,
	'S',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_default_ejb',
	4,
	'XML_DATA_1',
	'I',
	NULL,
	'S',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_default_ejb',
	5,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_default_ejb',
	6,
	'OBJ_CONTEXT',
	'I',
	NULL,
	'S',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_default_ejb',
	7,
	'FOCUSED_COLUMN',
	'I',
	NULL,
	'S',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'poic_default_ejb',
	8,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_default_ejb',
	9,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pos_asnlotstat',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 11:32:32','DD-MM-YYYY HH24:MI:SS'),
	'chaitali  ',
	'chaitali',
	'EJB');
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pos_asnlotstat',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 11:32:32','DD-MM-YYYY HH24:MI:SS'),
	'chaitali  ',
	'chaitali',
	'AsnLotStatConf');
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pos_asnlotstat',
	3,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 11:32:32','DD-MM-YYYY HH24:MI:SS'),
	'chaitali  ',
	'chaitali',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pos_asnlotstat',
	4,
	'<tran_id>',
	'I',
	NULL,
	'B.String',
	NULL,
	TO_DATE('8-05-2012 11:32:32','DD-MM-YYYY HH24:MI:SS'),
	'chaitali  ',
	'chaitali',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pos_asnlotstat',
	5,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 11:32:32','DD-MM-YYYY HH24:MI:SS'),
	'chaitali  ',
	'chaitali',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pos_asnlotstat',
	6,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 11:32:32','DD-MM-YYYY HH24:MI:SS'),
	'chaitali  ',
	'chaitali',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pos_asnlotstat',
	7,
	'DB_CONN',
	'I',
	NULL,
	'S.Connection',
	NULL,
	TO_DATE('8-05-2012 11:32:32','DD-MM-YYYY HH24:MI:SS'),
	'chaitali  ',
	'chaitali',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_default_ejb',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('1-06-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'Manohar   ',
	'Manohar',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_default_ejb',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('1-06-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'Manohar   ',
	'Manohar',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_default_ejb',
	3,
	'XML_DATA',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('1-06-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'Manohar   ',
	'Manohar',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_default_ejb',
	4,
	'XML_DATA_1',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('1-06-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'Manohar   ',
	'Manohar',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_default_ejb',
	5,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('1-06-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'Manohar   ',
	'Manohar',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_default_ejb',
	6,
	'OBJ_CONTEXT',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('1-06-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'Manohar   ',
	'Manohar',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_default_ejb',
	7,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('1-06-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'Manohar   ',
	'Manohar',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_default_ejb',
	8,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('1-06-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'Manohar   ',
	'Manohar',
	NULL);
	
UPDATE MESSAGES SET MSG_DESCR ='Invalid Lpn No.Lpn no must start with NJ,CN,DM or EX' WHERE MSG_NO='VTINVLPN';

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
(
	'REPLSCANF',
	'replenishment not completed',
	'please complete replenishment task',
	'E',
	NULL,
	NULL,
	NULL,
	NULL,
	sysdate,
	'BASE',
	'BASE',
	NULL,
	NULL
);

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
(
	'EMPTYRMK',
	'Invalid Records',
	'Physical Item does not exist in Stock,Please Enter Remarks',
	'E',
	NULL,
	NULL,
	NULL,
	NULL,
	sysdate,
	'BASE',
	'BASE',
	NULL,
	NULL
);
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
(
	'EMPTYRMK1',
	'Invalid Remarks',
	'Physical Item exists in Stock,Remark can not be entered',
	'E',
	NULL,
	NULL,
	NULL,
	NULL,
	sysdate,
	'BASE',
	'BASE',
	NULL,
	NULL
);

DELETE FROM OBJ_FORMS WHERE WIN_NAME='w_phy_item_mscan';

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_phy_item_mscan','Header',null,null,null,null,null,null,'1','F',null,null,'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,null,null,null,null,'E',null,null,null);

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_phy_item_mscan','Physical Item Scan',null,null,null,null,null,null,'2','F',null,null,'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Is Empty:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>isempty</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',null,null,null,null,null,null,null,null,null,null,null,null,null,'E',null,null,null);

Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW) 
values ('w_phy_item_mscan','Detail',null,null,null,null,null,null,'3','T',null,null,'<SCAN_INFO><MAPPING_SCAN ORDER="1"> <SCAN_LABEL>Location Code:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="2"> <SCAN_LABEL>LPN NO:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="3"> <SCAN_LABEL>Item Code:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="4"> <SCAN_LABEL>Lot No:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS> </MAPPING_SCAN> <INPUT_SCAN ORDER="1"> <SCAN_LABEL>Case Count:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>phy_input</FIELD></FIELDS> </INPUT_SCAN> <SCAN_CONDITION field="loc_code">parseInt(quantity) != 0</SCAN_CONDITION></SCAN_INFO>',null,null,null,null,null,null,null,null,null,'checkedImage@img<descr>(<item_code>),<loc_code>,<lot_no>,<lot_sl>',null,null,null,'E',null,null,null);

UPDATE TRANSETUP SET HEADER_FORM_NO='2' WHERE TRAN_WINDOW='w_phy_item_mscan';
																					
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 (
	'SDSPCONFIR',
	'invalid Shipment id ',
	'Shipment should be confirmed by loading ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('28-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);

	
alter table inv_lock add lock_type char(1);
	
UPDATE MESSAGES SET msg_str= 'Invalid wave task', msg_descr ='Wave Reversal is not possible, wave task is on hold or canceled or both' 
where msg_no='VTHOLDTASK';

DELETE FROM DISPARM WHERE var_name='STAGING_LOC';

INSERT INTO DISPARM (
	prd_code,
	var_name,
	var_type,
	var_value,
	descr,
	var_subs,
	chg_date,
	chg_user,
	chg_term )
 VALUES (
	'999999',
	'STAGING_LOC',
	'S',
	'ASTAG',
	'STAGING LOCATION ACTIVE PICK',
	0,
	TO_DATE('20-08-2012 17:54:50','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ');
INSERT INTO DISPARM (
	prd_code,
	var_name,
	var_type,
	var_value,
	descr,
	var_subs,
	chg_date,
	chg_user,
	chg_term )
 VALUES (
	'999999',
	'STAGING_LOC_MPK',
	'S',
	'MSTAG',
	'STAGING LOCATION MATSER PACK',
	0,
	TO_DATE('20-08-2012 17:54:50','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE      ');
	ALTER TABLE ASN_LOT_STAT ADD LOCK_CODE CHAR(10);
	
	ALTER TABLE LOCATION ADD ALLOC_PREF CHAR(1);
	
	ALTER TABLE INVSTAT ADD ALLOC_PREF CHAR(1);
	 
	
	INSERT INTO LOCATION (
	loc_code ,
	descr ,
	sh_descr ,
	loc_type ,
	inv_stat ,
	one_item ,
	capacity ,
	cap_uom ,
	loc_group ,
	temp ,
	site_code ,
	site_code__own ,
	item_code ,
	eff_from ,
	valid_upto ,
	hire_charge ,
	usable ,
	chg_date ,
	chg_user ,
	chg_term ,
	zone ,
	pallet_based ,
	single_lot_sl ,
	item_lot_opt ,
	cycle_count_reqd ,
	phy_han_basis ,
	phy_han_uom ,
	drop_group ,
	loc_zone ,
	alloc_pref )
VALUES (
	'ASTAG   ',
	'STAGING LOCATION FOR ACTIVES',
	'STAGING LOCATION FOR',
	'N',
	'STAG ',
	'N',
	999999999,
	NULL,
	'S    ',
	'N',
	'TA821',
	NULL,
	NULL,
	NULL,
	NULL,
	0,
	'N',
	TO_DATE('11-09-2012 11:43:16','DD-MM-YYYY HH24:MI:SS'),
	'ASHISH    ',
	'sunmisstock    ',
	NULL,
	NULL,
	'N',
	'2',
	'N',
	'L',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO LOCATION (
	loc_code ,
	descr ,
	sh_descr ,
	loc_type ,
	inv_stat ,
	one_item ,
	capacity ,
	cap_uom ,
	loc_group ,
	temp ,
	site_code ,
	site_code__own ,
	item_code ,
	eff_from ,
	valid_upto ,
	hire_charge ,
	usable ,
	chg_date ,
	chg_user ,
	chg_term ,
	zone ,
	pallet_based ,
	single_lot_sl ,
	item_lot_opt ,
	cycle_count_reqd ,
	phy_han_basis ,
	phy_han_uom ,
	drop_group ,
	loc_zone ,
	alloc_pref )
 VALUES (
	'MSTAG   ',
	'STAGING LOCATION FOR MASTER PACK',
	'STAGING LOC -  MP',
	'N',
	'STAG ',
	'N',
	999999999.000,
	NULL,
	'S    ',
	'N',
	'TA821',
	NULL,
	NULL,
	NULL,
	NULL,
	0,
	'N',
	TO_DATE('2-10-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'ASHISH    ',
	'sunmisstock    ',
	NULL,
	NULL,
	'N',
	'2',
	'N',
	'L',
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO INVSTAT (inv_stat ,
	descr ,
	available ,
	overiss ,
	plan_prod ,
	record ,
	chg_date ,
	chg_user ,
	chg_term ,
	usable ,
	stat_type ,
	report_type ,
	alloc_pref )
 VALUES ('STAG ',
	'Staging Area',
	'Y',
	'N',
	'N',
	'Y',
	TO_DATE('2-10-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'ASHISH    ',
	'ASHISH         ',
	'Y',
	'M',
	NULL,
	NULL);
	
CREATE OR REPLACE function fn_prono (as_trancode in char,as_prono in char) 
return varchar2 is 
 ls_prono varchar2(20) := as_prono; 
 len number := 0; 
 m number(17,2); 
 rem number(17,2); 
 c number; 
 sumodd number := 0; 
 sumeven number := 0; 
begin 
 if trim(as_trancode) in ('FEDEX') --('VC0010') 
 then 
 m := as_prono / 7; 
 rem := m-trunc(m); 
 if     rem = 0                 then ls_prono := as_prono||'0'; 
 elsif  rem = .14               then ls_prono := as_prono||'1'; 
 elsif (rem = .28 or rem = .29) then ls_prono := as_prono||'2'; 
 elsif (rem = .42 or rem = .43) then ls_prono := as_prono||'3'; 
 elsif  rem = .57               then ls_prono := as_prono||'4'; 
 elsif  rem = .71               then ls_prono := as_prono||'5'; 
 elsif (rem = .85 or rem = .86) then ls_prono := as_prono||'6'; 
 end if; 
 end if; 
 /*if as_trancode not in ('VC0010') 
 then 
 len := length(trim(ls_prono)); 
 m := -1; 
 for i in reverse 1..len loop 
  c := substr(ls_prono,m,1); 
  if mod(c,2) = 0   then sumodd :=  sumodd + c;  end if; 
  if mod(c,2) <> 0  then sumeven := sumeven + c; end if; 
  m := m-1; 
 end loop; 
 sumOdd := sumOdd * 3; 
 ls_prono :=  ls_prono || trim(to_char(10 - mod((sumEven + sumOdd), 10))) ; 
 end if; */ 
return ls_prono ; 
end;
/

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 (
	'SDSPCONFIR',
	'invalid Shipment id ',
	'Shipment should be confirmed by loading ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('28-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);

	
alter table inv_lock add lock_type char(1);
	
UPDATE MESSAGES SET msg_str= 'Invalid wave task', msg_descr ='Wave Reversal is not possible, wave task is on hold or canceled or both' 
where msg_no='VTHOLDTASK';
	
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 (
	'INVPRINTER',
	'Invalid Printer Service ',
	'Please enter valid printer service name ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('28-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);

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 (
	'NOOFPALLET',
	'Invalid Shipment Content',
	'Number of pallet in header is not macthing with number of detail in shipment content table.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('28-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);
	
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 (
	'NLLPRINTER',
	'Null Printer',
	'Please insert printer service name.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('28-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);
	
INSERT INTO POPHELP (
	field_name,
	mod_name,
	sql_str ,
	dw_object ,
	msg_title ,
	width ,
	height ,
	chg_date ,
	chg_user ,
	chg_term ,
	dist_opt,
	filter_string ,
	sql_input ,
	default_col ,
	pop_align,
	query_mode,
	page_context,
	pophelp_cols ,
	pophelp_source,
	multi_opt ,
	help_option)
VALUES (
	'PRINTER',
	'W_WAVEGEN',
	'SELECT DESCR AS PRINTER_NAME FROM GENCODES WHERE MOD_NAME =''W_WAVEGEN''',
	NULL,
	'Printer Service name',
	0,
	0,
	TO_DATE('3-10-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO GENCODES (
	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3 )
 VALUES (
	'PRINTER',
	'W_WAVEGEN',
	'P1',
	'PDFCreator',
	NULL,
	TO_DATE('10-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	'Y',
	NULL,
	NULL,
	NULL);
	
INSERT INTO GENCODES (
	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3 )
 VALUES  (
	'PRINTER',
	'W_WAVEGEN',
	'P2',
	'\\192.000.000.00',
	NULL,
	TO_DATE('10-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL,
	NULL,
	NULL);

update MESSAGES set msg_str = 'Invalid Shipment Id ' where msg_no ='SDSPCONFIR';

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 (
	'INVPRINTER',
	'Invalid Printer Service ',
	'Please enter valid printer service name ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('28-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);
INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'VTINVLPN',
	'Invalid Lpn No.',
	'Invalid Lpn No.Lpn no must start with NJ or CN.',
	'E',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE ');
	
INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'VTINVLEN',
	'Invalid Lpn No.',
	'Invalid Lpn No.Lpn no should be 10 character.',
	'E',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE ');
	
INSERT INTO refser (
	ref_ser,
	descr,
	type,
	sys_ser,
	prefix,
	chg_date,
	chg_user,
	chg_term,
	seq_name,
	tax_form_reqd,
	trans_type)
 VALUES (
	'R-ACT ',
	'Replenishment Task - Actives',
	'S',
	'R-ACT ',
	NULL,
	fn_sysdate(),
	'Rohan',
	'Base ',
	NULL,
	NULL,
	NULL);

	--Added by manoj dtd 09102012 to remove location code from mapping scan from detail window

update obj_forms set scan_metadata='<SCAN_INFO><MAPPING_SCAN ORDER="1"> <SCAN_LABEL>LPN NO:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="2"> <SCAN_LABEL>Item Code:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="3"> <SCAN_LABEL>Lot No:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS> </MAPPING_SCAN> <INPUT_SCAN ORDER="1"> <SCAN_LABEL>Case Count:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>phy_input</FIELD></FIELDS> </INPUT_SCAN> <SCAN_CONDITION field="loc_code">parseInt(quantity) != 0</SCAN_CONDITION></SCAN_INFO>' where win_name='w_phy_item_mscan' and form_no=3;

-- added by Rohan on 10/10/12 warning msg.

INSERT INTO MESSAGES (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt ,  
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'VTHAZMAT',
	'Hazardous Material.',
	'Transaction contains Hazardous material.',
	'W',
	'Y',
	fn_sysdate(),
	'ROHAN'  ,
	'BASE ');
	
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
('ALLRDSCN',
	'Already Scanned Record',
	'Selected Record is Already Scanned,Please verify ',
	'E',
	NULL,
	NULL,
	NULL,
	NULL,
	sysdate,
	'BASE',
	'BASE',
	NULL,
	NULL
);


-- sql given by Rohan
INSERT INTO disparm (
	prd_code,
	var_name,
	var_type,
	var_value,
	descr,
	var_subs,
	chg_date,
	chg_user,
	chg_term)
 VALUES (
	'999999',
	'HAZMAT_PRINTER',
	'S',
	'\\172.16.100.90\unimis-hpljP3015-001',
	'Path of printer exp:  \\000.000.000.000\PDFCreator',
	NULL,
	fn_sysdate(),
	'BASE',
	'base');
	
	
INSERT INTO disparm (
	prd_code,
	var_name,
	var_type,
	var_value,
	descr,
	var_subs,
	chg_date,
	chg_user,
	chg_term)
 VALUES (
	'999999',
	'HAZMAT_REPORT_SAVE_TYPE',
	'S',
	'PDF',
	'Report save type i.e NATIVE OR PDF (in case of null NATIVE will set as a default)',
	0,
	fn_sysdate(),
	'BASE      ',
	'BASE           ');
INSERT INTO disparm (
	prd_code,
	var_name,
	var_type,
	var_value,
	descr,
	var_subs,
	chg_date,
	chg_user,
	chg_term)
 VALUES (
	'999999',
	'HAZMAT_LABLE_OBJ_NAME',
	'S',
	'haz_mat_label',
	'Hazmat lable report name',
	NULL,
	fn_sysdate(),
	'BASE      ',
	'BASE           ');
INSERT INTO disparm (
	prd_code,
	var_name,
	var_type,
	var_value,
	descr,
	var_subs,
	chg_date,
	chg_user,
	chg_term)
 VALUES (
	'999999',
	'HAZMAT_FORM_OBJ_NAME',
	'S',
	'haz_mat_form',
	'Hazmat form report name',
	NULL,
	fn_sysdate(),
	'BASE      ',
	'BASE           ');
---12-10-12	
---SELECT DISTINCT(R.REPL_ORDER),L.LOC_CODE FROM REPL_ORD_DET R,WAVE_TASK_DET W,LOCATION L  WHERE R.REPL_ORDER = W.REF_ID AND W.STATUS = 'N' AND R.LOC_CODE = L.LOC_CODE AND L.INV_STAT = '?'

--SELECT DISTINCT WH.WAVE_ID,WH.CANCEL, W.PTCN,R.REPL_ORDER ,L.LOC_CODE FROM REPL_ORD_DET R,REPL_ORD_HDR H,WAVE_TASK_DET W,LOCATION L ,WAVE_TASK WH WHERE W.WAVE_ID = WH.WAVE_ID AND R.REPL_ORDER = H.REPL_ORDER AND R.REPL_ORDER = W.REF_ID AND W.STATUS = 'N'  AND H.ORDER_TYPE = 'A' AND FN_VALID_REPL (H.REPL_ORDER) = 'Y' AND R.LOC_CODE = L.LOC_CODE  AND L.INV_STAT = '?' 
SET ECHO ON
SPOOL D:\TEST.LOG

CREATE OR REPLACE function fn_valid_repl (as_replorder in char) 
 return varchar2 is 
 ls_validrepl varchar2(1) := 'Y';
 ls_waveid wave_task.wave_id%type ;
 ls_ptcn wave_task_det.ptcn%type ;
 ls_cancel char(1) := 'N';
 ll_count number(3) := 0;
begin 
	begin
		select h.wave_id,d.ptcn,case when h.cancel is null then 'N' else h.cancel end  into ls_waveid, ls_ptcn, ls_cancel  
		from wave_task_det d, wave_task h where h.wave_id = d.wave_id and d.ref_id = as_replorder and rownum =  1;
	exception when others then
		ls_waveid := ' ';
		ls_ptcn := ' ';
		ls_cancel := ' '; 
	end;
	if ls_cancel = 'Y' then
		begin
			select count(1) into ll_count from pick_ord_det p,wave_task_det w, wave_task wh
			where w.wave_id = wh.wave_id
			and w.ref_id = p.pick_order
			and wh.wave_id <> ls_waveid
			and case when wh.cancel is null then 'N' else wh.cancel end = 'N'
			and (p.repl_order, p.line_no__repl) in (select repl_order,line_no from repl_ord_det where repl_order = as_replorder);
		end;
	--else
	end if;

	return ls_validrepl ; 
end;
/

delete from pophelp where field_name = 'REPL_ORDER' AND MOD_NAME IN ('W_ACTIVE_REPL_ISS','W_REPL_ISS','W_REPL_ISS_DOCK');

INSERT INTO pophelp (field_name,
	mod_name,
	sql_str,
	dw_object,
	msg_title,
	width,
	height,
	chg_date,
	chg_user,
	chg_term,
	dist_opt,
	filter_string,
	sql_input,
	default_col,
	pop_align,
	query_mode,
	page_context,
	pophelp_cols,
	pophelp_source,
	multi_opt,
	help_option)
VALUES (
	'REPL_ORDER',
	'W_ACTIVE_REPL_ISS',
	'SELECT DISTINCT R.REPL_ORDER ,L.LOC_CODE FROM REPL_ORD_DET R,REPL_ORD_HDR H,WAVE_TASK_DET W,LOCATION L ,WAVE_TASK WH WHERE W.WAVE_ID = WH.WAVE_ID AND R.REPL_ORDER = H.REPL_ORDER AND R.REPL_ORDER = W.REF_ID AND W.STATUS = ''N'' AND H.ORDER_TYPE IN (''E'',''Q'') AND FN_VALID_REPL (H.REPL_ORDER) = ''Y'' AND R.LOC_CODE = L.LOC_CODE  AND L.INV_STAT = ''?'' ',
	NULL,
	'Repl Order',
	0,
	NULL,
	TO_DATE('20-09-2012 11:37:36','DD-MM-YYYY HH24:MI:SS'),
	'SUN       ',
	'BASE           ',
	'0',
	NULL,
	':1.repl_order',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'S',
	NULL,
	NULL);
INSERT INTO pophelp (field_name,
	mod_name,
	sql_str,
	dw_object,
	msg_title,
	width,
	height,
	chg_date,
	chg_user,
	chg_term,
	dist_opt,
	filter_string,
	sql_input,
	default_col,
	pop_align,
	query_mode,
	page_context,
	pophelp_cols,
	pophelp_source,
	multi_opt,
	help_option)
VALUES (
	'REPL_ORDER',
	'W_REPL_ISS',
	'SELECT DISTINCT R.REPL_ORDER ,L.LOC_CODE FROM REPL_ORD_DET R,REPL_ORD_HDR H,WAVE_TASK_DET W,LOCATION L ,WAVE_TASK WH WHERE W.WAVE_ID = WH.WAVE_ID AND R.REPL_ORDER = H.REPL_ORDER AND R.REPL_ORDER = W.REF_ID AND W.STATUS = ''N'' AND H.ORDER_TYPE NOT IN (''E'',''Q'') AND FN_VALID_REPL (H.REPL_ORDER) = ''Y'' AND R.LOC_CODE = L.LOC_CODE  AND L.INV_STAT = ''?'' ',
	NULL,
	'Repl Order',
	0,
	NULL,
	TO_DATE('20-09-2012 10:46:27','DD-MM-YYYY HH24:MI:SS'),
	'SUN       ',
	'BASE           ',
	'0',
	NULL,
	':1.repl_order',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'S',
	NULL,
	NULL);
INSERT INTO pophelp (field_name,
	mod_name,
	sql_str,
	dw_object,
	msg_title,
	width,
	height,
	chg_date,
	chg_user,
	chg_term,
	dist_opt,
	filter_string,
	sql_input,
	default_col,
	pop_align,
	query_mode,
	page_context,
	pophelp_cols,
	pophelp_source,
	multi_opt,
	help_option)
VALUES (
	'REPL_ORDER',
	'W_REPL_ISS_DOCK',
	'SELECT DISTINCT R.REPL_ORDER ,L.LOC_CODE FROM REPL_ORD_DET R,REPL_ORD_HDR H,WAVE_TASK_DET W,LOCATION L ,WAVE_TASK WH WHERE W.WAVE_ID = WH.WAVE_ID AND R.REPL_ORDER = H.REPL_ORDER AND R.REPL_ORDER = W.REF_ID AND W.STATUS = ''N'' AND H.ORDER_TYPE IN (''D'',''L'') AND FN_VALID_REPL (H.REPL_ORDER) = ''Y'' AND R.LOC_CODE = L.LOC_CODE  AND L.INV_STAT = ''?'' ',
	NULL,
	'Repl Order',
	0,
	NULL,
	TO_DATE('23-11-2004 13:30:41','DD-MM-YYYY HH24:MI:SS'),
	'SUN       ',
	'BASE           ',
	'0',
	NULL,
	':1.repl_order',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'S',
	NULL,
	NULL);

update messages  set msg_str = 'No record to process', msg_descr = 'No record to process for the selected parameters'
where msg_no = 'VTNOREC2';

update transetup set header_form_no='2' where tran_window='w_active_pick';
INSERT INTO refser (
	ref_ser,
	descr,
	type,
	sys_ser,
	prefix,
	chg_date,
	chg_user,
	chg_term,
	seq_name,
	tax_form_reqd,
	trans_type)
VALUES (
	'R-CPA ',
	'Replenishment Task (Case to Active)',
	'S',
	'R-CPA ',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'Base           ',
	NULL,
	NULL,
	NULL);
INSERT INTO refser (
	ref_ser,
	descr,
	type,
	sys_ser,
	prefix,
	chg_date,
	chg_user,
	chg_term,
	seq_name,
	tax_form_reqd,
	trans_type)
VALUES (
	'RP-ACT',
	'Repanishment Task(Partial-Active)',
	'S',
	'RP-ACT',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'Base           ',
	NULL,
	NULL,
	NULL);
INSERT INTO refser (
	ref_ser,
	descr,
	type,
	sys_ser,
	prefix,
	chg_date,
	chg_user,
	chg_term,
	seq_name,
	tax_form_reqd,
	trans_type)
VALUES (
	'RR-DSA',
	'Repanishment Task(PSO-Active)',
	'S',
	'RR-DSA',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'Base           ',
	NULL,
	NULL,
	NULL);
INSERT INTO refser (
	ref_ser,
	descr,
	type,
	sys_ser,
	prefix,
	chg_date,
	chg_user,
	chg_term,
	seq_name,
	tax_form_reqd,
	trans_type)
VALUES (
	'RD-DSA',
	'Repanishment Task(DSO-Active)',
	'S',
	'RD-DSA',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'Base           ',
	NULL,
	NULL,
	NULL);
INSERT INTO refser (
	ref_ser,
	descr,
	type,
	sys_ser,
	prefix,
	chg_date,
	chg_user,
	chg_term,
	seq_name,
	tax_form_reqd,
	trans_type)
VALUES (
	'RN-DSA',
	'Replenishment Task ( PND-Active)',
	'S',
	'RN-DSA',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'Base           ',
	NULL,
	NULL,
	NULL);

INSERT INTO wave_seq (
	ref_ser,
	priority)
 VALUES (
	'R-CPA',
	4);
INSERT INTO wave_seq (
	ref_ser,
	priority)
 VALUES (
	'RD-DSA',
	4);
INSERT INTO wave_seq (
	ref_ser,
	priority)
 VALUES (
	'RR-DSA',
	4);
INSERT INTO wave_seq (
	ref_ser,
	priority)
 VALUES (
	'RP-ACT',
	4);
INSERT INTO wave_seq (
	ref_ser,
	priority)
 VALUES (
	'RN-DSA',
	4);	


COMMIT;

--Added by Rohan 13-10-12 to change description of wave generation messages.
update messages set msg_descr = 'No Records Found.'
where msg_no='VTNOREC2';

-- 15/10/12

INSERT INTO itm2menu (application,
	level_1,
	level_2,
	level_3,
	level_4,
	level_5,
	win_name,
	descr,
	comments,
	menu_path,
	icon_path,
	close_icon,
	open_icon,
	obj_type,
	chg_date,
	chg_term,
	chg_user,
	mob_deploy)
VALUES (
	'WMS',
	1,
	36,
	0,
	0,
	0,
	'w_despeditprc',
	'Edit task details process',
	'.',
	'WMS.1.36.0.0.0',
	NULL,
	NULL,
	NULL,
	'P',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO transetup (tran_window,
	save_flag,
	val_flag,
	key_flag,
	key_string,
	chg_date,
	chg_user,
	chg_term,
	edi_option,
	site_acc_col,
	multitire_opt,
	ref_ser)
VALUES (
	'w_despeditprc',
	'2',
	'2',
	'A',
	'seq10',
	sysdate,
	'BASE      ',
	'1              ',
	'0',
	NULL,
	NULL,
	'D-EDT');
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 (
	'despeditprc',
	'get_data',
	'1',
	'agetData_despeditprc',
	NULL,
	'0',
	sysdate,
	'Dharmen   ',
	'BASE29',
	'2',
	'EJB',
	'DespeditPrc',
	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 (
	'despeditprc',
	'post_item_change',
	'1',
	'poic_despeditprc',
	NULL,
	'0',
	sysdate,
	'Gulzar    ',
	'BASE',
	'2',
	'EJB',
	'DespEditIC',
	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 (
	'despeditprc',
	'pre_validate',
	'1',
	'prv_despeditprc',
	NULL,
	'0',
	sysdate,
	'BASE      ',
	'BASE',
	'2',
	'EJB',
	'DespEditIC',
	NULL);
INSERT INTO system_event_services (service_code,
	service_descr,
	service_uri,
	method_name,
	return_value,
	return_type,
	return_xfrm,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'agetData_despeditprc',
	'Action To get the Data',
	'http://localhost:9090/axis/services/ValidatorService',
	'getData',
	'String',
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:06','DD-MM-YYYY HH24:MI:SS'),
	'Dharmen   ',
	'BASE29');
INSERT INTO system_event_services (service_code,
	service_descr,
	service_uri,
	method_name,
	return_value,
	return_type,
	return_xfrm,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'poic_despeditprc',
	NULL,
	'http://localhost:9090/axis/services/ValidatorService',
	'itemChanged',
	'String',
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:10','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE');
INSERT INTO system_event_services (service_code,
	service_descr,
	service_uri,
	method_name,
	return_value,
	return_type,
	return_xfrm,
	chg_date,
	chg_user,
	chg_term)
VALUES (
	'prv_despeditprc',
	'Validation',
	'http://localhost:9090/axis/services/ValidatorService',
	'wfValData',
	'String',
	'S',
	NULL,
	TO_DATE('18-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_despeditprc',
	1,
	'COMPONENT_TYPE',
	'I',
	'Component Type',
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:06','DD-MM-YYYY HH24:MI:SS'),
	'AVIPRASH  ',
	'BASE216',
	'EJB');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_despeditprc',
	2,
	'COMPONENT_NAME',
	'I',
	'Component Name',
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:06','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29',
	'WaveGenerationPrc');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_despeditprc',
	3,
	'XML_DATA',
	'I',
	'XML data of form no 1',
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:06','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_despeditprc',
	4,
	'XML_DATA_1',
	'I',
	'XML data of form no All',
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:06','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_despeditprc',
	5,
	'WINDOW_NAME',
	'I',
	'Window Name',
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:06','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29',
	'w_sordalloc');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'agetData_despeditprc',
	6,
	'XTRA_PARAMS',
	'I',
	'Extra Arguments',
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:06','DD-MM-YYYY HH24:MI:SS'),
	'DHARMEN   ',
	'BASE29',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'poic_despeditprc',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:10','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	'EJB');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'poic_despeditprc',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:10','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	'WaveGenerationIC');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'poic_despeditprc',
	3,
	'XML_DATA',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:10','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'poic_despeditprc',
	4,
	'XML_DATA_1',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:10','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'poic_despeditprc',
	5,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:10','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'poic_despeditprc',
	6,
	'OBJ_CONTEXT',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:10','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'poic_despeditprc',
	7,
	'FOCUSED_COLUMN',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:10','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'poic_despeditprc',
	8,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:10','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'poic_despeditprc',
	9,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:10','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prv_despeditprc',
	1,
	'COMPONENT_TYPE',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('18-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'EJB');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prv_despeditprc',
	2,
	'COMPONENT_NAME',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('18-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'WaveGenerationIC');
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prv_despeditprc',
	3,
	'XML_DATA',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('18-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prv_despeditprc',
	4,
	'XML_DATA_1',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('18-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prv_despeditprc',
	5,
	'XML_DATA_ALL',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('18-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prv_despeditprc',
	6,
	'OBJ_CONTEXT',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('18-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prv_despeditprc',
	7,
	'OBJ_CONTEXT',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('18-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
INSERT INTO system_service_args (service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'prv_despeditprc',
	8,
	'XTRA_PARAMS',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('18-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
INSERT INTO obj_actions (obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
VALUES (
	'despeditprc',
	7,
	NULL,
	'Action Button for getting data',
	'get_data',
	'a',
	'R',
	'GetData',
	'2',
	'3',
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_forms (win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no)
VALUES (
	'w_despeditprc',
	'Filter',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1');
INSERT INTO obj_forms (win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no)
VALUES (
	'w_despeditprc',
	'Task list',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2');
INSERT INTO obj_links (obj_name,
	form_no,
	field_name,
	target_obj_name,
	link_form_name,
	link_title,
	link_uri,
	link_type,
	link_arg,
	update_flag,
	link_name,
	rights_char,
	image)
VALUES (
	'despeditprc',
	'2',
	'ref_id',
	'pick_order',
	'pick_order21',
	'Edit Pick Order',
	NULL,
	'2',
	'ref_id.String',
	'0',
	NULL,
	'*',
	NULL);
INSERT INTO obj_links (obj_name,
	form_no,
	field_name,
	target_obj_name,
	link_form_name,
	link_title,
	link_uri,
	link_type,
	link_arg,
	update_flag,
	link_name,
	rights_char,
	image)
VALUES (
	'despeditprc',
	'2',
	'ref_ser',
	'despatch',
	'desparch21',
	'Edit Despatch',
	NULL,
	'2',
	'ref_id.String',
	'0',
	NULL,
	'*',
	NULL);



commit;
---19-10-12 unique base

 update system_events set service_code = 'prcm_default_ejb', comp_type  =
'EJB', comp_name = 'PoRcpConf'
where obj_name = 'porcp' and event_code = 'pre_confirm';


alter table sordalloc add wave_flag char(1);

create or replace
FUNCTION FN_CHECK_MANUAL_STOCK_ALLOC(SI_SALE_ORDER IN CHAR, SI_LINE_NO IN CHAR )
  RETURN number is FLAG number ;
  CNT NUMBER;
  CNT1 NUMBER;
  BEGIN
   BEGIN
    SELECT count(*) INTO CNT FROM SORDALLOC WHERE SALE_ORDER = SI_SALE_ORDER AND LINE_NO = SI_LINE_NO;      
    IF (CNT  > 0 ) THEN
      SELECT count(*) INTO CNT1 FROM SORDALLOC WHERE SALE_ORDER = SI_SALE_ORDER AND LINE_NO = SI_LINE_NO
      AND (CASE WHEN WAVE_FLAG IS NULL THEN 'N' ELSE WAVE_FLAG END) = 'Y';
      IF( CNT1 >0 ) THEN
        FLAG := 1;
      ELSE
       FLAG := 0 ;
      END IF;
    ELSE
      FLAG :=3;
    END IF;
  EXCEPTION
  WHEN NO_DATA_FOUND  THEN
   FLAG :=2;
  END;
  RETURN FLAG;
  END;
  /



create or replace
FUNCTION FN_MANUAL_STOCK_FOR_EACHITEM(SI_SALE_ORDER IN CHAR, SI_LINE_NO IN CHAR)
  RETURN char is FLAG char;
  CNT NUMBER;
  CNT1 NUMBER;
  BEGIN
   BEGIN
    SELECT count(*) INTO CNT FROM SORDALLOC WHERE SALE_ORDER = SI_SALE_ORDER AND LINE_NO = SI_LINE_NO
    AND (CASE WHEN WAVE_FLAG IS NULL THEN 'N' ELSE WAVE_FLAG END) = 'N';
    IF (CNT  > 0 ) THEN
      FLAG := 'M';
    ELSE
      FLAG := 'N';
    END IF;
  EXCEPTION
  WHEN NO_DATA_FOUND  THEN
   FLAG :='E';
  END;
  RETURN FLAG;
  END;
  /
  
  

update obj_forms set SCAN_METADATA = '<SCAN_INFO><MAPPING_SCAN 
ORDER="1"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="S" 
DELIMITER=""><FIELD ORDER="0" start="6" end="15" 
>item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN 
ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="S" 
DELIMITER=""><FIELD ORDER="0" start="13" end="22" 
>lot_no</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN 
ORDER="1"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" 
DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN 
ORDER="2"><SCAN_LABEL>Number of Cases:</SCAN_LABEL><FIELDS SEPARATOR="" 
DELIMITER=""><FIELD>no_art</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN 
ORDER="3"><SCAN_LABEL>Partial Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" 
DELIMITER=""><FIELD>part_qty</FIELD></FIELDS></INPUT_SCAN><SCAN_CONDITION 
field="part_qty">no_art == "null" || no_art == "0" || no_art == 
""</SCAN_CONDITION></SCAN_INFO>'
where win_name ='w_porcp_wiz' and form_no = 3;

delete from pophelp where field_name='TRAN_ID__HOLD';

INSERT INTO POPHELP (
	field_name ,
	mod_name ,
	sql_str ,
	dw_object ,
	msg_title ,
	width ,
	height ,
	chg_date ,
	chg_user ,
	chg_term ,
	dist_opt ,
	filter_string ,
	sql_input ,
	default_col ,
	pop_align ,
	query_mode ,
	page_context ,
	pophelp_cols ,
	pophelp_source ,
	multi_opt ,
	help_option )
 VALUES (
	'TRAN_ID__HOLD',
	'W_INV_HOLD_REL',
	'select ihold.tran_id, ihold.lock_code, ilock.descr from inv_hold ihold ,inv_lock ilock, inv_hold_det ihdet where ihold.lock_code = ilock.lock_code and ihold.tran_id = ihdet.tran_id and ihold.confirmed = ''Y'' and ihdet.HOLD_STATUS <> ''R'' and ihold.lock_code = ilock.lock_code order by ihold.tran_id ',
	'inv_hold_rel',
	NULL,
	0,
	0,
	TO_DATE('8-05-2012 13:26:02','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE           ',
	'1',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO POPHELP (
	field_name ,
	mod_name ,
	sql_str ,
	dw_object ,
	msg_title ,
	width ,
	height ,
	chg_date ,
	chg_user ,
	chg_term ,
	dist_opt ,
	filter_string ,
	sql_input ,
	default_col ,
	pop_align ,
	query_mode ,
	page_context ,
	pophelp_cols ,
	pophelp_source ,
	multi_opt ,
	help_option )
 VALUES (
	'TRAN_ID__HOLD',
	'W_INV_HOLD_REL_GEN',
	'select ihold.tran_id, ihold.lock_code, ilock.descr from inv_hold ihold ,inv_lock ilock, inv_hold_det ihdet where ihold.lock_code = ilock.lock_code and ihold.tran_id = ihdet.tran_id and ihold.confirmed = ''Y'' and ihdet.HOLD_STATUS <> ''R'' and ihold.lock_code = ilock.lock_code order by ihold.tran_id ',
	'''inv_hold_rel_gen',
	NULL,
	0,
	0,
	TO_DATE('8-05-2012 13:26:02','DD-MM-YYYY HH24:MI:SS'),
	'Pragyan   ',
	'base           ',
	'1',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

update obj_forms set scan_metadata='<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location From:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>New LPN:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl__new</FIELD></FIELDS></INPUT_SCAN> <SCAN_CONDITION field="lot_sl__new">order_type != ''T''</SCAN_CONDITION></SCAN_INFO>'
where win_name='w_active_repl_iss' and form_no='3';
	
COMMIT;

----23-10-12-----
INSERT INTO POPHELP (
	field_name ,
	mod_name ,
	sql_str ,
	dw_object ,
	msg_title ,
	width ,
	height ,
	chg_date ,
	chg_user ,
	chg_term ,
	dist_opt ,
	filter_string ,
	sql_input ,
	default_col ,
	pop_align ,
	query_mode ,
	page_context ,
	pophelp_cols ,
	pophelp_source ,
	multi_opt ,
	help_option )
 VALUES (
	'TRAN_ID__FROM',
	'W_INV_HOLD_REL_GEN',
	'select ihold.tran_id, ihold.lock_code, ilock.descr from inv_hold ihold ,inv_lock ilock, inv_hold_det ihdet where ihold.lock_code = ilock.lock_code and ihold.tran_id = ihdet.tran_id and ihold.confirmed = ''Y'' and ihdet.HOLD_STATUS <> ''R'' and ihold.lock_code = ilock.lock_code order by ihold.tran_id ',
	'''inv_hold_rel_gen',
	NULL,
	0,
	0,
	TO_DATE('8-05-2012 13:26:02','DD-MM-YYYY HH24:MI:SS'),
	'RAVI      ',
	'RAVI           ',
	'1',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO POPHELP (
	field_name ,
	mod_name ,
	sql_str ,
	dw_object ,
	msg_title ,
	width ,
	height ,
	chg_date ,
	chg_user ,
	chg_term ,
	dist_opt ,
	filter_string ,
	sql_input ,
	default_col ,
	pop_align ,
	query_mode ,
	page_context ,
	pophelp_cols ,
	pophelp_source ,
	multi_opt ,
	help_option )
VALUES (
	'TRAN_ID__TO',
	'W_INV_HOLD_REL_GEN',
	'select ihold.tran_id, ihold.lock_code, ilock.descr from inv_hold ihold ,inv_lock ilock, inv_hold_det ihdet where ihold.lock_code = ilock.lock_code and ihold.tran_id = ihdet.tran_id and ihold.confirmed = ''Y'' and ihdet.HOLD_STATUS <> ''R'' and ihold.lock_code = ilock.lock_code order by ihold.tran_id ',
	'''inv_hold_rel_gen',
	NULL,
	0,
	0,
	TO_DATE('8-05-2012 13:26:02','DD-MM-YYYY HH24:MI:SS'),
	'RAVI      ',
	'RAVI           ',
	'1',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

	update obj_forms set scan_metadat = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="S" DELIMITER=""><FIELD ORDER="0" start="6" end="15" >item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="S" DELIMITER=""><FIELD ORDER="0" start="13" end="22" >lot_no</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Number of Cases:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>no_art</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="3"><SCAN_LABEL>Partial Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>part_qty</FIELD></FIELDS></INPUT_SCAN><SCAN_CONDITION field="part_qty">no_art == "null" || no_art == "0" || no_art == ""</SCAN_CONDITION></SCAN_INFO>' where win_name = 'w_porcp_wiz' and form_no = 3;
	
	
	
commit;
--- 23-10-12 unique base team changed by rohan
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 (
	'INVPLTNOU ',
	'INVPLTNOU',
	'Duplicate pallet no.Pallet no already used',
	'E',
	NULL,
	NULL,
	NULL,
	NULL,
	TO_DATE('15-09-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'pragyan',
	NULL,
	NULL);
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 (
	'NTWAVECAN ',
	'Wave not cancle.',
	'Despatch is generated.You can not cancle wave.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'ROHAN     ',
	'BASE           ',
	NULL,
	NULL);
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 (
	'WAVECANCEL',
	'Wave Reversal already done',
	'Wave reversal already done.You can not Reverse wave again.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'ROHAN     ',
	'BASE           ',
	NULL,
	NULL);
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 (
	'WAVENTREV ',
	'Task scan already',
	'One of the Task is already Scan.Wave Reversal is not possible.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'ROHAN     ',
	'BASE           ',
	NULL,
	NULL);
	
---25-10-12

delete from obj_forms where win_name in ('w_active_pick','w_case_pick') and form_no = 3;

INSERT INTO obj_forms (
	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata,
	selection_mode,
	default_view)
VALUES (
	'w_active_pick',
	'Pick Inventory',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Pick Location:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="S" DELIMITER=""><FIELD ORDER="0" start="6" end="15" >item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="S" DELIMITER=""><FIELD ORDER="0" start="13" end="22" >lot_no</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="4"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>quantity</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<loc_code>, <item_descr>(<item_code>), <lot_no>, <lot_sl>, <quantity> ',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');

INSERT INTO obj_forms (
	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata,
	selection_mode,
	default_view)
VALUES (
	'w_case_pick',
	'Case Pick Inventory',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Pick Location:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="S" DELIMITER=""><FIELD ORDER="0" start="6" end="15" >item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="S" DELIMITER=""><FIELD ORDER="0" start="13" end="22" >lot_no</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="4"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Number of Cases:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>no_art</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<loc_code>, <item_code>,<lot_no>, <lot_sl>, <no_art>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
	
	----- 26/10/12
	update messages set msg_str = 'Weight / Cases Exceed' , msg_descr = 'Click 
OK to Add Carton Click Cancel and Deselect to remove Carton' where msg_no 
= 'VTWGTEXD  ';
	
----27/10/12
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 (
	'ACTRPLCONF',
	'Replenishment Conformed',
	'Replenishment Confirmed, Active Replenishment is Already Confirmed',
	'P',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('27-10-2000 11:59:45','DD-MM-YYYY HH24:MI:SS'),
	'Base      ',
	'Base           ',
	NULL,
	NULL);
commit;

commit;
--Changed by Rohan on 29-10-12
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 (
	'REPLWAVCAN',
	'wave cancle.',
	'Wave already cancle for scanning transcation',
	'W',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'ROHAN',
	'BASE',
	NULL,
	NULL);
	
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 (
	'PRVREPLSCN',
	'Replanishment Not Scan.',
	'Depended Repanishment not scan.',
	'W',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'ROHAN',
	'BASE',
	NULL,
	NULL);
	commit;

--Changed by Rohan on 1-11-12
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 (
	'NTREPLSCAN',
	'Wave Cancle.',
	'Wave Cancle already.You can not scan the transcation.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'ROHAN',
	'BASE',
	NULL,
	NULL);	
--Changed by Rohan on 2-11-12
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 (
	'INVSUGLOC',
	'Blank Suggested Location',
	'Please Enter Suggested Location.It can not be null.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'ROHAN',
	'BASE',
	NULL,
	NULL);		
	
	---- Changed on 21-11-12
	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 (
	'palletprc',
	'post_item_change',
	'1',
	'poic_palletprc',
	NULL,
	'0',
	sysdate,
	'Sankar    ',
	'BASE',
	'2',
	'EJB',
	'CartonNoGenIC',
	NULL);

INSERT INTO system_event_services (
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,
	return_descr ,
	return_xfrm ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'poic_palletprc',
	'post item change',
	'http://localhost:9090/axis/services/ValidatorService',
	'BASE',
	'itemChanged',
	'String',
	'S',
	NULL,
	NULL,
	sysdate,
	'Sankar    ',
	'BASE');

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_palletprc',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Sankar    ',
	'BASE',
	'EJB');

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_palletprc',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Sankar    ',
	'BASE',
	'CartonNoGenIC');

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_palletprc',
	3,
	'XML_DATA',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Sankar    ',
	'BASE',
	NULL);

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'poic_palletprc',
	4,
	'XML_DATA_1',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'sankar    ',
	'BASE',
	NULL);

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_palletprc',
	5,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Sankar    ',
	'BASE',
	NULL);

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_palletprc',
	6,
	'OBJ_CONTEXT',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Sankar    ',
	'BASE',
	NULL);

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_palletprc',
	7,
	'FOCUSED_COLUMN',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Sankar    ',
	'BASE',
	NULL);

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_palletprc',
	8,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Sankar    ',
	'BASE',
	NULL);

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_palletprc',
	9,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Sankar    ',
	'BASE',
	NULL);

INSERT INTO obj_itemchange(
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
 VALUES (
	'palletprc',
	'1  ',
	'itm_default',
	NULL);

INSERT INTO obj_itemchange(
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
 VALUES (
	'palletprc',
	'1  ',
	'pallet_label',
	'Y');
INSERT INTO pophelp (
	field_name ,
	mod_name ,
	sql_str ,
	dw_object ,
	msg_title ,
	width ,
	height ,
	chg_date ,
	chg_user ,
	chg_term ,
	dist_opt ,
	filter_string ,
	sql_input ,
	default_col ,
	pop_align ,
	query_mode ,
	page_context ,
	pophelp_cols ,
	pophelp_source ,
	multi_opt ,
	help_option )
 VALUES (
	'PRINTER_NAME',
	'W_PALLETPRC',
	'SELECT DESCR FROM GENCODES WHERE FLD_NAME =''PRINTER_NAME'' AND MOD_NAME = ''W_PALLETPRC''',
	NULL,
	'PRINTER NAME',
	0,
	0,
	TO_DATE('17-11-2012 15:02:10','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO gencodes (
	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3 )
 VALUES (
	'PRINTER_NAME',
	'W_PALLETPRC',
	'YES',
	'\\172.16.100.90\unimis-hpljP3015-001',
	'PRINTER',
	TO_DATE('16-02-2001 18:54:50','DD-MM-YYYY HH24:MI:SS'),
	'SUN       ',
	'BASE           ',
	'Y',
	NULL,
	NULL,
	NULL);
INSERT INTO disparm (
	prd_code ,
	var_name ,
	var_type ,
	var_value ,
	descr ,
	var_subs ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'999999',
	'CARTON_GEN_OBJNAME',
	'S',
	'pallet_no',
	'Object name of Report',
	NULL,
	TO_DATE('2-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ');
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 (
	'BLKPRINTNM',
	'Printer Name Blank',
	'Printer Name Should not be Blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('20-11-2012 11:59:45','DD-MM-YYYY HH24:MI:SS'),
	'Base      ',
	'Base           ',
	NULL,
	NULL);

update obj_forms set SCAN_METADATA = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location From:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="4"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>New LPN:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl__new</FIELD></FIELDS></INPUT_SCAN><SCAN_CONDITION field="lot_sl__new">order_type != "T"</SCAN_CONDITION></SCAN_INFO>'
where win_name ='w_active_repl_iss' and form_no = 3;

commit;
------------- Manoj sharma 22-nov-12
alter table physcandet add ref_id char(10);
alter table physcandet add verified char(1);
alter table physcandet add ref_line_no number(5);
ALTER TABLE PHYSCANDET ADD REVERIFY CHAR(1);

update transetup set header_form_no='1' where tran_window='w_phy_scan_verify';
delete from TARO.obj_forms where win_name='w_phy_scan_verify';
INSERT INTO TARO.obj_forms VALUES (
	'w_phy_scan_verify',
	'Header',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	NULL);
INSERT INTO TARO.obj_forms VALUES (
	'w_phy_scan_verify',
	'Detail',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"> <SCAN_LABEL>LOCATION:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS> </MAPPING_SCAN><MAPPING_SCAN ORDER="2"> <SCAN_LABEL>LPN NO:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="3"> <SCAN_LABEL>Item Code:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="4"> <SCAN_LABEL>Lot No:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS> </MAPPING_SCAN> <INPUT_SCAN ORDER="1"> <SCAN_LABEL>Case Count:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>phy_input</FIELD></FIELDS> </INPUT_SCAN><INPUT_SCAN ORDER="2"> <SCAN_LABEL>Re-verify (Y/N)?:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>reverify</FIELD></FIELDS> </INPUT_SCAN> <SCAN_CONDITION field="loc_code">parseInt(quantity) != 0</SCAN_CONDITION><SCAN_CONDITION field="reverify">parseInt(phy_input) != parseInt(no_art)</SCAN_CONDITION></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<descr>(<item_code>),<loc_code>,<lot_no>,<lot_sl>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	NULL);

delete from system_events where obj_name='phy_scan_verify';

INSERT INTO system_events VALUES (
	'phy_scan_verify',
	'default_data_wiz',
	'1',
	'phy_scan_default_data',
	NULL,
	'0',
	sysdate,
	'MANOJ     ',
	'BASE',
	'2',
	'EJB',
	'PhyItemVerifyIC',
	NULL);

INSERT INTO system_events VALUES (
	'phy_scan_verify',
	'post_save',
	'1',
	'pos_phy_scan',
	NULL,
	'0',
	sysdate,
	'MANOJ     ',
	'BASE',
	'2',
	'EJB',
	'PhyItemVerifyPos',
	NULL);
INSERT INTO system_events VALUES (
	'phy_scan_verify',
	'pre_navigate_next',
	'1',
	'prv_phy_scan',
	NULL,
	'0',
	sysdate,
	'MANOJ     ',
	'BASE',
	'2',
	'EJB',
	'PhyItemVerifyIC',
	NULL);
INSERT INTO system_events VALUES (
	'phy_scan_verify',
	'pre_validate',
	'1',
	'prv_phy_scan',
	NULL,
	'0',
	sysdate,
	'MANOJ     ',
	'BASE',
	'2',
	'EJB',
	'PhyItemVerifyIC',
	NULL);
INSERT INTO system_events VALUES (
	'phy_scan_verify',
	'pre_navigate_finish',
	'1',
	'prv_phy_scan',
	NULL,
	'0',
	sysdate,
	'MANOJ     ',
	'BASE',
	'2',
	'EJB',
	'PhyItemVerifyIC',
	NULL);

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 ('INVVERIFY','Invalid Value','Please enter Y/N to Re-verify','E','Y',null,null,null,SYSDATE,'BASE      ','BASE           ',null,null);


------------sumit on 23-11-12
INSERT INTO itm2menu (
	application,
	level_1,
	level_2,
	level_3,
	level_4,
	level_5,
	win_name,
	descr,
	comments,
	menu_path,
	icon_path,
	close_icon,
	open_icon,
	obj_type,
	chg_date,
	chg_term,
	chg_user,
	mob_deploy)
VALUES (
	'WMS',
	1,
	43,
	0,
	0,
	0,
	'w_pelletized_carton',
	'Palatalized Carton',
	'Palatalized Carton',
	'WMS.1.43.0.0.0',
	'e12_logo.gif',
	NULL,
	NULL,
	'W',
	NULL,
	'BASE',
	'BASE',
	NULL);

	
	INSERT INTO transetup (
	tran_window,
	save_flag,
	val_flag,
	key_flag,
	key_string,
	udf_1,
	udf_2,
	udf_3,
	udf_4,
	udf_5,
	repeate_add,
	chg_date,
	chg_user,
	chg_term,
	edi_option,
	site_acc_col,
	confirm_col,
	confirm_val,
	repeat_add_det,
	repeatadddet,
	load_mode,
	auto_confirm,
	ledg_post_conf,
	chg_date_on_conf,
	tran_id_col,
	mail_option,
	confirm_mode,
	garbage_opt,
	val_flag_edi,
	verify_password,
	cust_acc_col,
	sales_pers_acc_col,
	supp_acc_col,
	item_ser_acc_code,
	emp_acc_col,
	item_ser_acc_col,
	workflow_opt,
	table_name,
	application,
	table_desc,
	tran_date_col,
	tran_id__from,
	tran_id__to,
	table_name_det1,
	table_name_det2,
	table_name_det3,
	multitire_opt,
	ref_ser,
	view_mode,
	tax_forms,
	sign_status,
	user_tran_window,
	custom_preview_obj,
	ignoreerrlist_onload,
	childdata_argopt,
	edit_tmplt,
	wrkflw_init,
	edittax,
	formal_args,
	audit_trail_opt,
	edit_opt,
	cache_opt,
	optimize_mode,
	edit_expr,
	rate_col,
	qty_col,
	edit_expr_inp,
	rcp_cache_status,
	print_control,
	transfer_mode,
	profile_id__res,
	tran_compl_msg,
	period_option,
	wrkflw_priority,
	exec_type,
	disp_meta_data,
	allow_attach,
	start_form,
	isattachment,
	header_form_no)
 VALUES (
	'w_pelletized_carton',
	'2',
	'2',
	'M',
	'seq10',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'N',
	TO_DATE('9-06-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'0',
	'0',
	'N',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'WMS',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'M-PACA',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'M',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);


	INSERT INTO OBJ_ACTIONS (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date ,
	chg_term,
	chg_user)
 VALUES (
	'pelletized_carton',
	1,
	NULL,
	'Saving',
	NULL,
	NULL,
	'S',
	'Finish',
	'3',
	NULL,
	NULL,
	'U',
	NULL,
	TO_DATE('3-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE           ',
	'BASE    ');
	
	
INSERT INTO OBJ_ACTIONS (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date,
	chg_term,
	chg_user)
 VALUES  (
	'pelletized_carton',
	2,
	NULL,
	'Prev',
	'a',
	'a',
	'P',
	'Prev',
	'2',
	NULL,
	NULL,
	'U',
	NULL,
	TO_DATE('3-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE           ',
	'BASE    ');
	
INSERT INTO OBJ_ACTIONS (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date ,
	chg_term,
	chg_user)
 VALUES  (
	'pelletized_carton',
	5,
	'confirm~normal.gif',
	'Confirming records',
	'pre_confirm',
	'a',
	'F',
	'Confirm',
	'3',
	'2',
	'1',
	'S',
	NULL,
	TO_DATE('3-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE           ',
	'BASE    ');
	
	
INSERT INTO OBJ_ACTIONS (
	obj_name,
	line_no,
	image,
	description,
	service_code,
	interactive,
	rights_char,
	title,
	form_no,
	service_handler,
	placement,
	action_type,
	tran_type,
	chg_date ,
	chg_term,
	chg_user)
 VALUES (
	'pelletized_carton',
	6,
	NULL,
	'Next',
	NULL,
	NULL,
	'N',
	'Next',
	'1',
	NULL,
	NULL,
	'U',
	NULL,
	TO_DATE('3-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE           ',
	'BASE    ');

	
	INSERT INTO OBJ_FORMS (
	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata,
	selection_mode,
	default_view)
 VALUES (
	'w_pelletized_carton',
	'Header',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Carton No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	NULL);
	
	
INSERT INTO OBJ_FORMS (
	win_name,
	title,
	obj_brow_name,
	obj_edit_name,
	cross_update_expr,
	expr_fld_info,
	target_fld_info,
	expr_comment,
	form_no,
	scr_flag,
	auto_accept_scan,
	scan_flag,
	scan_metadata,
	property_info,
	scan_delimiter,
	column_on_save,
	after_save,
	ext_setup,
	ext_metadata,
	ext_com,
	auto_accept_weighdata,
	form_type,
	disp_metadata,
	parent_key_col,
	qty_col,
	rate_col,
	assisted_mode,
	storage_key_metadata,
	selection_mode,
	default_view)
 VALUES (
	'w_pelletized_carton',
	'Detail',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>New Pallet No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no__new</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	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 (
	'pelletized_carton',
	'default_data_wiz',
	'1',
	'phy_scan_default_data',
	NULL,
	'0',
	TO_DATE('3-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	'2',
	'EJB',
	'PalletMergeIC',
	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 (
	'pelletized_carton',
	'post_save',
	'1',
	'pos_phy_scan',
	NULL,
	'0',
	TO_DATE('8-05-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	'2',
	'EJB',
	'PalletMergePos',
	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(
	'pelletized_carton',
	'pre_navigate_finish',
	'1',
	'prv_phy_scan',
	NULL,
	'0',
	TO_DATE('8-05-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	'2',
	'EJB',
	'PalletMergeIC',
	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 (
	'pelletized_carton',
	'pre_navigate_next',
	'1',
	'prv_phy_scan',
	NULL,
	'0',
	TO_DATE('8-05-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	'2',
	'EJB',
	'PalletMergeIC',
	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 (
	'pelletized_carton',
	'pre_validate',
	'1',
	'prv_phy_scan',
	NULL,
	'0',
	TO_DATE('3-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	'2',
	'EJB',
	'PalletMergeIC',
	NULL);

	
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 (
	'NULLCARNO',
	'Null Carton Number',
	'Please Enter Carton Number',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);

	UPDATE messages SET MSG_DESCR ='The Pallet/Carton is not exist in the master' WHERE MSG_NO = 'INVPLTNOM';
	
commit;


delete from OBJ_ITEMCHANGE where obj_name = 'despeditprc';
INSERT INTO OBJ_ITEMCHANGE (
	obj_name ,
	form_no,
	field_name ,
	mandatory )
VALUES (
	'despeditprc',
	'1  ',
	'itm_default',
	'Y');
	
INSERT INTO OBJ_ITEMCHANGE (
	obj_name ,
	form_no,
	field_name ,
	mandatory )
VALUES (
	'despeditprc',
	'1  ',
	'sale_order__fr',
	'Y');
	
INSERT INTO OBJ_ITEMCHANGE (
	obj_name ,
	form_no,
	field_name ,
	mandatory )
VALUES (
	'despeditprc',
	'1  ',
	'sale_order__to',
	'Y');
----- Sumit 24-11-12 part 2
INSERT INTO POPHELP  (
	field_name,
	mod_name,
	sql_str ,
	dw_object ,
	msg_title ,
	width ,
	height ,
	chg_date,
	chg_user,
	chg_term ,
	dist_opt,
	filter_string ,
	sql_input,
	default_col ,
	pop_align,
	query_mode,
	page_context,
	pophelp_cols,
	pophelp_source,
	multi_opt ,
	help_option)
VALUES (
	'SHIPMENT_ID',
	'W_CHECKSHEET',
	'SELECT S.SHIPMENT_ID FROM SHIPMENT S, SHIP_DOCS SD WHERE S.CONFIRMED =''N'' AND SD.REF_SER = ''S-DSP'' and s.SHIPMENT_ID =  SD.SHIPMENT_ID ORDER BY SD.SHIPMENT_ID',
	NULL,
	'SHIPMENT ID',
	0,
	0,
	TO_DATE('16-11-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
	
	update OBJ_FORMS set scan_metadata = '<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Shipment ID:</SCAN_LABEL><FIELDS SEPARATOR=""  DELIMITER=""><FIELD>shipment_id</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Printer :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>printer_name</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>'
	where win_name = 'w_checksheet' and form_no = 1;
	
	commit;
	
	INSERT INTO OBJ_ITEMCHANGE (
	obj_name,
	form_no ,
	field_name ,
	mandatory )
 VALUES (
	'wavegen',
	'1  ',
	'print_label',
	'Y');
	
	INSERT INTO disparm (
	prd_code,
	var_name,
	var_type,
	var_value,
	descr,
	var_subs,
	chg_date,
	chg_user,
	chg_term)
 VALUES (
	'999999',
	'WAVE_LABEL_OBJ_NAME',
	'S',
	'pick_label',
	'wave label report name',
	NULL,
	fn_sysdate(),
	'BASe',
	'BASE ');
  
  commit;
  -- 26-NOV-12 ADDING POPHELP FOR WAVE GENERATION FOR ALL PRINTER AS A PRINTER_NAME
  INSERT INTO GENCODES(
	fld_name,
	mod_name,
	fld_value,
	descr ,
	sh_descr,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1,
	udf_str2,
	udf_str3)
 VALUES (
	'PRINTER_NAME',
	'X',
	'P1',
	'PDFCreator',
	NULL,
	TO_DATE('10-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	'Y',
	NULL,
	NULL,
	NULL);
	
INSERT INTO GENCODES(
	fld_name,
	mod_name,
	fld_value,
	descr ,
	sh_descr,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1,
	udf_str2,
	udf_str3)
 VALUES (
	'PRINTER_NAME',
	'X',
	'P2',
	'DOCK1',
	NULL,
	TO_DATE('10-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL,
	NULL,
	NULL);

	INSERT INTO POPHELP (
	field_name,
	mod_name,
	sql_str,
	dw_object ,
	msg_title ,
	width,
	height,
	chg_date ,
	chg_user,
	chg_term ,
	dist_opt ,
	filter_string ,
	sql_input,
	default_col,
	pop_align ,
	query_mode ,
	page_context ,
	pophelp_cols,
	pophelp_source ,
	multi_opt,
	help_option )
 VALUES (
	'PRINTER_NAME',
	'X',
	'SELECT DESCR AS PRINTER_NAME FROM GENCODES WHERE FLD_NAME =''PRINTER_NAME'' AND MOD_NAME =''X''',
	NULL,
	'Printer Service name',
	0,
	0,
	TO_DATE('3-10-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

	UPDATE POPHELP 
SET SQL_STR = 'SELECT DISTINCT S.SHIPMENT_ID FROM SHIPMENT S, SHIP_DOCS SD WHERE S.CONFIRMED =''N'' AND SD.REF_SER = ''S-DSP'' and S.SHIPMENT_ID =  SD.SHIPMENT_ID'
WHERE MOD_NAME = 'W_CHECKSHEET' AND FIELD_NAME = 'SHIPMENT_ID';

delete from OBJ_ACTIONS where obj_name = 'checksheet' and rights_char = 'N' and form_no = 2 ;

INSERT INTO POPHELP (
	field_name,
	mod_name,
	sql_str,
	dw_object ,
	msg_title ,
	width,
	height,
	chg_date ,
	chg_user,
	chg_term ,
	dist_opt ,
	filter_string ,
	sql_input,
	default_col,
	pop_align ,
	query_mode ,
	page_context ,
	pophelp_cols,
	pophelp_source ,
	multi_opt,
	help_option )
 VALUES (
	'PRINTER_NAME',
	'W_CHECKSHEET',
	'SELECT DESCR AS PRINTER_NAME FROM GENCODES WHERE FLD_NAME =''PRINTER_NAME'' AND MOD_NAME =''X''',
	NULL,
	'Printer Service name',
	0,
	0,
	TO_DATE('3-10-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

	INSERT INTO disparm (
	prd_code,
	var_name,
	var_type,
	var_value,
	descr,
	var_subs,
	chg_date,
	chg_user,
	chg_term)
 VALUES (
	'999999',
	'LOADING_REP_OBJNAME',
	'S',
	'bill_of_lading',
	'bill of lading report name',
	NULL,
	fn_sysdate(),
	'BASe',
	'BASE ');
  
commit;

//---------Changed by Rohan on 26-11-12 for active pick split
INSERT INTO DISPARM (
	prd_code,
	var_name,
	var_type,
	var_value,
	descr,
	var_subs,
	chg_date,
	chg_user,
	chg_term)
 VALUES (
	'999999',
	'ACTIVE_PICK_CASE_COUNT',
	'S',
	'5',
	'Maximun active pick case count',
	NULL,
	fn_sysdate(),
	'Rohan     ',
	'Base ');
	
	
//---------Changed by Kunal Cycle Count 28-11-12
INSERT INTO ITM2MENU 
(
	APPLICATION,
	LEVEL_1,
	LEVEL_2,
	LEVEL_3,
	LEVEL_4,
	LEVEL_5,
	WIN_NAME,
	DESCR,
	COMMENTS,
	MENU_PATH,
	ICON_PATH,
	OBJ_TYPE,
	CHG_USER,
	CHG_TERM,
	CHG_DATE
	
)VALUES (
	'WMS',
	1,51,0,0,0,
	'w_schedule_location',
	'Schedule Location(Manually)',
	null,
	'WMS.1.51.0.0.0',
	'e12_logo.gif',
	null,
	'kunal',
	'kunal',
	sysdate
	
);

INSERT INTO TRANSETUP
(TRAN_WINDOW,SAVE_FLAG,VAL_FLAG,KEY_FLAG,KEY_STRING,CHG_DATE,CHG_USER,CHG_TERM,
 EDI_OPTION,CONFIRM_COL,CONFIRM_VAL,REPEAT_ADD_DET,LEDG_POST_CONF,TRAN_ID_COL,
 CONFIRM_MODE,MAIL_OPTION,TABLE_NAME,APPLICATION,REF_SER,VIEW_MODE) 
VALUES 
('w_schedule_location','2','2','A','seq10',sysdate,'kunal','BASE',
 '0','','','Y','N','tran_id',
 '0','0','physcan','WMS','PSCAN','F');	


INSERT INTO OBJ_FORMS 
(	WIN_NAME,
	TITLE,
	OBJ_BROW_NAME,
	OBJ_EDIT_NAME,
	CROSS_UPDATE_EXPR,
	EXPR_FLD_INFO,
	TARGET_FLD_INFO,
	EXPR_COMMENT,
	FORM_NO
	
) values (
	'w_schedule_location',
	'Header',
	'schedule_location11',
	'schedule_location21',
	null,
	null,
	null,
	null,
	'1'
	
);


INSERT INTO OBJ_FORMS 
(	WIN_NAME,
	TITLE,
	OBJ_BROW_NAME,
	OBJ_EDIT_NAME,
	CROSS_UPDATE_EXPR,
	EXPR_FLD_INFO,
	TARGET_FLD_INFO,
	EXPR_COMMENT,
	FORM_NO
	
) values (
	'w_schedule_location',
	'Detail',
	'schedule_location12',
	'schedule_location22',
	null,
	null,
	null,
	null,
	'2'
	
);



	
INSERT INTO OBJ_ACTIONS 
(
	OBJ_NAME ,
	LINE_NO,
	RIGHTS_CHAR,
	INTERACTIVE, 
	SERVICE_CODE, 
	DESCRIPTION, 
	TITLE, 
	IMAGE, 
	FORM_NO, 
	SERVICE_HANDLER,
	PLACEMENT,
	ACTION_TYPE,	
	TRAN_TYPE
) VALUES (
	'schedule_location',
	'1',
	'E',
	'a',
	'a',
	'Editing Existing Record',
	'Edit',
	'edit.gif',
	'1',
	NULL,
	NULL,
	'S',
	NULL
);
	

	


INSERT INTO SYSTEM_EVENTS
(
	OBJ_NAME,
	EVENT_CODE,
	EVENT_CONTEXT,
	SERVICE_CODE,
	METHOD_RULE,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	RESULT_HANDLE,
	OVERWRITE_CORE,
	COMP_TYPE,
	COMP_NAME,
	COMM_FORMAT
) VALUES (
	'schedule_location',
	'pre_validate',
	'1',
	'prv_default_ejb',
	null,
	sysdate,
	'Kunal',
	'Kunal',
	'2',
	'0',
	'EJB',
	'ScheduleLocationIC',
	NULL
);


INSERT INTO SYSTEM_EVENTS
(	
	OBJ_NAME,
	EVENT_CODE,
	EVENT_CONTEXT,
	SERVICE_CODE,
	METHOD_RULE,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	RESULT_HANDLE,
	OVERWRITE_CORE,
	COMP_TYPE,
	COMP_NAME,
	COMM_FORMAT
) VALUES (
	'schedule_location',
	'post_item_change',
	'1',
	'poic_default_ejb',
	null,
	sysdate,
	'Mangesh',
	'Mangesh',
	'2',
	'0',
	'EJB',
	'ScheduleLocationIC',
	NULL
);

insert into obj_itemchange (obj_name,FIELD_NAME,form_no) values ('schedule_location','itm_default',2);
insert into obj_itemchange (obj_name,FIELD_NAME,form_no) values ('schedule_location','loc_code',2);


update messages set msg_type = 'E' ,msg_opt = 'Y' where msg_no = 'VMLOC6' ;
update messages set msg_type = 'E' ,msg_opt = 'Y' where msg_no = 'VMLOC4' ;

INSERT INTO messages(
	msg_no,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt 
	)
 VALUES (
	'VMIDATA3',
	'Invalid Location Code',
	'Data for the specified Location Code  not found.',
	'E',
	'Y'
	);

INSERT INTO messages(
	msg_no,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt 
	)
 VALUES (
	'VMDEL1',
	'Can not Delete Record',
	'Can not Delete Schedular generated record. ',
	'E',
	'Y'
	);



alter table physcandet
add tran_type char(1);

--added by akhilesh on 28/nov/12 for audit trail
Insert into obj_actions
(OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER)
values ('schedule_location',21,'menu.bmp','View AuditTrail','audit_trail','1','X','View Audit','1','1','1','U',null,null,null,null);

update  transetup set audit_trail_opt ='1' where tran_window = 'w_schedule_location' ;

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 ('schedule_location','audit_trail','1','project_audit_trail',null,'0',sysdate,'d','Base45','2',null,null,null);
update obj_forms set disp_metadata='checkedImage@img<loc_code>' where win_name='w_empty_loc_scan' and form_no='2';

-- Added by sumit on 30-nov-12 update pophelp for loading start.
UPDATE POPHELP 
SET SQL_STR = 'SELECT DISTINCT S.SHIPMENT_ID, sd.ptcn, D.CUST_CODE FROM SHIPMENT S, SHIP_DOCS SD, DESPATCH D , DESPATCHDET DE WHERE S.CONFIRMED =''N'' AND SD.REF_SER = ''S-DSP'' AND D.DESP_ID = SD.REF_ID and s.SHIPMENT_ID =  SD.SHIPMENT_ID AND D.DESP_ID = DE.DESP_ID'
WHERE MOD_NAME = 'W_CHECKSHEET' AND FIELD_NAME = 'SHIPMENT_ID'; 
-- Added by sumit on 30-nov-12 update pophelp for loading end.
update obj_forms set disp_metadata='checkedImage@img<loc_code>' where win_name='w_empty_loc_scan' and form_no='2';

INSERT INTO WAVE_SEQ (
	ref_ser,
	priority)	
 VALUES (
	'S-DSP ',
	9);	

INSERT INTO WAVE_SEQ (
	ref_ser,
	priority)	
 VALUES (
	'M-PACK',
	8);
	
INSERT INTO WAVE_SEQ (
	ref_ser,
	priority)	
 VALUES (
	'R-TASK',
	3);
	
INSERT INTO WAVE_SEQ (
	ref_ser,
	priority)	
 VALUES  (
	'C-PICK',
	6);
	
INSERT INTO WAVE_SEQ (
	ref_ser,
	priority)	
 VALUES  (
	'A-PICK',
	7);
	
INSERT INTO WAVE_SEQ (
	ref_ser,
	priority)	
 VALUES  (
	'RP-PND',
	2);
	
INSERT INTO WAVE_SEQ (
	ref_ser,
	priority)	
 VALUES  (
	'R-CPA ',
	5);
	
INSERT INTO WAVE_SEQ (
	ref_ser,
	priority)	
 VALUES  (
	'R-PND ',
	2);
	
INSERT INTO WAVE_SEQ (
	ref_ser,
	priority)	
 VALUES  (
	'M-PICK',
	6);
	
INSERT INTO WAVE_SEQ (
	ref_ser,
	priority)	
 VALUES  (
	'S-DOC ',
	3);
	
INSERT INTO WAVE_SEQ (
	ref_ser,
	priority)	
 VALUES  (
	'RP-ACT',
	4);
	
INSERT INTO WAVE_SEQ (
	ref_ser,
	priority)	
 VALUES  (
	'RR-DSA',
	3);
	
INSERT INTO WAVE_SEQ (
	ref_ser,
	priority)	
 VALUES (
	'RD-DSA',
	1);
	
INSERT INTO WAVE_SEQ (
	ref_ser,
	priority)	
 VALUES  (
	'R-DSO ',
	1);
	
INSERT INTO WAVE_SEQ (
	ref_ser,
	priority)	
 VALUES (
	'RS-DSO',
	1);
	
INSERT INTO WAVE_SEQ (
	ref_ser,
	priority)	
 VALUES  (
	'RN-DSA',
	2);

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 (
	'INVPLTDESP',
	'Invalid Pallet No.',
	'Pallet No. does not belong to current PTCN',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('30-11-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);

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 (
	'INVPLTMST',
	'Invalid Pallet No.',
	'Please enter a unused pallet No. from pallet master.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('30-11-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);

commit;

------ 04-12-12
CREATE OR REPLACE FUNCTION FN_CHECK_REPL_ORD_USER(REPL_ORDER_IN IN CHAR, USER_IN IN CHAR)
  RETURN NUMBER is FLAG NUMBER;
  CNT NUMBER;
  CNT1 NUMBER;
  CNT2 NUMBER;
  BEGIN
   BEGIN
     SELECT count(*) INTO CNT FROM REPL_ISS_HDR WHERE REPL_ORDER = REPL_ORDER_IN AND CHG_USER = USER_IN;
     IF( CNT > 0) THEN
      select count(*) into CNT1  from WAVE_TASK_DET where REF_ID = REPL_ORDER_IN  AND STATUS <>'Y';
       if( CNT1 > 0) THEN
         FLAG := 1;
       ELSE
         FLAG := 0;
       END IF ;
    ELSE
		SELECT count(*) INTO CNT2 FROM REPL_ISS_HDR WHERE REPL_ORDER = REPL_ORDER_IN AND CONFIRMED ='N';
		IF( CNT2 > 0) THEN
			FLAG := 0;
		ELSE
			FLAG := 1;
		END IF ;
    END IF;
  EXCEPTION
  WHEN NO_DATA_FOUND  THEN
   FLAG := 2;
  END;
  RETURN FLAG;
  END;
/
UPDATE POPHELP 
SET SQL_INPUT=':1.repl_order,:1.chg_user' ,SQL_STR = 'SELECT REPL_ORDER,LOC_CODE FROM (SELECT  DISTINCT R.REPL_ORDER ,L.LOC_CODE FROM REPL_ORD_DET R,REPL_ORD_HDR H,WAVE_TASK_DET W,LOCATION L ,WAVE_TASK WH WHERE W.WAVE_ID = WH.WAVE_ID AND R.REPL_ORDER = H.REPL_ORDER AND R.REPL_ORDER = W.REF_ID AND W.STATUS = ''N'' AND H.ORDER_TYPE NOT IN (''E'',''Q'',''I'') AND FN_VALID_REPL (H.REPL_ORDER) = ''Y'' AND R.LOC_CODE = L.LOC_CODE  AND L.INV_STAT = ''?'' AND FN_CHECK_REPL_ORD_USER(H.REPL_ORDER,''?'') = 1)  ORDER BY LOC_CODE'
WHERE MOD_NAME = 'W_REPL_ISS' AND FIELD_NAME = 'REPL_ORDER';

UPDATE TRANSETUP SET SAVE_FLAG='A' 
WHERE TRAN_WINDOW IN ('w_repl_iss','w_active_repl_iss') ;

UPDATE POPHELP 
SET SQL_INPUT=':1.repl_order,:1.chg_user' ,SQL_STR = 'SELECT REPL_ORDER,LOC_CODE FROM (SELECT DISTINCT R.REPL_ORDER ,L.LOC_CODE FROM REPL_ORD_DET R,REPL_ORD_HDR H,WAVE_TASK_DET W,LOCATION L ,WAVE_TASK WH WHERE W.WAVE_ID = WH.WAVE_ID AND R.REPL_ORDER = H.REPL_ORDER AND R.REPL_ORDER = W.REF_ID AND W.STATUS = ''N'' AND H.ORDER_TYPE IN (''E'',''Q'',''T'',''I'') AND FN_VALID_REPL (H.REPL_ORDER) = ''Y'' AND R.LOC_CODE = L.LOC_CODE  AND L.INV_STAT = ''?'' AND FN_CHECK_REPL_ORD_USER(H.REPL_ORDER,''?'') = 1) ORDER BY LOC_CODE'
WHERE MOD_NAME = 'W_ACTIVE_REPL_ISS' AND FIELD_NAME = 'REPL_ORDER';
UPDATE SYSTEM_EVENTS SET OBJ_NAME ='repl_iss_1' WHERE OBJ_NAME IN ('repl_iss') AND EVENT_CODE='pre_navigate_finish';
UPDATE SYSTEM_EVENTS SET OBJ_NAME ='active_repl_iss_1' WHERE OBJ_NAME IN ('active_repl_iss') AND EVENT_CODE='pre_navigate_finish';

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 (
    'RECONEXIST',
    'Record not exist',
    'Record Not exist for next transaction',
    'F',
    'Y',
    NULL,
    NULL,
    NULL,
    TO_DATE('22-10-2000 11:59:45','DD-MM-YYYY HH24:MI:SS'),
    'BASE      ',
    'PRAGYAN        ',
    NULL,
    NULL);
    
    ----- 05/12/12
    INSERT INTO disparm (
	prd_code ,
	var_name ,
	var_type ,
	var_value ,
	descr ,
	var_subs ,
	chg_date ,
	chg_user ,
	chg_term 
	 )
VALUES (
	'999999',
	'MASTER_PACK_BEST_FIT',
	'S',
	'N',
	'Algorithm to use master pack best fit Y/N',
	0,
	fn_sysdate(),
	'BASE',
	'pragyan'
	);
update OBJ_FORMS SET SCAN_METADATA = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="6" end="15" >item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="13" end="22" >lot_no</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Number of Cases:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" mandatory = "N">no_art</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="3"><SCAN_LABEL>Partial Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>part_qty</FIELD></FIELDS></INPUT_SCAN><SCAN_CONDITION field="part_qty">no_art == "null" || no_art == "0" || no_art == ""</SCAN_CONDITION></SCAN_INFO>'
where win_name ='w_porcp_wiz' and form_no = 3;

update OBJ_FORMS SET SCAN_METADATA = '<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>LPN No To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl__to</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Number of Cases:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" mandatory = "N">no_art</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="3"><SCAN_LABEL>Active Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>quantity</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="4"><SCAN_LABEL>Location Code To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN><SCAN_CONDITION field="quantity">no_art == "null" || no_art == "0" || no_art == ""</SCAN_CONDITION></SCAN_INFO>'
where win_name ='w_stock_transfer_wiz' and form_no = 3;

-- 05-DEC-12 given by kunal 

insert into obj_itemchange (obj_name,FIELD_NAME,form_no) values ('schedule_location','itm_defaultedit',1);

INSERT INTO messages(
	msg_no,
	msg_str ,
	msg_descr ,
	msg_type ,
	msg_opt 
	)
 VALUES (
	'VMDEL2',
	'Can not Edit Record',
	'Can not Edit Schedular generated record. ',
	'E',
	'Y'
	);
	
-- added by sumit on 05-DEC-12 updating msg_type 
update messages set msg_type = 'E' where msg_no ='PRVREPLSCN';

Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('wavegen','1','wave_mode','Y');
CREATE OR REPLACE FUNCTION FN_IS_VALID_PICK_ORDER(PICK_ORDER IN CHAR)
  RETURN CHAR is FLAG CHAR;
  HOLD_STATUS CHAR;
  CANCEL_STATUS CHAR;
  BEGIN
   BEGIN
     SELECT W.HOLD_STATUS ,W.CANCEL INTO HOLD_STATUS , CANCEL_STATUS FROM WAVE_TASK W,WAVE_TASK_DET D WHERE W.WAVE_ID = D.WAVE_ID AND D.REF_ID = PICK_ORDER;
    IF( HOLD_STATUS = 'Y') THEN
      FLAG := 'N';
   RETURN FLAG;
    ELSE
   FLAG := 'Y';
    END IF;
   IF( CANCEL_STATUS = 'Y') THEN
      FLAG := 'N';
   RETURN FLAG;
    ELSE
   FLAG := 'Y';
    END IF;
  EXCEPTION
  WHEN NO_DATA_FOUND  THEN
   FLAG := 'F';
  END;
  RETURN FLAG;
  END;
  
  -- added by sumit on 07/12/12 added message id
  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 (
	'INVPLTNUS',
	'Invalid Pallet Number.',
	'Entered pallet number is already used.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('30-11-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);

UPDATE POPHELP
SET SQL_INPUT=':1.repl_order,:1.chg_user' ,SQL_STR = 'SELECT REPL_ORDER,LOC_CODE FROM (SELECT  DISTINCT R.REPL_ORDER ,L.LOC_CODE FROM REPL_ORD_DET R,REPL_ORD_HDR H,WAVE_TASK_DET W,LOCATION L ,WAVE_TASK WH WHERE W.WAVE_ID = WH.WAVE_ID AND R.REPL_ORDER = H.REPL_ORDER AND R.REPL_ORDER = W.REF_ID AND W.STATUS = ''N'' AND H.ORDER_TYPE NOT IN (''E'',''Q'',''T'',''I'',''P'') AND FN_VALID_REPL (H.REPL_ORDER) = ''Y'' AND R.LOC_CODE = L.LOC_CODE  AND L.INV_STAT = ''?'' AND FN_CHECK_REPL_ORD_USER(H.REPL_ORDER,''?'') = 1)  ORDER BY LOC_CODE'
WHERE MOD_NAME = 'W_REPL_ISS' AND FIELD_NAME = 'REPL_ORDER';


UPDATE POPHELP 
SET SQL_INPUT=':1.repl_order,:1.chg_user' ,SQL_STR = 'SELECT REPL_ORDER,LOC_CODE FROM (SELECT DISTINCT R.REPL_ORDER ,L.LOC_CODE FROM REPL_ORD_DET R,REPL_ORD_HDR H,WAVE_TASK_DET W,LOCATION L ,WAVE_TASK WH WHERE W.WAVE_ID = WH.WAVE_ID AND R.REPL_ORDER = H.REPL_ORDER AND R.REPL_ORDER = W.REF_ID AND W.STATUS = ''N'' AND H.ORDER_TYPE IN (''E'',''Q'',''T'',''I'',''P'') AND FN_VALID_REPL (H.REPL_ORDER) = ''Y'' AND R.LOC_CODE = L.LOC_CODE  AND L.INV_STAT = ''?'' AND FN_CHECK_REPL_ORD_USER(H.REPL_ORDER,''?'') = 1) ORDER BY LOC_CODE'
WHERE MOD_NAME = 'W_ACTIVE_REPL_ISS' AND FIELD_NAME = 'REPL_ORDER';
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 (
        'RECNOTSORA',
        'Record not found.',
        'Stock allocation record not found.',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('30-11-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'BASE           ',
        NULL,
        NULL);
update OBJ_FORMS SET ASSISTED_MODE='A' WHERE WIN_NAME='w_master_pack' AND FORM_NO='3';

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 (
        'INVCARTONO',
        'Master Carton already used!!',
        'Master Carton no entered or scanned is already used.',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('30-11-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'BASE           ',
        NULL,
        NULL);
        
delete  from system_events where obj_name='master_pack' and event_code='pre_navigate_finish';
COMMIT;
----121212----
UPDATE MESSAGES SET MSG_TYPE='E' WHERE MSG_NO='REPCOMPL';

-- Changes done by Sabita on 13/dec/12
INSERT INTO itm2menu
(
        application ,
        level_1 ,
        level_2,
        level_3 ,
        level_4 ,
        level_5,
        win_name ,
        descr ,
        comments ,
        menu_path,
        icon_path ,
        obj_type ,
        chg_user,
        chg_term ,
        chg_date ,
        open_icon)
VALUES (
        'WMS',
        1,
        36,
        43,
        0,
        0,
        'w_d_lists_unwaved',
        'List of Unwaved Items/Orders',
        NULL,
        'WMS.1.36.43.0.0',
        'e12_logo.gif',
        'R',
        NULL,
        NULL,
        NULL,
        NULL);
		
CREATE OR REPLACE FUNCTION FN_NEAR_EXPIRY(AS_ITEM_CODE CHAR,AS_SITE_CODE CHAR) RETURN NUMBER IS 
AS_STK_QTY NUMBER(30);
BEGIN
SELECT SUM(STOCK.QUANTITY - STOCK.ALLOC_QTY - nvl(STOCK.HOLD_QTY,0)) STOCK_AVAIL INTO AS_STK_QTY
FROM  STOCK,LOCATION,INVSTAT
WHERE STOCK.LOC_CODE =LOCATION.LOC_CODE
AND   LOCATION.INV_STAT =INVSTAT.INV_STAT
AND  LOCATION.INV_STAT ='NEXP'
AND  STOCK.ITEM_CODE =AS_ITEM_CODE
AND  STOCK.SITE_CODE =AS_SITE_CODE;

RETURN AS_STK_QTY;
END;
/
---17DEC12 sumit
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 (
        'INVMDYALLQ',
        'Invalid Quantity Allocated!!',
        'Mannualy Stock  allocated  line item should not be allocated through Wave !!',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'BASE           ',
        NULL,
        NULL);
        
 -- added by sumit on 22/12/12 
 update obj_forms set ASSISTED_MODE = 'A', DEFAULT_VIEW = 'U' where win_name = 'w_checksheet' and form_no = 2;

 --added by sumit on 28/12/12 for loading scanning
 update OBJ_FORMS set assisted_mode = 'E' where win_name = 'w_checksheet' and form_no = 2;
 
---added by Ashish Meheta On 31/12/13 not to deliver 
UPDATE POPHELP SET SQL_STR = 'SELECT W.PTCN, D.SORD_NO, D.CUST_CODE, 
D.TRAN_CODE  FROM WAVE_TASK_DET W, DESPATCH D , WAVE_TASK T WHERE REF_ID = 
D.DESP_ID AND D.CONFIRMED != 'Y' AND W.WAVE_ID = T.WAVE_ID AND T.CANCEL <> 
'Y''
WHERE MOD_NAME = 'W_SHIPMENT' and FIELD_NAME = 'PTCN';

---added by Ashish Meheta On 03/12/13 not to deliver

--Alter for PARCELPACK_ALLOW for wave_type table
ALTER TABLE WAVE_TYPE
ADD PARCELPACK_ALLOW CHAR(1);


-- RENAMING ORIGNAL TABLE
alter table DISTROUTEDET RENAME TO DISTROUTEDET_RENAMED ;

-- ADDING MAX_CASE AND MIN_CASE TO DISTROUTEDET_RENAMED TABLE
ALTER TABLE DISTROUTEDET_RENAMED ADD MIN_CASE NUMBER(6);
ALTER TABLE DISTROUTEDET_RENAMED ADD MAX_CASE NUMBER(6);

-- UPDATING ALL MIN_CASE AS O AND MAX_CASE 55555
UPDATE DISTROUTEDET_RENAMED SET MIN_CASE = 0, MAX_CASE = 99999;

COMMIT;

-- CREATING TABLE
CREATE TABLE DISTROUTEDET(
DIST_ROUTE CHAR(5) NOT NULL, 
LINE_NO NUMBER(3,0) NOT NULL, 
STAN_CODE__FR CHAR(5) NOT NULL, 
STAN_CODE__TO CHAR(5) NOT NULL, 
TRAN_CODE CHAR(10) NOT NULL, 
FRT_AMT NUMBER(12,3), 
CURR_CODE CHAR(5), 
TRAN_TIME NUMBER(12,3), 
EXCH_RATE NUMBER(14,6), 
TRANS_MODE CHAR(1), 
MAX_WEIGHT NUMBER(14,6) NOT NULL, 
MIN_WEIGHT NUMBER(14,6) NOT NULL,
MIN_CASE NUMBER(6) NOT NULL,
MAX_CASE NUMBER(6) NOT NULL,
STATE_CODE__TO CHAR(5) NOT NULL, 
STATE_CODE__FR CHAR(5) NOT NULL, 
LOC_TYPE CHAR(3), 
PIN__FR VARCHAR2(15) NOT NULL, 
PIN__TO VARCHAR2(15) NOT NULL
) ;
ALTER TABLE DISTROUTEDET ADD ( CONSTRAINT DISROUTEDET_N_X PRIMARY KEY ( DIST_ROUTE, LINE_NO )) ;


--COPPING RECORD FROM ORGNAL TABLE
INSERT INTO DISTROUTEDET
(
DIST_ROUTE , LINE_NO , STAN_CODE__FR , STAN_CODE__TO , TRAN_CODE , FRT_AMT , CURR_CODE , TRAN_TIME , EXCH_RATE , 
TRANS_MODE , MAX_WEIGHT , MIN_WEIGHT , MIN_CASE, MAX_CASE, STATE_CODE__TO , STATE_CODE__FR , LOC_TYPE , PIN__FR , PIN__TO 
)
SELECT DIST_ROUTE , LINE_NO , STAN_CODE__FR , STAN_CODE__TO , TRAN_CODE , FRT_AMT , CURR_CODE , TRAN_TIME , EXCH_RATE ,
TRANS_MODE , MAX_WEIGHT , MIN_WEIGHT ,MIN_CASE, MAX_CASE, STATE_CODE__TO , STATE_CODE__FR , LOC_TYPE , PIN__FR , PIN__TO
FROM DISTROUTEDET_RENAMED ; 

--added by sumit on 03/01/13 
INSERT INTO refser  (
	ref_ser,
	descr ,
	type ,
	sys_ser ,
	prefix ,
	chg_date ,
	chg_user ,
	chg_term ,
	seq_name ,
	tax_form_reqd ,
	trans_type )
VALUES (
	'P-PICK',
	'Parcel Pick',
	'S',
	'P-PICK',
	NULL,
	TO_DATE('11-09-2012 15:45:44','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL,
	NULL);

 
	-- added by sumit 04/01/13 
	alter table customer add ship_cons_grp varchar2(10);
	
	-- Added by sumit on 08/01/13 for new screen master unpacking
	

INSERT INTO ITM2MENU (
	application ,
	level_1 ,
	level_2 ,
	level_3 ,
	level_4 ,
	level_5 ,
	win_name ,
	descr ,
	comments ,
	menu_path ,
	icon_path ,
	close_icon ,
	open_icon ,
	obj_type ,
	chg_date ,
	chg_term ,
	chg_user ,
	mob_deploy )
 VALUES (
	'WMS',
	1,
	46,
	0,
	0,
	0,
	'w_master_repack',
	'Master Unpacking',
	NULL,
	'WMS.1.46.0.0.0',
	NULL,
	NULL,
	NULL,
	'W',
	NULL,
	NULL,
	NULL,
	NULL);

	INSERT INTO TRANSETUP (
	tran_window ,
	save_flag ,
	val_flag ,
	key_flag ,
	key_string ,
	udf_1 ,
	udf_2 ,
	udf_3 ,
	udf_4 ,
	udf_5 ,
	repeate_add ,
	chg_date ,
	chg_user ,
	chg_term ,
	edi_option ,
	site_acc_col ,
	confirm_col ,
	confirm_val ,
	repeat_add_det ,
	repeatadddet ,
	load_mode ,
	auto_confirm ,
	ledg_post_conf ,
	chg_date_on_conf ,
	tran_id_col ,
	mail_option ,
	confirm_mode ,
	garbage_opt ,
	val_flag_edi ,
	verify_password ,
	cust_acc_col ,
	sales_pers_acc_col ,
	supp_acc_col ,
	item_ser_acc_code ,
	emp_acc_col ,
	item_ser_acc_col ,
	workflow_opt ,
	table_name ,
	application ,
	table_desc ,
	tran_date_col ,
	tran_id__from ,
	tran_id__to ,
	table_name_det1 ,
	table_name_det2 ,
	table_name_det3 ,
	multitire_opt ,
	ref_ser ,
	view_mode ,
	tax_forms ,
	sign_status ,
	user_tran_window ,
	custom_preview_obj ,
	ignoreerrlist_onload ,
	childdata_argopt ,
	edit_tmplt ,
	wrkflw_init ,
	edittax ,
	formal_args ,
	audit_trail_opt ,
	edit_opt ,
	cache_opt ,
	optimize_mode ,
	edit_expr ,
	rate_col ,
	qty_col ,
	edit_expr_inp ,
	rcp_cache_status ,
	print_control ,
	transfer_mode ,
	profile_id__res ,
	tran_compl_msg ,
	period_option ,
	wrkflw_priority ,
	exec_type ,
	disp_meta_data ,
	allow_attach ,
	start_form ,
	isattachment ,
	header_form_no ,
	msg_onsave )
 VALUES (
	'w_master_repack',
	'A',
	'2',
	'A',
	'MPK,seq07',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'Y',
	TO_DATE('8-05-2012 13:26:14','DD-MM-YYYY HH24:MI:SS'),
	'Chaitali  ',
	'SYSTEM         ',
	'0',
	'site_code',
	'CONFIRMED',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'tran_id',
	'0',
	'0',
	'N',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'pack_hdr',
	'WMS',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'M-PACK',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'M',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	NULL);

	
	INSERT INTO OBJ_ACTIONS(
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES (
	'master_repack',
	1,
	NULL,
	'Saving',
	NULL,
	NULL,
	'S',
	'Finish',
	'3',
	NULL,
	NULL,
	'U',
	NULL,
	TO_DATE('8-05-2012 13:26:08','DD-MM-YYYY HH24:MI:SS'),
	'BASE           ',
	'Gulzar    ');
	
	
INSERT INTO OBJ_ACTIONS(
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES (
	'master_repack',
	2,
	NULL,
	'Next',
	'a',
	'a',
	'N',
	'Next',
	'2',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
	
	
INSERT INTO OBJ_ACTIONS(
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES (
	'master_repack',
	3,
	NULL,
	'Prev',
	'a',
	'a',
	'P',
	'Prev',
	'2',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
	
	
INSERT INTO OBJ_ACTIONS(
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES(
	'master_repack',
	4,
	NULL,
	'Prev',
	'a',
	'a',
	'P',
	'Prev',
	'3',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
	
INSERT INTO OBJ_ACTIONS(
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES (
	'master_repack',
	5,
	NULL,
	'Saving',
	NULL,
	NULL,
	'S',
	'Finish',
	'3',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
	
	
INSERT INTO OBJ_ACTIONS(
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES(
	'master_repack',
	6,
	'confirm~normal.gif',
	'Confirming records',
	'pre_confirm',
	'a',
	'F',
	'Confirm',
	'3',
	'2',
	'1',
	'S',
	NULL,
	NULL,
	NULL,
	NULL);
	
	
INSERT INTO OBJ_ACTIONS(
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES (
	'master_repack',
	7,
	NULL,
	'Next',
	NULL,
	NULL,
	'N',
	'Next',
	'1',
	NULL,
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);

	
	INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_master_repack',
	'Header',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Pick Location:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="4"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>quantity</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'U');
	
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_master_repack',
	'Detail',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Carton No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>carton_no</FIELD></FIELDS></MAPPING_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<carton_no>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'S');
	
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_master_repack',
	'Master Unpacking',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>PTCN:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>ptcn</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Master Pack Carton No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>outer_carton_no</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	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 (
	'master_repack',
	'default_data_wiz',
	'1',
	'master_pack_default_data',
	NULL,
	'0',
	TO_DATE('8-05-2012 13:26:14','DD-MM-YYYY HH24:MI:SS'),
	'Chaitali  ',
	'BASE',
	'2',
	'EJB',
	'MasterPackIC',
	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(
	'master_repack',
	'post_save',
	'1',
	'pos_master_pack',
	NULL,
	'0',
	TO_DATE('8-05-2012 13:26:14','DD-MM-YYYY HH24:MI:SS'),
	'chaitali  ',
	'chaitali',
	'2',
	'EJB',
	'MasterPackPos',
	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 (
	'master_repack',
	'pre_validate',
	'1',
	'prv_master_pack',
	NULL,
	'0',
	TO_DATE('8-05-2012 13:26:14','DD-MM-YYYY HH24:MI:SS'),
	'Chaitali  ',
	'BASE',
	'2',
	'EJB',
	'MasterPackIC',
	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 (
	'master_repack',
	'pre_navigate_next',
	'1',
	'prv_nevigate_ejb',
	NULL,
	'0',
	TO_DATE('8-05-2012 13:26:14','DD-MM-YYYY HH24:MI:SS'),
	'Chaitali  ',
	'BASE',
	'2',
	'EJB',
	'MasterPackIC',
	NULL);

	-- changed by sumit on 09/01/13 
	update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1" MAP_DATA_FILTER = "NOTMAPPED" ><SCAN_LABEL>Carton No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>carton_no</FIELD></FIELDS></MAPPING_SCAN></SCAN_INFO>'
	where win_name = 'w_master_pack' and form_no = 3;
	
	update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1" MAP_DATA_FILTER = "MAPPED" ><SCAN_LABEL>Carton No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>carton_no</FIELD></FIELDS></MAPPING_SCAN></SCAN_INFO>'
	where win_name = 'w_master_repack' and form_no = 3;

	--Added by sankara on 11/01/13 for wave_type
	DROP INDEX WAVE_TYPE_UINDEX;
	
	CREATE UNIQUE INDEX WAVE_TYPE_UINDEX ON WAVE_TYPE ( MASTER_PACK_ALLOW, ACTIVE_PICK_ALLOW, STOCK_TO_DOCK_ALLOW, PARCELPACK_ALLOW);

 
COMMIT;

//Changed By Pragyan 18/01/13

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 (
	'ERRGENPOD',
	'Error Generated Porder',
	'Purchase Order not generated ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('8-05-2012 16:36:55','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);
	
	
//Pragyan 21/01/13
update messages set msg_str='Weight/Volume Exceeded', msg_descr='Master Carton Weight/Volume/No. Of Cases is Exceeded'  
where msg_no='VTWGTEXD';

//sumit 22/01/13

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 (
	'VTLESMAXCA',
	'Invalid Max Case',
	'Max Case should not be less than min case.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('8-05-2012 16:36:55','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);

	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 (
	'VTLESMAXWA',
	'Invalid Max Weight',
	'Max weight should not be less than min weight.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('8-05-2012 16:36:55','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	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 (
	'dock_tran',
	'pre_navigate_next',
	'1',
	'prv_default_ejb',
	NULL,
	'0',
	TO_DATE('21-01-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'2',
	'EJB',
	'PalletNoIC',
	NULL);


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 (
	'INVPACKDET',
	'Master pack pending',
	'Master pack task is pending !',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('8-05-2012 16:36:55','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);	
	
	
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 (
	'VMPICKORDU',
	'Invalid pick order ',
	'Selected Pick Order is being processed by another user.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('8-05-2012 16:36:55','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);
	
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 (
	'VTLESMAXCA',
	'Invalid Max Case',
	'Max Case should not be less than min case.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('8-05-2012 16:36:55','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);

	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 (
	'VTLESMAXWA',
	'Invalid Max Weight',
	'Max weight should not be less than min weight.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('8-05-2012 16:36:55','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);
update messages set msg_descr ='The pallet is already transferred'
where msg_no = 'VTPLTTRF';

//Changed By Sumit 23/01/12

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 (
	'INVSHIPCON',
	'Invalid Pallet Number',
	'Ship consignee group are not same of entered pallet numbers. ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('8-05-2012 16:36:55','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);
	
	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 (
	'ALLPTCNNTA',
	'Incomplete Shipment',
	'Please enter all PTCN number''s whose ship consignee group are same on the wave of entered PTCN',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('8-05-2012 16:36:55','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);
	
	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 (
	'DUPPTCNNO',
	'Invalid PTCN',
	'Duplicate PTCN number',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('8-05-2012 16:36:55','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	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 (
	'shipment',
	'pre_save',
	'1',
	'prsr_shipment',
	NULL,
	'0',
	TO_DATE('18-01-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'2',
	'EJB',
	'ShipmentPrs',
	NULL);

	
	INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode,
	descr ,
	arg_type ,
	arg_xfrm,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prsr_shipment',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'C.String',
	NULL,
	TO_DATE('18-01-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'EJB');
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode,
	descr ,
	arg_type ,
	arg_xfrm,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES  (
	'prsr_shipment',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'C.String',
	NULL,
	TO_DATE('18-01-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'ShipmentPrs');
	
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode,
	descr ,
	arg_type ,
	arg_xfrm,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES  (
	'prsr_shipment',
	3,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('18-01-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
	
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode,
	descr ,
	arg_type ,
	arg_xfrm,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES  (
	'prsr_shipment',
	4,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('18-01-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
	
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode,
	descr ,
	arg_type ,
	arg_xfrm,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES  (
	'prsr_shipment',
	5,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('18-01-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
	
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode,
	descr ,
	arg_type ,
	arg_xfrm,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES  (
	'prsr_shipment',
	6,
	'DB_CONN',
	'I',
	NULL,
	'S.Connection',
	NULL,
	TO_DATE('18-01-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);

	
	COMMIT;
	
UPDATE MESSAGES SET MSG_STR = 'Invalid ptcn Number', MSG_DESCR  ='Ship consignee group are not same for entered ptcn numbers.' 
WHERE MSG_NO ='INVSHIPCON';

alter table pack_hdr add pallet_no varchar2(25);

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 (
	'VTPTCNALLX',
	'Invalid PTCN Number',
	'Entered PTCN number is already added on a shipment !',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('8-05-2012 16:36:55','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL);


//sumit 28-01-13

create or replace
function fn_wave_status(SI_WAVE_ID IN CHAR) 
 return CHAR IS STATUS CHAR;
 CNT NUMBER;
  CNT1 NUMBER;
  BEGIN
   BEGIN
    SELECT count(*) INTO CNT FROM WAVE_TASK_DET WHERE WAVE_ID = SI_WAVE_ID;
    SELECT count(*) INTO CNT1 FROM WAVE_TASK_DET WHERE WAVE_ID = SI_WAVE_ID AND WAVE_STATUS = 'V';
    IF (CNT = cnt1 ) THEN
      STATUS := 'Y';
    ELSE
      STATUS := 'N';
    END IF;
  EXCEPTION
  WHEN NO_DATA_FOUND  THEN
   STATUS :='N';
  END;
  RETURN STATUS;
  END;
//Sumit 29-01-13

INSERT INTO SYSTEM_EVENT_SERVICES (
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,
	return_descr ,
	return_xfrm ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'prsr_shipment',
	'pre save',
	'http://localhost:9090/axis/services/ValidatorService',
	'BASE',
	'preSave',
	'String',
	'S',
	NULL,
	NULL,
	TO_DATE('18-01-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE');
//pragyan 29-01-13

update transetup set save_flag=2 where tran_window='w_case_transfer';

//pragyan 30-01-13

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 (
	'LOCNOTEMPT',
	'Location Not Empty',
	'Location Not Empty',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('30-01-2013 12:02:35','DD-MM-YYYY HH24:MI:SS'),
	'Base      ',
	'Base           ',
	NULL,
	NULL);
	
	--Added by Manoj dtd 30/01/2013 to update error message for Expired Stock transfer transaction
INSERT INTO MESSAGES(MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,CHG_DATE,CHG_USER,CHG_TERM) VALUES('INVLOCSTAT','Invalid Location!','Invalid Location! Entered Location is not Applicable for NEXP/EXP Lock Type.','E','Y',SYSDATE,'BASE','BASE');
--Ended by Manoj dtd 30/01/2013 to update error message for Expired Stock transfer transaction

--Added by Manoj dtd 30/01/2013 to remove column from physcandet table and conrrected entry for empty location scanning

ALTER TABLE PHYSCANDET DROP COLUMN ISEMPTY;
update obj_forms set scan_metadata='<SCAN_INFO>   <MAPPING_SCAN ORDER="1">   <SCAN_LABEL>Location Code:</SCAN_LABEL>   <FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS>   </MAPPING_SCAN>   <INPUT_SCAN ORDER="1">   <SCAN_LABEL>Is Empty :</SCAN_LABEL>   <FIELDS SEPARATOR="" DELIMITER=""><FIELD>isempty</FIELD></FIELDS>   </INPUT_SCAN>   <INPUT_SCAN ORDER="2">   <SCAN_LABEL>LPN No :</SCAN_LABEL>   <FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS>   </INPUT_SCAN>   <INPUT_SCAN ORDER="3">   <SCAN_LABEL>Item Code :</SCAN_LABEL>   <FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS>   </INPUT_SCAN>   <INPUT_SCAN ORDER="4">   <SCAN_LABEL>Lot No :</SCAN_LABEL>   <FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS>   </INPUT_SCAN>   <INPUT_SCAN ORDER="5">  <SCAN_LABEL>Case Count:</SCAN_LABEL>  <FIELDS SEPARATOR="" DELIMITER=""><FIELD>phy_input</FIELD></FIELDS>  </INPUT_SCAN><SCAN_CONDITION field="lot_sl">isempty.indexOf("N") != -1</SCAN_CONDITION>  <SCAN_CONDITION field="item_code">isempty.indexOf("N") != -1</SCAN_CONDITION>  <SCAN_CONDITION field="lot_no">isempty.indexOf("N") != -1</SCAN_CONDITION>  <SCAN_CONDITION field="phy_input">isempty.indexOf("N") != -1</SCAN_CONDITION>  </SCAN_INFO>' where win_name='w_empty_loc_scan' and form_no=2;

--Ended by Manoj dtd 30/01/2013 to remove column from physcandet table and conrrected entry for empty location scanning

--Added by Manoj dtd 30/01/2013 to update error message for Schedule location 
INSERT INTO MESSAGES (
        msg_no ,
        msg_str ,
        msg_descr ,
        msg_type ,
        msg_opt ,
         chg_date ,
        chg_user ,
        chg_term 
         )
 VALUES (
        'VMLOC8',
        'Invalid Location Code!',
        'Location Code already exists in Physcandet table.',
        'E',
        'Y',
        SYSDATE,
        'BASE ',
        'BASE '
        );

INSERT INTO MESSAGES (
        msg_no ,
        msg_str ,
        msg_descr ,
        msg_type ,
        msg_opt ,
         chg_date ,
        chg_user ,
        chg_term 
         )
 VALUES (
        'VMLOC7',
        'Invalid Location Code!',
        'Location Code Not available in Reserv Or Case Pick or Deep Store Location.',
        'E',
        'Y',
        SYSDATE,
        'BASE ',
        'BASE '
        );
        
--Ended by Manoj dtd 30/01/2013 to update error message for Schedule location
--Added by Rohan on 30/01/13 for Repanishment cancle.start
ALTER TABLE REPL_ORD_DET ADD CANCEL_MODE CHAR(1);

UPDATE POPHELP
SET SQL_STR ='SELECT REPL_ORDER,LOC_CODE FROM (SELECT  DISTINCT R.REPL_ORDER ,L.LOC_CODE FROM REPL_ORD_DET R,REPL_ORD_HDR H,WAVE_TASK_DET W,LOCATION L ,WAVE_TASK WH WHERE W.WAVE_ID = WH.WAVE_ID AND R.REPL_ORDER = H.REPL_ORDER AND R.REPL_ORDER = W.REF_ID AND W.STATUS = ''N'' AND H.ORDER_TYPE NOT IN (''E'',''Q'',''T'',''I'',''P'') AND CASE WHEN R.CANCEL_MODE IS NULL THEN ''N'' ELSE R.CANCEL_MODE END <> ''Y'' AND FN_VALID_REPL (H.REPL_ORDER) =''Y'' AND R.LOC_CODE = L.LOC_CODE  AND L.INV_STAT = ''?'' AND FN_CHECK_REPL_ORD_USER(H.REPL_ORDER,''?'') = 1)  ORDER BY LOC_CODE'
WHERE FIELD_NAME ='REPL_ORDER' AND MOD_NAME = 'W_REPL_ISS';

UPDATE POPHELP
SET SQL_STR ='SELECT REPL_ORDER,LOC_CODE FROM (SELECT DISTINCT R.REPL_ORDER ,L.LOC_CODE FROM REPL_ORD_DET R,REPL_ORD_HDR H,WAVE_TASK_DET W,LOCATION L ,WAVE_TASK WH WHERE W.WAVE_ID = WH.WAVE_ID AND R.REPL_ORDER = H.REPL_ORDER AND R.REPL_ORDER = W.REF_ID AND W.STATUS = ''N'' AND H.ORDER_TYPE IN (''E'',''Q'',''T'',''I'',''P'') AND CASE WHEN R.CANCEL_MODE IS NULL THEN ''N'' ELSE R.CANCEL_MODE END <> ''Y'' AND FN_VALID_REPL (H.REPL_ORDER) = ''Y'' AND R.LOC_CODE = L.LOC_CODE  AND L.INV_STAT = ''?'' AND FN_CHECK_REPL_ORD_USER(H.REPL_ORDER,''?'') = 1) ORDER BY LOC_CODE'
WHERE FIELD_NAME ='REPL_ORDER' AND MOD_NAME = 'W_ACTIVE_REPL_ISS';
COMMIT;
//Pragyan 30/01/13
alter table distroutedet add ship_type char(1);
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 (
	'NVLTRANCOD',
	'DOCK Location not available',
	'DOCK Location not available',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('30-01-2013 12:02:35','DD-MM-YYYY HH24:MI:SS'),
	'Base      ',
	'Base           ',
	NULL,
	NULL);
	
	-- Changed by sumit on 07/02/13
	ALTER TABLE REPL_ISS_DET ADD LOC_TO_ASSIGNED CHAR(1);
	
	-- Given by Manoj sharma on 09/03/13 issue tracker point 144
	alter table physcan modify TRAN_TYPE default 'M';
    alter table physcandet modify TRAN_TYPE default 'M';
    
    --Changed by manoj sharma on 14/feb/13
    update transetup set save_flag='A' WHERE tran_window='w_phy_scan_verify'; 
	
COMMIT;

--Changed by Rohan on 22-02-12 for Repanishment Cancel.
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 (
	'CANCELREPL',
	'Repanishment Cancel',
	'Repanishment Cancel,Replenishment cannot be done.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base',
	'Base',
	NULL,
	NULL);
	
 -- changed by sumit on 25/02/13 for active cubbing 
 UPDATE OBJ_FORMS SET SCAN_METADATA = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location From:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="4"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>New LPN:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl__new</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>No of Article</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>no_art</FIELD></FIELDS></INPUT_SCAN><SCAN_CONDITION field="lot_sl__new">order_type != "T"</SCAN_CONDITION></SCAN_INFO>'
WHERE WIN_NAME = 'w_active_repl_iss' AND FORM_NO = 3;

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 (
	'NULLNOART',
	'Null Number of article',
	'Number of article should not be null.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base',
	'Base',
	NULL,
	NULL);
	
	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 (
	'ARTNOTANUM',
	'Invalid Number of article',
	'Number of article should be numeric value.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base',
	'Base',
	NULL,
	NULL);
	
	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 (
	'INVNOOFART',
	'Invalid Number of article',
	'Number of article is not correct.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base',
	'Base',
	NULL,
	NULL);
	 
commit;	

--Changed by Pragyan Parcel Picking and LTL to master/parcel coverts

 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 (
	'ATLSTSELMP',
	'Invalid selection',
	'For Master Packing Shipment type should be As per route or Master',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('25-02-2013 18:49:58','DD-MM-YYYY HH24:MI:SS'),
	'base      ',
	'Pragyan        ',
	NULL,
	NULL);
 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 (
	'ATLSTSELPP',
	'Invalid selection',
	'For Parcel Packing Shipment type should be As per route or Parcel',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('25-02-2013 18:49:58','DD-MM-YYYY HH24:MI:SS'),
	'base      ',
	'Pragyan        ',
	NULL,
	NULL);
 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 (
	'ATLSTSENAN',
	'Invalid selection',
	'Only For Maste/Parcel Packing Shipment type should be Master/Parcel ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('25-02-2013 18:49:58','DD-MM-YYYY HH24:MI:SS'),
	'base      ',
	'Pragyan        ',
	NULL,
	NULL);
 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 (
	'ONSELCMP  ',
	'Invalid selection',
	'Both Parcel and Master should not be selected for a shipment',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('25-02-2013 18:49:58','DD-MM-YYYY HH24:MI:SS'),
	'base      ',
	'Pragyan        ',
	NULL,
	NULL);
 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 (
	'INVDPIKLOC',
	'Invalid Direct Pick',
	'Invalid Direct Pick Location',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('25-02-2013 18:49:58','DD-MM-YYYY HH24:MI:SS'),
	'base      ',
	'Pragyan        ',
	NULL,
	NULL);
alter table location add direct_pick char(1);
alter table distroutedet add  ship_type char(1);

-- changes by sumit on 27/02/13 
 UPDATE MESSAGES SET MSG_STR = 'Null number of case. ',MSG_DESCR = 'Number of case should not be null' WHERE MSG_NO = 'NULLNOART';
 UPDATE MESSAGES SET MSG_STR = 'Null number of case.',MSG_DESCR = 'Number of case should be numeric value.' WHERE MSG_NO = 'ARTNOTANUM';
 UPDATE MESSAGES SET MSG_STR = 'Null number of case.',MSG_DESCR = 'Number of case is not correct.' WHERE MSG_NO = 'INVNOOFART';
 
 -- sumit 27/02/13 for stock deallocation
 
  create table dealloc_art
(
tran_id         varchar2(10),
site_code       char(5),
PTCN            char(10),
wave_id         varchar2(12),
confirmed       char(1),
conf_date       date,
chg_date        date,
chg_user        char(10),
chg_term        char(15)
);
ALTER TABLE dealloc_art ADD ( CONSTRAINT PK_A_DEALLOC PRIMARY KEY ( TRAN_ID ));

create table dealloc_art_det
(
tran_id           varchar2(10),
line_no           NUMBER(3,0),
carton_no         varchar2(20), 
pick_order        char(10), 
line_no__pick     NUMBER(3,0),
item_code         char(10),
quantity          NUMBER(14,3),
pick_type         char(1)
);
ALTER TABLE dealloc_art_det ADD ( CONSTRAINT PK_A_DEALLOCDET PRIMARY KEY ( TRAN_ID, LINE_NO ));
 
create or replace
FUNCTION FN_CHECK_DEALLOC_ARTDET(SI_PTCN IN CHAR, SI_CARTON_NO IN CHAR )
  RETURN number is FLAG number ;
  CNT NUMBER;
  --CNT1 NUMBER;
  BEGIN
   BEGIN
    SELECT count(*) INTO CNT FROM DEALLOC_ART DA, DEALLOC_ART_DET DAD WHERE PTCN = SI_PTCN 
    AND DAD.CARTON_NO = SI_CARTON_NO AND DA.TRAN_ID = DAD.TRAN_ID;
    IF (CNT  > 0 ) THEN
      FLAG := 1;
    ELSE
      FLAG :=0;
    END IF;
  EXCEPTION
  WHEN NO_DATA_FOUND  THEN
   FLAG :=2;
  END;
  RETURN FLAG;
  END;
 /
 
 create or replace
FUNCTION FN_IS_CASE_PRESENT(SI_WAVE_ID IN CHAR )
  RETURN number is FLAG number ;
  CNT NUMBER;
  --CNT1 NUMBER;
  BEGIN
   BEGIN
    SELECT count(*) INTO CNT FROM WAVE_TASK_DET WHERE WAVE_ID = SI_WAVE_ID AND REF_TYPE IN ('C','M');
    IF (CNT  > 0 ) THEN
      FLAG := 1;
    ELSE
      FLAG :=0;
    END IF;
  EXCEPTION
  WHEN NO_DATA_FOUND  THEN
   FLAG :=2;
  END;
  RETURN FLAG;
  END;
  
  INSERT INTO ITM2MENU (
	application ,
	level_1 ,
	level_2 ,
	level_3 ,
	level_4 ,
	level_5 ,
	win_name ,
	descr ,
	comments ,
	menu_path ,
	icon_path ,
	close_icon ,
	open_icon ,
	obj_type ,
	chg_date ,
	chg_term ,
	chg_user ,
	mob_deploy )
 VALUES (
	'WMS',
	1,
	45,
	0,
	0,
	0,
	'w_dealloc_art',
	'Pick De-Allocation',
	NULL,
	'WMS.1.45.0.0.0',
	'e12_logo.gif',
	NULL,
	NULL,
	'T',
	NULL,
	'BASE           ',
	'BASE      ',
	NULL);
	
INSERT INTO ITM2MENU (
	application ,
	level_1 ,
	level_2 ,
	level_3 ,
	level_4 ,
	level_5 ,
	win_name ,
	descr ,
	comments ,
	menu_path ,
	icon_path ,
	close_icon ,
	open_icon ,
	obj_type ,
	chg_date ,
	chg_term ,
	chg_user ,
	mob_deploy )
 VALUES (
	'WMS',
	1,
	47,
	0,
	0,
	0,
	'w_dealloc_art_proc',
	'Pick De-Allocation Process',
	NULL,
	'WMS.1.47.0.0.0',
	'e12_logo.gif',
	NULL,
	NULL,
	'P',
	NULL,
	NULL,
	NULL,
	NULL);
	
  INSERT INTO TRANSETUP (
	tran_window ,
	save_flag ,
	val_flag ,
	key_flag ,
	key_string ,
	udf_1 ,
	udf_2 ,
	udf_3 ,
	udf_4 ,
	udf_5 ,
	repeate_add ,
	chg_date ,
	chg_user ,
	chg_term ,
	edi_option ,
	site_acc_col ,
	confirm_col ,
	confirm_val ,
	repeat_add_det ,
	repeatadddet ,
	load_mode ,
	auto_confirm ,
	ledg_post_conf ,
	chg_date_on_conf ,
	tran_id_col ,
	mail_option ,
	confirm_mode ,
	garbage_opt ,
	val_flag_edi ,
	verify_password ,
	cust_acc_col ,
	sales_pers_acc_col ,
	supp_acc_col ,
	item_ser_acc_code ,
	emp_acc_col ,
	item_ser_acc_col ,
	workflow_opt ,
	table_name ,
	application ,
	table_desc ,
	tran_date_col ,
	tran_id__from ,
	tran_id__to ,
	table_name_det1 ,
	table_name_det2 ,
	table_name_det3 ,
	multitire_opt ,
	ref_ser ,
	view_mode ,
	tax_forms ,
	sign_status ,
	user_tran_window ,
	custom_preview_obj ,
	ignoreerrlist_onload ,
	childdata_argopt ,
	edit_tmplt ,
	wrkflw_init ,
	edittax ,
	formal_args ,
	audit_trail_opt ,
	edit_opt ,
	cache_opt ,
	optimize_mode ,
	edit_expr ,
	rate_col ,
	qty_col ,
	edit_expr_inp ,
	rcp_cache_status ,
	print_control ,
	transfer_mode ,
	profile_id__res ,
	tran_compl_msg ,
	period_option ,
	wrkflw_priority ,
	exec_type ,
	disp_meta_data ,
	allow_attach ,
	start_form ,
	isattachment ,
	header_form_no ,
	msg_onsave )
 VALUES (
	'w_dealloc_art',
	'2',
	'2',
	'A',
	'seq10',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'Y',
	TO_DATE('2-01-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	'0',
	'site_code',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'TRAN_ID',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'dealloc_art',
	'WMS',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'DEART',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'M',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

 INSERT INTO OBJ_ACTIONS (
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES (
	'dealloc_art',
	1,
	'add.gif',
	'Adding New',
	'a',
	'a',
	'A',
	'Add',
	'1',
	NULL,
	NULL,
	'S',
	NULL,
	NULL,
	NULL,
	NULL);
	
INSERT INTO OBJ_ACTIONS (
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES (
	'dealloc_art',
	9,
	NULL,
	'Confirmation',
	'pre_confirm',
	'a',
	'R',
	'Confirm',
	'1',
	'2',
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
	
INSERT INTO OBJ_ACTIONS (
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES (
	'dealloc_art_proc',
	7,
	NULL,
	'Action Button for getting data',
	'get_data',
	'a',
	'R',
	'GetData',
	'1',
	'3',
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);
	
INSERT INTO OBJ_ACTIONS (
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES (
	'dealloc_art_proc',
	8,
	NULL,
	'Action Button for processing the data',
	'process',
	'a',
	'R',
	'Process',
	'2',
	'3',
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);

	
	INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_dealloc_art',
	'Carton Deallocation',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
	
	
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES(
	'w_dealloc_art',
	'Carton Deallocation',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
	
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_dealloc_art_proc',
	'Stock De-Allocation',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
	
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES(
	'w_dealloc_art_proc',
	'detail',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

	
	INSERT INTO OBJ_ITEMCHANGE (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
 VALUES (
	'dealloc_art',
	'1  ',
	'itm_default',
	'Y');
	
INSERT INTO OBJ_ITEMCHANGE (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
 VALUES (
	'dealloc_art',
	'1  ',
	'ptcn',
	'Y');
	
INSERT INTO OBJ_ITEMCHANGE (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
 VALUES (
	'dealloc_art',
	'2  ',
	'carton_no',
	'Y');
	
INSERT INTO OBJ_ITEMCHANGE (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
 VALUES (
	'dealloc_art',
	'2  ',
	'itm_default',
	'Y');
	
	INSERT INTO POPHELP  (
	field_name ,
	mod_name ,
	sql_str ,
	dw_object ,
	msg_title ,
	width ,
	height ,
	chg_date ,
	chg_user ,
	chg_term ,
	dist_opt ,
	filter_string ,
	sql_input ,
	default_col ,
	pop_align ,
	query_mode ,
	page_context ,
	pophelp_cols ,
	pophelp_source ,
	multi_opt ,
	help_option )	
VALUES (
	'PTCN',
	'W_DEALLOC_ART',
	'SELECT DISTINCT WTD.PTCN AS PTCN , WTD.WAVE_ID AS WAVE_ID FROM WAVE_TASK WT, WAVE_TASK_DET WTD, DESPATCH D WHERE WT.CANCEL <> ''Y'' AND FN_IS_CASE_PRESENT(WTD.WAVE_ID) = 1 AND WTD.REF_ID = D.DESP_ID AND D.CONFIRMED <> ''Y'' ORDER BY WAVE_ID',
	NULL,
	'PTCN',
	0,
	0,
	TO_DATE('27-02-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'S',
	NULL,
	NULL);
	
INSERT INTO POPHELP  (
	field_name ,
	mod_name ,
	sql_str ,
	dw_object ,
	msg_title ,
	width ,
	height ,
	chg_date ,
	chg_user ,
	chg_term ,
	dist_opt ,
	filter_string ,
	sql_input ,
	default_col ,
	pop_align ,
	query_mode ,
	page_context ,
	pophelp_cols ,
	pophelp_source ,
	multi_opt ,
	help_option )	
VALUES (
	'CARTON_NO',
	'W_DEALLOC_ART',
	'SELECT CARTON_NO, PTCN FROM CARTON_MASTER WHERE PTCN = ''?'' AND CARTON_NO <> ''R'' AND CARTON_TYPE = ''C''',
	NULL,
	'PTCN',
	0,
	0,
	TO_DATE('27-02-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	'0',
	NULL,
	':0.ptcn',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'S',
	NULL,
	NULL);
	
INSERT INTO POPHELP  (
	field_name ,
	mod_name ,
	sql_str ,
	dw_object ,
	msg_title ,
	width ,
	height ,
	chg_date ,
	chg_user ,
	chg_term ,
	dist_opt ,
	filter_string ,
	sql_input ,
	default_col ,
	pop_align ,
	query_mode ,
	page_context ,
	pophelp_cols ,
	pophelp_source ,
	multi_opt ,
	help_option )	
VALUES (
	'PTCN',
	'W_DEALLOC_ART_PROC',
	'SELECT DISTINCT WTD.PTCN AS PTCN , WTD.WAVE_ID AS WAVE_ID FROM WAVE_TASK WT, WAVE_TASK_DET WTD, DESPATCH D WHERE WT.CANCEL <> ''Y'' AND FN_IS_CASE_PRESENT(WTD.WAVE_ID) = 1 AND WTD.REF_ID = D.DESP_ID AND D.CONFIRMED <> ''Y'' ORDER BY WAVE_ID',
	NULL,
	'PTCN',
	0,
	0,
	TO_DATE('27-02-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'S',
	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 (
	'dealloc_art',
	'post_item_change',
	'1',
	'poic_default_ejb',
	NULL,
	'0',
	TO_DATE('2-01-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'2',
	'EJB',
	'DeallocArtIC',
	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 (
	'dealloc_art',
	'pre_confirm',
	'1',
	'prcm_default_2',
	NULL,
	'0',
	TO_DATE('2-01-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'2',
	'EJB',
	'DeallocArtConf',
	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 (
	'dealloc_art',
	'pre_validate',
	'1',
	'prv_default_ejb',
	NULL,
	'0',
	TO_DATE('2-01-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'2',
	'EJB',
	'DeallocArtIC',
	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 (
	'dealloc_art_proc',
	'get_data',
	'1',
	'gd_default_2',
	NULL,
	'0',
	TO_DATE('10-01-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'2',
	'EJB',
	'DeallocArtPrc',
	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 (
	'dealloc_art_proc',
	'pre_validate',
	'1',
	'prv_default_ejb',
	NULL,
	'0',
	TO_DATE('12-01-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'2',
	'EJB',
	'DeallocArtIC',
	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 (
	'dealloc_art_proc',
	'process',
	'1',
	'prcs_default_2',
	NULL,
	'0',
	TO_DATE('11-01-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'2',
	'EJB',
	'DeallocArtPrc',
	NULL);

	----
 
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 (
        'INVPTCNCAP',
        'Invalid PTCN !!',
        'Entered PTCN No. does not have case pick activity !!',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'BASE           ',
        NULL,
        NULL);
		
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 (
        'INVPTCNCAN',
        'Invalid PTCN !!',
        'Entered PTCN No. is in hold or canceled !!',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'BASE           ',
        NULL,
        NULL);
		
	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 (
        'INVCARALEX',
        'Invalid PTCN !!',
        'Entered PTCN No. is already added !!',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'BASE           ',
        NULL,
        NULL);
	
	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 (
        'INVCARTON1',
        'Invalid Carton Number !!',
        'Entered carton number does not exist in carton master !!',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'BASE           ',
        NULL,
        NULL);		
	
		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 (
        'INVCARTON2',
        'Invalid Carton Number !!',
        'Entered carton number is already rejected !!',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'BASE           ',
        NULL,
        NULL);
		
		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 (
        'INVCARTON1',
        'Invalid Carton Number !!',
        'Entered carton number does not exist in carton master !!',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'BASE           ',
        NULL,
        NULL);
		
		
	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 (
        'INVPTCNCAR',
        'Invalid Carton Number !!',
        'Entered carton number does not match with PTCN entered in header !!',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'BASE           ',
        NULL,
        NULL);
		
	
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 (
        'INVPTCNDSP',
        'Invalid PTCN number !!',
        'Dispatch is confirmed of this PTCN number !!',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'BASE           ',
        NULL,
        NULL);
		
		
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 (
        'INVPTCASAD',
        'Invalid PTCN number !!',
        'All carton number of entered PTCN are already added or rejected !!',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'BASE           ',
        NULL,
        NULL);
		
	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 (
        'INVPTCNNO',
        'Invalid PTCN !!',
        'Please insert valid PTCN',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'BASE           ',
        NULL,
        NULL);
	
	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 (
        'DUPCARTONN',
        'Invalid PTCN number !!',
        'Duplicate PTCN',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'BASE           ',
        NULL,
        NULL);
		
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 (
        'INVCARTON3',
        'Invalid PTCN number !!',
        'Entered PTCN No. is in hold or canceled !!',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'BASE           ',
        NULL,
        NULL);
        
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 (
        'CARTALLCOF',
        'Invalid carton number !!',
        'Carton already canceled !!',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'BASE           ',
        NULL,
        NULL);
		
INSERT INTO OBJ_ITEMCHANGE (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
 VALUES (
	'dealloc_art',
	'1',
	'itm_defaultedit',
	'Y');
	
	INSERT INTO OBJ_ACTIONS (
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES (
	'dealloc_art',
	2,
	'edit.gif',
	'Editing Existing Record',
	'a',
	'a',
	'E',
	'Edit',
	'1',
	NULL,
	NULL,
	'S',
	NULL,
	NULL,
	NULL,
	NULL);
	
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 (
        'PICKDEALOC',
        'Invalid pick order !!',
        'Pick order deallocated !!',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'BASE           ',
        NULL,
        NULL);
        
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 (
        'NVLPLTMND',
        'Blank Pallet No',
        'Pallet No is Mandatory In case of Direct Pick Location Selected in Wave',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'Pragyan',
        NULL,
        NULL);
	
        --Changed by sumit on 01-mar-13 updated pophelp sql
UPDATE POPHELP SET SQL_STR = 'SELECT DISTINCT WTD.PTCN AS PTCN , WTD.WAVE_ID AS WAVE_ID FROM WAVE_TASK WT, WAVE_TASK_DET WTD, DESPATCH D WHERE WT.CANCEL <> ''Y'' AND FN_IS_CASE_PRESENT(WTD.WAVE_ID) = 1 AND WT.CANCEL <> ''Y'' AND WTD.REF_ID = D.DESP_ID AND D.CONFIRMED <> ''Y'' ORDER BY WAVE_ID '
WHERE FIELD_NAME = 'PTCN' AND MOD_NAME = 'W_DEALLOC_ART';

UPDATE POPHELP SET SQL_STR = 'SELECT DISTINCT WTD.PTCN AS PTCN , WTD.WAVE_ID AS WAVE_ID FROM WAVE_TASK WT, WAVE_TASK_DET WTD, DESPATCH D WHERE WT.CANCEL <> ''Y'' AND FN_IS_CASE_PRESENT(WTD.WAVE_ID) = 1 AND WT.CANCEL <> ''Y'' AND WTD.REF_ID = D.DESP_ID AND D.CONFIRMED <> ''Y'' ORDER BY WAVE_ID '
WHERE FIELD_NAME = 'PTCN' AND MOD_NAME = 'W_DEALLOC_ART_PROC';


UPDATE POPHELP SET SQL_STR = 'SELECT CM.CARTON_NO, CM.PTCN, POD.ITEM_CODE, CM.PALLET_NO FROM CARTON_MASTER CM, PICK_ORD_DET POD WHERE CM.PTCN = ''?'' AND CM.PICK_ORDER = POD.PICK_ORDER AND CM.CARTON_NO <> ''R'' AND CM.CARTON_TYPE = ''C'' ORDER BY CM.CARTON_NO'
WHERE FIELD_NAME = 'CARTON_NO' AND MOD_NAME = 'W_DEALLOC_ART';
	

-- Changed by sumit on 07/03/13 
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 (
        'INVPALLET',
        'Invalid pallet number',
        'Scanned input is not a valid pallet number.',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE',
        'BASE',
        NULL,
        NULL);
		
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 (
        'NULLPALLET',
        'Null pallet number',
        'Please scan pallet number',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE',
        'BASE',
        NULL,
        NULL);
        
--Pragyan 13/03/13
delete from messages where msg_no = 'VQUANTI2';
delete from messages where msg_no = 'VQUANTI';


INSERT INTO messages VALUES (
        'VQUANTI   ',
        'Invalid Quantity',
        'Entered quantity / cases does not match with the pickorder 
quantity',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('19-06-2012 09:20:19','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'BASE           ',
        NULL,
        NULL);
        
--- Changed By Pragyan 19/03/13

alter table pick_ord_det add carton_no char(20);
alter table pick_ord_det add pack_code char(5);
alter table pick_iss_det modify carton_no varchar2(20);
alter table pick_iss_det add pack_code char(5);


DROP TABLE dealloc_art;

CREATE TABLE dealloc_art
(
TRAN_ID                                 VARCHAR2(10),
SITE_CODE                               CHAR(5),         
CONFIRMED                               CHAR(1),
CONF_DATE                               DATE,                       
CHG_DATE                                DATE,                                
CHG_USER                                CHAR(10),                           
CHG_TERM                                CHAR(15)   
);

ALTER TABLE DEALLOC_ART ADD ( CONSTRAINT PK_A_DEALLOC PRIMARY KEY ( TRAN_ID )) ;

DROP TABLE dealloc_art_det;
Create table dealloc_art_det
(
TRAN_ID                                 VARCHAR2(10),                      
LINE_NO                                 NUMBER(3), 
SALE_ORDER                              CHAR(10),                            
LINE_NO__SORD                           CHAR(3),   
WAVE_ID                                 VARCHAR2(12),                         
PTCN                                    CHAR(10),
CARTON_NO                               VARCHAR2(20),   
ITEM_CODE                               CHAR(10),  
LOC_CODE                                CHAR(8),            
LOT_NO                                  CHAR(15),                                                                 
LOT_SL                                  CHAR(15), 
QUANTITY                                NUMBER(14,3) ,               
PICK_TYPE                               CHAR(1),
PICK_ORDER                              CHAR(10),                   
LINE_NO__PICK                           NUMBER(3)
);
ALTER TABLE DEALLOC_ART_DET ADD ( CONSTRAINT PK_A_DEALLOCDET PRIMARY KEY ( TRAN_ID, LINE_NO )) ;


alter table repl_ord_det add dealloc_qty  NUMBER(14,3);
alter table repl_iss_det add dealloc_qty  NUMBER(14,3);
alter table pick_ord_det add dealloc_qty  NUMBER(14,3);
alter table pick_iss_det add dealloc_qty  NUMBER(14,3);

INSERT INTO obj_itemchange (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
 VALUES (
	'dealloc_art_proc',
	'1  ',
	'itm_default',
	'Y');
	
	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 (
	'dealloc_art_proc',
	'post_item_change',
	'1',
	'poic_default_ejb',
	NULL,
	'0',
	TO_DATE('11-01-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'2',
	'EJB',
	'DeallocArtIC',
	NULL);

	alter table pack_det add status char(1) default 'P';

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 (
        'INVDEALLQ1',
        'Invalid quantity',
        'Quantity can not be zero or less than zero',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE',
        'BASE',
        NULL,
        NULL);
		
		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 (
        'INVDEALLQ2',
        'Invalid quantity',
        'Quantity can not be more than real quantity',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE',
        'BASE',
        NULL,
        NULL);
		
		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 (
        'INVREFIDDE',
        'Deallocation not allowed',
        'Scanning is in progress, please scan first then deallocate.',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE',
        'BASE',
        NULL,
        NULL);
		

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 (
        'INVDEALLQ3',
        'Invalid quantity',
        'Quantity can not be altered for full CASES',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE',
        'BASE',
        NULL,
        NULL);
		
delete  from messages where msg_no in ('ATLSTSELMP','ATLSTSELPP','ATLSTSENAN','ONSELCMP','INVDPIKLOC');
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 (
        'NVLPLTMND',
        'Blank Pallet No',
        'Pallet No is Mandatory In case of Direct Pick Location Selected in Wave',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'Pragyan',
        NULL,
        NULL);
        
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 (
        'NVLTRANCOD',
        'DOCK Location not available',
        'DOCK Location not available',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'Pragyan',
        NULL,
        NULL);
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 (
	'ATLSTSELMP',
	'Invalid selection',
	'For Master Pack , Shipment type should be As per Routing or Master Pack',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('25-02-2013 18:49:58','DD-MM-YYYY HH24:MI:SS'),
	'base      ',
	'Pragyan        ',
	NULL,
	NULL);
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 (
	'ATLSTSELPP',
	'Invalid selection',
	'For Parcel Pack , Shipment type should be As per Routing or Parcel Pack',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('25-02-2013 18:49:58','DD-MM-YYYY HH24:MI:SS'),
	'base      ',
	'Pragyan        ',
	NULL,
	NULL);
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 (
	'ATLSTSENAN',
	'Invalid selection',
	'Only For Master/Parcel Pack , Shipment Type should be Master/Parcel',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('25-02-2013 18:49:58','DD-MM-YYYY HH24:MI:SS'),
	'base      ',
	'Pragyan        ',
	NULL,
	NULL);
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(
	'INVDPIKLOC',
	'Invalid Direct Pick',
	'Invalid Direct Pick Location',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('25-02-2013 18:49:58','DD-MM-YYYY HH24:MI:SS'),
	'base      ',
	'Pragyan        ',
	NULL,
	NULL);
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 (
	'ONSELCMP  ',
	'Invalid selection',
	'Both Master Allow and Parcel Allow should not be selected for the same wave',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	TO_DATE('25-02-2013 18:49:58','DD-MM-YYYY HH24:MI:SS'),
	'base      ',
	'Pragyan        ',
	NULL,
	NULL);

	--Changed by sumit on 20/03/13 for item changed
	
	INSERT INTO obj_itemchange (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
 VALUES (
	'dealloc_art_proc',
	'1  ',
	'sale_order__to',
	'Y');
	
	INSERT INTO obj_itemchange (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
 VALUES (
	'dealloc_art_proc',
	'1  ',
	'sale_order__fr',
	'Y');
 
	-- Changed by sumit on 21/03/13 for stock to dock messages
	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 (
        'INVDEALLQ4',
        'Invalid quantity',
        'Quantity can not be altered for full CASES',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE',
        'BASE',
        NULL,
        NULL);
        
        -- Changed by pragyan sir 22/03/13
UPDATE SYSTEM_SERVICE_ARGS SET ARG_VALUE = 'StockTransferPos' WHERE LINE_NO = 2 AND SERVICE_CODE ='posr_stock_transfer_2';

update system_events set service_code='posr_stock_transfer_wiz_2' 
where service_code='posr_stock_transfer_2' and obj_name='stock_transfer_wiz';
commit;


INSERT INTO system_service_args VALUES (
	'posr_stock_transfer_wiz_2',
	1,
	'COMPONENT_TYPE',
	'I',
	'Component Type',
	'C.String',
	NULL,
	TO_DATE('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'AVIPRASH  ',
	'BASE216        ',
	'EJB');
INSERT INTO system_service_args VALUES (
	'posr_stock_transfer_wiz_2',
	2,
	'COMPONENT_NAME',
	'I',
	'Component Name',
	'C.String',
	NULL,
	TO_DATE('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'AVIPRASH  ',
	'BASE216        ',
	'StockTransferCalPos');
INSERT INTO system_service_args VALUES (
	'posr_stock_transfer_wiz_2',
	3,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'AVIPRASH  ',
	'BASE216        ',
	NULL);
INSERT INTO system_service_args VALUES (
	'posr_stock_transfer_wiz_2',
	4,
	'FOCUSED_ROW_NO',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'AVIPRASH  ',
	'BASE216        ',
	NULL);
INSERT INTO system_service_args VALUES (
	'posr_stock_transfer_wiz_2',
	5,
	'OBJ_CONTEXT',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'AVIPRASH  ',
	'BASE216        ',
	NULL);
INSERT INTO system_service_args VALUES (
	'posr_stock_transfer_wiz_2',
	6,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'AVIPRASH  ',
	'BASE216        ',
	NULL);
INSERT INTO system_service_args VALUES (
	'posr_stock_transfer_wiz_2',
	7,
	'XTRA_PARAMS',
	'I',
	'Extra Arguments',
	'S',
	NULL,
	TO_DATE('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'AVIPRASH  ',
	'BASE216        ',
	NULL);
INSERT INTO system_service_args VALUES (
	'posr_stock_transfer_wiz_2',
	8,
	'DB_CONN',
	'I',
	NULL,
	'S.Connection',
	NULL,
	TO_DATE('4-12-2007 12:12:00','DD-MM-YYYY HH24:MI:SS'),
	'AVIPRASH  ',
	'BASE216        ',
	NULL);
	
	INSERT INTO SYSTEM_EVENT_SERVICES(
	service_code ,
	service_descr  ,
	service_uri  ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,
	return_descr  ,
	return_xfrm ,
	chg_date  ,
	chg_user  ,
	chg_term )
 VALUES (
	'posr_stock_transfer_wiz_2',
	'Execution Transaction for each Record',
	'http://localhost/axis/services/ValidatorService',
	'Base Information',
	'postSaveRec',
	'String',
	'S',
	NULL,
	NULL,
	TO_DATE('21-03-2007 14:03:14','DD-MM-YYYY HH24:MI:SS'),
	'AVIPRASH  ',
	'BASE216');

	-- added by sumit on 22/03/13 
	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 (
        'INVDEALLQ5',
        'Invalid location',
        'Quantity can not be deallocated from PND location.',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE',
        'BASE',
        NULL,
        NULL);

create or replace
function fn_wave_status(SI_WAVE_ID IN CHAR)
 return CHAR IS STATUS CHAR;
 CNT NUMBER;
  CNT1 NUMBER;
  BEGIN
   BEGIN
    SELECT count(*) INTO CNT FROM WAVE_TASK_DET WHERE WAVE_ID = SI_WAVE_ID;
    SELECT count(*) INTO CNT1 FROM WAVE_TASK_DET WHERE WAVE_ID = SI_WAVE_ID AND STATUS = 'Y';
    IF (CNT = cnt1 ) THEN
      STATUS := 'Y';
    ELSE
      STATUS := 'N';
    END IF;
  EXCEPTION
  WHEN NO_DATA_FOUND  THEN
   STATUS :='N';
  END;
  RETURN STATUS;
  END;
  
  
  -----------------changed by sankara 26/03/13  WM2lSUN005 Start ---
  

DELETE FROM OBJ_FORMS WHERE WIN_NAME IN
('w_phy_item_scan',
'w_repl_iss',
'w_dock_tran',
'w_checksheet',
'w_active_repl_iss',
'w_case_transfer',
'w_expired_stock_transfer',
'w_phy_scan_verify',
'w_porcp_wiz',
'w_active_pick',
'w_stock_transfer_grl',
'w_master_repack',
'w_salesreturn_wiz',
'w_pack_wiz',
'w_stock_transfer_wiz',
'w_master_pick',
'w_pelletized_carton',
'w_case_pick',
'w_master_pack',
'w_empty_loc_scan',
'w_palletmerge',
'w_phy_item_mscan');

INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_active_pick',
	'Active Picking(AP)',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Pallet Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Pick Task ID:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pick_order</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_active_pick',
	'AP-Task',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
VALUES (
	'w_active_pick',
	'AP-Inventory Detail',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Pick Location:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="6" end="15" >item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>Lot Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="13" end="22" >lot_no</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="4"><SCAN_LABEL>LPN Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>quantity</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<loc_code>, <item_code>, <lot_no>, <lot_sl>, <quantity> ',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'U');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_active_repl_iss',
	'ReplenishmentTask-RT',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Replenishment Task ID:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>repl_order</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_active_repl_iss',
	'RT-Order',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_active_repl_iss',
	'RT-Inventory',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location From:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="6" end="15" >item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="4"><SCAN_LABEL>Lot Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="13" end="22" >lot_no</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>New LPN:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl__new</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>No of Cases</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>no_art</FIELD></FIELDS></INPUT_SCAN><SCAN_CONDITION field="lot_sl__new">order_type != "T"</SCAN_CONDITION></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<loc_code>, <item_code>, <lot_no>, <lot_sl>, <no_art> <unit> = <loc_code__to> <lot_sl__new>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_active_repl_iss',
	'AP-Locate',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'4',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>LPN:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl__new</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>To  Location :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<lot_sl__new>, <loc_code__sys>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_case_pick',
	'Case Pick(CP)',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Pallet Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Pick Task ID:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pick_order</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_case_pick',
	'CP-Order',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
VALUES (
	'w_case_pick',
	'CP-Inventory',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Pick Location:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="6" end="15" >item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>Lot Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="13" end="22" >lot_no</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="4"><SCAN_LABEL>LPN Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Number of Cases:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>no_art</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<loc_code>, <item_descr>(<item_code>),<lot_no>, <lot_sl>, <no_art>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'U');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_case_pick',
	'CP-Locate',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'4',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Dock/Stage Location :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'<loc_code__to>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_case_transfer',
	'Case Transfer(CT)',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Pallet Number From :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no__fr</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_case_transfer',
	'CT-Cases',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Carton Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0"  start="3" end="20" >carton_no</FIELD></FIELDS></MAPPING_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<carton_no>(<item_code>,<lot_no>,<lot_sl>)',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_case_transfer',
	'CT-Pallets',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Pallet Number To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_checksheet',
	'Shipment Loading(SL)',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Shipment ID:</SCAN_LABEL><FIELDS SEPARATOR=""  DELIMITER=""><FIELD>shipment_id</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Printer :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>printer_name</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_checksheet',
	'SL-Shipment Content',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Pallet/Carton Number :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no</FIELD></FIELDS></MAPPING_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img  <pallet_no>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'U');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_dock_tran',
	'DT-Pallet',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Pallet Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<pallate_no>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_dock_tran',
	'DT-Transfer Location',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Destination Location:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<loc_code__to>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_empty_loc_scan',
	'Empty Loc. Verify',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Task Type:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>inv_stat</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	NULL);
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_empty_loc_scan',
	'ELV-Detail',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO> <MAPPING_SCAN ORDER="1"> <SCAN_LABEL>Location Code:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""> <FIELD>loc_code</FIELD> </FIELDS> </MAPPING_SCAN> <INPUT_SCAN ORDER="1"> <SCAN_LABEL>Is Empty :</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""> <FIELD>isempty</FIELD> </FIELDS> </INPUT_SCAN> <INPUT_SCAN ORDER="2"> <SCAN_LABEL>LPN Number :</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""> <FIELD>lot_sl</FIELD> </FIELDS> </INPUT_SCAN> <INPUT_SCAN ORDER="3"> <SCAN_LABEL>Item Code :</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""> <FIELD ORDER="0" start="6" end="15" >item_code</FIELD> </FIELDS> </INPUT_SCAN> <INPUT_SCAN ORDER="4"> <SCAN_LABEL>Lot Number :</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""> <FIELD ORDER="0" start="13" end="22" >lot_no</FIELD> </FIELDS> </INPUT_SCAN> <INPUT_SCAN ORDER="5"> <SCAN_LABEL>Case Count:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""> <FIELD>phy_input</FIELD> </FIELDS> </INPUT_SCAN> <SCAN_CONDITION field="lot_sl">isempty.indexOf("N") != -1</SCAN_CONDITION> <SCAN_CONDITION field="item_code">isempty.indexOf("N") != -1</SCAN_CONDITION> <SCAN_CONDITION field="lot_no">isempty.indexOf("N") != -1</SCAN_CONDITION> <SCAN_CONDITION field="phy_input">isempty.indexOf("N") != -1</SCAN_CONDITION> </SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<loc_code>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'U');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_expired_stock_transfer',
	'Sh/Expr Transfer-SET',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Lock Type:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lock_type</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	NULL);
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_expired_stock_transfer',
	'SET-Location Status',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Task Type:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>task_code</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_expired_stock_transfer',
	'SET-Inventory Detail',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__fr</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl__fr</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<loc_code__fr>,<item_descr>(<item_code>),<lot_no__fr>,<lot_sl__fr>,<hold_qty>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_master_pack',
	'Master Packing(MP)',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>PTCN:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>ptcn</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Outer Carton No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0"  start="3" end="20" >outer_carton_no</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_master_pack',
	'MP-Task',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_master_pack',
	'MP-Contents',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1" MAP_DATA_FILTER = "NOTMAPPED" ><SCAN_LABEL>Carton Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0"  start="3" end="20" >carton_no</FIELD></FIELDS></MAPPING_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<carton_no>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_master_pick',
	'Master Picking Task',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Pick Task ID:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pick_order</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_master_pick',
	'Header',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_master_pick',
	'Detail',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Pick Location:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>LPN No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Number of Cases:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>no_art</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Case Label:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>case_label</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<item_descr>(<item_code>), <loc_code>, <lot_no>, <lot_sl>, <quantity> <unit>= <case_label>, <carton_no>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_master_repack',
	'MasterPack Reprocess',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>PTCN:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>ptcn</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Master Pack Carton No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0"  start="3" end="20" >outer_carton_no</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	NULL);
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_master_repack',
	'MPR-Task',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Pick Location:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>Lot Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="4"><SCAN_LABEL>LPN Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>quantity</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'U');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_master_repack',
	'MPR-Contents',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1" MAP_DATA_FILTER = "MAPPED" ><SCAN_LABEL>Carton Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0"  start="3" end="20" >carton_no</FIELD></FIELDS></MAPPING_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<carton_no>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'S');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_pack_wiz',
	'Task ID',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Pack Task ID:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>tran_id</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_pack_wiz',
	'Header',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_pack_wiz',
	'Detail',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><SCAN TYPE="MAPPING" ORDER="1" SEPARATOR="D"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>item_code</FIELD></FIELDS></SCAN><SCAN TYPE="MAPPING" ORDER="2"><SCAN_LABEL>Lot No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_no</FIELD></FIELDS></SCAN><SCAN TYPE="INPUT" ORDER="1"><SCAN_LABEL>Outer Carton No:</SCAN_LABEL><FIELDS>outer_carton_no</FIELDS></SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'<item_descr>(<item_code>) , <lot_no> , <lot_sl> , <quantity> <unit> = <outer_carton_no>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_palletmerge',
	'Pallet Merging(PM)',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Pallet Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_palletmerge',
	'PM-Merge With',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>New Pallet Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no__new</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_pelletized_carton',
	'Palatalized Carton',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Carton Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0"  start="3" end="20" >pallet_no</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	NULL);
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_pelletized_carton',
	'PC- Detail',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>New Pallet Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>pallet_no__new</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	NULL);
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_phy_item_mscan',
	'Phy. Verification-PV',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	NULL);
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_phy_item_mscan',
	'PV-Verify Location',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Is Empty:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>isempty</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	NULL);
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_phy_item_mscan',
	'PV-Inventory Detail',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"> <SCAN_LABEL>LPN Number:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="2"> <SCAN_LABEL>Item Code:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="6" end="15" >item_code</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="3"> <SCAN_LABEL>Lot Number:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="13" end="22" >lot_no</FIELD></FIELDS> </MAPPING_SCAN> <INPUT_SCAN ORDER="1"> <SCAN_LABEL>Case Count:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>phy_input</FIELD></FIELDS> </INPUT_SCAN> <SCAN_CONDITION field="loc_code">parseInt(quantity) != 0</SCAN_CONDITION></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<descr>(<item_code>),<loc_code>,<lot_no>,<lot_sl>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	NULL);
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_phy_item_scan',
	'Physical Count(PC)',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Task Type:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>inv_stat</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'U');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_phy_item_scan',
	'PC-Inventory Detail',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1" MAP_DATA_FILTER = "NOTMAPPED"> <SCAN_LABEL>Location Code:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="2" MAP_DATA_FILTER = "NOTMAPPED"> <SCAN_LABEL>LPN Number:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="3" MAP_DATA_FILTER = "NOTMAPPED"> <SCAN_LABEL>Item Code:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="6" end="15" >item_code</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="4" MAP_DATA_FILTER = "NOTMAPPED"> <SCAN_LABEL>Lot Number:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="13" end="22">lot_no</FIELD></FIELDS> </MAPPING_SCAN> <INPUT_SCAN ORDER="1"> <SCAN_LABEL>Case Count:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>phy_input</FIELD></FIELDS> </INPUT_SCAN> </SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<loc_code>,<descr>(<item_code>),<lot_no>,<lot_sl>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'U');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_phy_scan_verify',
	'Phy. Count Reverify',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	NULL);
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_phy_scan_verify',
	'PCR-Inventory',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"> <SCAN_LABEL>LOCATION:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS> </MAPPING_SCAN><MAPPING_SCAN ORDER="2"> <SCAN_LABEL>LPN Number:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="3"> <SCAN_LABEL>Item Code:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="6" end="15" >item_code</FIELD></FIELDS> </MAPPING_SCAN> <MAPPING_SCAN ORDER="4"> <SCAN_LABEL>Lot Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="13" end="22" >lot_no</FIELD></FIELDS> </MAPPING_SCAN> <INPUT_SCAN ORDER="1"> <SCAN_LABEL>Case Count:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>phy_input</FIELD></FIELDS> </INPUT_SCAN><INPUT_SCAN ORDER="2"> <SCAN_LABEL>Re-verify (Y/N)?:</SCAN_LABEL> <FIELDS SEPARATOR="" DELIMITER=""><FIELD>reverify</FIELD></FIELDS> </INPUT_SCAN><SCAN_CONDITION field="reverify">parseInt(phy_input) != parseInt(no_art)</SCAN_CONDITION></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<loc_code>,<descr>(<item_code>),<lot_no>,<lot_sl>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	NULL);
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_porcp_wiz',
	'Purchase Receipt-ASN',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>ASN Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>asn_no</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Location Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_porcp_wiz',
	'PRA-ASN',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_porcp_wiz',
	'PRA-Inventory Detail',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="6" end="15" >item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="13" end="22" >lot_no</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>LPN Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Number of Cases:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD  ORDER="0" mandatory = "N">no_art</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="3"><SCAN_LABEL>Partial Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>part_qty</FIELD></FIELDS></INPUT_SCAN><SCAN_CONDITION field="part_qty">no_art == "null" || no_art == "0" || no_art == ""</SCAN_CONDITION></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<item_descr>(<item_code>) , <lot_no> , <unit> = <lot_sl> , <loc_code>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'U');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_repl_iss',
	'ReplenishmentTask-RT',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Replenishment Task ID:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>repl_order</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_repl_iss',
	'RT-Order',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_repl_iss',
	'RT-Inventory',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location From:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location Code To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<loc_code>,<item_code>, <lot_no>, <lot_sl>, <quantity> <unit> = <loc_code__to>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_salesreturn_wiz',
	'Sales Return Form',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Authorization No:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>salesreturnform</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'N');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
VALUES (
	'w_salesreturn_wiz',
	'SRM-Header',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	NULL);
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_salesreturn_wiz',
	'SRM-Inventory Detail',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	'T',
	NULL,
	NULL,
	'<SCAN_INFO><MAPPING_SCAN ORDER="1" MAP_DATA_FILTER = "NOTMAPPED"><SCAN_LABEL>Item:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="6" end="15" >item_code</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>Lot No</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="13" end="22" >lot_no</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2">   <SCAN_LABEL>LPN NO:</SCAN_LABEL>  <FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="3"><SCAN_LABEL>Number of Cases:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD  ORDER="0" mandatory ="N">no_art</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="4"><SCAN_LABEL>Partial Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>quantity</FIELD></FIELDS></INPUT_SCAN><SCAN_CONDITION field="quantity">no_art == "null" || no_art == "0" || no_art == ""</SCAN_CONDITION></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'checkedImage@img<item_code>,<loc_code>,<lot_no>,<lot_sl>',
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'N');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_stock_transfer_grl',
	'Putaway(PA)',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_stock_transfer_grl',
	'PA-LPN',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>LPN Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lpn_no</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_stock_transfer_grl',
	'PA-Location',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location Code To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>New LPN Number :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl__to</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="3"><SCAN_LABEL>Quantity :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>quantity</FIELD></FIELDS></INPUT_SCAN><SCAN_CONDITION field="lot_sl__to">ispartial.indexOf("Y") != -1</SCAN_CONDITION><SCAN_CONDITION field="quantity">ispartial.indexOf("Y") != -1</SCAN_CONDITION></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_stock_transfer_wiz',
	'Stock Transfer(ST)',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
VALUES (
	'w_stock_transfer_wiz',
	'ST-Inventory',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>Location :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>LPN Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lpn_no</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_stock_transfer_wiz',
	'ST-Inventory Detail',
	'PRAGYAN',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'3',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>LPN Number To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl__to</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Number of Cases:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" mandatory = "N">no_art</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="3"><SCAN_LABEL>Active Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>quantity</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="4"><SCAN_LABEL>Location Code To:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code__to</FIELD></FIELDS></INPUT_SCAN><SCAN_CONDITION field="quantity">no_art == "null" || no_art == "0" || no_art == ""</SCAN_CONDITION></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'E',
	NULL,
	NULL,
	'A');
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_near_expiry_prc',
	'Near Expiry Process',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
UPDATE ITM2MENU SET DESCR='Empty Location Verification' WHERE WIN_NAME='w_empty_loc_scan';
UPDATE ITM2MENU SET DESCR='Shipment Loading(SL)' WHERE WIN_NAME='w_checksheet';
UPDATE ITM2MENU SET DESCR='Master Pack-Reprocess(MPR)' WHERE WIN_NAME='w_master_repack';
UPDATE ITM2MENU SET DESCR='Physical Count-Re-Verification' WHERE WIN_NAME='w_phy_scan_verify';
UPDATE ITM2MENU SET DESCR='Physical Count(PC)' WHERE WIN_NAME='w_phy_item_scan';
UPDATE ITM2MENU SET DESCR='Purchase Receipt From ASN' WHERE WIN_NAME='w_porcp_wiz';
UPDATE ITM2MENU SET DESCR='Sales Return From MRA' WHERE WIN_NAME='w_salesreturn_wiz';
COMMIT;

  -----------------changed by sankara 26/03/13  WM2lSUN005 End ---  
  
  ---changed By Pragyan 26/03/13 WM2lSUN015----
  
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 (
'INVCURITEM',
'Non hazardous item not allowed',
'Non hazardous items not allowed in this master carton',
'E',
'E',
NULL,
NULL,
NULL,
TO_DATE('13-02-2008 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'RAKESH    ',
'RAKESH         ',
NULL,
NULL);
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 (
'INVHAZITEM',
'hazardous item not allowed',
'Hazardous items not allowed in this master carton',
'E',
'E',
NULL,
NULL,
NULL,
TO_DATE('13-02-2008 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'RAKESH    ',
'RAKESH         ',
NULL,
NULL);
  
-- Changed by sumit on 28/03/13 

create or replace
function FN_WAVE_DESCRIPTION(VI_REF_SER IN CHAR,VI_REF_ID IN CHAR, VI_PTCN IN VARCHAR)
RETURN VARCHAR2 IS TEMP_DESCR VARCHAR2(200);
CNT1 NUMBER;
--TEMP_DESCR VARCHAR2(200);
TEMP_HAZARDOUS CHAR;
TEMP_ITEM_CODE CHAR(10);
TEMP_REF_ID CHAR(10);
TEMP_CASE VARCHAR2(20);
TEMP_ACTIVE VARCHAR2(20);
TEMP_REF_SER CHAR(6);
ISTACKDONE  CHAR(1);

BEGIN
  BEGIN
  --ISTACKDONE := 'N';
  IF(VI_REF_SER = 'R-DSO') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'R-PND') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'S-DSP') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'R-CPA') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'R-TASK') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'RD-DSA') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'RN-DSA') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'RP-ACT') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'RP-PND') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'RP-PND') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'RR-DSA') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'RS-DSO') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'S-DOC') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'M-PACK') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  END IF;
 
    if( VI_REF_SER = 'C-PICK') then 
        TEMP_HAZARDOUS := '';
        select wtd.ref_id,WTD.REF_SER, (CASE WHEN I.hazardous IS NULL THEN 'N' ELSE I.hazardous END) AS HAZ into TEMP_REF_ID,TEMP_REF_SER, TEMP_HAZARDOUS
        from wave_task_det WTD, ITEM I , PICK_ORD_DET POD
        where WTD.ptcn= VI_PTCN and WTD.ref_ser ='C-PICK' and WTD.REF_ID = VI_REF_ID 
        AND WTD.REF_ID = POD.PICK_ORDER AND I.ITEM_CODE = POD.ITEM_CODE AND ROWNUM = 1;
        IF (TEMP_REF_SER = 'C-PICK' AND TEMP_HAZARDOUS = 'Y' ) THEN          
          TEMP_CASE := 'HAZ_CASE_CASE';
          ISTACKDONE := 'Y';
        ELSIF (TEMP_REF_SER = 'C-PICK' AND TEMP_HAZARDOUS = 'N' ) THEN
           TEMP_CASE := 'CASE_CASE';
           ISTACKDONE := 'Y';       
        END IF;
    END IF;
    IF ( VI_REF_SER = 'M-PICK') then         
       select wtd.ref_id,WTD.REF_SER, (CASE WHEN I.hazardous IS NULL THEN 'N' ELSE I.hazardous END) AS HAZ into TEMP_REF_ID,TEMP_REF_SER, TEMP_HAZARDOUS
       from wave_task_det WTD, ITEM I , PICK_ORD_DET POD
       where WTD.ptcn= VI_PTCN and WTD.ref_ser ='M-PICK' and WTD.REF_ID  = VI_REF_ID
       AND WTD.REF_ID = POD.PICK_ORDER AND I.ITEM_CODE = POD.ITEM_CODE AND ROWNUM = 1;
       IF (TEMP_REF_SER = 'M-PICK' AND TEMP_HAZARDOUS = 'Y' ) THEN
         TEMP_CASE := 'HAZ_MASTER_CASE';
         --RETURN TEMP_CASE;
         ISTACKDONE := 'Y';
       ELSIF (TEMP_REF_SER = 'M-PICK' AND TEMP_HAZARDOUS = 'N' ) THEN
         TEMP_CASE := 'MASTER_CASE';
         ISTACKDONE := 'Y';        
       END IF;
    ELSIF ( VI_REF_SER = 'P-PICK' ) then
       TEMP_HAZARDOUS := '';
       select wtd.ref_id,WTD.REF_SER, (CASE WHEN I.hazardous IS NULL THEN 'N' ELSE I.hazardous END) AS HAZ into TEMP_REF_ID,TEMP_REF_SER, TEMP_HAZARDOUS
       from wave_task_det WTD, ITEM I , PICK_ORD_DET POD
       where WTD.ptcn= VI_PTCN and WTD.ref_ser ='P-PICK' and WTD.REF_ID  = VI_REF_ID
       AND WTD.REF_ID = POD.PICK_ORDER AND I.ITEM_CODE = POD.ITEM_CODE AND ROWNUM = 1;
       IF (TEMP_REF_SER = 'P-PICK' AND TEMP_HAZARDOUS = 'Y' ) THEN
         TEMP_CASE := 'HAZ_PARCEL_CASE';
         ISTACKDONE := 'Y';
       ELSIF (TEMP_REF_SER = 'P-PICK' AND TEMP_HAZARDOUS = 'N' ) THEN
         TEMP_CASE := 'PARCEL_CASE';
         ISTACKDONE := 'Y';
       END IF;
     ELSIF ( VI_REF_SER = 'A-PICK' ) then
        select count(*) as cont into CNT1 from wave_task_det WTD where WTD.ptcn = VI_PTCN and WTD.ref_ser ='C-PICK';      
       IF (CNT1 > 0 ) then
          TEMP_CASE := 'CASE_CASE';        
      end if;
      select count(*) as cont into CNT1 from wave_task_det WTD where WTD.ptcn = VI_PTCN and WTD.ref_ser ='M-PICK';       
       IF (CNT1 > 0 ) then
          TEMP_CASE := 'MASTER_CASE';        
      end if;
      select count(*) as cont into CNT1 from wave_task_det WTD where WTD.ptcn = VI_PTCN and WTD.ref_ser ='P-PICK';       
       IF (CNT1 > 0 ) then
          TEMP_CASE := 'PARCEL_CASE';        
      end if;
    end if;   
   
  IF(VI_REF_SER = 'C-PICK' AND TEMP_CASE = 'HAZ_CASE_CASE' ) THEN
    SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'HAZ_CASE_CASE' and MOD_NAME = 'WAVE_TASK' ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'C-PICK' AND TEMP_CASE = 'CASE_CASE' ) THEN
    SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'CASE_CASE' and MOD_NAME = 'WAVE_TASK' ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'M-PICK' AND TEMP_CASE = 'HAZ_MASTER_CASE' ) THEN ---// for normal MASTER pick ------- start
    SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'HAZ_MASTER_CASE' and MOD_NAME = 'WAVE_TASK' ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'M-PICK' AND TEMP_CASE = 'MASTER_CASE' ) THEN
    SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'MASTER_CASE' and MOD_NAME = 'WAVE_TASK' ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'P-PICK' AND TEMP_CASE = 'HAZ_PARCEL_CASE' ) THEN ---// for normal MASTER pick ------- start
    SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'HAZ_PARCEL_CASE' and MOD_NAME = 'WAVE_TASK' ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'P-PICK' AND TEMP_CASE = 'PARCEL_CASE' ) THEN
    SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'PARCEL_CASE' and MOD_NAME = 'WAVE_TASK' ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'A-PICK') THEN
  
       IF ( TEMP_CASE <> 'PARCEL_CASE' AND TEMP_CASE <> 'MASTER_CASE' ) THEN
           SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'CASE_ACTIVE' and MOD_NAME = 'WAVE_TASK' ;
            RETURN TEMP_DESCR;
        ELSIF ( TEMP_CASE = 'MASTER_CASE') THEN
            SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'MASTER_ACTIVE' and MOD_NAME = 'WAVE_TASK' ;
            RETURN TEMP_DESCR;
        ELSIF ( TEMP_CASE = 'PARCEL_CASE') THEN
           SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'PARCEL_ACTIVE' and MOD_NAME = 'WAVE_TASK' ;
           RETURN TEMP_DESCR;
       
        END IF;
  END IF; 
 
  EXCEPTION
  WHEN NO_DATA_FOUND  THEN
   TEMP_DESCR :='';
  END;
  RETURN TEMP_DESCR;
END;
/

INSERT INTO GENCODES (
	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3 )
 VALUES (
	'MASTER_ACTIVE',
	'WAVE_TASK',
	'1',
	'Active Pick Master Picking',
	NULL,
	TO_DATE('27-03-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL,
	NULL,
	NULL);
	
INSERT INTO GENCODES (
	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3 )
 VALUES (
	'PARCEL_CASE',
	'WAVE_TASK',
	'1',
	'Case Pick Parcel Picking',
	NULL,
	TO_DATE('27-03-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL,
	NULL,
	NULL);
	
INSERT INTO GENCODES (
	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3 )
 VALUES (
	'PARCEL_ACTIVE',
	'WAVE_TASK',
	'1',
	'Active Pick Parcel Picking',
	NULL,
	TO_DATE('27-03-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL,
	NULL,
	NULL);
	
INSERT INTO GENCODES (
	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3 )
 VALUES(
	'HAZ_CASE_CASE',
	'WAVE_TASK',
	'1',
	'Hazmat Case Picking',
	NULL,
	TO_DATE('27-03-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL,
	NULL,
	NULL);
	
INSERT INTO GENCODES (
	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3 )
 VALUES (
	'CASE_CASE',
	'WAVE_TASK',
	'1',
	'Case Pick LTL Picking',
	NULL,
	TO_DATE('27-03-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL,
	NULL,
	NULL);
	
INSERT INTO GENCODES (
	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3 )
 VALUES (
	'CASE_ACTIVE',
	'WAVE_TASK',
	'1',
	'Active Pick LTL Picking',
	NULL,
	TO_DATE('27-03-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL,
	NULL,
	NULL);
	
INSERT INTO GENCODES (
	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3 )
 VALUES (
	'MASTER_CASE',
	'WAVE_TASK',
	'1',
	'Case Pick Master Picking',
	NULL,
	TO_DATE('27-03-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	NULL,
	NULL,
	NULL,
	NULL);
	
INSERT INTO GENCODES (
	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3 )
 VALUES (
	'HAZ_MASTER_CASE',
	'WAVE_TASK',
	'1',
	'Hazmat Case Pick - Master',
	NULL,
	TO_DATE('27-03-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE      ',
	NULL,
	NULL,
	NULL,
	NULL);
	
INSERT INTO GENCODES (
	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3 )
 VALUES (
	'HAZ_PARCEL_CASE',
	'WAVE_TASK',
	'1',
	'Hazmat Case Pick - Parcel',
	NULL,
	TO_DATE('27-03-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE      ',
	NULL,
	NULL,
	NULL,
	NULL);

  delete from MESSAGES where msg_no in ('INVHAZITEM','INVCURITEM');
 
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 (
'INVCURITEM',
'Invalid Master Carton',
'Haz and Non Haz items cannot be packed in the same master',
'E',
'E',
NULL,
NULL,
NULL,
TO_DATE('13-02-2008 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'RAKESH    ',
'RAKESH         ',
NULL,
NULL);

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 (
'INVHAZITEM',
'Invalid Master Carton ',
'Haz and Non Haz items cannot be packed in the same master ',
'E',
'E',
NULL,
NULL,
NULL,
TO_DATE('13-02-2008 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'RAKESH    ',
'RAKESH         ',
NULL,
NULL);

 -- changed by sumit on 29/03/13 bug solved
 create or replace
function FN_WAVE_DESCRIPTION(VI_REF_SER IN CHAR,VI_REF_ID IN CHAR, VI_PTCN IN VARCHAR)
RETURN VARCHAR2 IS TEMP_DESCR VARCHAR2(200);
CNT1 NUMBER;
--TEMP_DESCR VARCHAR2(200);
TEMP_HAZARDOUS CHAR;
TEMP_ITEM_CODE CHAR(10);
TEMP_REF_ID CHAR(10);
TEMP_CASE VARCHAR2(20);
TEMP_ACTIVE VARCHAR2(20);
TEMP_REF_SER CHAR(6);
ISTACKDONE  CHAR(1);

BEGIN
  BEGIN
  --ISTACKDONE := 'N';
  IF(VI_REF_SER = 'R-DSO') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'R-PND') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'S-DSP') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'R-CPA') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'R-TASK') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'RD-DSA') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'RN-DSA') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'RP-ACT') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'RP-PND') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'RP-PND') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'RR-DSA') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'RS-DSO') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'S-DOC') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'M-PACK') THEN
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ;
    RETURN TEMP_DESCR;
  END IF;
 
    if( VI_REF_SER = 'C-PICK') then 
        TEMP_HAZARDOUS := '';
        select wtd.ref_id,WTD.REF_SER, (CASE WHEN I.hazardous IS NULL THEN 'N' ELSE I.hazardous END) AS HAZ into TEMP_REF_ID,TEMP_REF_SER, TEMP_HAZARDOUS
        from wave_task_det WTD, ITEM I , PICK_ORD_DET POD
        where WTD.ptcn= VI_PTCN and WTD.ref_ser ='C-PICK' and WTD.REF_ID = VI_REF_ID 
        AND WTD.REF_ID = POD.PICK_ORDER AND I.ITEM_CODE = POD.ITEM_CODE AND ROWNUM = 1;
        IF (TEMP_REF_SER = 'C-PICK' AND TEMP_HAZARDOUS = 'Y' ) THEN          
          TEMP_CASE := 'HAZ_CASE_CASE';
          ISTACKDONE := 'Y';
        ELSIF (TEMP_REF_SER = 'C-PICK' AND TEMP_HAZARDOUS = 'N' ) THEN
           TEMP_CASE := 'CASE_CASE';
           ISTACKDONE := 'Y';       
        END IF;
    END IF;
    IF ( VI_REF_SER = 'M-PICK') then         
       select wtd.ref_id,WTD.REF_SER, (CASE WHEN I.hazardous IS NULL THEN 'N' ELSE I.hazardous END) AS HAZ into TEMP_REF_ID,TEMP_REF_SER, TEMP_HAZARDOUS
       from wave_task_det WTD, ITEM I , PICK_ORD_DET POD
       where WTD.ptcn= VI_PTCN and WTD.ref_ser ='M-PICK' and WTD.REF_ID  = VI_REF_ID
       AND WTD.REF_ID = POD.PICK_ORDER AND I.ITEM_CODE = POD.ITEM_CODE AND ROWNUM = 1;
       IF (TEMP_REF_SER = 'M-PICK' AND TEMP_HAZARDOUS = 'Y' ) THEN
         TEMP_CASE := 'HAZ_MASTER_CASE';
         --RETURN TEMP_CASE;
         ISTACKDONE := 'Y';
       ELSIF (TEMP_REF_SER = 'M-PICK' AND TEMP_HAZARDOUS = 'N' ) THEN
         TEMP_CASE := 'MASTER_CASE';
         ISTACKDONE := 'Y';        
       END IF;
    ELSIF ( VI_REF_SER = 'P-PICK' ) then
       TEMP_HAZARDOUS := '';
       select wtd.ref_id,WTD.REF_SER, (CASE WHEN I.hazardous IS NULL THEN 'N' ELSE I.hazardous END) AS HAZ into TEMP_REF_ID,TEMP_REF_SER, TEMP_HAZARDOUS
       from wave_task_det WTD, ITEM I , PICK_ORD_DET POD
       where WTD.ptcn= VI_PTCN and WTD.ref_ser ='P-PICK' and WTD.REF_ID  = VI_REF_ID
       AND WTD.REF_ID = POD.PICK_ORDER AND I.ITEM_CODE = POD.ITEM_CODE AND ROWNUM = 1;
       IF (TEMP_REF_SER = 'P-PICK' AND TEMP_HAZARDOUS = 'Y' ) THEN
         TEMP_CASE := 'HAZ_PARCEL_CASE';
         ISTACKDONE := 'Y';
       ELSIF (TEMP_REF_SER = 'P-PICK' AND TEMP_HAZARDOUS = 'N' ) THEN
         TEMP_CASE := 'PARCEL_CASE';
         ISTACKDONE := 'Y';
       END IF;
     ELSIF ( VI_REF_SER = 'A-PICK' ) then
        select count(*) as cont into CNT1 from wave_task_det WTD where WTD.ptcn = VI_PTCN and WTD.ref_ser ='C-PICK';      
       IF (CNT1 > 0 ) then
          TEMP_CASE := 'CASE_CASE';        
      end if;
      select count(*) as cont into CNT1 from wave_task_det WTD where WTD.ptcn = VI_PTCN and WTD.ref_ser ='M-PICK';       
       IF (CNT1 > 0 ) then
          TEMP_CASE := 'MASTER_CASE';        
      end if;
      select count(*) as cont into CNT1 from wave_task_det WTD where WTD.ptcn = VI_PTCN and WTD.ref_ser ='P-PICK';       
       IF (CNT1 > 0 ) then
          TEMP_CASE := 'PARCEL_CASE';        
      end if;
    end if;   
   
  IF(VI_REF_SER = 'C-PICK' AND TEMP_CASE = 'HAZ_CASE_CASE' ) THEN
    SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'HAZ_CASE_CASE' and MOD_NAME = 'WAVE_TASK' ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'C-PICK' AND TEMP_CASE = 'CASE_CASE' ) THEN
    SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'CASE_CASE' and MOD_NAME = 'WAVE_TASK' ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'M-PICK' AND TEMP_CASE = 'HAZ_MASTER_CASE' ) THEN ---// for normal MASTER pick ------- start
    SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'HAZ_MASTER_CASE' and MOD_NAME = 'WAVE_TASK' ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'M-PICK' AND TEMP_CASE = 'MASTER_CASE' ) THEN
    SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'MASTER_CASE' and MOD_NAME = 'WAVE_TASK' ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'P-PICK' AND TEMP_CASE = 'HAZ_PARCEL_CASE' ) THEN ---// for normal MASTER pick ------- start
    SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'HAZ_PARCEL_CASE' and MOD_NAME = 'WAVE_TASK' ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'P-PICK' AND TEMP_CASE = 'PARCEL_CASE' ) THEN
    SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'PARCEL_CASE' and MOD_NAME = 'WAVE_TASK' ;
    RETURN TEMP_DESCR;
  ELSIF (VI_REF_SER = 'A-PICK') THEN
  
       IF ( (TEMP_CASE <> 'PARCEL_CASE' AND TEMP_CASE <> 'MASTER_CASE') or TEMP_CASE is null ) THEN
           SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'CASE_ACTIVE' and MOD_NAME = 'WAVE_TASK' ;
            RETURN TEMP_DESCR;
        ELSIF ( TEMP_CASE = 'MASTER_CASE') THEN
            SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'MASTER_ACTIVE' and MOD_NAME = 'WAVE_TASK' ;
            RETURN TEMP_DESCR;
        ELSIF ( TEMP_CASE = 'PARCEL_CASE') THEN
           SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'PARCEL_ACTIVE' and MOD_NAME = 'WAVE_TASK' ;
           RETURN TEMP_DESCR;
       
        END IF;
  END IF; 
 
  EXCEPTION
  WHEN NO_DATA_FOUND  THEN
   TEMP_DESCR :='';
  END;
  RETURN TEMP_DESCR;
END;
/

-- changed by sumit on 30-03-13
  
INSERT INTO ITM2MENU (
	application ,
	level_1 ,
	level_2 ,
	level_3 ,
	level_4 ,
	level_5 ,
	win_name ,
	descr ,
	comments ,
	menu_path ,
	icon_path ,
	close_icon ,
	open_icon ,
	obj_type ,
	chg_date ,
	chg_term ,
	chg_user ,
	mob_deploy )
	VALUES (
	'WMS',
	1,
	48,
	0,
	0,
	0,
	'w_pick_iss_tr',
	'Pick Issue',
	NULL,
	'WMS.1.48.0.0.0',
	'e12_logo.gif',
	NULL,
	NULL,
	'T',
	NULL,
	'BASE   ',
	'BASE   ',
	NULL);

INSERT INTO TRANSETUP (
	tran_window ,
	save_flag ,
	val_flag ,
	key_flag ,
	key_string ,
	udf_1 ,
	udf_2 ,
	udf_3 ,
	udf_4 ,
	udf_5 ,
	repeate_add ,
	chg_date ,
	chg_user ,
	chg_term ,
	edi_option ,
	site_acc_col ,
	confirm_col ,
	confirm_val ,
	repeat_add_det ,
	repeatadddet ,
	load_mode ,
	auto_confirm ,
	ledg_post_conf ,
	chg_date_on_conf ,
	tran_id_col ,
	mail_option ,
	confirm_mode ,
	garbage_opt ,
	val_flag_edi ,
	verify_password ,
	cust_acc_col ,
	sales_pers_acc_col ,
	supp_acc_col ,
	item_ser_acc_code ,
	emp_acc_col ,
	item_ser_acc_col ,
	workflow_opt ,
	table_name ,
	application ,
	table_desc ,
	tran_date_col ,
	tran_id__from ,
	tran_id__to ,
	table_name_det1 ,
	table_name_det2 ,
	table_name_det3 ,
	multitire_opt ,
	ref_ser ,
	view_mode ,
	tax_forms ,
	sign_status ,
	user_tran_window ,
	custom_preview_obj ,
	ignoreerrlist_onload ,
	childdata_argopt ,
	edit_tmplt ,
	wrkflw_init ,
	edittax ,
	formal_args ,
	audit_trail_opt ,
	edit_opt ,
	cache_opt ,
	optimize_mode ,
	edit_expr ,
	rate_col ,
	qty_col ,
	edit_expr_inp ,
	rcp_cache_status ,
	print_control ,
	transfer_mode ,
	profile_id__res ,
	tran_compl_msg ,
	period_option ,
	wrkflw_priority ,
	exec_type ,
	disp_meta_data ,
	allow_attach ,
	start_form ,
	isattachment ,
	header_form_no ,
	msg_onsave )
 VALUES (
	'w_pick_iss_tr',
	'2',
	'2',
	'M',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'N',
	TO_DATE('1-03-2013 17:22:42','DD-MM-YYYY HH24:MI:SS'),
	'BASE ',
	'1      ',
	'0',
	NULL,
	NULL,
	NULL,
	'N',
	NULL,
	NULL,
	'N',
	'N',
	NULL,
	'TRAN_ID',
	'0',
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'PICK_ISS_HDR',
	'DIS',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	NULL,
	'V',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'M',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_pick_iss_tr',
	'Pick Iss Header',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
	
INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_pick_iss_tr',
	'Pick Iss Detail',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO OBJ_ACTIONS (
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES (
	'pick_iss_tr',
	2,
	'edit.gif',
	'Editing Existing Record',
	'a',
	'a',
	'E',
	'Edit',
	'1',
	NULL,
	NULL,
	'S',
	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 (
	'pick_iss_tr',
	'pre_validate',
	'1',
	'prv_pick_iss_tr',
	NULL,
	'0',
	sysdate,
	'Base ',
	'Base',
	'2',
	'EJB',
	'PickIssueEJB',
	NULL);

INSERT INTO system_event_services (
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,
	return_descr ,
	return_xfrm ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'prv_pick_iss_tr',
	'Validation',
	'http://localhost:9090/axis/services/ValidatorService',
	'BASE',
	'wfValData',
	'String',
	'S',
	NULL,
	NULL,
	sysdate,
	'Base  ',
	'Base');

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_pick_iss_tr',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Base   ',
	'BASE',
	'EJB');

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'prv_pick_iss_tr',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	sysdate,
	'Sankar    ',
	'BASE',
	'PickIssueEJB');

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_pick_iss_tr',
	3,
	'XML_DATA',
	'l',
	NULL,
	'S',
	NULL,
	sysdate,
	'Base    ',
	'BASE',
	NULL);

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_pick_iss_tr',
	4,
	'XML_DATA_1',
	'l',
	NULL,
	'S',
	NULL,
	sysdate,
	'Base  ',
	'BASE',
	NULL);

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_pick_iss_tr',
	5,
	'XML_DATA_ALL',
	'l',
	NULL,
	'S',
	NULL,
	sysdate,
	'Base   ',
	'BASE',
	NULL);

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_pick_iss_tr',
	6,
	'OBJ_CONTEXT',
	'l',
	NULL,
	'S',
	NULL,
	sysdate,
	'Base   ',
	'BASE',
	NULL);

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_pick_iss_tr',
	7,
	'EDIT_FLAG',
	'l',
	NULL,
	'S',
	NULL,
	sysdate,
	'Base   ',
	'BASE',
	NULL);

INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_pick_iss_tr',
	8,
	'XTRA_PARAMS',
	'l',
	NULL,
	'S',
	NULL,
	sysdate,
	'Base   ',
	'BASE',
	NULL);
	
	-- sumit -- 
	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 (
	'pick_iss_tr',
	'pre_save',
	'1',
	'prsr_pick_iss_tr',
	NULL,
	'0',
	TO_DATE('3-10-2012 11:45:50','DD-MM-YYYY HH24:MI:SS'),
	'Base      ',
	'Base',
	'2',
	'EJB',
	'PickIssuePrs',
	NULL);

	INSERT INTO SYSTEM_EVENT_SERVICES(
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,
	return_descr ,
	return_xfrm ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'prsr_pick_iss_tr',
	'pre save',
	'http://localhost:9090/axis/services/ValidatorService',
	'BASE',
	'preSave',
	'String',
	'S',
	NULL,
	NULL,
	TO_DATE('18-01-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE      ');

	INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prsr_pick_iss_tr',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'C.String',
	NULL,
	TO_DATE('29-03-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE      ',
	'EJB');
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES(
	'prsr_pick_iss_tr',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'C.String',
	NULL,
	TO_DATE('29-03-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE      ',
	'PickIssuePrs');
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prsr_pick_iss_tr',
	3,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('29-03-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE      ',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prsr_pick_iss_tr',
	4,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('29-03-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE      ',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES(
	'prsr_pick_iss_tr',
	5,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('29-03-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE      ',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prsr_pick_iss_tr',
	6,
	'DB_CONN',
	'I',
	NULL,
	'S.Connection',
	NULL,
	TO_DATE('29-03-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE      ',
	NULL);

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 (
	'INPICKTYPE',
	'Invalid Pick Type',
	'Only active pick allow in Edit',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	TO_DATE('13-02-2008 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);
	
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 (
	'INVPIKORD',
	'Invalid Pick order',
	'Quantity already dispatch to dock location',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	TO_DATE('13-02-2008 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);
	
	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 (
	'INVPIKNCON',
	'Invalid Pick order',
	'Pick issue not confirmed',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	TO_DATE('13-02-2008 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);
	
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 (
	'INVCTNNO1',
	'Invalid Carton Number',
	'Carton number does not exist in carton master.',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	TO_DATE('13-02-2008 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);
	
	
	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 (
	'INVCTNNO',
	'Invalid Carton Number',
	'Carton number does not belongs to same PTCN.',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	TO_DATE('13-02-2008 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);

INSERT INTO TRANS_COPY_SETUP (
	obj_name ,
	form_no ,
	field_name ,
	def_value ,
	copy_flag )
 VALUES (
	'pick_iss_tr',
	'2',
	'quantity',
	'0',
	'N');
	
INSERT INTO TRANS_COPY_SETUP (
	obj_name ,
	form_no ,
	field_name ,
	def_value ,
	copy_flag )
 VALUES (
	'pick_iss_tr',
	'2',
	'dealloc_qty',
	'0',
	'N');
	
	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 (
	'INVPIISQTY',
	'Invalid Quantity',
	'Quantity mis match.',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	TO_DATE('13-02-2008 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);

---Chnaged by sankara WMS Label Changes 30/03/13 ----
UPDATE ITM2MENU SET DESCR='Sales Return From RMA' WHERE WIN_NAME='w_salesreturn_wiz';
UPDATE OBJ_FORMS SET TITLE='Sales Return (SRM)' WHERE WIN_NAME='w_salesreturn_wiz' and form_no='1';

---Chnaged by Pragyan Message change 30/03/13 ----
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 (
	'INVTRANSTG',
	'Invalid Transaction Stat',
	'All task not completed(despatch detail is not populated)',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	TO_DATE('13-02-2008 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);
commit;
	
commit;
---Chnaged by Rohan Message change 30/03/13 ----
INSERT INTO pophelp (
	field_name,
	mod_name,
	sql_str,
	dw_object,
	msg_title,
	width,
	height,
	chg_date,
	chg_user,
	chg_term,
	dist_opt,
	filter_string,
	sql_input,
	default_col,
	pop_align,
	query_mode,
	page_context,
	pophelp_cols,
	pophelp_source,
	multi_opt,
	help_option)
 VALUES (
	'PTCN',
	'W_CONSOLIDATE',
	'SELECT DISTINCT WTD.PTCN AS PTCN , WTD.WAVE_ID AS WAVE_ID FROM WAVE_TASK WT, WAVE_TASK_DET WTD, DESPATCH D WHERE WT.CANCEL <> ''Y'' AND WT.HOLD_STATUS <> ''Y'' AND WTD.STATUS <> ''Y'' AND WTD.WAVE_STATUS <> ''C'' AND WTD.REF_ID = D.DESP_ID AND D.CONFIRMED <> ''Y''',
	NULL,
	'PTCN',
	0,
	0,
	fn_sysdate(),
	'Rohan',
	'Rohan',
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
	
	-- Changed by sumit on 30/03/13
	
	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 (
	'NULCARTNNO',
	'Null Carton number',
	'Please insert carton number',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	TO_DATE('13-02-2008 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);
	
	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 (
	'INVCTNNO1',
	'Invalid Carton number',
	'Carton number does not exist in carton master.',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	TO_DATE('13-02-2008 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);
	
	
	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 (
	'INVQUANTIY',
	'Invalid Quantity',
	'Quantity can not be zero.',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	TO_DATE('13-02-2008 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);

-- changed by sumit on 03/apr/13 
	UPDATE obj_forms SET SCAN_METADATA = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Location From:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>loc_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>LPN Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="3"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="6" end="15" >item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="4"><SCAN_LABEL>Lot Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="13" end="22" >lot_no</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>New LPN:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl__new</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>No of CASE</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>no_art</FIELD></FIELDS></INPUT_SCAN><SCAN_CONDITION field="lot_sl__new">order_type == "Q" || order_type == "E" || order_type == "P"</SCAN_CONDITION></SCAN_INFO>'
 WHERE win_name ='w_active_repl_iss' AND FORM_NO = 3;
 
 
 -- update by sumit on 05-apr-13 
 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 (
	'INVPALLFPI',
	'Invalid Pallet number',
	'Scan pallet number already asign to other pick order of different PTCN',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	TO_DATE('13-02-2008 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE',
	'BASE',
	NULL,
	NULL);
	
	-- changed by sumit on 13/03/13 
	alter table transporter add chk_digit_yn char(1) default 'N';
	
commit;	

-- changed by Rohan on 18-04-13 for addting validation of expired stock transfer

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 (
	'VTLOCNTVAL',
	'Invalid To location',
	'Expired Material cannot be transferred to restricted location as defined in disparm var_name=''NOT_TRANF_INV_STAT''',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);


INSERT INTO disparm (
	prd_code ,
	var_name ,
	var_type ,
	var_value ,
	descr ,
	var_subs ,
	chg_date ,
	chg_user ,
	chg_term 
	 )
VALUES 
(
	'999999',
	'NOT_TRANF_INV_STAT',
	'S',
	'CASPK',
	'Location not transfer inv stat',
	0,
	fn_sysdate(),
	'BASE',
	'Rohan'
);	

-- update by sumit on 06/05/13 sql given by pyagyan sir.
update obj_forms set title = 'Header' where win_name = 'w_inv_lock' and form_no = 1;
update obj_forms set title = 'Detail' where win_name = 'w_inv_lock' and form_no = 2;

update messages set msg_descr = 'Entered lock code is already exist,
please enter new lock code' where msg_no = 'INVLOCKEXT';

commit;

--changed by Rohan on 07-MAy-13 
DELETE FROM MESSAGES WHERE MSG_NO = 'REPCOMPL';


INSERT INTO MESSAGES VALUES (
        'REPCOMPL  ',
        'Preview Generated !',
        'The Preview is generated and the wave is not processed. Would you
like to reset the data and process a new wave ? ',
        'W',
        NULL,
        NULL,
        NULL,
        NULL,
        TO_DATE('7-08-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'BASE      ',
        'BASE           ',
        NULL,
        NULL);

-- uPDATE BY SUMIT ON 07/06/13 INSERT SQL given by pragyan sir.
INSERT INTO POPHELP VALUES (
        'LINE_NO__HOLD',
        'W_INV_HOLD_REL',
        'SELECT LINE_NO,ITEM_CODE,SITE_CODE,LOC_CODE,LOT_NO,LOT_SL AS
LPN_NO FROM INV_HOLD_DET WHERE TRAN_ID = ''?''',
        NULL,
        'Line no ',
        0,
        0,
        TO_DATE('7-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'ASHISH    ',
        'ASHISH         ',
        '1',
        NULL,
        ':1.TRAN_ID__HOLD',
        1,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL);
        
-- Added by sumit on 08/06/13        
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 (
	'INVSUPPCOD',
	'Invalid supplier code.',
	'Enter valid supplier code.',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);

commit;
--Chnaged by Rohan on 09-05-13 for chnages in message description
UPDATE MESSAGES SET MSG_STR='Invalid LPN No', MSG_DESCR='LPN No does not exist on the current location.' WHERE MSG_NO ='VTLPNNTVAL';
UPDATE MESSAGES SET MSG_STR='Invalid Location', MSG_DESCR='Inventory is on Hold.Scanned location is not a reserve location.' WHERE MSG_NO ='VTLOCCODE8';

--Changed by sumit on 10/05/13 given by pragyan sir.
 INSERT INTO messages VALUES (
        'NOTMATCH  ',
        'Mismatch Found ',
        'Physical Scan Quantity and Stock Quantity mismatch',
        'W',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('19-06-2012 09:20:19','DD-MM-YYYY HH24:MI:SS'),
        'ROHAN     ',
        'BASE           ',
        NULL,
        NULL);

-- Changed by sumit on 11/05/13 Req.id [WM3ASUN003]
update system_events set service_code = 'pos_pick_iss_finish' 
where obj_name = 'active_pick' and event_code = 'pre_navigate_finish';

INSERT INTO system_event_services (
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,
	return_descr ,
	return_xfrm ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'pos_pick_iss_finish',
	'post save',
	'http://localhost:9090/axis/services/ValidatorService',
	'BASE',
	'postSave',
	'String',
	'S',
	NULL,
	NULL,
	TO_DATE('11-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE');

	
	INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pos_pick_iss_finish',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:08','DD-MM-YYYY HH24:MI:SS'),
	'chaitali  ',
	'chaitali',
	'EJB');
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pos_pick_iss_finish',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:08','DD-MM-YYYY HH24:MI:SS'),
	'chaitali  ',
	'chaitali',
	'PickIssPos');
	
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pos_pick_iss_finish',
	3,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:08','DD-MM-YYYY HH24:MI:SS'),
	'chaitali  ',
	'chaitali',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES(
	'pos_pick_iss_finish',
	4,
	'<tran_id>',
	'I',
	NULL,
	'B.String',
	NULL,
	TO_DATE('8-05-2012 13:26:08','DD-MM-YYYY HH24:MI:SS'),
	'chaitali  ',
	'chaitali',
	NULL);
	
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pos_pick_iss_finish',
	5,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:08','DD-MM-YYYY HH24:MI:SS'),
	'chaitali  ',
	'chaitali',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pos_pick_iss_finish',
	6,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:08','DD-MM-YYYY HH24:MI:SS'),
	'chaitali  ',
	'chaitali',
	NULL);

--changed by sumit on 13/05/13 
	update system_events set service_code = 'pos_pick_iss_finish', comp_name = 'PickIssPos'
where obj_name = 'active_pick' and event_code = 'pre_navigate_finish';


--changed by sumit on 16/03/13
UPDATE SYSTEM_SERVICE_ARGS SET ARG_NAME = 'XML_DATA_ALL' WHERE SERVICE_CODE ='prv_repl_iss' AND LINE_NO = 3;
COMMIT;

-- changed by sumit on 21/05/13 for active repl iss
 
update system_events set service_code = 'prv_repl_iss_next' 
where obj_name = 'active_repl_iss' and event_code ='pre_navigate_next';

UPDATE SYSTEM_SERVICE_ARGS SET ARG_NAME = 'XML_DATA' WHERE LINE_NO = 3 AND SERVICE_CODE = 'prv_repl_iss';


INSERT INTO SYSTEM_EVENT_SERVICES (
	 service_code ,
	 service_descr ,
	 service_uri ,
	 service_provider ,
	 method_name ,
	 return_value ,
	 return_type ,
	 return_descr ,
	 return_xfrm ,
	 chg_date ,
	 chg_user ,
	 chg_term )
 VALUES (
	 'prv_repl_iss_next',
	 'Validation',
	 'http://localhost:9090/axis/services/ValidatorService',
	 'BASE',
	 'wfValData',
	 'String',
	 'S',
	 NULL,
	 NULL,
	 TO_DATE('8-05-2012 13:26:07','DD-MM-YYYY HH24:MI:SS'),
	 'Gulzar    ',
	 'BASE');
 

	INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_repl_iss_next',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:07','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	'EJB');
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_repl_iss_next',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:07','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	'ReplIssIC');
	
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_repl_iss_next',
	3,
	'XML_DATA_ALL',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:07','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_repl_iss_next',
	4,
	'XML_DATA_1',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:07','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_repl_iss_next',
	5,
	'XML_DATA_ALL',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:07','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_repl_iss_next',
	6,
	'OBJ_CONTEXT',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:07','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_repl_iss_next',
	7,
	'EDIT_FLAG',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:07','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES(
	'prv_repl_iss_next',
	8,
	'XTRA_PARAMS',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('8-05-2012 13:26:07','DD-MM-YYYY HH24:MI:SS'),
	'Gulzar    ',
	'BASE',
	NULL);

	-- Changed by sumit on 22/05/13 for point 192
	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 (
	'DUPLOTSLNW',
	'Invalid LPN.',
	'LPN already used.',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);
	
	alter table DELIVERY_TERM add adsi_dlv_term varchar2(25);
	
commit;	
-- Changed by Rohan on 23/05/13 as said by Pragyan sir
update obj_forms set title = 'Header' where win_name = 'w_inv_lock' and
form_no = 1;
update obj_forms set title = 'Detail' where win_name = 'w_inv_lock' and
form_no = 2;

update messages set msg_descr = 'Entered lock code is already exist,please enter new lock code' where msg_no = 'INVLOCKEXT';

INSERT INTO POPHELP VALUES (
        'LINE_NO__HOLD',
        'W_INV_HOLD_REL',
        'SELECT LINE_NO,ITEM_CODE,SITE_CODE,LOC_CODE,LOT_NO,LOT_SL AS LPN_NO FROM INV_HOLD_DET WHERE TRAN_ID = ''?''',
        NULL,
        'Line no ',
        0,
        0,
        TO_DATE('7-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'ASHISH    ',
        'ASHISH         ',
        '1',
        NULL,
        ':1.TRAN_ID__HOLD',
        1,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL);

delete from messages where msg_no = 'NOTMATCH';


INSERT INTO messages VALUES (
        'NOTMATCH  ',
        'Mismatch Found ',
        'Physical Scan Quantity and Stock Quantity mismatch',
        'W',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('19-06-2012 09:20:19','DD-MM-YYYY HH24:MI:SS'),
        'ROHAN     ',
        'BASE           ',
        NULL,
        NULL);

INSERT INTO POPHELP VALUES (
        'TRAN_SER',
        'W_INV_LOCK',
        'SELECT REF_SER AS TRAN SER,DESCR FROM REFSER',
        NULL,
        'TRAN SER',
        0,
        0,
        TO_DATE('14-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'ASHISH',
        'ASHISH',
        '1',
        NULL,
        ':1.TRAN_SER',
        1,
        NULL,
        NULL,
        NULL,
        NULL,
        'S',
        NULL,
        NULL);

UPDATE MESSAGES SET MSG_DESCR = 'Stan Code To and Stan Code From Combination is duplicate' where msg_no = 'VTSTANDB';
commit;
--chnaged by rohan on 29-05-13
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 (
	'SNGIEMLOT',
	'single item and single lot',
	'single item and single lot allow only',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);
	
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 (
	'SGITMMULLT',
	'single item and multiple lot',
	'single item and multiple lot allow only',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);	
--Changed by Rohan on 17-06-13 for system do not ask no of artiacales input in case of pgrl location.start
update obj_forms set scan_metadata = '<SCAN_INFO><MAPPING_SCAN ORDER="1"><SCAN_LABEL>Item Code:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="6" end="15" >item_code</FIELD></FIELDS></MAPPING_SCAN><MAPPING_SCAN ORDER="2"><SCAN_LABEL>Lot Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD ORDER="0" start="13" end="22" >lot_no</FIELD></FIELDS></MAPPING_SCAN><INPUT_SCAN ORDER="1"><SCAN_LABEL>LPN Number:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>lot_sl</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Number of Cases:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD  ORDER="0" mandatory = "N">no_art</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="3"><SCAN_LABEL>Partial Quantity:</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>part_qty</FIELD></FIELDS></INPUT_SCAN><SCAN_CONDITION field="no_art">loc_code == "GRL"</SCAN_CONDITION><SCAN_CONDITION field="part_qty">no_art == "null" || no_art == "0" || no_art == ""</SCAN_CONDITION></SCAN_INFO>'
 where win_name='w_porcp_wiz' and form_no='3';
 
 --Changed by sankara on 26-06-13 for wave generation due date validation
 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 (
	'INVLDDATE',
	'Invalid Date!',
	'Due Date To is always greater than Due Date From',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base ',
	NULL,
	NULL);
	
commit;
	
--Created by Sabita for "Tracking Details of PTCN report" as on date 26/06/2013.

INSERT INTO itm2menu
(
        application ,
        level_1 ,
        level_2,
        level_3 ,
        level_4 ,
        level_5,
        win_name ,
        descr ,
        comments ,
        menu_path,
        icon_path ,
        obj_type ,
        chg_user,
        chg_term ,
        chg_date ,
        open_icon)
VALUES (
        'WMS',
        1,
        52,
        0,
        0,
        0,
        'w_d_tracking_details_of_ptcn',
        'Tracking Details by PTCN',
        NULL,
        'WMS.1.51.0.0.0',
        'e12_logo.gif',
        'R',
        NULL,
        NULL,
        NULL,
        NULL);
COMMIT;
--Changed by Rohan on 28-06-13 for ADSI as said by Pragayn
--//Changed By Rekha WM3BSUN006 20/05/13 To get the SOAP connection.start
INSERT INTO disparm (
	prd_code ,
	var_name ,
	var_type ,
	var_value ,
	descr ,
	var_subs ,
	chg_date ,
	chg_user ,
	chg_term 
	 )
VALUES 
(
	'999999',
	'WMS_ADSI_SOAP_URL',
	'S',
	'http://172.20.0.137/ADSIShippingWS/ADSIShipping.asmx',
	'WMS ADSI Integration soap URL',
	0,
	fn_sysdate(),
	'BASE',
	'Rekha'
);	

Prompt -------Ashish : I thing we decided to create a day wise folder for the lables , YOu can create a folder on c:\ADSI AND IN THAT CREATE DAY WISE FOLDERS


INSERT INTO disparm (
	prd_code ,
	var_name ,
	var_type ,
	var_value ,
	descr ,
	var_subs ,
	chg_date ,
	chg_user ,
	chg_term 
	 )
VALUES 
(
	'999999',
	'SHIP_WITH_PATH',
	'S',
	'C://ADSI/',
	'Save Ship With Label Images(Any Path Of Application Server)',
	0,
	fn_sysdate(),
	'BASE',
	'Rekha'
);	
INSERT INTO disparm (
	prd_code ,
	var_name ,
	var_type ,
	var_value ,
	descr ,
	var_subs ,
	chg_date ,
	chg_user ,
	chg_term 
	 )
VALUES 
(
	'999999',
	'SHIPPER_DEFAULT_PH',
	'S',
	'9143459001',
	'Default phone no for recipient',
	0,
	fn_sysdate(),
	'BASE',
	'Rekha'
);	
INSERT INTO disparm (
	prd_code ,
	var_name ,
	var_type ,
	var_value ,
	descr ,
	var_subs ,
	chg_date ,
	chg_user ,
	chg_term 
	 )
VALUES 
(
	'999999',
	'NAFTA_FLAG_COUNT',
	'S',
	'MEX,CAN',
	'Nafta Flag is true for this country code',
	0,
	fn_sysdate(),
	'BASE',
	'Rekha'
);	

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 (
	'ADSISRVERR',
	'ADSI Connection Failure',
	'Metis connection to ADSI Server Failed,for UPS/Fedex Labels',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);
	
--//Changed By Rekha WM3BSUN006 20/05/13 To get the SOAP connection.end

alter table transporter add service_code varchar2(10); -- already exist
alter table delivery_term add adsi_dlv_term varchar2(25);
alter table carton_master add tracking_no varchar2(200);
alter table carton_master add ship_label varchar2(120);
alter table carton_master add msn_no number(14,3);











Prompt -------Ashish : What is this table used for ?



-- changes by sumit

create table wave_status_org
(
tran_id                         char(10),
wave_id                         varchar2(12),
tran_code                         char(10),
ptcn                            char(10),
chg_user                         char(10),
chg_date                         date,
chg_term                         varchar2(15),
print_status                     char(1)
);
alter table wave_status_org add constraint pk_wave_org primary key (tran_id) ;

create table wave_status_org_det
(
tran_id                      char(10),
line_no                      number(3,0),
ptcn                        char(10),
carton_no                   varchar2(20),
pick_order                   char(10),
line_no__pick                 number(3,0),
ref_ser                       char(6),
ref_id                        char(10),
carton_type                   char(1),
pack_code                     char(5),
master_carton                 varchar2(20),
item_code                     char(10),
weight                        number(14,3),
tracking_no                   varchar2(200),
ship_label                    varchar2(120)
) ;

alter table wave_status_org_det add constraint pk_wave_org_det primary key
(tran_id,line_no);

ALTER TABLE wave_status_org_det ADD CONSTRAINT FK_wave_org_det FOREIGN KEY
(tran_id ) REFERENCES wave_status_org ON DELETE CASCADE;

alter table carton_master add change_status char(1) default 'N';






Prompt -------Ashish : The key string needs to be proper , not seq 10 we can discuss and change it before executing




INSERT INTO TRANSETUP (
	tran_window ,
	save_flag ,
	val_flag ,
	key_flag ,
	key_string ,
	udf_1 ,
	udf_2 ,
	udf_3 ,
	udf_4 ,
	udf_5 ,
	repeate_add ,
	chg_date ,
	chg_user ,
	chg_term ,
	edi_option ,
	site_acc_col ,
	confirm_col ,
	confirm_val ,
	repeat_add_det ,
	repeatadddet ,
	load_mode ,
	auto_confirm ,
	ledg_post_conf ,
	chg_date_on_conf ,
	tran_id_col ,
	mail_option ,
	confirm_mode ,
	garbage_opt ,
	val_flag_edi ,
	verify_password ,
	cust_acc_col ,
	sales_pers_acc_col ,
	supp_acc_col ,
	item_ser_acc_code ,
	emp_acc_col ,
	item_ser_acc_col ,
	workflow_opt ,
	table_name ,
	application ,
	table_desc ,
	tran_date_col ,
	tran_id__from ,
	tran_id__to ,
	table_name_det1 ,
	table_name_det2 ,
	table_name_det3 ,
	multitire_opt ,
	ref_ser ,
	view_mode ,
	tax_forms ,
	sign_status ,
	user_tran_window ,
	custom_preview_obj ,
	ignoreerrlist_onload ,
	childdata_argopt ,
	edit_tmplt ,
	wrkflw_init ,
	edittax ,
	formal_args ,
	audit_trail_opt ,
	edit_opt ,
	cache_opt ,
	optimize_mode ,
	edit_expr ,
	rate_col ,
	qty_col ,
	edit_expr_inp ,
	rcp_cache_status ,
	print_control ,
	transfer_mode ,
	profile_id__res ,
	tran_compl_msg ,
	period_option ,
	wrkflw_priority ,
	exec_type ,
	disp_meta_data ,
	allow_attach ,
	start_form ,
	isattachment ,
	header_form_no ,
	msg_onsave ,
	wf_status )
 VALUES (
	'w_gen_label',
	'2',
	'2',
	'A',
	'seq10',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'N',
	TO_DATE('30-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE           ',
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'G-LABL',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'M',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);




Prompt -------Ashish :  The menu has to be put under new tree - I have changed this in the below sql according to the new menu 


	INSERT INTO ITM2MENU (
	application ,
	level_1 ,
	level_2 ,
	level_3 ,
	level_4 ,
	level_5 ,
	win_name ,
	descr ,
	comments ,
	menu_path ,
	icon_path ,
	close_icon ,
	open_icon ,
	obj_type ,
	chg_date ,
	chg_term ,
	chg_user ,
	mob_deploy )
 VALUES (
	'WMS',
	13,
	3,
	12,
	0,
	0,
	'w_gen_label',
	'Generate UPS/Fedex Label',
	'Generate UPS/Fedex Label',
	'WMS.13.3.12.0.0',
	'e12_logo.gif',
	NULL,
	NULL,
	'P',
	TO_DATE('30-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE ',
	'BASE      ',
	NULL);
	



INSERT INTO OBJ_FORMS (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view )
 VALUES (
	'w_gen_label',
	'Label Detail',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO OBJ_ACTIONS (
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES (
	'gen_label',
	8,
	NULL,
	'Action Button for processing the data',
	'process',
	'a',
	'R',
	'Process',
	'1',
	'3',
	NULL,
	'U',
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO OBJ_ITEMCHANGE (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
 VALUES (
	'gen_label',
	'1  ',
	'ptcn',
	'Y');	
	
INSERT INTO OBJ_ITEMCHANGE (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
 VALUES (
	'gen_label',
	'1  ',
	'wave_id',
	'Y');
	
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 (
	'gen_label',
	'post_item_change',
	'1',
	'poic_gen_label',
	NULL,
	'0',
	TO_DATE('31-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'2',
	'EJB',
	'GenerateLabelsIC',
	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 (
	'gen_label',
	'pre_validate',
	'1',
	'prv_gen_label',
	NULL,
	'0',
	TO_DATE('31-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'2',
	'EJB',
	'GenerateLabelsIC',
	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 (
	'gen_label',
	'process',
	'1',
	'prc_gen_label',
	NULL,
	'0',
	TO_DATE('30-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'2',
	'EJB',
	'GenerateLabelsPrc',
	NULL);







Prompt -------Ashish :The ip address and the dotnetservice name has to be correct , This looks like very old msi also at the end its .asm it should be .asmx  



	INSERT INTO SYSTEM_EVENT_SERVICES(
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,
	return_descr ,
	return_xfrm ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'prc_gen_label',
	'Action To process the Data',
	'http://172.16.100.15/BaseE12DotNetService6-3-0-054/E12BusinessLogic6-3-0-054.asmx',
	'BASE',
	'process',
	'String',
	'S',
	NULL,
	NULL,
	TO_DATE('30-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE');
	
INSERT INTO SYSTEM_EVENT_SERVICES(
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,
	return_descr ,
	return_xfrm ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES  (
	'poic_gen_label',
	'Item Chnage',
	'http://172.16.100.15/BaseE12DotNetService6-3-0-054/E12BusinessLogic6-3-0-054.asmx',
	'BASE',
	'itemChanged',
	'String',
	'S',
	NULL,
	NULL,
	TO_DATE('30-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE');
	
	
INSERT INTO SYSTEM_EVENT_SERVICES(
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,
	return_descr ,
	return_xfrm ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'prv_gen_label',
	'Validation',
	'http://172.16.100.15/BaseE12DotNetService6-3-0-054/E12BusinessLogic6-3-0-054.asmx',
	'BASE',
	'wfValData',
	'String',
	'S',
	NULL,
	NULL,
	TO_DATE('30-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE');

	INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_gen_label',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'EJB');	






	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_gen_label',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'GenerateLabelsIC');
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_gen_label',
	3,
	'XML_DATA',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_gen_label',
	4,
	'XML_DATA_1',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_gen_label',
	5,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_gen_label',
	6,
	'OBJ_CONTEXT',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_gen_label',
	7,
	'FOCUSED_COLUMN',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_gen_label',
	8,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'poic_gen_label',
	9,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prc_gen_label',
	1,
	'COMPONENT_TYPE',
	'I',
	'Component Type',
	'C.String',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE      ',
	'EJB');
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prc_gen_label',
	2,
	'COMPONENT_NAME',
	'I',
	'Component Name',
	'C.String',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE      ',
	'GenerateLabelsPrc');
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prc_gen_label',
	3,
	'XML_DATA_1',
	'I',
	'XML data of form no 1',
	'S',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE      ',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prc_gen_label',
	4,
	'XML_DATA__ALL',
	'I',
	'XML data of form no 1',
	'S',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE      ',
	NULL);
	
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prc_gen_label',
	5,
	'OBJ_CONTEXT',
	'I',
	'Object Context',
	'S',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE      ',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prc_gen_label',
	6,
	'XTRA_PARAMS',
	'I',
	'Extra Arguments',
	'S',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE      ',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_gen_label',
	1,
	'COMPONENT_TYPE',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'EJB');
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_gen_label',
	2,
	'COMPONENT_NAME',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	'GenerateLabelsIC');
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_gen_label',
	3,
	'XML_DATA',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_gen_label',
	4,
	'XML_DATA_1',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES(
	'prv_gen_label',
	5,
	'XML_DATA_ALL',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
	
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_gen_label',
	6,
	'OBJ_CONTEXT',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_gen_label',
	7,
	'OBJ_CONTEXT',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);
	
	
INSERT INTO SYSTEM_SERVICE_ARGS (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_gen_label',
	8,
	'XTRA_PARAMS',
	'l',
	NULL,
	'S',
	NULL,
	TO_DATE('29-05-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE      ',
	'BASE',
	NULL);




Prompt -------Ashish : Correction in messages done 

-- If entered wave is in hold or canceled.
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 (
	'WAVECAORHO',
	'Invalid Wave ID',
	'Entered wave id is on hold or canceled',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);	

-- Entered wave id or ptcn is not matching.


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 (
	'WAVEAPTNSM',
	'Invalid Wave ID or PTCN',
	'Entered wave id or ptcn is not matching',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);	

	-- Wave id is not present in master.





Prompt -------Ashish : What do you mean by Entered wave id is not present in the master . There is no master for wave , COrrect this message


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 (
	'INVAWAVEID',
	'Invalid Wave ID',
	'Entered wave id is not present in wave transations.',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);	

-- IF both wave id and ptcn field is null	



Prompt -------Ashish : Replace null with Blank 


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 (
	'NULLBOTHFD',
	'Blank Wave ID and PTCN',
	'Both wave id and PTCN can not be null.',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);	

	--ptcn does not present in wave master.


Prompt -------Ashish :  Again what is wave master ? its wrong 



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 (
	'INVAPTCN09',
	'Invalid PTCN',
	'Entered PTCN is not present in Wave transaction',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);	

	
--	IF entered ptcn does not contain master or parcel task

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 (
	'INVAPTCN10',
	'Invalid PTCN',
	'Entered PTCN does not contain master or parcel pack.',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);	

	-- IF entered wave id does not contain master or parcel task
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 (
	'INVAWAVE11',
	'Invalid Wave ID',
	'Entered wave id does not contain master or parcel pack.',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);	

	--If label is already printed


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 (
	'ALLREPRINT',
	'Invalid PTCN',
	'Label of entered ptcn is already generated.',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);	

 -- if despatch is allready confirmed of entered ptcn

Prompt -------Ashish : PTCN changed to Capital 


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 (
	'DESPCONFIR',
	'Invalid PTCN',
	'Despatch of entered PTCN is already confirmed.',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);	

	-- validation at the time of loading if user didn't print label.


	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 (
	'INVPRINTST',
	'Invalid print status',
	'Please reprint UPS/Fedex label.',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);	

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 (
	'NOTHING2PR',
	'Invalid Quantity',
	'Zero quantity.',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);


-------------- Function To Print Transporter Name From Despatch ------------------

CREATE OR REPLACE FUNCTION DDF_GET_TRAN_NAME_DESPATCH(AS_REPL_ORDER WAVE_TASK_DET.REF_ID%TYPE) 
RETURN varchar2 IS 
AS_TRAN_NAME TRANSPORTER.TRAN_NAME%TYPE; 
AS_PTCN WAVE_TASK_DET.PTCN%TYPE; 
AS_REF_ID WAVE_TASK_DET.REF_ID%TYPE; 
AS_TRAN_CODE TRANSPORTER.TRAN_CODE%TYPE; 
BEGIN

SELECT PTCN INTO AS_PTCN FROM WAVE_TASK_DET WHERE REF_ID = AS_REPL_ORDER;

SELECT REF_ID INTO AS_REF_ID FROM WAVE_TASK_DET WHERE PTCN = AS_PTCN AND REF_SER = 'S-DSP ';

SELECT TRAN_CODE INTO AS_TRAN_CODE FROM DESPATCH WHERE DESP_ID  = AS_REF_ID;

SELECT TRAN_NAME INTO AS_TRAN_NAME FROM TRANSPORTER WHERE TRAN_CODE = AS_TRAN_CODE;

RETURN AS_TRAN_NAME ; 
EXCEPTION  
WHEN NO_DATA_FOUND THEN RETURN '' ; 
END;
/
-------Changed by sankara add sql's given by rohan on 22-06-2013--------------------	
alter table wave_status_org add  carrier_symbol varchar2(50);
alter table wave_status_org add  carrier_friendlyName varchar2(50);
alter table carton_master add  carrier_symbol varchar2(50);
alter table carton_master add  carrier_friendlyName varchar2(50);
commit;
-------Changed by sankara add sql'  for added column sf_identity in carton_master on 26-06-2013--------------------	
alter table carton_master add sf_identity varchar2(250);

INSERT INTO itm2menu (
	application ,
	level_1 ,
	level_2 ,
	level_3 ,
	level_4 ,
	level_5 ,
	win_name ,
	descr ,
	comments ,
	menu_path ,
	icon_path ,
	close_icon ,
	open_icon ,
	obj_type ,
	chg_date ,
	chg_term ,
	chg_user ,
	mob_deploy )
 VALUES (
	'WMS',
	7,
	3,
	0,
	0,
	0,
	'w_ptcn_confirm',
	'Close Out EOD(Manifestation)',
	'PTCN',
	'WMS.7.3.0.0.0',
	'e12_logo.gif',
	NULL,
	NULL,
	'P',
	fn_sysdate(),
	'Base  ',
	'Base  ',
	NULL);
INSERT INTO transetup (
	tran_window,
	save_flag,
	val_flag,
	key_flag,
	key_string,
	udf_1,
	udf_2,
	udf_3,
	udf_4,
	udf_5,
	repeate_add,
	chg_date,
	chg_user,
	chg_term,
	edi_option,
	site_acc_col,
	confirm_col,
	confirm_val,
	repeat_add_det,
	repeatadddet,
	load_mode,
	auto_confirm,
	ledg_post_conf,
	chg_date_on_conf,
	tran_id_col,
	mail_option,
	confirm_mode,
	garbage_opt,
	val_flag_edi,
	verify_password,
	cust_acc_col,
	sales_pers_acc_col,
	supp_acc_col,
	item_ser_acc_code,
	emp_acc_col,
	item_ser_acc_col,
	workflow_opt,
	table_name,
	application,
	table_desc,
	tran_date_col,
	tran_id__from,
	tran_id__to,
	table_name_det1,
	table_name_det2,
	table_name_det3,
	multitire_opt,
	ref_ser,
	view_mode,
	tax_forms,
	sign_status,
	user_tran_window,
	custom_preview_obj,
	ignoreerrlist_onload,
	childdata_argopt,
	edit_tmplt,
	wrkflw_init,
	edittax,
	formal_args,
	audit_trail_opt,
	edit_opt,
	cache_opt,
	optimize_mode,
	edit_expr,
	rate_col,
	qty_col,
	edit_expr_inp,
	rcp_cache_status,
	print_control,
	transfer_mode,
	profile_id__res,
	tran_compl_msg,
	period_option,
	wrkflw_priority,
	exec_type,
	disp_meta_data,
	allow_attach,
	start_form,
	isattachment)
 VALUES (
	'w_ptcn_confirm',
	'2',
	'2',
	'M',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'N',
	fn_sysdate(),
	'Base ',
	'Base  ',
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'0',
	'0',
	'N',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'DIS',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'P-RCP',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO obj_forms(
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata )	
 VALUES (
	'w_ptcn_confirm',
	'ptcn',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
	
INSERT INTO obj_forms(
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata )	
 VALUES (
	'w_ptcn_confirm',
	'ptcn',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
	
INSERT INTO obj_actions (
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES (
	'ptcn_confirm',
	1,
	NULL,
	'GetData',
	'get_data',
	'a',
	'R',
	'GetData',
	'1',
	'3',
	NULL,
	'U',
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE  ');
	
INSERT INTO obj_actions (
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES (
	'ptcn_confirm',
	2,
	NULL,
	'Process',
	'process',
	'a',
	'R',
	'Process',
	'1',
	'3',
	NULL,
	'U',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE');

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 (
	'ptcn_confirm',
	'get_data',
	'1',
	'ptcn_get_data',
	NULL,
	'0',
	fn_sysdate(),
	'Base ',
	'Base',
	'2',
	'EJB',
	'ShipmentPrc',
	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 (
	'ptcn_confirm',
	'process',
	'1',
	'ptcn_process',
	NULL,
	'0',
	fn_sysdate(),
	'Base  ',
	'Base',
	'2',
	'EJB',
	'ShipmentPrc',
	NULL);
	
INSERT INTO system_event_services (
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,
	return_descr ,
	return_xfrm ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'ptcn_get_data',
	'GetData',
	'http://localhost/axis/services/ProcessService',
	'BASE',
	'getData',
	'String',
	'S',
	NULL,
	NULL,
	fn_sysdate(),
	'BASE ',
	'BASE');
INSERT INTO system_event_services (
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,
	return_descr ,
	return_xfrm ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'ptcn_process',
	'process',
	'http://localhost/axis/services/ProcessService',
	'BASE',
	'process',
	'String',
	'S',
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE');
	
INSERT INTO system_service_args (                     
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'ptcn_get_data',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Base',
	'Base',
	'EJB');
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'ptcn_get_data',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE ',
	'BASE',
	'ShipmentPrc');
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'ptcn_get_data',
	3,
	'XML_DATA',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'ptcn_get_data',
	4,
	'XML_DATA_1',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'ptcn_get_data',
	5,
	'WINNAME',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'ptcn_get_data',
	6,
	'XTRA_PARAMS',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'ptcn_process',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'C.String',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	'EJB');
	
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'ptcn_process',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'C.String',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	'ShipmentPrc');
	
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'ptcn_process',
	3,
	'XML_DATA_1',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);
	
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'ptcn_process',
	4,
	'XML_DATA__ALL',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);
	
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'ptcn_process',
	5,
	'OBJ_CONTEXT',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);
	
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'ptcn_process',
	6,
	'XTRA_PARAMS',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);
	
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 (
	'BLKFROMDT ',
	'From Date Blank',
	'From Date Should not be Blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base  ',
	'Base   ',
	NULL,
	NULL);
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 (
	'BLKTODT ',
	'To Date Blank',
	'To Date Should not be Blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base  ',
	'Base   ',
	NULL,
	NULL);
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 (
	'INVLDATA  ',
	'No Data Found',
	'No Data Found For Given Arguments',
	'E',
	'0',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base  ',
	'Base  ',
	NULL,
	NULL);
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 (
	'INVLDATE ',
	'Invalid Date !',
	'To Date is always greater than From Date',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE  ',
	NULL,
	NULL);
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 (
	'BLKSHIPTYP',
	'Blank Shipment Type',
	'Shipment Type Should not be Blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base  ',
	'Base  ',
	NULL,
	NULL);
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 (
	'BLKTRANFR ',
	'Transporter Code From Blank',
	'Transporter Code From Should not be Blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base  ',
	NULL,
	NULL);
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 (
	'BLKTRANTO ',
	'Transporter Code To Blank',
	'Transporter Code To should not be Blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base  ',
	NULL,
	NULL);
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 (
	'INVSHIPTYP',
	'Invalid Shipment Type',
	'Entered Shipment type does not exist in the gencodes master',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base  ',
	'Base   ',
	NULL,
	NULL);
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 (
	'INVTRANPRT',
	'Invalid Transporter Code',
	'Entered Transporter Code does not exist in the Transporter Master',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base  ',
	'Base  ',
	NULL,
	NULL);
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 (
	'PRCESSFUL',
	'Process Successful !',
	'Selected rows updated Successfully',
	'W',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base  ',
	'Base  ',
	NULL,
	NULL);
INSERT INTO pophelp(
	field_name ,
	mod_name ,
	sql_str ,
	dw_object ,
	msg_title ,
	width ,
	height ,
	chg_date ,
	chg_user ,
	chg_term ,
	dist_opt ,
	filter_string ,
	sql_input ,
	default_col ,
	pop_align ,
	query_mode ,
	page_context ,
	pophelp_cols ,
	pophelp_source ,
	multi_opt ,
	help_option )
VALUES (
	'TRAN_CODE_FROM',
	'W_PTCN_CONFIRM',
	'SELECT TRAN_CODE,TRAN_NAME FROM TRANSPORTER',
	'ptcn_confirm',
	'Transporter From',
	0,
	0,
	fn_sysdate(),
	'Base ',
	'Base ',
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO pophelp(
	field_name ,
	mod_name ,
	sql_str ,
	dw_object ,
	msg_title ,
	width ,
	height ,
	chg_date ,
	chg_user ,
	chg_term ,
	dist_opt ,
	filter_string ,
	sql_input ,
	default_col ,
	pop_align ,
	query_mode ,
	page_context ,
	pophelp_cols ,
	pophelp_source ,
	multi_opt ,
	help_option )
 VALUES (
	'TRAN_CODE_TO',
	'W_PTCN_CONFIRM',
	'SELECT TRAN_CODE,TRAN_NAME FROM TRANSPORTER',
	'ptcn_confirm',
	'Transporter To',
	0,
	0,
	fn_sysdate(),
	'Base  ',
	'Base   ',
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO pophelp(
	field_name ,
	mod_name ,
	sql_str ,
	dw_object ,
	msg_title ,
	width ,
	height ,
	chg_date ,
	chg_user ,
	chg_term ,
	dist_opt ,
	filter_string ,
	sql_input ,
	default_col ,
	pop_align ,
	query_mode ,
	page_context ,
	pophelp_cols ,
	pophelp_source ,
	multi_opt ,
	help_option )
VALUES (
	'SHIPMENT_TYPE',
	'W_PTCN_CONFIRM',
	'SELECT FLD_VALUE,DESCR FROM GENCODES WHERE FLD_NAME = ''SHIPMENT_TYPE'' AND MOD_NAME = ''W_TRANSPORTER''',
	'ptcn_confirm',
	'Shipment Type',
	0,
	0,
	fn_sysdate(),
	'BASE  ',
	'BASE  ',
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
UPDATE GENCODES SET FLD_VALUE='Taro Commercial' WHERE FLD_NAME='SHIPMENT_TYPE' AND MOD_NAME='W_TRANSPORTER' AND DESCR='TARO COMMERCIAL';

UPDATE GENCODES SET FLD_VALUE='Taro Fulfillment' WHERE FLD_NAME='SHIPMENT_TYPE' AND MOD_NAME='W_TRANSPORTER' AND DESCR='TARO FULFILLMENT';
COMMIT;

--Changed by Rohan on 01-07-13 for void packages in wave cancellation

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 (
	'NTVOIDPKGS',
	' Packages void unsuccessful',
	'Packages not void for shipment.',
	'E',
	'E',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);	
////sankara 05-07-13 -------------

alter table shipment add state_code char(5);
alter table shipment add stan_code char(5);
alter table shipment add count_code char(5);

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 (
	'INVCOUNTRY',
	'Invalid Country',
	'Please enter valid Country',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base ',
	NULL,
	NULL);
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 (
	'INVSTATE  ',
	'Invalid State',
	'Please enter valid State',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base ',
	NULL,
	NULL);
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 (
	'INVSTATION',
	'Invalid Station',
	'Please enter valid Station',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base ',
	NULL,
	NULL);
INSERT INTO pophelp(
	field_name ,
	mod_name ,
	sql_str ,
	dw_object ,
	msg_title ,
	width ,
	height ,
	chg_date ,
	chg_user ,
	chg_term ,
	dist_opt ,
	filter_string ,
	sql_input ,
	default_col ,
	pop_align ,
	query_mode ,
	page_context ,
	pophelp_cols ,
	pophelp_source ,
	multi_opt ,
	help_option )
VALUES (
	'STAN_CODE',
	'W_SHIPMENT',
	'SELECT STAN_CODE,DESCR FROM STATION',
	NULL,
	'STATION CODE',
	0,
	0,
	fn_sysdate(),
	'Base ',
	'Base ',
	'1',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO pophelp(
	field_name ,
	mod_name ,
	sql_str ,
	dw_object ,
	msg_title ,
	width ,
	height ,
	chg_date ,
	chg_user ,
	chg_term ,
	dist_opt ,
	filter_string ,
	sql_input ,
	default_col ,
	pop_align ,
	query_mode ,
	page_context ,
	pophelp_cols ,
	pophelp_source ,
	multi_opt ,
	help_option )
VALUES (
	'COUNT_CODE',
	'W_SHIPMENT',
	'SELECT COUNT_CODE,DESCR FROM COUNTRY',
	NULL,
	'COUNTRY CODE',
	0,
	0,
	fn_sysdate(),
	'Base ',
	'Base ',
	'1',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO pophelp(
	field_name ,
	mod_name ,
	sql_str ,
	dw_object ,
	msg_title ,
	width ,
	height ,
	chg_date ,
	chg_user ,
	chg_term ,
	dist_opt ,
	filter_string ,
	sql_input ,
	default_col ,
	pop_align ,
	query_mode ,
	page_context ,
	pophelp_cols ,
	pophelp_source ,
	multi_opt ,
	help_option )
VALUES (
	'STATE_CODE',
	'W_SHIPMENT',
	'SELECT STATE_CODE,DESCR FROM STATE',
	NULL,
	'STATE CODE',
	0,
	0,
	fn_sysdate(),
	'Base ',
	'Base  ',
	'1',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO OBJ_ITEMCHANGE(
	obj_name,
	form_no ,
	field_name ,
	mandatory )
 VALUES (
	'shipment',
	'1  ',
	'count_code',
	NULL);
INSERT INTO OBJ_ITEMCHANGE(
	obj_name,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'shipment',
	'1  ',
	'stan_code',
	NULL);
INSERT INTO OBJ_ITEMCHANGE(
	obj_name,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'shipment',
	'1  ',
	'state_code',
	NULL);
commit;
--Changed by Rohan on 10-07-13
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 (
	'VTINVTRANF',
	'Invalid Transfer',
	'NOSL Location stock transfer to NOSL Location only.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base  ',
	NULL,
	NULL);
INSERT INTO DISPARM (
	prd_code ,
	var_name ,
	var_type ,
	var_value ,
	descr ,
	var_subs ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'999999',
	'INV_NO_SL',
	'S',
	'NOSL',
	'Nosl Location',
	0,
	fn_sysdate(),
	'BASE ',
	'BASE ');
commit;
INSERT INTO disparm (
	prd_code,
	var_name,
	var_type,
	var_value,
	descr,
	var_subs,
	chg_date,
	chg_user,
	chg_term)
 VALUES (
	'999999',
	'ACTIVE_REPL_SPILT_COUNT',
	'S',
	'10',
	'Active Repanishment task split variable',
	0,
	fn_sysdate(),
	'BASE',
	'Rohan');
	--///12-jul-13
	
	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 (
	'VTPUCNTCNF',
	'uncofirmed purchase order',
	'Purchase Order not confirm.Please confirm Purchase Order ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base ',
	NULL,
	NULL);
	
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 (
	'VTINVPUORD',
	'Invalid purchase order',
	'Purchase Order not exist.Please enter valid Purchase Order',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base ',
	NULL,
	NULL);	
INSERT INTO obj_itemchange(
	obj_name,
	form_no,
	field_name,
	mandatory)
 VALUES (
	'asn',
	'2',
	'line_no__ord',
	NULL);

INSERT INTO obj_itemchange(
	obj_name,
	form_no,
	field_name,
	mandatory)
 VALUES (
	'asn',
	'2',
	'itm_default',
	NULL);

INSERT INTO obj_itemchange(
	obj_name,
	form_no,
	field_name,
	mandatory)
 VALUES (
	'asn',
	'2',
	'itm_defaultedit',
	NULL);
	
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 (
	'VTACTPKCSC',
	'Invalid Selection of Actives',
	'Sales Order in cases Active Pick should not Allowed',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base ',
	NULL,
	NULL);
commit;	
///Sankara and Rohan 17-JUL-13

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 (
	'VTMNSTKHLD',
	'Stock is on Hold',
	'Manually allocated Stock is on Hold',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base  ',
	'Base  ',
	NULL,
	NULL);

	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 (
	'NULLPOLINE',
	'Null purchase order Line No.',
	'Purchase order Line No is blank.Please enter valid Purchase Order Line No',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base',
	'Base',
	NULL,
	NULL);
///Rohan 18JUL13
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 (
	'VMACTRECHG',
	'Repl Ord already processed',
	'Replenishment order processed by other user !',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE  ',
	NULL,
	NULL);

	commit;

//Changed By Pragyan 29/JUL/13
	
INSERT INTO DISPARM (
	prd_code ,
	var_name ,
	var_type ,
	var_value ,
	descr ,
	var_subs ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'999999',
	'REJECTION_LOCKCODE',
	'S',
	'REJECT_LCK',
	'Rejection Lock Code',
	0,
	fn_sysdate(),
	'BASE',
	'BASE');
	commit;

	
	
CREATE OR REPLACE function FN_WAVE_DESCRIPTION(VI_REF_SER IN CHAR,VI_REF_ID IN CHAR, VI_PTCN IN VARCHAR) 
RETURN VARCHAR2 IS TEMP_DESCR VARCHAR2(200); 
CNT1 NUMBER; 
--TEMP_DESCR VARCHAR2(200); 
TEMP_HAZARDOUS CHAR; 
TEMP_ITEM_CODE CHAR(10); 
TEMP_REF_ID CHAR(10); 
TEMP_CASE VARCHAR2(20); 
TEMP_ACTIVE VARCHAR2(20); 
TEMP_REF_SER CHAR(6); 
ISTACKDONE  CHAR(1); 
 
BEGIN 
  BEGIN 
  --ISTACKDONE := 'N'; 
  IF(VI_REF_SER = 'R-DSO') THEN 
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ; 
    RETURN TEMP_DESCR; 
  ELSIF (VI_REF_SER = 'R-PND') THEN 
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ; 
    RETURN TEMP_DESCR; 
  ELSIF (VI_REF_SER = 'S-DSP') THEN 
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ; 
    RETURN TEMP_DESCR; 
  ELSIF (VI_REF_SER = 'R-CPA') THEN 
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ; 
    RETURN TEMP_DESCR; 
  ELSIF (VI_REF_SER = 'R-TASK') THEN 
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ; 
    RETURN TEMP_DESCR; 
  ELSIF (VI_REF_SER = 'RD-DSA') THEN 
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ; 
    RETURN TEMP_DESCR; 
  ELSIF (VI_REF_SER = 'RN-DSA') THEN 
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ; 
    RETURN TEMP_DESCR; 
  ELSIF (VI_REF_SER = 'RP-ACT') THEN 
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ; 
    RETURN TEMP_DESCR; 
  ELSIF (VI_REF_SER = 'RP-PND') THEN 
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ; 
    RETURN TEMP_DESCR; 
  ELSIF (VI_REF_SER = 'RP-PND') THEN 
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ; 
    RETURN TEMP_DESCR; 
  ELSIF (VI_REF_SER = 'RR-DSA') THEN 
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ; 
    RETURN TEMP_DESCR; 
  ELSIF (VI_REF_SER = 'RS-DSO') THEN 
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ; 
    RETURN TEMP_DESCR; 
  ELSIF (VI_REF_SER = 'S-DOC') THEN 
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ; 
    RETURN TEMP_DESCR; 
  ELSIF (VI_REF_SER = 'M-PACK') THEN 
    SELECT DESCR INTO TEMP_DESCR FROM REFSER WHERE REF_SER = VI_REF_SER ; 
    RETURN TEMP_DESCR; 
  END IF; 
  
    if( VI_REF_SER = 'C-PICK') then  
        TEMP_HAZARDOUS := ''; 
        select wtd.ref_id,WTD.REF_SER, (CASE WHEN I.hazardous IS NULL THEN 'N' ELSE I.hazardous END) AS HAZ into TEMP_REF_ID,TEMP_REF_SER, TEMP_HAZARDOUS 
        from wave_task_det WTD, ITEM I , PICK_ORD_DET POD 
        where WTD.ptcn= VI_PTCN and WTD.ref_ser ='C-PICK' and WTD.REF_ID = VI_REF_ID  
        AND WTD.REF_ID = POD.PICK_ORDER AND I.ITEM_CODE = POD.ITEM_CODE AND ROWNUM = 1; 
        IF (TEMP_REF_SER = 'C-PICK' AND TEMP_HAZARDOUS = 'Y' ) THEN           
          TEMP_CASE := 'HAZ_CASE_CASE'; 
          ISTACKDONE := 'Y'; 
        ELSIF (TEMP_REF_SER = 'C-PICK' AND TEMP_HAZARDOUS = 'N' ) THEN 
           TEMP_CASE := 'CASE_CASE'; 
           ISTACKDONE := 'Y';        
        END IF; 
    END IF; 
    IF ( VI_REF_SER = 'M-PICK') then          
       select wtd.ref_id,WTD.REF_SER, (CASE WHEN I.hazardous IS NULL THEN 'N' ELSE I.hazardous END) AS HAZ into TEMP_REF_ID,TEMP_REF_SER, TEMP_HAZARDOUS 
       from wave_task_det WTD, ITEM I , PICK_ORD_DET POD 
       where WTD.ptcn= VI_PTCN and WTD.ref_ser ='M-PICK' and WTD.REF_ID  = VI_REF_ID 
       AND WTD.REF_ID = POD.PICK_ORDER AND I.ITEM_CODE = POD.ITEM_CODE AND ROWNUM = 1; 
       IF (TEMP_REF_SER = 'M-PICK' AND TEMP_HAZARDOUS = 'Y' ) THEN 
         TEMP_CASE := 'HAZ_MASTER_CASE'; 
         --RETURN TEMP_CASE; 
         ISTACKDONE := 'Y'; 
       ELSIF (TEMP_REF_SER = 'M-PICK' AND TEMP_HAZARDOUS = 'N' ) THEN 
         TEMP_CASE := 'MASTER_CASE'; 
         ISTACKDONE := 'Y';         
       END IF; 
    ELSIF ( VI_REF_SER = 'P-PICK' ) then 
       TEMP_HAZARDOUS := ''; 
       select wtd.ref_id,WTD.REF_SER, (CASE WHEN I.hazardous IS NULL THEN 'N' ELSE I.hazardous END) AS HAZ into TEMP_REF_ID,TEMP_REF_SER, TEMP_HAZARDOUS 
       from wave_task_det WTD, ITEM I , PICK_ORD_DET POD 
       where WTD.ptcn= VI_PTCN and WTD.ref_ser ='P-PICK' and WTD.REF_ID  = VI_REF_ID 
       AND WTD.REF_ID = POD.PICK_ORDER AND I.ITEM_CODE = POD.ITEM_CODE AND ROWNUM = 1; 
       IF (TEMP_REF_SER = 'P-PICK' AND TEMP_HAZARDOUS = 'Y' ) THEN 
         TEMP_CASE := 'HAZ_PARCEL_CASE'; 
         ISTACKDONE := 'Y'; 
       ELSIF (TEMP_REF_SER = 'P-PICK' AND TEMP_HAZARDOUS = 'N' ) THEN 
         TEMP_CASE := 'PARCEL_CASE'; 
         ISTACKDONE := 'Y'; 
       END IF; 
     ELSIF ( VI_REF_SER = 'A-PICK' ) then 
        select count(*) as cont into CNT1 from wave_task_det WTD where WTD.ptcn = VI_PTCN and WTD.ref_ser ='C-PICK';       
       IF (CNT1 > 0 ) then 
          TEMP_CASE := 'CASE_CASE';         
      end if; 
      select count(*) as cont into CNT1 from wave_task_det WTD where WTD.ptcn = VI_PTCN and WTD.ref_ser ='M-PICK';        
       IF (CNT1 > 0 ) then 
          TEMP_CASE := 'MASTER_CASE';         
      end if; 
      select count(*) as cont into CNT1 from wave_task_det WTD where WTD.ptcn = VI_PTCN and WTD.ref_ser ='P-PICK';        
       IF (CNT1 > 0 ) then 
          TEMP_CASE := 'PARCEL_CASE';         
      end if; 
      select count(*) as cont into CNT1 from wave_task_det WTD,wave_status_org O where WTD.ptcn = VI_PTCN and o.ptcn = WTD.ptcn  and WTD.ref_ser ='A-PICK';  
      IF (CNT1 > 0 ) then 
		TEMP_CASE := 'PARCEL_CASE';         
	end if;
       select count(*) as cont into CNT1 from wave_task_det WTD where WTD.ptcn = VI_PTCN and WTD.ref_ser ='M-PICK';        
       IF (CNT1 > 0 ) then 
          TEMP_CASE := 'MASTER_CASE';         
      end if; 
    end if;    
    
  IF(VI_REF_SER = 'C-PICK' AND TEMP_CASE = 'HAZ_CASE_CASE' ) THEN 
    SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'HAZ_CASE_CASE' and MOD_NAME = 'WAVE_TASK' ; 
    RETURN TEMP_DESCR; 
  ELSIF (VI_REF_SER = 'C-PICK' AND TEMP_CASE = 'CASE_CASE' ) THEN 
    SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'CASE_CASE' and MOD_NAME = 'WAVE_TASK' ; 
    RETURN TEMP_DESCR; 
  ELSIF (VI_REF_SER = 'M-PICK' AND TEMP_CASE = 'HAZ_MASTER_CASE' ) THEN ---// for normal MASTER pick ------- start 
    SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'HAZ_MASTER_CASE' and MOD_NAME = 'WAVE_TASK' ; 
    RETURN TEMP_DESCR; 
  ELSIF (VI_REF_SER = 'M-PICK' AND TEMP_CASE = 'MASTER_CASE' ) THEN 
    SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'MASTER_CASE' and MOD_NAME = 'WAVE_TASK' ; 
    RETURN TEMP_DESCR; 
  ELSIF (VI_REF_SER = 'P-PICK' AND TEMP_CASE = 'HAZ_PARCEL_CASE' ) THEN ---// for normal MASTER pick ------- start 
    SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'HAZ_PARCEL_CASE' and MOD_NAME = 'WAVE_TASK' ; 
    RETURN TEMP_DESCR; 
  ELSIF (VI_REF_SER = 'P-PICK' AND TEMP_CASE = 'PARCEL_CASE' ) THEN 
    SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'PARCEL_CASE' and MOD_NAME = 'WAVE_TASK' ; 
    RETURN TEMP_DESCR; 
  ELSIF (VI_REF_SER = 'A-PICK') THEN 
   
       IF ( (TEMP_CASE <> 'PARCEL_CASE' AND TEMP_CASE <> 'MASTER_CASE') or TEMP_CASE is null ) THEN 
           SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'CASE_ACTIVE' and MOD_NAME = 'WAVE_TASK' ; 
            RETURN TEMP_DESCR; 
        ELSIF ( TEMP_CASE = 'MASTER_CASE') THEN 
            SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'MASTER_ACTIVE' and MOD_NAME = 'WAVE_TASK' ; 
            RETURN TEMP_DESCR; 
        ELSIF ( TEMP_CASE = 'PARCEL_CASE') THEN 
           SELECT DESCR INTO TEMP_DESCR FROM GENcodes WHERE FLD_NAME = 'PARCEL_ACTIVE' and MOD_NAME = 'WAVE_TASK' ; 
           RETURN TEMP_DESCR; 
        
        END IF; 
  END IF;  
  
  EXCEPTION 
  WHEN NO_DATA_FOUND  THEN 
   TEMP_DESCR :=''; 
  END; 
  RETURN TEMP_DESCR; 
END;


alter table shipment_content add LENGTH NUMBER(14,3);
alter table shipment_content add WIDTH NUMBER(14,3);
alter table shipment_content add HEIGHT NUMBER(14,3);

alter table shipment add PKG_DESCR VARCHAR2(60);
alter table shipment add UNIT_VALUE NUMBER(15,4);
alter table shipment add ITEM_DESCR VARCHAR2(60);
 
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 (
	'VTINVPNCN',
	'Invalid Carton/Pallet No',
	'Invalid Carton No.and Pallet No. combination.Please enter Carton No. and Pallet No. ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE  ',
	NULL,
	NULL);
	
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 (
	'VTINVPALET',
	'Invalid Pallet No.',
	'Pallet Number status is not valid.Please enter valid Pallet Number',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);
	
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 (
	'VTNLPALLET',
	'Null Pallet No.',
	'Pallet Number is null.Please enter valid Pallet Number',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);

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 (
	'VTADSIPKGE',
	'Packages set unsuceesfuly',
	'ADSI Packages not set Properly ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE  ',
	NULL,
	NULL);	

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 (
	'VTINVPALNO',
	'Invalid No of Pallet.',
	'No of Pallet is blank.Please enter valid no of Pallet.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE  ',
	NULL,
	NULL);		
	
CREATE OR REPLACE TRIGGER TRIG_WAVE_STAT_ORG
AFTER UPDATE OF tran_code ON DESPATCH
FOR EACH ROW WHEN (new.tran_code <> old.tran_code)
BEGIN
      UPDATE WAVE_STATUS_ORG SET
      PRINT_STATUS = 'N'
      WHERE WAVE_ID = :old.wave_id;

     UPDATE  SHIPMENT
     SET     TRAN_CODE = :new.tran_code
     WHERE   SHIPMENT_ID  IN (SELECT SHIP_DOCS.SHIPMENT_ID FROM SHIP_DOCS
     WHERE SHIP_DOCS.REF_ID = :old.desp_id);

     UPDATE SHIP_DOCS 
     SET     TRAN_CODE = :new.tran_code
     WHERE REF_ID = :old.desp_id;

  EXCEPTION

       WHEN OTHERS THEN

        Raise;

  END TRIG_WAVE_STAT_ORG;
  /
commit;

//Shankara
INSERT INTO system_events (
	obj_name ,
	event_code ,
	event_context,
	service_code ,
	chg_date ,
	chg_user ,
	chg_term ,
	result_handle ,
	overwrite_core ,
	comp_type ,
	comp_name )
VALUES (
	'shipment',
	'post_save',
	'2',
	'pos_shipment',
	 fn_sysdate(),
	'Base',
	'Base',
	'2',
	'0',
	'EJB',
	'ShipmentPos');
INSERT INTO system_event_services (
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,	
	chg_date ,
	chg_user ,
	chg_term ) 
VALUES (
	'pos_shipment',
	'postSave',
	'http://localhost:9090/axis/services/ValidatorService',
	'BASE',
	'postSave',
	'String',
	'S',
	fn_sysdate(),
	'Base',
	'Base');
INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_shipment',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Base',
	'Base',
	'EJB');

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_shipment',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Base',
	'Base',
	'ShipmentPos');

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_shipment',
	3,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Base ',
	'Base',
	NULL);

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_shipment',
	4,
	'<tran_id>',
	'I',
	NULL,
	'B.String',
	NULL,
	fn_sysdate(),
	'Base',
	'Base',
	NULL);

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_shipment',
	5,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Base ',
	'Base',
	NULL);

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_shipment',
	6,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Base ',
	'Base',
	NULL);

INSERT INTO system_service_args (
	service_code,
	line_no,
	arg_name,
	arg_mode,
	descr,
	arg_type,
	arg_xfrm,
	chg_date,
	chg_user,
	chg_term,
	arg_value)
VALUES (
	'pos_shipment',
	7,
	'DB_CONN',
	'I',
	NULL,
	'S.Connection',
	NULL,
	fn_sysdate(),
	'Base',
	'Base',
	NULL);
commit;
//---- 
	
INSERT INTO DISPARM (
	prd_code ,
	var_name ,
	var_type ,
	var_value ,
	descr ,
	var_subs ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'999999',
	'PORCP_TRAN_TYPE',
	'S',
	' ',
	'Tran Type',
	0,
	fn_sysdate(),
	'BASE ',
	'BASE ');
	
ALTER TABLE ASN_HDR ADD TRAN_TYPE VARCHAR2(3);	
ALTER TABLE SHIPMENT ADD TELE1 VARCHAR2(15);

commit;



--Chnaged by shankra on 16-08-13
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 (
	'VTTRANCDBK',
	'Transporter Code is Blank',
	'Transporter Code is Blank,Please enter valid Transporter Code',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base ',
	NULL,
	NULL);
commit;	 

--Chnaged By shankara on 19-08-13 for alter of wave task det
 ALTER TABLE WAVE_TASK_DET MODIFY LINE_NO NUMBER(4);
COMMIT;

--Changed by Rohan on 21-08-13 for Manual Shipment
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 (
	'VTINVCONSE',
	'Blank Consigneee Name',
	'please enter consigneee name',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base ',
	NULL,
	NULL);
	
	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 (
	'VTINVADDR',
	'Blank Consigneee Address1',
	'please enter consignee address1.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base ',
	NULL,
	NULL);
	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 (
	'NOTHING2PR',
	'No Change in Shipment',
	'Packet/Transporter data has not been changed!',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base ',
	NULL,
	NULL);
///Shankara 05/sep/13

ALTER TABLE PICK_ORD_HDR ADD ASSIGN_TO CHAR(10);
INSERT INTO itm2menu (
	application ,
	level_1 ,
	level_2 ,
	level_3 ,
	level_4 ,
	level_5 ,
	win_name ,
	descr ,
	comments ,
	menu_path ,
	icon_path ,
	close_icon ,
	open_icon ,
	obj_type ,
	chg_date ,
	chg_term ,
	chg_user ,
	mob_deploy )
 VALUES (
	'WMS',
	2,
	54,
	0,
	0,
	0,
	'w_pick_assignto',
	'Unconfirmed Pick Order',
	'PickOrdHdr',
	'WMS.2.54.0.0.0',
	'e12_logo.gif',
	NULL,
	NULL,
	'P',
	fn_sysdate(),
	'Base  ',
	'Base  ',
	NULL);
INSERT INTO transetup (
	tran_window,
	save_flag,
	val_flag,
	key_flag,
	key_string,
	udf_1,
	udf_2,
	udf_3,
	udf_4,
	udf_5,
	repeate_add,
	chg_date,
	chg_user,
	chg_term,
	edi_option,
	site_acc_col,
	confirm_col,
	confirm_val,
	repeat_add_det,
	repeatadddet,
	load_mode,
	auto_confirm,
	ledg_post_conf,
	chg_date_on_conf,
	tran_id_col,
	mail_option,
	confirm_mode,
	garbage_opt,
	val_flag_edi,
	verify_password,
	cust_acc_col,
	sales_pers_acc_col,
	supp_acc_col,
	item_ser_acc_code,
	emp_acc_col,
	item_ser_acc_col,
	workflow_opt,
	table_name,
	application,
	table_desc,
	tran_date_col,
	tran_id__from,
	tran_id__to,
	table_name_det1,
	table_name_det2,
	table_name_det3,
	multitire_opt,
	ref_ser,
	view_mode,
	tax_forms,
	sign_status,
	user_tran_window,
	custom_preview_obj,
	ignoreerrlist_onload,
	childdata_argopt,
	edit_tmplt,
	wrkflw_init,
	edittax,
	formal_args,
	audit_trail_opt,
	edit_opt,
	cache_opt,
	optimize_mode,
	edit_expr,
	rate_col,
	qty_col,
	edit_expr_inp,
	rcp_cache_status,
	print_control,
	transfer_mode,
	profile_id__res,
	tran_compl_msg,
	period_option,
	wrkflw_priority,
	exec_type,
	disp_meta_data,
	allow_attach,
	start_form,
	isattachment)
 VALUES (
	'w_pick_assignto',
	'2',
	'2',
	'M',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'N',
	fn_sysdate(),
	'Base ',
	'Base  ',
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'0',
	'0',
	'N',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'DIS',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'P-HDR',
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO obj_forms(
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata )	
 VALUES (
	'w_pick_assignto',
	'Pick Order',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
	
INSERT INTO obj_forms(
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata )	
 VALUES (
	'w_pick_assignto',
	'Pick Order',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'2',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO obj_actions (
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES (
	'pick_assignto',
	1,
	NULL,
	'GetData',
	'get_data',
	'a',
	'R',
	'GetData',
	'1',
	'3',
	NULL,
	'U',
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE  ');

INSERT INTO obj_actions (
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user )
 VALUES (
	'pick_assignto',
	2,
	NULL,
	'Process',
	'process',
	'a',
	'R',
	'Process',
	'1',
	'3',
	NULL,
	'U',
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE ');

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 (
	'pick_assignto',
	'get_data',
	'1',
	'pick_get_data',
	NULL,
	'0',
	fn_sysdate(),
	'Base ',
	'Base',
	'2',
	'EJB',
	'PickOrderPrc',
	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 (
	'pick_assignto',
	'process',
	'1',
	'pick_process',
	NULL,
	'0',
	fn_sysdate(),
	'Base  ',
	'Base',
	'2',
	'EJB',
	'PickOrderPrc',
	NULL);

INSERT INTO system_event_services (
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,
	return_descr ,
	return_xfrm ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'pick_get_data',
	'GetData',
	'http://localhost/axis/services/ProcessService',
	'BASE',
	'getData',
	'String',
	'S',
	NULL,
	NULL,
	fn_sysdate(),
	'BASE ',
	'BASE');
INSERT INTO system_event_services (
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,
	return_descr ,
	return_xfrm ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'pick_process',
	'process',
	'http://localhost/axis/services/ProcessService',
	'BASE',
	'process',
	'String',
	'S',
	NULL,
	NULL,
	fn_sysdate(),
	'BASE ',
	'BASE');
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pick_get_data',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Base',
	'Base',
	'EJB');
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pick_get_data',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE ',
	'BASE',
	'PickOrderPrc');
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pick_get_data',
	3,
	'XML_DATA',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pick_get_data',
	4,
	'XML_DATA_1',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pick_get_data',
	5,
	'WINNAME',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pick_get_data',
	6,
	'XTRA_PARAMS',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'pick_process',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'C.String',
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE',
	'EJB');
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pick_process',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'C.String',
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE',
	'PickOrderPrc');
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pick_process',
	3,
	'XML_DATA_1',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pick_process',
	4,
	'XML_DATA__ALL',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pick_process',
	5,
	'OBJ_CONTEXT',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'pick_process',
	6,
	'XTRA_PARAMS',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE',
	NULL);
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 (
	'VPFROMBTBK',
	'From Date Blank',
	'From Date Should not be Blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base ',
	NULL,
	NULL);
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 (
	'VPTODADTBK',
	'To Date Blank',
	'To Date Should not be Blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base ',
	NULL,
	NULL);
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 (
	'VPINVLDATA',
	'No Data Found',
	'No Data Found For Given Arguments',
	'E',
	'0',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base ',
	NULL,
	NULL);
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 (
	'VPINVLDATE',
	'Invalid Date',
	'Please specify the Proper Date',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base ',
	NULL,
	NULL);
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 (
	'VPPRCESFUL',
	'PROCESS OVER!',
	'Process Successful, Selected Row Updated Sucessfully',
	'P',
	NULL,
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base  ',
	NULL,
	NULL);
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 (
	'VPINVUSRCD',
	'Invalid User Code',
	'Invalid User Code, Entered User Code does not exist in the Users Table',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base ',
	NULL,
	NULL);
commit;
-----------------------system table entry for item change----------------
INSERT INTO system_events (
	obj_name ,
	event_code ,
	event_context,
	service_code ,
	chg_date ,
	chg_user ,
	chg_term ,
	result_handle ,
	overwrite_core ,
	comp_type ,
	comp_name )
VALUES (
	'pick_assignto',
	'post_item_change',
	'1',
	'poic_pick_assign',
	 fn_sysdate(),
	'Base',
	'Base',
	'2',
	'0',
	'EJB',
	'PickAssignIC');
INSERT INTO system_event_services (
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,	
	chg_date ,
	chg_user ,
	chg_term) 
VALUES (
	'poic_pick_assign',
	'post item change',
	'http://localhost:9090/axis/services/ValidatorService',
	'BASE',
	'itemChanged',
	'String',
	'S',
	fn_sysdate(),
	'Base',
	'Base');
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	arg_type ,	
	chg_date ,
	chg_user,
	chg_term ,
	arg_value )
VALUES (
	'poic_pick_assign',
	 1,
	'COMPONENT_TYPE',
	'I',
	'S',
	fn_sysdate(),
	'Base',
	'Base',
	'EJB');	
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	arg_type ,	
	chg_date ,
	chg_user,
	chg_term ,
	arg_value )
VALUES (
	'poic_pick_assign',
	 2,
	'COMPONENT_NAME',
	'I',	
	'S',	
	fn_sysdate(),
	'Base',
	'Base',
	'PickAssignIC');	
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	arg_type ,	
	chg_date ,
	chg_user,
	chg_term )
VALUES (
	'poic_pick_assign',
	3,
	'XML_DATA',
	'I',
	'S',
	fn_sysdate(),
	'Base ',
	'Base');	
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	arg_type ,	
	chg_date ,
	chg_user,
	chg_term )
VALUES (
	'poic_pick_assign',
	4,
	'XML_DATA_1',
	'I',
	'S',
	fn_sysdate(),
	'Base',
	'Base');
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	arg_type ,	
	chg_date ,
	chg_user,
	chg_term )
VALUES (
	'poic_pick_assign',
	5,
	'XML_DATA_ALL',
	'I',	
	'S',
	fn_sysdate(),
	'Base',
	'Base');
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	arg_type ,	
	chg_date ,
	chg_user,
	chg_term )
VALUES (
	'poic_pick_assign',
	6,
	'OBJ_CONTEXT',
	'I',
	'S',	
	fn_sysdate(),
	'Base',
	'Base');	
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	arg_type ,	
	chg_date ,
	chg_user,
	chg_term )
VALUES (
	'poic_pick_assign',
	 7,
	'FOCUSED_COLUMN',
	'I',	
	'S',
	fn_sysdate(),
	'Base',
	'Base');	
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	arg_type ,	
	chg_date ,
	chg_user,
	chg_term )
VALUES (
	'poic_pick_assign',
	8,
	'EDIT_FLAG',
	'I',
	'S',	
	fn_sysdate(),
	'Base',
	'Base');	
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	arg_type ,	
	chg_date ,
	chg_user,
	chg_term )
VALUES(
	'poic_pick_assign',
	9,
	'XTRA_PARAMS',
	'I',
	'S',	
	fn_sysdate(),
	'Base',
	'Base');
	
INSERT INTO obj_itemchange(
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
 VALUES (
	'pick_assignto',
	'1  ',
	'pick_order_to',
	NULL);
	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 (
	'VPBLKEMPCD',
	'User Code Blank!',
	'User Code Should not be Blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base',
	NULL,
	NULL);
commit;	

//Pragyan 120913
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 (
'VTTRANCDBK',
'Transporter Code Blank',
'Transporter Code is Blank,Please enter valid Transporter Code',
'E',
'Y',
NULL,
NULL,
NULL,
TO_DATE('16-08-2013 15:50:24','DD-MM-YYYY HH24:MI:SS'),
'Base      ',
'Base           ',
NULL,
NULL);
commit;	
--changed by sankara on 19/09/13 for updated message sql
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 (
	'VTNODATAFD',
	'No data Found',
	'No Data Found in INV_HOLD_DET and INV_HOLD_REL_DET table',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base ',
	NULL,
	NULL);
commit;
--changed by sankara on 30/09/13 for getting unconfirmed repl orders request WM3FSUN005 start.
ALTER TABLE REPL_ORD_HDR ADD ASSIGN_TO CHAR(10);
INSERT INTO pophelp(
	field_name ,
	mod_name ,
	sql_str ,
	dw_object ,
	msg_title ,
	width ,
	height ,
	chg_date ,
	chg_user ,
	chg_term ,
	dist_opt ,
	filter_string ,
	sql_input ,
	default_col ,
	pop_align ,
	query_mode ,
	page_context ,
	pophelp_cols ,
	pophelp_source ,
	multi_opt ,
	help_option )
VALUES (
	'STATUS',
	'W_PICK_ASSIGNTO',
	'SELECT FLD_VALUE,DESCR FROM GENCODES WHERE FLD_NAME = ''STATUS'' AND MOD_NAME = ''W_PICK_ASSIGNTO''',
	'pick_assignto',
	'Status',
	0,
	0,
	fn_sysdate(),
	'Base ',
	'Base ',
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

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 (
	'VPBLKSTAUS',
	'Blank Status',
	'Status Should not be Blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base',
	'Base',
	NULL,
	NULL);
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 (
	'VPINVSTAUS',
	'Invalid Status!',
	'Entered Status does not defined in Gencodes ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Baes',
	'Base',
	NULL,
	NULL);
INSERT INTO GENCODES (
	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3 )
 VALUES (
	'STATUS',
	'W_PICK_ASSIGNTO',
	'R',
	'Replenishment Order',
	'REPLENISHMENT ORDER',
	fn_syadate(),
	'Base ',
	'Base ',
	'Y',
	NULL,
	NULL,
	NULL);
INSERT INTO GENCODES (
	fld_name ,
	mod_name ,
	fld_value ,
	descr ,
	sh_descr ,
	chg_date ,
	chg_user ,
	chg_term ,
	active ,
	udf_str1 ,
	udf_str2 ,
	udf_str3 )
 VALUES (
	'STATUS',
	'W_PICK_ASSIGNTO',
	'P',
	'Pick Order',
	'PICK ORDER',
	fn_sysdate(),
	'Base ',
	'Base ',
	'Y',
	NULL,
	NULL,
	NULL);
commit;
--changed by sankara on 30/09/13 for getting unconfirmed repl orders request WM3FSUN005 end.
--changed by sankara on 03/10/13 for getting for unconfiremd picking pallets
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 (
	'VTPENDPICK',
	'Unconfirmed Picking pallets ',
	'Unconfirmed Picking pallets found,please check the picking tasks.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE ',
	'BASE ',
	NULL,
	NULL);
commit;
--changed by sankara on 04/10/13 update disparm and messages sql of shipment type
INSERT INTO disparm(
	prd_code ,
	var_name ,
	var_type ,
	var_value ,
	descr ,
	var_subs ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
     '999999',
     'TRANSFERED_NEXP_LOCK',
     'S',
     'NE_LOCK',
     'Transfered Short Expiry Items ',
     NULL,
     fn_sysdate(),
     'TARO ',
     'jbnitashishm');
	 
INSERT INTO disparm(
	prd_code ,
	var_name ,
	var_type ,
	var_value ,
	descr ,
	var_subs ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
    '999999',
    'TRANSFERED_EXPR_LOCK',
    'S',
    'EX_LOCK',
    'Transfered Locks for Expired Items',
    NULL,
    fn_sysdate(),
    'TARO ',
    'jbnitashishm ');

INSERT INTO disparm(
	prd_code ,
	var_name ,
	var_type ,
	var_value ,
	descr ,
	var_subs ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'999999',
	'TARO_SHIPPER_NAME',
	'S',
	'Taro Commercial',
	'Shipment Type',
	NULL,
	fn_sysdate(),
	'Base',
	'Base');

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 (
	'VTINVSHTYN',
	'Shipment Type Mismatch',
	'Shipment Type Mismatched Please Check Shipment Type',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE  ',
	NULL,
	NULL);
//chnged by Pragyan 09-OCT-13 to add ptcn in despatch detail	
alter table despatch add ptcn char(10);
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 (
        'VTDIFFTRAN',
        'Invalid PTCN',
        'Cannot club multiple PTCN of different Transporters',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('9-10-2013 06:53:35','DD-MM-YYYY HH24:MI:SS'),
        'TARO      ',
        'jbnitashishm   ',
        NULL,
        NULL);
commit;
--changed by sankara on 11/10/13 update sql for set title in obj_forms
UPDATE obj_forms SET TITLE = 'Reassign' WHERE WIN_NAME ='w_pick_assignto';
commit;
--changed by sankara on 18/10/13 update function given by pragyan sir
CREATE OR REPLACE FUNCTION FN_GET_CONV_QTY(SI_SALE_ORDER IN CHAR,
SI_LINE_NO IN CHAR )
  RETURN number is
  FLAG number ;
  quantity NUMBER;
  qtyDesp NUMBER;
  quantityAlloc NUMBER;
  convQtyStdU   NUMBER;
  UNIT char(3);
  BEGIN
   BEGIN
    SELECT  QUANTITY,qty_alloc,QTY_DESP,CONV__QTY_STDQTY,UNIT INTO
quantity,quantityAlloc,qtyDesp,convQtyStdU,UNIT
    FROM SORDITEM WHERE SALE_ORDER = SI_SALE_ORDER AND TRIM(LINE_NO) =
TRIM(SI_LINE_NO);
  DBMS_OUTPUT.put_line('quantity'||quantity);
 -- DBMS_OUTPUT.put_line('1');
    IF (UNIT = 'CS') THEN
      FLAG := ((quantity * convQtyStdU)-(qtyDesp *
convQtyStdU)-quantityAlloc );
    ELSE
      FLAG := (quantity -qtyDesp -quantityAlloc);
    END IF;
  EXCEPTION
  WHEN NO_DATA_FOUND  THEN
   FLAG :=2;
  END;
  RETURN FLAG;
  END;
/

//Pragyan 18-OCT-13 

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 (
        'VTPICKCOMP',
        'Pick Completed',
        'All items already picked',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('18-10-2013 00:00:00','DD-MM-YYYY HH24:MI:SS'),
        'ppatro    ',
        'ppatro         ',
        NULL,
        NULL);
--changed by sankara on 21/10/13 updated system_events sql of active_pick given by pragyan sir
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_pick',
	'pre_navigate_previous',
	'1',
	'prv_nevigate_ejb',
	NULL,
	'0',
	fn_sysdate(),
	'ppatro  ',
	'ppatro',
	'2',
	'EJB',
	'PickIssIC',
	NULL);
commit;
--changed by sankara on 01/11/13 updated messages sql and update sql of replenishment
Delete from messages where msg_no = 'SRWIZQTY3';
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 (
        'SRWIZQTY3 ',
        'Invalid Quantity !',
        'Physical Quantity cannot be greater than RMA quantity',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        TO_DATE('7-03-2013 03:46:41','DD-MM-YYYY HH24:MI:SS'),
        'BASE    ',
        'BASE    ',
        NULL,
        NULL);

UPDATE MESSAGES SET MSG_STR='No pending Tasks', MSG_DESCR='All tasks are Processed' 
WHERE MSG_NO='RECONEXIST';
--Changed By Pragyan 13-nov-13 last updated function
CREATE OR REPLACE FUNCTION FN_GET_CONV_QTY(SI_SALE_ORDER IN CHAR,
SI_LINE_NO IN CHAR )
  RETURN number is
  FLAG number ;
  quantity NUMBER;
  qtyDesp NUMBER;
  quantityAlloc NUMBER;
  convQtyStdU   NUMBER;
  UNIT char(3);
  BEGIN
   BEGIN
    SELECT  QUANTITY,qty_alloc,QTY_DESP,CONV__QTY_STDQTY,UNIT INTO
quantity,quantityAlloc,qtyDesp,convQtyStdU,UNIT
    FROM SORDITEM WHERE SALE_ORDER = SI_SALE_ORDER AND TRIM(LINE_NO) =
	TRIM(SI_LINE_NO);
      FLAG := ((quantity * convQtyStdU)-(qtyDesp *
convQtyStdU)-quantityAlloc );
  EXCEPTION
  WHEN NO_DATA_FOUND  THEN
   FLAG :=2;
  END;
  RETURN FLAG;
  END;
/

COMMIT;
--changed by sankara on 18/11/13 for pophelp of replenishment and assigned user message. 
UPDATE POPHELP SET SQL_STR='SELECT REPL_ORDER,LOC_CODE FROM (SELECT  DISTINCT R.REPL_ORDER,L.LOC_CODE 
FROM REPL_ORD_DET R,REPL_ORD_HDR H, WAVE_TASK_DET W,LOCATION L ,WAVE_TASK WH 
WHERE W.WAVE_ID = WH.WAVE_ID 
AND R.REPL_ORDER = H.REPL_ORDER
AND R.REPL_ORDER =W.REF_ID 
AND W.STATUS = ''N''
AND H.ORDER_TYPE NOT IN (''E'',''Q'',''T'',''I'',''P'')
AND CASE WHEN R.CANCEL_MODE IS NULL THEN ''N'' ELSE R.CANCEL_MODE END <> ''Y''
AND FN_VALID_REPL(H.REPL_ORDER) =''Y''
AND R.LOC_CODE = L.LOC_CODE
AND L.INV_STAT = ''?'' 
AND FN_CHECK_REPL_ORD_USER(H.REPL_ORDER,''?'') = 1
AND (H.ASSIGN_TO =''?'' OR H.ASSIGN_TO IS NULL ))
ORDER BY REPL_ORDER, LOC_CODE',SQL_INPUT=':1.repl_order,:1.chg_user,:1.login_code' where mod_name = 'W_REPL_ISS';     

                                                                    
UPDATE POPHELP SET SQL_STR='SELECT REPL_ORDER,LOC_CODE FROM (SELECT DISTINCT R.REPL_ORDER , L.LOC_CODE FROM REPL_ORD_DET R,
REPL_ORD_HDR H,WAVE_TASK_DET W,LOCATION L ,WAVE_TASK WH
WHERE W.WAVE_ID = WH.WAVE_ID 
AND R.REPL_ORDER = H.REPL_ORDER
AND R.REPL_ORDER = W.REF_ID 
AND W.STATUS = ''N'' 
AND H.ORDER_TYPE IN (''E'',''Q'',''T'',''I'',''P'')
AND CASE WHEN R.CANCEL_MODE IS NULL THEN ''N'' ELSE R.CANCEL_MODE END <> ''Y''
AND FN_VALID_REPL (H.REPL_ORDER) = ''Y'' 
AND R.LOC_CODE = L.LOC_CODE  
AND L.INV_STAT = ''?''
AND FN_CHECK_REPL_ORD_USER(H.REPL_ORDER,''?'') = 1 
AND (H.ASSIGN_TO =''?'' OR H.ASSIGN_TO IS NULL ))
ORDER BY REPL_ORDER, LOC_CODE ',SQL_INPUT=':1.repl_order,:1.chg_user,:1.login_code' where mod_name = 'W_ACTIVE_REPL_ISS';

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 (
	'INVREPKTSK',
	'Invalid Task',
	'Task is already assigned to another User',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base   ',
	'Base   ',
	NULL,
	NULL);
commit;
--changed by sankara on 19/11/13 for pending replenishment.
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 (
	'VTREPLPEND',
	'Replenishment pending',
	'Replenishment Task Pending',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base  ',
	NULL,
	NULL);
commit;
--changed by sankara on 25/11/13 for clubing ptcn at messages level
INSERT INTO messages_level (
	profile_id ,
	msg_no ,
	win_name ,
	msg_type )
 VALUES (
	'BASE  ',
	'ALLPTCNNTA',
	'w_shipment',
	'W');

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 (
	'LOC_CODE__TO',
	'W_STOCK_TRANSFER',
	'Validation for Pending Replineshment',
	'VTREPLPEND',
	'N',
	'C',
	'select count(1) from repl_ord_det d,wave_task w,wave_task_det k
     where d.repl_order = k.ref_id and w.wave_id = k.wave_id and w.cancel <>
     ''Y'' and k.status <>''Y'' AND d.cancel_mode IS NULL AND site_code = ? and
     d.item_code=? and  d.loc_code = ? and d.lot_no =  ? and d.lot_sl = ? ',
	'0',
	'Q',
	fn_sysdate(),
	'TARO ',
	'jbnitashishm',
	NULL,
	':0.SITE_CODE,:1.ITEM_CODE,:1.LOC_CODE__FR,:1.LOT_NO__FR,:1.LOT_SL__FR',
	10,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

// added by ritesh received from sun(Pragyan) on 06/DEC/13 for  Issue Tracker No-303 start

 ALTER TABLE INVSTAT ADD ALLOC_PREF_CASE CHAR(1);
 
 // added by ritesh received from sun(Pragyan) on 06/DEC/13 for  Issue Tracker No-303 end 
 
 --added by kunal on 17/dec/13 add finparm to store tran_type for  Customer Remittance
 insert into finparm ( prd_code ,var_name ,var_type , var_value ,descr ,var_subs ,chg_date , chg_user ,chg_term )
values ('999999','CR_TRAN_TYPE','S','CRM','Default tran type for CR and DR generated through CRemittance Confirmation',0,sysdate,'BASE','BASE' );

 --added by kunal on 17/dec/13 end
-- ADDED BY RITESH ON 18/DEC/2013 FOR REQUEST FI3ISUN003 START

Insert into OBJ_LINKS(OBJ_NAME,FORM_NO,FIELD_NAME,TARGET_OBJ_NAME,LINK_FORM_NAME,LINK_TITLE,LINK_URI,LINK_TYPE,LINK_ARG,UPDATE_FLAG,LINK_NAME,RIGHTS_CHAR,IMAGE) 
values ('rcp_tr','1','bank_code','rcp_chq_amt','rcp_chq_amt11','Cumulative balance Amount',
null,'1','tran_id.String','0',null,'O',null);

CREATE OR REPLACE FUNCTION fn_get_cum_bal(AS_TRANID IN  VARCHAR2) 
RETURN NUMBER 
IS 
LS_TOTAMT NUMBER(14,3); 
BEGIN
LS_TOTAMT:=0;
  SELECT RECEIPT_FORM.CHQ_AMT -( sum(NVL(RCPDET_FORM.RCP_AMT,0))+sum(NVL(RCPDET_FORM.FIN_CHG,0)) )
  INTO LS_TOTAMT
  FROM RECEIPT_FORM RECEIPT_FORM,RCPDET_FORM RCPDET_FORM 
  WHERE RCPDET_FORM.TRAN_ID = RECEIPT_FORM.TRAN_ID 
  AND RECEIPT_FORM.TRAN_ID = AS_TRANID GROUP BY RECEIPT_FORM.CHQ_AMT; 
   RETURN LS_TOTAMT; 
  END;

-- ADDED BY RITESH ON 18/DEC/2013 FOR REQUEST FI3ISUN003 END
-- ADDED BY RITESH ON 25/DEC/2013 FOR wms issue point no. 306 start
  INSERT INTO system_events 
 (obj_name,event_code,event_context,service_code ,method_rule ,chg_date ,chg_user ,
chg_term ,result_handle ,overwrite_core ,comp_type ,comp_name ,comm_format )
VALUES ('inv_hold_rel_gen','post_item_change','1','poic_default_ejb',NULL,SYSDATE,
'BASE','BASE111','2','0','EJB','IncHoldRelGenIC',NULL);

INSERT INTO obj_itemchange (obj_name,form_no,field_name,mandatory)
VALUES ('inv_hold_rel_gen','1','itm_default',NULL);
-- ADDED BY RITESH ON 25/DEC/2013 FOR wms issue point no. 306 end
-- ADDED BY RITESH ON 27/DEC/2013 FOR wms issue point no. 306 start

insert into  messages(msg_no, msg_str, msg_descr, msg_type, msg_opt, chg_date, chg_user, chg_term)
values ('VTLOCKCD1','Lock Code is blank!','Lock code can not be blank.Please enter lock code.','E','Y',sysdate,'BASE','BASE111'); 
-- ADDED BY RITESH ON 27/DEC/2013 FOR wms issue point no. 306 end
 
commit;
 --changed by sankara on 31/12/2013 for repl order done wise based on stock pk 
 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 (
	'VTREPLORDR',
	'Replenishment Order mismatch',
	'Replenishment should be done Order Wise',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base  ',
	'Base  ',
	NULL,
	NULL);
-- ADDED BY KUNAL ON 04/JAN/13 for SOF 181 N  POINT

insert into disparm ( prd_code ,var_name ,var_type , var_value ,descr ,var_subs ,chg_date , chg_user ,chg_term )
values ('999999','SCH_DSP_DATE','S','2','No of days for Schedule Despatch Date Calculation ',0,sysdate,'BASE','BASE' );

insert into obj_itemchange(obj_name,form_no,field_name) values ('sordform_tr',1,'order_date');
-- ADDED BY KUNAL ON 04/JAN/13 for SOF 181 N  POINT END 
 
commit;
--changed by sankara on 06/01/2014 for pro_no,freight_amt_add points
  ALTER TABLE TRANSPORTER ADD ADSI_FLAG CHAR(1);
 ALTER TABLE SHIP_DOCS ADD FREIGHT_AMT_ADD NUMBER(14,3);
 ALTER TABLE DESPATCH ADD FREIGHT_AMT_ADD NUMBER(14, 3);
 DELETE FROM MESSAGES WHERE MSG_NO='VTREPLORDR';
 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 (
        'VTREPLORDR',
        'Pending Active Replineshment',
        'Active Replineshment Pending from the current location. Please complete Active Replineshment first',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        fn_sysdate(),
        'Base ',
        'Base ',
        NULL,
        NULL);
  commit;      
  -- changed by sankara on 20/01/2014 update messages sql given by pragyan.
   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 (
        'VTACTREPLO',
        'Invalid Replineshment Order',
        'Entered Replenishment order is not an Active Replenishment Order',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        fn_sysdate(),
        'Base ',
        'Base ',
        NULL,
        NULL);
		
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 (
        'VTCASREPLO',
        'Invalid Replenishment Order',
        'Entered Replenishment order is an Active Replenishment Order',
        'E',
        'Y',
        NULL,
        NULL,
        NULL,
        fn_sysdate(),
        'Base ',
        'Base ',
        NULL,
        NULL);
--SQL added by manoj dtd 06/02/2014 to define finparm to Set tran Type in Cr Note through Credit rebill process
Insert into FINPARM (PRD_CODE,VAR_NAME,VAR_TYPE,VAR_VALUE,CHG_DATE,CHG_USER,CHG_TERM,DESCR,VAR_SUBS,ADDL_VALUE) values ('999999','CRBILL_TRAN_TYPE','S','F',SYSDATE,'BASE      ','base           ','Set tran Type in Cr Note through Credit rebill process ',0,null);

--ADDED BY KUNAL ON 11/FEB/14 add gen validate for SOF-TARO
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)
values ('sordform_tr','post_validate','1','post_gen_val',null,'0',sysdate,'KUNAL','KUNAL','2','EJB','GenValidate');

--Added by Manoj dtd 14/02/2014 to set siteCode for which Cycle count scheduler to be executed 
insert into disparm(PRD_CODE,VAR_NAME,VAR_TYPE,VAR_VALUE,DESCR,VAR_SUBS,CHG_DATE,CHG_USER,CHG_TERM) values ('999999','CYCLE_COUNT_SITE','S','TA821','Site Code Defined for Cycle count Scheduler',null,sysdate,'BASE','BASE');
--Ended by Manoj dtd 14/02/2014 to set siteCode for which Cycle count scheduler to be executed

commit;
--changed by sankara on 28/02/14 for add site code in wave_task start.
ALTER TABLE WAVE_TASK ADD SITE_CODE CHAR(5);
commit;
--changed by sankara on 07/03/14 updated sql given by pragyan. 
alter  table wave_status_org add  tran_code__new char(10);

CREATE OR REPLACE TRIGGER TRIG_WAVE_STAT_ORG
AFTER UPDATE OF tran_code ON DESPATCH
FOR EACH ROW WHEN (new.tran_code <> old.tran_code)
DECLARE
WAVE_ORG_TRAN_CODE_NEW VARCHAR2(10);

BEGIN
  SELECT TRAN_CODE__NEW INTO WAVE_ORG_TRAN_CODE_NEW
  FROM WAVE_STATUS_ORG WHERE PTCN = :old.ptcn;
  IF WAVE_ORG_TRAN_CODE_NEW <> :new.tran_code THEN
    UPDATE WAVE_STATUS_ORG SET
    PRINT_STATUS = 'N'
    WHERE
    PTCN = :old.ptcn;
   END IF;
   IF WAVE_ORG_TRAN_CODE_NEW = :new.tran_code THEN
    UPDATE WAVE_STATUS_ORG SET
    PRINT_STATUS = 'Y'
    WHERE
    PTCN = :old.ptcn;
   END IF;
     UPDATE  SHIPMENT
     SET     TRAN_CODE = :new.tran_code
     WHERE   SHIPMENT_ID  IN (SELECT SHIP_DOCS.SHIPMENT_ID FROM SHIP_DOCS
     WHERE SHIP_DOCS.REF_ID = :old.desp_id);
     UPDATE SHIP_DOCS
     SET     TRAN_CODE = :new.tran_code
     WHERE REF_ID = :old.desp_id;
  EXCEPTION
       WHEN OTHERS THEN
        Raise;
  END TRIG_WAVE_STAT_ORG;
  --changed by sankara on 28/02/14 for add site code in wave_task end.
  
  -- ADDED BY RITESH ON 12/MAR/2014 FOR Issue Tracker point #  328 START
  
  ALTER TABLE PHYSCANDET ADD EMP_CODE__VERIFY CHAR(10);
    -- ADDED BY RITESH ON 12/MAR/2014 FOR Issue Tracker point #  328 END

--SQL Added by manoj dtd 01/04/2014 to Increase size of PRIORITY_SEQ UPTO 5 digit for Physical Cycle count
ALTER TABLE PHYSCANDET MODIFY PRIORITY_SEQ NUMBER(5);
--End SQL Added by manoj dtd 01/04/2014 to  Increase size of PRIORITY_SEQ UPTO 5 digit for Physical Cycle count

--changed by sankara on 04/04/14  updated trigger given by pragyan.
CREATE OR REPLACE TRIGGER TRIG_WAVE_STAT_ORG
AFTER UPDATE OF tran_code ON DESPATCH
FOR EACH ROW WHEN (new.tran_code <> old.tran_code)
DECLARE
WAVE_ORG_TRAN_CODE_NEW VARCHAR2(10);
ll_detcnt number(3) := 0;
BEGIN
select count(1) into ll_detcnt from WAVE_STATUS_ORG  where PTCN = :old.ptcn;
if ll_detcnt > 0 then
  SELECT TRAN_CODE__NEW INTO WAVE_ORG_TRAN_CODE_NEW
  FROM WAVE_STATUS_ORG WHERE PTCN = :old.ptcn;
  IF WAVE_ORG_TRAN_CODE_NEW <> :new.tran_code THEN
    UPDATE WAVE_STATUS_ORG SET
    PRINT_STATUS = 'N'
    WHERE
    PTCN = :old.ptcn;
   END IF;
   IF WAVE_ORG_TRAN_CODE_NEW = :new.tran_code THEN
    UPDATE WAVE_STATUS_ORG SET
    PRINT_STATUS = 'Y'
    WHERE
    PTCN = :old.ptcn;
   END IF;
END IF;
     UPDATE  SHIPMENT
     SET     TRAN_CODE = :new.tran_code
     WHERE   SHIPMENT_ID  IN (SELECT SHIP_DOCS.SHIPMENT_ID FROM SHIP_DOCS
     WHERE SHIP_DOCS.REF_ID = :old.desp_id);
     UPDATE SHIP_DOCS
     SET     TRAN_CODE = :new.tran_code
     WHERE REF_ID = :old.desp_id;
  EXCEPTION
       WHEN OTHERS THEN
        Raise;
  END TRIG_WAVE_STAT_ORG;
/
  
--changed by sankara 08/04/14 for wms live

CREATE OR REPLACE FUNCTION       "FN_PRONO" (as_trancode in char,as_prono in varchar2) 
return varchar2 is 
 ls_prono varchar2(20) := as_prono; 
 len number := 0; 
 m number(17,2); 
 rem number(17,2); 
 c number; 
 sumodd number := 0; 
 sumeven number := 0; 
begin 
 if trim(as_trancode) in ('TACO0001','TAUP0071') 
 then 
 m := as_prono / 7; 
 rem := m-trunc(m); 
 if     rem = 0                 then ls_prono := as_prono||'0'; 
 elsif  rem = .14               then ls_prono := as_prono||'1'; 
 elsif (rem = .28 or rem = .29) then ls_prono := as_prono||'2'; 
 elsif (rem = .42 or rem = .43) then ls_prono := as_prono||'3'; 
 elsif  rem = .57               then ls_prono := as_prono||'4'; 
 elsif  rem = .71               then ls_prono := as_prono||'5'; 
 elsif (rem = .85 or rem = .86) then ls_prono := as_prono||'6'; 
 end if; 
 end if; 
 if trim(as_trancode) in ('TAFE0039') 
 then 
 m := as_prono / 7; 
 rem := trunc(m); 
 rem := rem * 7; 
 rem := as_prono - rem; 
 ls_prono := as_prono||trim(rem); 
 end if; 
 return ls_prono ; 
end;
--changed by sankara on 18/04/14 updated messages sql
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 (
	'INVALOCQTY',
	'Error in Replenishment',
	'Allocation Other then Sales Order,needs to be moved first.',
	'E',
	'1',
	NULL,
	NULL,
	NULL,
	TO_DATE('14-04-2014 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BASE   ',
	'BASE   ',
	NULL,
	NULL);
commit;
--changed by sankara on 21/04/14 updated messages sql for wms live
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 (
	'VTREPLQUAN',
	'Invalid quantity',
	'Repelinishment quantity Should not be less then Shipper size',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base  ',
	'Base   ',
	NULL,
	NULL);
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 (
	'VTPKNTCONF',
	'Dock Transfer Not allowed',
	'Picking Task is completed on this pallet, So Dock Trasfer Not allowed',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base  ',
	'Base   ',
	NULL,
	NULL);
commit;
--changed by sankara on 26/05/14 updated messages sql
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 (
 'VTAPLTEXST',
 'Palllete used for picking',
 'You can use old pallet used for this picking task',
 'W',
 'Y',
 NULL,
 NULL,
 NULL,
 fn_sysdate(),
 'Base  ',
 'Base  ',
 NULL,
 NULL);
commit;
-- changed by sankara on 28/05/14 updated alter and messages sql
 alter table wave_task add remarks char(70);
 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 (
	'VTSYSLOCCD',
	'Location Code mismatch',
	'Location Code To and Suggested Location are not same',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base  ',
	'Base  ',
	NULL,
	NULL);
 commit;

--SQL Added by Manoj dtd 30/05/2014 to disable Audit trail for object 'sorder_insert'
update transetup set audit_trail_opt=0 WHERE tran_window='w_sorder_insert';
--SQL Ended by Manoj dtd 30/05/2014 to disable Audit trail for object 'sorder_insert'
 --changed by sankara on 02/06/14 update sql for wave task home screen start.
 ------------Function sql---------------------
CREATE OR REPLACE FUNCTION FN_WAVE_EMP_SHORT_NAME(VI_REF_SER IN CHAR ,VI_REF_Id IN VARCHAR)
  RETURN VARCHAR2 IS EMP_SHORT_NAME VARCHAR2(500);
  BEGIN
IF(VI_REF_SER = 'P-PICK' OR VI_REF_SER = 'C-PICK' OR VI_REF_SER = 'A-PICK' OR VI_REF_SER = 'M-PICK') THEN
select  nvl(pick_ord_hdr.ASSIGN_TO,' ') into EMP_SHORT_NAME
from pick_ord_hdr where pick_ord_hdr.pick_order = VI_REF_Id;
RETURN EMP_SHORT_NAME;
ELSIF (VI_REF_SER = 'R-TASK' OR VI_REF_SER = 'RP-PND' OR VI_REF_SER = 'R-CPA' OR
VI_REF_SER = 'R-PND' OR VI_REF_SER = 'S-DOC' OR VI_REF_SER = 'RP-ACT' OR VI_REF_SER = 'RR-DSA'
OR VI_REF_SER = 'RD-DSA' OR VI_REF_SER = 'R-DSO' OR VI_REF_SER = 'RS-DSO' OR VI_REF_SER = 'RN-DSA') THEN
       select nvl(repl_ord_hdr.ASSIGN_TO,' ') into EMP_SHORT_NAME from repl_ord_hdr where repl_ord_hdr.repl_order = VI_REF_Id;
    END IF;
RETURN EMP_SHORT_NAME;
EXCEPTION
    WHEN NO_DATA_FOUND  THEN
     EMP_SHORT_NAME :=' ';
RETURN EMP_SHORT_NAME;
END;
/

CREATE OR REPLACE FUNCTION FN_WAVE_PERFORMED_BY(VI_REF_SER IN CHAR ,VI_REF_Id IN VARCHAR)
RETURN VARCHAR2 IS PERFORMED_BY VARCHAR2(500);
  userby varchar2(500);
  flag  BOOLEAN := false;
     cursor C1 is SELECT nvl(pick_iss_hdr.chg_user,' ') as PERFORMED_BY1  from pick_iss_hdr where pick_iss_hdr.pick_order = VI_REF_Id; 
     cursor C2 is  SELECT nvl(repl_iss_hdr.chg_user,' ') as PERFORMED_BY1 from repl_iss_hdr where repl_iss_hdr.repl_order = VI_REF_Id;
BEGIN
 IF(VI_REF_SER = 'P-PICK' OR VI_REF_SER = 'C-PICK' OR VI_REF_SER = 'A-PICK' OR VI_REF_SER = 'M-PICK')  THEN
    FOR userchage in  C1
      LOOP
         IF(flag) Then
           userby :=userby || ',' || userchage.PERFORMED_BY1;
         ELSE
          userby := userchage.PERFORMED_BY1;
          flag:=true;
         End IF;
      END LOOP;  
     PERFORMED_BY :=userby;
    RETURN PERFORMED_BY;
 ELSIF(VI_REF_SER = 'R-TASK' OR VI_REF_SER = 'RP-PND' OR VI_REF_SER = 'R-CPA' OR VI_REF_SER = 'R-PND' OR VI_REF_SER = 'S-DOC' OR VI_REF_SER = 'RP-ACT' OR VI_REF_SER = 'RR-DSA' OR VI_REF_SER = 'RD-DSA' OR VI_REF_SER = 'R-DSO' OR VI_REF_SER = 'RS-DSO' OR VI_REF_SER = 'RN-DSA')  THEN
    FOR userchage in  C2
      LOOP
         IF(flag) Then
           userby :=userby || ',' || userchage.PERFORMED_BY1;
         ELSE
          userby := userchage.PERFORMED_BY1;
          flag:=true;
         End IF;
      END LOOP;  
     PERFORMED_BY :=userby;
    RETURN PERFORMED_BY;
 ELSE   
    PERFORMED_BY :=' ';
    RETURN PERFORMED_BY;
 End IF;
 EXCEPTION
    WHEN NO_DATA_FOUND  THEN
     PERFORMED_BY :=' ';
 RETURN PERFORMED_BY;
END;
/

CREATE OR REPLACE FUNCTION FN_WAVE_DEPENDENT_TASKS(VI_REF_SER IN CHAR ,VI_REF_Id IN VARCHAR)
RETURN VARCHAR2 IS DEPENDENT_TASKS VARCHAR2(1500);
  dependentReplTasks varchar2(1500);
  dependentPickTasks varchar2(1500);
  flagRepl  BOOLEAN := false;
  flagPick  BOOLEAN := false;
       cursor C1 is SELECT distinct(nvl(repl_ord_det.repl_order,' ')) as DEPENDENT_REPL_TASKS1 from repl_ord_det where repl_ord_det.pick_order = VI_REF_Id; 
       cursor C2 is SELECT distinct(nvl(pick_ord_det.pick_order,' ')) as DEPENDENT_PICK_TASKS1 from pick_ord_det where pick_ord_det.repl_order = VI_REF_Id;
BEGIN
 IF(VI_REF_SER = 'P-PICK' OR VI_REF_SER = 'C-PICK' OR VI_REF_SER = 'A-PICK' OR VI_REF_SER = 'M-PICK')  THEN
     DEPENDENT_TASKS :=' ';
  RETURN DEPENDENT_TASKS;
 ELSIF(VI_REF_SER = 'R-TASK' OR VI_REF_SER = 'RP-PND' OR VI_REF_SER = 'R-CPA' OR VI_REF_SER = 'R-PND' OR VI_REF_SER = 'S-DOC' OR VI_REF_SER = 'RP-ACT' OR VI_REF_SER = 'RR-DSA' OR VI_REF_SER = 'RD-DSA' OR VI_REF_SER = 'R-DSO' OR VI_REF_SER = 'RS-DSO' OR VI_REF_SER = 'RN-DSA')  THEN
    --FOR depend REPL
    FOR depTaskRepl in  C1
    LOOP
         IF(flagRepl) Then
           dependentReplTasks :=dependentReplTasks || ',' || depTaskRepl.DEPENDENT_REPL_TASKS1;
         ELSE
          dependentReplTasks := depTaskRepl.DEPENDENT_REPL_TASKS1;
          flagRepl:=true;
         End IF;
    END LOOP;  
    --FOR depend PICK
    FOR depTaskPick in  C2
    LOOP
         IF(flagPick) Then
           dependentPickTasks :=dependentPickTasks || ',' || depTaskPick.DEPENDENT_PICK_TASKS1;
         ELSE
          dependentPickTasks := depTaskPick.DEPENDENT_PICK_TASKS1;
          flagPick:=true;
         End IF;
    END LOOP;  
    --CONCATENATE LOGIC
    IF(flagPick) THEN
         IF(flagRepl) THEN
           DEPENDENT_TASKS :=dependentReplTasks || ',' || dependentPickTasks;
         ELSE
            DEPENDENT_TASKS := dependentPickTasks;
         End IF;
     ELSE
         IF(flagRepl) THEN
           DEPENDENT_TASKS := dependentReplTasks;
         End IF;   
     End IF;
    RETURN DEPENDENT_TASKS;
 ELSE
   DEPENDENT_TASKS := ' ';
   RETURN DEPENDENT_TASKS;
 End IF;
 EXCEPTION
    WHEN NO_DATA_FOUND  THEN
     DEPENDENT_TASKS :=' ';
 RETURN DEPENDENT_TASKS;
END;
/

CREATE OR REPLACE FUNCTION FN_WAVE_TASK_DEPENDENT_ON(VI_REF_SER IN CHAR ,VI_REF_Id IN VARCHAR)
RETURN VARCHAR2 IS TASK_DEPENDENT_ON VARCHAR2(1500);
  taskDependentOn varchar2(1500);
  flag  BOOLEAN := false;
     cursor C1 is SELECT distinct(nvl(pick_ord_det.repl_order,' ')) as TASK_DEPENDENT_NO1 from pick_ord_det where pick_ord_det.pick_order = VI_REF_Id; 
     cursor C2 is SELECT distinct(nvl(repl_ord_det.pick_order,' ')) as TASK_DEPENDENT_NO1 from repl_ord_det where repl_ord_det.repl_order = VI_REF_Id;
BEGIN
 IF(VI_REF_SER = 'P-PICK' OR VI_REF_SER = 'C-PICK' OR VI_REF_SER = 'A-PICK' OR VI_REF_SER = 'M-PICK')  THEN
    FOR taskDepOn in  C1
    LOOP
        IF(flag) Then
           taskDependentOn :=taskDependentOn || ',' || taskDepOn.TASK_DEPENDENT_NO1;
        ELSE
           taskDependentOn := taskDepOn.TASK_DEPENDENT_NO1;
           flag:=true;
        End IF;
    END LOOP;  
    TASK_DEPENDENT_ON :=taskDependentOn;
    RETURN TASK_DEPENDENT_ON;
 ELSIF(VI_REF_SER = 'R-TASK' OR VI_REF_SER = 'RP-PND' OR VI_REF_SER = 'R-CPA' OR VI_REF_SER = 'R-PND' OR VI_REF_SER = 'S-DOC' OR VI_REF_SER = 'RP-ACT' OR VI_REF_SER = 'RR-DSA' OR VI_REF_SER = 'RD-DSA' OR VI_REF_SER = 'R-DSO' OR VI_REF_SER = 'RS-DSO' OR VI_REF_SER = 'RN-DSA')  THEN
    FOR taskDepOn in  C2
    LOOP
        IF(flag) Then
           taskDependentOn :=taskDependentOn || ',' || taskDepOn.TASK_DEPENDENT_NO1;
        ELSE
           taskDependentOn := taskDepOn.TASK_DEPENDENT_NO1;
           flag:=true;
        End IF;
    END LOOP;  
    TASK_DEPENDENT_ON :=taskDependentOn;
    RETURN TASK_DEPENDENT_ON;
 ELSE
    TASK_DEPENDENT_ON :=' ';
    RETURN TASK_DEPENDENT_ON;
 End IF;
 EXCEPTION
    WHEN NO_DATA_FOUND  THEN
      TASK_DEPENDENT_ON :=' ';
 RETURN TASK_DEPENDENT_ON;
END;
/

-----------------system entries sql------------------------------------
	
INSERT INTO itm2menu(
	application,
	level_1,
	level_2,
	level_3,
	level_4,
	level_5,
	win_name,
	descr,
	comments,
	menu_path,
	icon_path,
	close_icon,
	open_icon,
	obj_type,
	chg_date,
	chg_term,
	chg_user,
	mob_deploy )
 VALUES (
	'WMS',
	3,
	4,
	0,
	0,
	0,
	'w_wave_task_status_det',
	'Wave Summary',
	'Wave Tasks Detail ',
	'WMS.3.4.0.0.0',
	'e12_logo.gif',
	NULL,
	NULL,
	'T',
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);	
	
INSERT INTO obj_forms (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	form_no)
VALUES (
	'w_wave_task_status_det',
	'Wave Tasks Detail',
	'd_wave_task_status_det11',
	'null',
	'2');
	
INSERT INTO transetup (
	tran_window ,
	save_flag ,
	val_flag ,
	key_flag ,
	key_string ,
	repeate_add ,
	chg_date ,
	chg_user ,
	chg_term ,
	edi_option ,
	confirm_mode ,
	mail_option ,
	garbage_opt ,
	table_name,
	application )
VALUES (
	'w_wave_task_status_det',
	'2',
	'2',
	'A',
	'seq10',
	'N',
	fn_sysdate(),
	'BASE',
	'BASE ',
	'0',
	'0',
	'0',
	'N',
	'null',
	'WMS');
commit;
--changed by sankara on 02/06/14 update sql for wave task home screen end.
--changed by sankara on 07/06/14 update sql for pick deallocation validation 
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 (
	'VPPICKNOTA',
	'Invalid Deallocation',
	'is already in process, Pick Deallocation not allowed',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE  ',
	NULL,
	NULL);
commit;
--chanegd by sankara on 16/06/14 update function and messages sql
--changed by sankara on 10/06/14 updated messages for picking not allowed
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 (
	'VTINVQUNAT',
	'Picking not allowed',
	'Pick Deallocation Done Picking not allowed',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE  ',
	NULL,
	NULL);

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 (
	'VTINVPRONO',
	'Duplicate Pro Number',
	'The Pro Number already used for another shipment Transaction.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base',
	'Base',
	NULL,
	NULL);

CREATE OR REPLACE FUNCTION FN_WAVE_DEALLOCATED(VI_REF_SER IN CHAR ,VI_REF_Id IN VARCHAR)
RETURN VARCHAR2 IS DEALLOCATED VARCHAR2(5);
  flagRepl  BOOLEAN := true;
  flagPick  BOOLEAN := true;
       cursor C1 is SELECT nvl(repl_ord_det.cancel_mode,'N') as DEALLOCATIOM1 from repl_ord_det where repl_ord_det.repl_order = VI_REF_Id; 
       cursor C2 is SELECT (nvl(Quantity,0)-nvl(dealloc_qty,0)) as  DEALLOCATIOM1 from pick_ord_det where pick_ord_det.pick_order = VI_REF_Id;
BEGIN
  --FOR PICK
 IF(VI_REF_SER = 'P-PICK' OR VI_REF_SER = 'C-PICK' OR VI_REF_SER = 'A-PICK' OR VI_REF_SER = 'M-PICK')  THEN
    FOR deallcatTaskPick in  C2
    LOOP
        IF(flagPick) Then 
             IF(deallcatTaskPick.DEALLOCATIOM1>0) Then
               DEALLOCATED :='N';
               flagPick := false;
             ELSE
              DEALLOCATED :='Y';
             End IF;
       End IF;  
    END LOOP;  
    RETURN DEALLOCATED;
 ELSIF(VI_REF_SER = 'R-TASK' OR VI_REF_SER = 'RP-PND' OR VI_REF_SER = 'R-CPA' OR VI_REF_SER = 'R-PND' OR VI_REF_SER = 'S-DOC' OR VI_REF_SER = 'RP-ACT' OR VI_REF_SER = 'RR-DSA' OR VI_REF_SER = 'RD-DSA' OR VI_REF_SER = 'R-DSO' OR VI_REF_SER = 'RS-DSO' OR VI_REF_SER = 'RN-DSA')  THEN
    --FOR REPL
    FOR deallcatTaskRepl in  C1  
    LOOP
        IF( flagRepl) Then 
             IF(deallcatTaskRepl.DEALLOCATIOM1='Y') Then
               DEALLOCATED :='Y';
             ELSE
               DEALLOCATED := 'N';
               flagRepl :=false;
             End IF;
        End IF; 
    END LOOP;  
    RETURN DEALLOCATED;
 ELSE
   DEALLOCATED := ' ';
   RETURN DEALLOCATED;
 End IF;
 EXCEPTION
    WHEN NO_DATA_FOUND  THEN
     DEALLOCATED :=' ';
 RETURN DEALLOCATED;
END;
/
--changed by sankara on 26/06/14 updated messages sql
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 (
	'VTUNCNFIRM',
	'Transaction not confirmed',
	'Transaction not confirmed ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base   ',
	'Base   ',
	NULL,
	NULL);
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 (
	'VTINVPRONO',
	'Duplicate Pro Number',
	'The Pro Number already used for another shipment Transaction.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base',
	'Base',
	NULL,
	NULL);
	
	--Changed By Pragyan for report sql 30-jul-14
	INSERT INTO DISPARM DISPARM ( 	prd_code , 	var_name, 	var_type, 	var_value, 	descr , 	var_subs, 	chg_date, 	chg_user , 	chg_term )  VALUES ( 	'999999', 	'IS_REMOTE_PRNTSRV_CONFIGRD', 	'S', 	'Y', 	'FOR WMS TOMCAT SERVER INSTALLATION', 	0, 	TO_DATE('30-06-2014 00:00:00','DD-MM-YYYY HH24:MI:SS'), 	'PP', 	'P');
	
	--Changed By Pragyan for report sql 01-jul-14
	CREATE TABLE NET_PRINTERS
(
   PRINTER_NAME VARCHAR2(50) NOT NULL PRIMARY KEY,
   PRINTER_DESCR VARCHAR2(120),
   PRINTER_TYPE CHAR(3),
   SERVER_URI VARCHAR2(120),
   OS_NAME VARCHAR2(120),
   VISIBILITY_SCOPE CHAR(1),
   FACILITY_CODE CHAR(10)
);
	
--added by kunal on 16-jul-14
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 ('SRWIZQTY4 ','Invalid Quantity !', 'RMA Quantity cannot be Zero .', 'E',   'Y',
        null, null, null,   sysdate,  'BASE    ',    'BASE    ',     null,       null);

--added by kunal on 16-jul-14 end
commit;
 --Changed by Dhanraj 11-07-14 base server pending 
  
   alter table
   REPL_ISS_HDR
   add
   (
   CARTON_NO_ORG  VARCHAR2(20)
   );
   
  -- Changed by Dhanraj 14-07-14 three triggers create.
  
Create or replace TRIGGER dt_PACK_det_chk BEFORE INSERT  ON PACK_DET  FOR
EACH ROW
DECLARE
    ll_pickcount number(3) := 0;
BEGIN
      begin
         select count(1) into ll_pickcount from pick_ORD_det P
   WHERE (P.PICK_ORDER,p.LINE_NO) IN (SELECT PICK_ORDER,LINE_NO__PICK FROM
CARTON_MASTER WHERE CARTON_NO = :NEW.CARTON_NO)
   AND (P.QUANTITY - (CASE WHEN P.DEALLOC_QTY IS NULL THEN 0 ELSE
P.DEALLOC_QTY END ) )> 0
   AND (CASE WHEN P.STATUS IS NULL THEN 'N' ELSE P.STATUS END ) <> 'C';
      exception when others then
         ll_pickcount := 0;
      end;
      if ll_pickcount > 0 then
          raise_application_error( -20601, 'All Lines Not Picked From the Picking Order packing not allowed!!!');
      end if;
END;
/


Create or replace TRIGGER dt_wavetask_det_chk BEFORE UPDATE OF status ON
WAVE_TASK_DET referencing old as old new as new FOR EACH ROW
DECLARE
    ll_pickcount number(3) := 0;
BEGIN
   if :new.status = 'Y' and nvl(:old.status,'N') = 'N' and :old.ref_ser
in('C-PICK','P-PICK','M-PICK','P-PICK')  then
      begin
         select count(1) into ll_pickcount from pick_ORD_det P
		 		 		 WHERE P.PICK_ORDER = :old.REF_ID
		 		 		 AND (P.QUANTITY - (CASE WHEN P.DEALLOC_QTY IS NULL THEN 0 ELSE
P.DEALLOC_QTY END ) )> 0
		 		 		 AND (CASE WHEN P.STATUS IS NULL THEN 'N' ELSE P.STATUS END ) <> 'C';
      exception when others then
         ll_pickcount := 0;
      end;
      if ll_pickcount > 0 then
          raise_application_error( -20601, 'All Lines Not Picked For the Picking Order');
      end if;
   end if;
END;
/

create or replace 
trigger REPL_ISS_HDR_CHK BEFORE INSERT  ON REPL_ISS_HDR
FOR EACH ROW
DECLARE
        stkQty number(14,3) := 0;
        replQty number(14,3) := 0;
        ll_refseries varchar2(10) := 0;
 BEGIN


       select trim(ref_ser) into ll_refseries from wave_task_det where ref_id = :new.repl_order;

   if ll_refseries in('RS-DSO','RP-PND','S-DOC','R-DSO','R-PND','R-TASK') then
   begin
          SELECT QUANTITY INTO replQty FROM REPL_ORD_DET WHERE REPL_ORDER =:NEW.REPL_ORDER;
          SELECT QUANTITY INTO stkQty FROM STOCK WHERE (LOC_CODE,ITEM_CODE,LOT_NO,LOT_SL,SITE_CODE)
              IN (SELECT LOC_CODE ,ITEM_CODE,LOT_NO,LOT_SL,SITE_CODE FROM REPL_ORD_DET WHERE REPL_ORDER = :NEW.REPL_ORDER);

          exception when others then
              stkQty := 0;
              replQty := 0;
          end;

          if stkQty <> replQty then
              raise_application_error( -20601, 'Replenishment Quantity should be same as Stock available Quantity!!!');
          end if;
   end if;
END;
/

--Changed by Dhanraj 18-07-2014
--Created by Pragyan for cross verification.[16-07-2014]
create or replace 
TRIGGER dt_wavetask_det_chk BEFORE UPDATE OF status ON
WAVE_TASK_DET referencing old as old new as new FOR EACH ROW
DECLARE
    ll_pickcount number(3) := 0;
    ll_replcount number(3) := 0;
BEGIN
   if :new.status = 'Y' and nvl(:old.status,'N') = 'N' and :old.ref_ser
   in('C-PICK','P-PICK','M-PICK','P-PICK')  then
   begin
         select count(1) into ll_pickcount from pick_ORD_det P
         WHERE P.PICK_ORDER = :old.REF_ID
         AND (P.QUANTITY - (CASE WHEN P.DEALLOC_QTY IS NULL THEN 0 ELSE
         P.DEALLOC_QTY END ) )> 0
         AND (CASE WHEN P.STATUS IS NULL THEN 'N' ELSE P.STATUS END ) <> 'C';
         
		 exception when others then
             ll_pickcount := 0;
         end;
         if ll_pickcount > 0 then
             raise_application_error( -20601, 'All Lines Not Picked For the Picking Order');
         end if;
   end if;

   if :new.status = 'Y' and nvl(:old.status,'N') = 'N' and :old.ref_ser in('RS-DSO','RP-PND','S-DOC','R-DSO','R-PND','R-TASK','RD-DSA','RN-DSA','RR-DSA','RP-ACT','R-CPA') then
   begin
          SELECT COUNT(*) into ll_replcount FROM REPL_ISS_HDR R,REPL_ISS_DET D WHERE R.REPL_ORDER=:old.REF_ID
          AND R.REPL_ORDER = D.REPL_ORDER AND R.TRAN_ID = D.TRAN_ID AND R.CONFIRMED = 'N';

          exception when others then
              ll_replcount := 0;
          end;

          if ll_replcount > 0 then
              raise_application_error( -20601, 'Replenishment issue is not confirmed so task can not be verified !!!');
          end if;
   end if;

END;
/
--Created by Dhanraj thakare for cross verification.[16-07-2014]
create or replace 
TRIGGER DT_REPL_ISS_HDR_CHK BEFORE UPDATE OF CONFIRMED ON
REPL_ISS_HDR referencing old as old new as new FOR EACH ROW
DECLARE
    ll_replcount number(3) := 0;
BEGIN
   if :new.CONFIRMED = 'N' and nvl(:old.CONFIRMED,'Y') = 'Y' then
   begin
          SELECT COUNT(*) into ll_replcount FROM WAVE_TASK_DET WHERE REF_ID=:old.REPL_ORDER
           AND STATUS='Y' ;
         
          exception when others then
              ll_replcount := 0;
          end;

          if ll_replcount > 0 then
              raise_application_error( -20601, 'Wave Task Confirmed, so replenishment order can not be cancel !!!');
          end if;
   end if;
END;
/
commit;
--changed by sankara on 25/07/14 for print_checksheet sql w14dsun004
INSERT INTO itm2menu(
	application,
	level_1,
	level_2,
	level_3,
	level_4,
	level_5,
	win_name,
	descr,
	comments,
	menu_path,
	icon_path,
	close_icon,
	open_icon,
	obj_type,
	chg_date,
	chg_term,
	chg_user,
	mob_deploy )
VALUES (
	'WMS',
	1,
	32,
	2,
	0,
	0,
	'w_print_checksheet',
	'Print CheckSheet',
	NULL,
	'WMS.1.32.2.0.0',
	'e12_logo.gif',
	NULL,
	NULL,
	'W',
	fn_sysdate(),
	'BASE   ',
	'BASE   ',
	'Y');
INSERT INTO transetup (
	tran_window ,
	save_flag ,
	val_flag ,
	key_flag ,
	key_string ,
	udf_1 ,
	udf_2 ,
	udf_3 ,
	udf_4 ,
	udf_5 ,
	repeate_add ,
	chg_date ,
	chg_user ,
	chg_term ,
	edi_option ,
	site_acc_col ,
	confirm_col ,
	confirm_val ,
	repeat_add_det ,
	repeatadddet ,
	load_mode ,
	auto_confirm ,
	ledg_post_conf ,
	chg_date_on_conf ,
	tran_id_col ,
	mail_option ,
	confirm_mode ,
	garbage_opt ,
	val_flag_edi ,
	verify_password ,
	cust_acc_col ,
	sales_pers_acc_col ,
	supp_acc_col ,
	item_ser_acc_code ,
	emp_acc_col ,
	item_ser_acc_col ,
	workflow_opt ,
	table_name ,
	application ,
	table_desc ,
	tran_date_col ,
	tran_id__from ,
	tran_id__to ,
	table_name_det1 ,
	table_name_det2 ,
	table_name_det3 ,
	multitire_opt ,
	ref_ser ,
	view_mode ,
	tax_forms ,
	sign_status ,
	user_tran_window ,
	custom_preview_obj ,
	ignoreerrlist_onload ,
	childdata_argopt ,
	edit_tmplt ,
	wrkflw_init ,
	edittax ,
	formal_args ,
	audit_trail_opt ,
	edit_opt ,
	cache_opt ,
	optimize_mode ,
	edit_expr ,
	rate_col ,
	qty_col ,
	edit_expr_inp ,
	rcp_cache_status ,
	print_control ,
	transfer_mode ,
	profile_id__res ,
	tran_compl_msg ,
	period_option ,
	wrkflw_priority ,
	exec_type ,
	disp_meta_data ,
	allow_attach ,
	start_form ,
	isattachment ,
	header_form_no ,
	msg_onsave ,
	wf_status ,
	restart_form ,
	isgwtinitiated ,
	confirm_date_col ,
	confirm_by_col )
 VALUES (
	'w_print_checksheet',
	'2',
	'2',
	'M',
	'MP,seq08',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'N',
	TO_DATE('19-06-2012 14:57:16','DD-MM-YYYY HH24:MI:SS'),
	'Kunal     ',
	'BASE           ',
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'0',
	'0',
	'N',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'WMS',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'M',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_forms (
	win_name ,
	title ,
	obj_brow_name ,
	obj_edit_name ,
	cross_update_expr ,
	expr_fld_info ,
	target_fld_info ,
	expr_comment ,
	form_no ,
	scr_flag ,
	auto_accept_scan ,
	scan_flag ,
	scan_metadata ,
	property_info ,
	scan_delimiter ,
	column_on_save ,
	after_save ,
	ext_setup ,
	ext_metadata ,
	ext_com ,
	auto_accept_weighdata ,
	form_type ,
	disp_metadata ,
	parent_key_col ,
	qty_col ,
	rate_col ,
	assisted_mode ,
	storage_key_metadata ,
	selection_mode ,
	default_view ,
	auto_addon_entry )
VALUES (
	'w_print_checksheet',
	'Check Sheet',
	'print_checksheet',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	'F',
	NULL,
	NULL,
	'<SCAN_INFO><INPUT_SCAN ORDER="1"><SCAN_LABEL>PTCN:</SCAN_LABEL><FIELDS SEPARATOR=""  DELIMITER=""><FIELD>ptcn</FIELD></FIELDS></INPUT_SCAN><INPUT_SCAN ORDER="2"><SCAN_LABEL>Printer :</SCAN_LABEL><FIELDS SEPARATOR="" DELIMITER=""><FIELD>printer_name</FIELD></FIELDS></INPUT_SCAN></SCAN_INFO>',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);
INSERT INTO obj_actions (
	obj_name ,
	line_no ,
	image ,
	description ,
	service_code ,
	interactive ,
	rights_char ,
	title ,
	form_no ,
	service_handler ,
	placement ,
	action_type ,
	tran_type ,
	chg_date ,
	chg_term ,
	chg_user ,
	is_confirmation_req )
 VALUES (
	'print_checksheet',
	1,
	NULL,
	'Saving',
	NULL,
	'a',
	'S',
	'Finish',
	'1',
	NULL,
	NULL,
	'U',
	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 (
	'print_checksheet',
	'default_data_wiz',
	'1',
	'load_default_data',
	NULL,
	'0',
	fn_sysdate(),
	'Base ',
	'Base  ',
	'2',
	'EJB',
	'CheckSheetPrintIC',
	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 (
	'print_checksheet',
	'post_save',
	'1',
	'prso_load',
	NULL,
	'0',
	fn_sysdate(),
	'Kunal ',
	'BASE',
	'2',
	'EJB',
	'CheckSheetPrintPos',
	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 (
	'print_checksheet',
	'pre_navigate_finish',
	'1',
	'prv_print_checksheet',
	NULL,
	'0',
	fn_sysdate(),
	'Gulzar ',
	'BASE',
	'2',
	'EJB',
	'CheckSheetPrintIC',
	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 (
	'print_checksheet',
	'pre_validate',
	'1',
	'prv_print_checksheet',
	NULL,
	'0',
	fn_sysdate(),
	'Base   ',
	'Base',
	'2',
	'EJB',
	'CheckSheetPrintIC',
	NULL);
INSERT INTO system_event_services (
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,
	return_descr ,
	return_xfrm ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'prso_load',
	NULL,
	'http://172.16.145.69/BaseE12DotNetService6-3-0-178/E12BusinessLogic6-3-0-178.asmx',
	NULL,
	'postSave',
	NULL,
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Kunal ',
	'BASE');
INSERT INTO system_event_services (
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,
	return_descr ,
	return_xfrm ,
	chg_date ,
	chg_user ,
	chg_term )
VALUES (
	'load_default_data',
	NULL,
	'http://172.16.145.69/BaseE12DotNetService6-3-0-178/E12BusinessLogic6-3-0-178.asmx',
	NULL,
	'itemChanged',
	'String',
	'S',
	NULL,
	NULL,
	fn_sysdate(),
	'Gulzar    ',
	'BASE' );
INSERT INTO system_event_services (
	service_code ,
	service_descr ,
	service_uri ,
	service_provider ,
	method_name ,
	return_value ,
	return_type ,
	return_descr ,
	return_xfrm ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'prv_print_checksheet',
	'Validation',
	'http://localhost:9090/axis/services/ValidatorService',
	'BASE',
	'wfValData',
	'String',
	'S',
	NULL,
	NULL,
	fn_sysdate(),
	'Base ',
	'Base');
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'prso_load',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Kunal',
	'Kunal',
	'EJB');
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prso_load',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Kunal',
	'Kunal',
	'CheckSheetPos');
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'prso_load',
	3,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Kunal ',
	'Kunal',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'prso_load',
	4,
	'<tran_id>',
	'I',
	NULL,
	'B.String',
	NULL,
	fn_sysdate(),
	'Kunal ',
	'Kunal',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'prso_load',
	5,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Kunal ',
	'Kunal',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'prso_load',
	6,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Kunal ',
	'Kunal',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'prso_load',
	7,
	'DB_CONN',
	'I',
	NULL,
	'S.Connection',
	NULL,
	fn_sysdate(),
	'Kunal ',
	'Kunal',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'load_default_data',
	7,
	'FOCUSED_COLUMN',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Gulzar ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'load_default_data',
	8,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Gulzar  ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'load_default_data',
	9,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Gulzar ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'load_default_data',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Gulzar ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'load_default_data',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'load_default_data',
	3,
	'XML_DATA',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Gulzar  ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'load_default_data',
	4,
	'XML_DATA_1',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'load_default_data',
	5,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'load_default_data',
	6,
	'OBJ_CONTEXT',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Gulzar    ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_print_checksheet',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Base ',
	'BASE',
	'EJB');
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'prv_print_checksheet',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Sankar ',
	'BASE',
	'CheckSheetPrintIC');
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
VALUES (
	'prv_print_checksheet',
	3,
	'XML_DATA',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Base ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_print_checksheet',
	4,
	'XML_DATA_1',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Base      ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_print_checksheet',
	5,
	'XML_DATA_ALL',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Base      ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_print_checksheet',
	6,
	'OBJ_CONTEXT',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Base  ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_print_checksheet',
	7,
	'EDIT_FLAG',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Base   ',
	'BASE',
	NULL);
INSERT INTO system_service_args (
	service_code ,
	line_no ,
	arg_name ,
	arg_mode ,
	descr ,
	arg_type ,
	arg_xfrm ,
	chg_date ,
	chg_user ,
	chg_term ,
	arg_value )
 VALUES (
	'prv_print_checksheet',
	8,
	'XTRA_PARAMS',
	'l',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'Base  ',
	'BASE',
	NULL);
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 (
	'RPTPRTSUCF',
	'Report On Printer',
	'Report printed successfully',
	'F',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE  ',
	NULL,
	NULL);
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 (
	'VTINVDPTCN',
	'Invalid PTCN',
	'Entered PTCN is invalid,please enter valid PTCN',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE  ',
	NULL,
	NULL);
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 (
	'VTINVPALLT',
	'Invalid Pallet ID',
	'Entered Pallet ID does not exist in Pallet No master',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE   ',
	'BASE  ',
	NULL,
	NULL);
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 (
	'VTINVPRINT',
	'Invalid Printer Name',
	'Entered Printer Name does not exist in Net Printers ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE  ',
	NULL,
	NULL);
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 (
	'VTPRNTBLNK',
	'Printer Name Blank',
	'Please enter Printer Name.It should not be left blank',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE   ',
	'BASE  ',
	NULL,
	NULL);
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 (
	'VTPTCNPALT',
	'Enter PTCN or Pallet Number',
	'Please enter either PTCN or Pallet No',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE   ',
	'BASE   ',
	NULL,
	NULL);
INSERT INTO user_obj_fav (
	obj_name ,
	user_id ,
	chg_date ,
	chg_user ,
	chg_term )
 VALUES (
	'print_checksheet',
	'BASE ',
	fn_sysdate(),
	'BASE  ',
	'127.0.0.1');
INSERT INTO POPHELP (
        field_name ,
        mod_name ,
        sql_str ,
        dw_object ,
        msg_title ,
        width ,
        height ,
        chg_date ,
        chg_user ,
        chg_term ,
        dist_opt ,
        filter_string ,
        sql_input ,
        default_col ,
        pop_align ,
        query_mode ,
        page_context ,
        pophelp_cols ,
        pophelp_source ,
        multi_opt ,
        help_option ,
        popup_xsl_name )
 VALUES (
        'PRINTER_NAME',
        'W_PRINT_CHECKSHEET',
        'SELECT PRINTER_NAME FROM NET_PRINTERS',
        NULL,
        'Printer Service name',
        0,
        0,
        fn_sysdate(),
        'BASE  ',
        'BASE ',
        '0',
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL);
commit;
--changed by sankara on 30/07/14 messages sql
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 (
	'VTINVDAETL',
	'Check Item Dimension/Weight !!',
	'Please check dimension and weight for this item',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'SUN ',
	'BASE ',
	NULL,
	NULL);
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 (
	'TRALNOTPIK',
	'All Pick Lines not confirmed ',
	'Could not allowed to Packing because all pick lines are not confirmed',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'Base  ',
	'Base  ',
	NULL,
	NULL);
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 (
	'VTPACKALED',
	'Quantity is on hold',
	'Could not allowed to Packing because quantity is on hold',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE  ',
	'BASE   ',
	NULL,
	NULL);
-- ADDED BY RITESH ON 02/08/14 FOR TARO POINT  (D14CTAR002) START
	alter table bom add RND_OFF  CHAR(1)      ;
    alter table bom add RND_TO  NUMBER(14,3)  ;
--  ADDED BY RITESH ON 02/08/14 FOR TARO POINT (D14CTAR002) END

--Changed by Dhanraj on 02/08/14 for GenValidation 

  
--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;


--End Dharnaj Changes on 02/08/14
commit;
-- changed by sankara on 06/08/14 for multiple site start.
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 (
	'VTSITEDIFR',
	'Site Code Different',
	'Despatch Site Code is different from login Site Code ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE   ',
	'BASE   ',
	NULL,
	NULL);
commit;


















 