CREATE TABLE wip_scanning_ps_hdr (
	tran_id char(10),
	tran_date date,
	work_order char(10),
	operation number(16, 0),
	confirmed char(1),
	conf_date date,
	emp_code__aprv char(10),
	mc_code char(10),
	proc_code char(10),
	bar_code char(20),
	qc_approval_reject char(1),
	reason_code char(20),
	reason_descr char(120),
	remarks char(20),
	run_start_date date,
	run_end_date date,
	run_start_time date,
	run_end_time date,
	cumulativ_run_time number(16, 5),
	total_run_time number(16, 3),
	sccaned char(1),
	cumulative_time number(16, 3),
	product_code char(10),
	lot_no char(15),
	wait_time number(16, 3),
	lot_sl char(15),
	site_code char(5)); TABLESPACE ITM_MFG_I1);
	alter table wip_scanning_ps_hdr add constraint pk_tran_id primary key(tran_id); USING INDEX TABLESPACE ITM_MFG_I1; 


--system entry for itm2menu of solar wipscan 
INSERT INTO itm2menu (	
application ,	
level_1 ,	
level_2 ,	
level_3 ,	
level_4 ,	
level_5 ,	
win_name ,	
descr ,	
comments ,	
menu_path ,	
icon_path ,	
chg_date ,	
chg_term ,	
chg_user ) 
VALUES (
'RCP',	
1,	
1,	
3,	
0,	
0,	
'w_wip_scan_ps',	
'WIP Scanning',	
'WIP Scanning',	
'RCP.1.1.3.0.0',	
'e12_logo.gif',		
sysdate,	
'TSD            ',	
'TSD       ');

--system entry for TRANSETUP of solar wipscan 
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 ,	
garbage_opt ,		
table_name ,	
application ,	
tran_date_col ,	
ref_ser)
VALUES (	
'w_wip_scan_ps',	
'2',	
'2',	
'M',	
'seq10',		
sysdate,	
'BASE      ',	
'BASE31         ',	
'0',		
'CONFIRMED',	
'Y',	
'N',		
'N',		
'TRAN_ID',	
'0',	
'0',	
'N',		
'wip_scanning_ps_hdr',	
'CHG',		
'TRAN_DATE',		
'W-MAT');

--system entry for obj_forms of solar wipscan 
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_wip_scan_ps',		
'Header',		
'd_wipscan11',		
'd_wip_scan_ps_21',		
'1',		
'Y',		
'lot_no,lot_sl',		
'Y',			
'-',		
'Y'	);
--system entry for system_events of solar wipscan 
INSERT INTO obj_actions (
obj_name ,	
line_no ,	
rights_char ,	
interactive ,
service_code,	
description ,	
title ,	
image ,	
action_type ,	
form_no 	) 
VALUES (
'wip_scan_ps',	
1,	
'A',	
'a',	
'a',	
'Adding New',	
'Add',	
'add.gif',	
'S',	
'1');

INSERT INTO obj_actions (
obj_name ,	
line_no ,	
rights_char ,	
interactive ,	
service_code ,	
description ,	
title ,	
image ,	
action_type ,	
form_no)  
VALUES (
'wip_scan_ps',	
2,	
'E',	
'a',	
'a',	
'Editing Existing Record',	
'Edit',	
'edit.gif',	
'S',	
'1');

INSERT INTO obj_actions (
obj_name ,	
line_no ,	
rights_char ,	
interactive ,	
service_code ,	
description ,	
title ,	
image ,	
action_type ,	
form_no,
SERVICE_HANDLER	) 
VALUES (
'wip_scan_ps',	
5,	
'F',	
'a',	
'pre_confirm',	
'Confirm',
'Confirm',		
'confirm.gif',	
'U',	
'1',	
'2'	);
	
--system entry for obj_itemchange
INSERT INTO obj_itemchange (	
obj_name ,	
form_no ,	
field_name 
) 
VALUES (	
'wip_scan_ps',	
'1',	
'lot_no'
);
INSERT INTO obj_itemchange (	
obj_name ,
	form_no ,	
	field_name 
	) 
VALUES (	
'wip_scan_ps',	
'1',	
'lot_sl'
);
INSERT INTO obj_itemchange (	
obj_name ,	
form_no ,	
field_name  
)
VALUES (	
'wip_scan_ps',	
'1',	
'itm_default'
);
INSERT INTO obj_itemchange (	
obj_name ,	
form_no ,	
field_name 
)
VALUES (	
'wip_scan_ps',	
'1',	
'qc_approval_reject'
);
INSERT INTO obj_itemchange (	
obj_name ,	
form_no ,	
field_name 
)
VALUES (	
'wip_scan_ps',	
'1',	
'reason_code'
	);

--system entry for POPHELP  
INSERT INTO pophelp(	
field_name ,	
mod_name ,	
sql_str ,	
msg_title ,		
chg_date ,	
chg_user ,	
chg_term )
VALUES (	
'fld_value',	
'w_wip_scan_ps',	
'SELECT FLD_VALUE FROM GENCODES',	
'ITEM',	
sysdate,
'C Pandey',
'122');
 
--system entry for system_events of solar wipscan  
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 (	
'wip_scan_ps',	
'post_item_change',	
'1',	
'poic_default_ejb1',	
sysdate,	
'chitranjan',	
'BASE249',	
'2',	
'0',	
'EJB',	
'WIPScanPvSolar'	);

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 (
'wip_scan_ps',	
'pre_confirm',	
'1',	
'prv_confirm',		
sysdate,	
'Shamim   ',	
'BASE215',	
'2',	
'0',	
'EJB',	
'WIPScanConfPvSolar');

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 (	
'wip_scan_ps',		
'pre_validate',		
'1',		
'prv_default_ejb1',		
sysdate,	
'chitranjan',	
'BASE249',		
'2',		
'0',
'EJB',	
'WIPScanPvSolar'	);

 --system entry for messages of solar wipscan  
INSERT INTO messages (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type 
	)
 VALUES (
	'VTWIPTI1  ',
	'TRAN ID CAN NOT BE BLANK',
	'ENTER TRAN ID',
	'E'
		);
		
INSERT INTO messages (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type 
	)
	VALUES (
	'VTWIPTI   ',
	'TRAN ID ALREADY EXIST',
	'EMTER UNIQUE TRAN ID',
	'E'
	);
	
insert into messages
(
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	chg_date ,
	chg_user ,
	chg_term 
)
VALUES 
(
	'VTWIPLN1  ',
	'INVALID BAR CODE ',
	'EITHER LOT NO OR LOT SL IS INVALID',
	'E',
	sysdate,
	'chitranjan',
	'Base31         '
		);
		
insert into messages
(
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	chg_date ,
	chg_user ,
	chg_term 
)
 VALUES (
	'VTWIPLN1  ',
	'INVALID BAR CODE ',
	'EITHER LOT NO OR LOT SL IS INVALID',
	'E',
	sysdate,
	'chitranjan',
	'Base31         '	
	);
	
	
	INSERT INTO messages (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type 
	)
	VALUES (
	'VTWIPSBC  ',
	'YOU ALREADY USED THIS NO',
	'ENTER UNIQUE BAR CODE ',
	'E'
	);
	
	INSERT INTO messages (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type 
	)
	VALUES (
	'VTWIPMC   ',
	'MACHNIE CODE NOT EXIST',
	'MACHNIE CODE NOT EXIST',
	'E'
	);
	
	INSERT INTO messages (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type 
	)
	 VALUES (
	'VTWIPPC   ',
	'PRODUCT CODE NOT EXIST',
	'ENTER PROCESS CODE',
	'E'
	);
	
	INSERT INTO messages (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type 
	)
	VALUES (
	'VTWIPWT   ',
	'WAIT TIME NOT EXIST',
	'ENTER VALID WAIT TIME',
	'E'
	);
	
	insert into messages
(
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	chg_date ,
	chg_user ,
	chg_term 
)
	 VALUES (
	'VTWIPQCAR1',
	'INVALID QC ORDER ',
	'ENTER QC ORDER OR APPROVAL OR REJECT',
	'E',
	sysdate,
	'chitranjan',
	'Base31         '
	);
	
	insert into messages
(
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	chg_date ,
	chg_user ,
	chg_term 
)
	 VALUES (
	'VTWIPRC1  ',
	'ENTER REASON CODE',
	'ENTER REASON CODE',
	'E',
	SYSDATE,
	'chitranjan',
	'Base31         '
		);
		
insert into messages
(
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	chg_date ,
	chg_user ,
	chg_term 
)
		VALUES (
	'VTWIPRM1  ',
	'ENTER REMARKS',
	'ENTER REMARKS',
	'E',
	SYSDATE,
	'chitranjan',
	'Base31         '
		);
		
	INSERT INTO messages (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type 
	)
		VALUES (
	'VTWIPCONFT',
	'TRANSACTION ALREADY CONFIRMED',
	'TRANSACTION ALREADY CONFIRMED',
	'E'
	);
	
	INSERT INTO messages (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type 
	)
	 VALUES (
	'VTWIPCOPR ',
	'RECEIPT CAN NOT BE GENRATE',
	'IT'S NOT LAST OPERATION RECEIPT CAN BE GENRATE AFTER COMPLETION OF ALL OPERATION',
	'E'
	);
INSERT INTO messages (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type ,
	chg_date ,
	chg_user ,
	chg_term ,
	mail_option 
)
 VALUES (
	'VTSUCC1   ',
	'VTSUCC',
	'Selected transaction Successfully Confirmed',
	'P',
	sysdate,
	'BASE      ',
	'07BASE83       ',
	'0');
INSERT INTO messages (
	msg_no ,
	msg_str ,
	msg_descr ,
	msg_type )
	)
 VALUES (
	'VTWIPCOPR ',
	'Receipt Can Not Be Genrate',
	'It's Not Last Transection  Receipt Can Not Be Genrate',
	'E'
	);
	
INSERT INTO POPHELP (
	field_name,
	mod_name ,
	sql_str ,
	msg_title 	
	)
 VALUES (
	'REASON_CODE       ',
	'W_WIP_SCAN_PS                                               ',
	'SELECT FLD_NAME, FLD_VALUE FROM GENCODES',
	'reason code         '	
	);