SET DEFINE OFF

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_adm_default_1','post item change default','http://172.16.145.69/BaseE12DotNetService6-3-1-134/E12BusinessLogic6-3-1-134.asmx','Base Information','gbf_itemchanged','String','S',null,null,fn_sysdate(),'SUJIT','User1');
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_adm_default_1','val data default','http://172.16.145.69/BaseE12DotNetService6-3-1-134/E12BusinessLogic6-3-1-134.asmx','Base Information','gbf_valdata','String','S',null,null,fn_sysdate(),'SUJIT','User1');
commit;

Insert into SYSTEM_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_adm_default_1',1,'COMPONENT_TYPE','I',null,'S',null,fn_sysdate(),'BASE','Base','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 ('poic_adm_default_1',2,'COMPONENT_NAME','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 ('poic_adm_default_1',3,'TAB_XML_DATA','I',null,'S',null,fn_sysdate(),'BASE','Base91',null);
Insert into SYSTEM_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_adm_default_1',4,'TAB_XML_DATA_1','I',null,'S',null,fn_sysdate(),'BASE','Base91',null);
Insert into SYSTEM_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_adm_default_1',5,'TAB_XML_DATA_ALL','I',null,'S',null,fn_sysdate(),'BASE','Base91',null);
Insert into SYSTEM_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_adm_default_1',6,'OBJ_CONTEXT','I',null,'S',null,fn_sysdate(),'BASE','Base91',null);
Insert into SYSTEM_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_adm_default_1',7,'FOCUSED_COLUMN','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 ('poic_adm_default_1',8,'EDIT_FLAG','I',null,'S',null,fn_sysdate(),'BASE','Base91',null);
Insert into SYSTEM_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_adm_default_1',9,'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 ('prv_adm_default_1',1,'COMPONENT_TYPE','I',null,'S',null,fn_sysdate(),'BASE','Base   ','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 ('prv_adm_default_1',2,'COMPONENT_NAME','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 ('prv_adm_default_1',3,'TAB_XML_DATA','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 ('prv_adm_default_1',4,'TAB_XML_DATA_1','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 ('prv_adm_default_1',5,'OBJ_CONTEXT','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 ('prv_adm_default_1',6,'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 ('prv_adm_default_1',7,'XTRA_PARAMS','I',null,'S',null,fn_sysdate(),'BASE','Base',null);
commit;



-----Prepared by Ganesh [20/02/2013][To create system table entries for Admin Payroll ][Start]-------

--- (A) itm2menu ----

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 (
	'ADM',
	2,
	26,
	0,
	0,
	0,
	'w_site_stan_paytbl',
	'Site Station PayTable',	
	NULL,
	'ADM.2.26.0.0.0',
	'e12_logo.gif',
	NULL,
	NULL,
	'T',
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL );

COMMIT;

--- (B) obj_forms ----

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,
	EXT_COM,
	EXT_METADATA,
	EXT_SETUP,
	AFTER_SAVE,
	COLUMN_ON_SAVE,
	SCAN_DELIMITER,
	AUTO_ACCEPT_WEIGHDATA,
	PARENT_KEY_COL,
	FORM_TYPE,
	DISP_METADATA,
	QTY_COL,
	RATE_COL
	)
VALUES (
	'w_site_stan_paytbl',
	'PayTable',
	'd_site_stan_paytbl_brow',
	'd_site_stan_paytbl_edit',
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

COMMIT;

--- (C) obj_itemchange ----

INSERT INTO obj_itemchange (
	OBJ_NAME ,
	FORM_NO ,
	FIELD_NAME ,
	MANDATORY 
	)
VALUES (
	'site_stan_paytbl',
	'1',
	'site_code',
	NULL);

INSERT INTO obj_itemchange (
	OBJ_NAME ,
	FORM_NO ,
	FIELD_NAME ,
	MANDATORY 
	)
VALUES (
	'site_stan_paytbl',
	'1',
	'state_code',
	NULL);

INSERT INTO obj_itemchange (
	OBJ_NAME ,
	FORM_NO ,
	FIELD_NAME ,
	MANDATORY 
	)
VALUES (
	'site_stan_paytbl',
	'1',
	'stan_code',
	NULL);

INSERT INTO obj_itemchange (
	OBJ_NAME ,
	FORM_NO ,
	FIELD_NAME ,
	MANDATORY 
	)
VALUES (
	'site_stan_paytbl',
	'1',
	'pay_table',
	NULL);

COMMIT;


--- (D) transetup ----

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)
VALUES (
	'w_site_stan_paytbl',
	'2',
	'2',
	'M',
	'seq10',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'N',
	fn_sysdate(),
	'GANESH',
	'SYSTEM',
	'0',
	NULL,
	NULL,
	NULL,
	'N',
	NULL,
	'E',
	NULL,
	'N',
	NULL,
	NULL,
	NULL,
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'SITE_STAN_PAYTBL',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	2,
	NULL,
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	0,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

COMMIT;

--- (E) system_events ----


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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'site_stan_paytbl',
	'post_item_change',
	'1',
	'poic_site_stan_paytbl',
	NULL,
	'0',
	fn_sysdate(),
	'BASE ',
	'BASE',
	'2',
	'SiteStanPayTbl',
	'EJB',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'site_stan_paytbl',
	'pre_validate',
	'1',
	'prv_site_stan_paytbl',
	NULL,
	'0',
	fn_sysdate(),
	'BASE ',
	'BASE',
	'2',
	'SiteStanPayTbl',
	'EJB',
	NULL);

COMMIT;


--- (F) system_event_services ----

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_site_stan_paytbl',
	'itemchanged',
	'http://localhost:9090/axis/services/ValidatorService',
	NULL,
	'itemChanged',
	'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 (
	'prv_site_stan_paytbl',
	'Navigate',
	'http://localhost:9090/axis/services/ValidatorService',
	NULL,
	'wfValData',
	'String',
	'S',
	NULL,
	NULL,
	fn_sysdate(),
	'BASE ',
	'BASE');

COMMIT;

----(G) system_service_args ----

---a) For poic_site_stan_paytbl : ---

INSERT INTO system_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_site_stan_paytbl',
	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 (
	'poic_site_stan_paytbl',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	'SiteStanPayTbl');
 

INSERT INTO system_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_site_stan_paytbl',
	3,
	'XML_DATA',
	'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 (
	'poic_site_stan_paytbl',
	4,
	'XML_DATA_1',
	'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 (
	'poic_site_stan_paytbl',
	5,
	'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 (
	'poic_site_stan_paytbl',
	6,
	'OBJ_CONTEXT',
	'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 (
	'poic_site_stan_paytbl',
	7,
	'FOCUSED_COLUMN',
	'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 (
	'poic_site_stan_paytbl',
	8,
	'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 (
	'poic_site_stan_paytbl',
	9,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);

 COMMIT;

---b) For prv_site_stan_paytbl : ---

INSERT INTO system_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_site_stan_paytbl',
	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_site_stan_paytbl',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	'SiteStanPayTbl');


INSERT INTO system_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_site_stan_paytbl',
	3,
	'XML_DATA',
	'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 (
	'prv_site_stan_paytbl',
	4,
	'XML_DATA_1',
	'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 (
	'prv_site_stan_paytbl',
	5,
	'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 (
	'prv_site_stan_paytbl',
	6,
	'OBJ_CONTEXT',
	'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 (
	'prv_site_stan_paytbl',
	7,
	'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 (
	'prv_site_stan_paytbl',
	8,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);

 COMMIT;

---H) obj_actions----------

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 (
	'site_stan_paytbl',
	1,
	'add~normal.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 (
	'site_stan_paytbl',
	2,
	'edit~normal.gif',
	'Editing Existing Record',
	'a',
	'a',
	'E',
	'Edit',
	'1',
	NULL,
	NULL,
	'S',
	NULL,
	NULL,
	NULL,
	NULL);

COMMIT;


-- I) 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 
	(
	'VMSTANNULL',
	'Station Code Null',
	'Station Code can not be null or empty',
	'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 
	(
	'VMSTANINVD',
	'Invalid station code',
	'The entered station code is not valid, please enter valid station code',
	'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 
	(
	'VMSTANSTCD',
	'Invalid station code',
	'The entered station code is not valid for the state code, please enter valid station code',
	'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 
	(
	'VMSITENULL',
	'Site Code Null',
	'Site Code can not be null or empty',
	'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 
	(
	'VMSTATNULL',
	'State Code Null',
	'State Code can not be null or empty',
	'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 
	(
	'VMPAYTBNUL',
	'Pay Table Null',
	'Pay Table can not be null or empty',
	'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 
	(
	'VMSITEINVD',
	'Invalid Site Code',
	'Entered site code is not present, please enter valid site code',
	'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 
	(
	'VMSTATINVD',
	'Invalid State Code',
	'The entered state code is not present, please enter valid state code',
	'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 
	(
	'VMPTBLINVD',
	'Invalid Pay Table',
	'The entered pay table is not present, please enter valid pay table',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);

COMMIT;

-- J) Pop help--

---1. For SITE_CODE--

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 (
	'SITE_CODE',
	'W_SITE_STAN_PAYTBL',
	'SELECT  SITE_CODE , DESCR FROM SITE',
	NULL,
	'Site',
	0,
	0,
	fn_sysdate(),
	'BASE',
	'BASE',
	'0',
	NULL,
	NULL,
	0,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL
	);


---2. For STATE_CODE--

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_SITE_STAN_PAYTBL',
	'SELECT STATE_CODE,DESCR FROM STATE',
	NULL,
	'State',
	0,
	0,
	fn_sysdate(),
	'BASE',
	'BASE',
	'0',
	NULL,
	NULL,
	0,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL
	);

---3. For STAN_CODE--

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_SITE_STAN_PAYTBL',
	'SELECT  STAN_CODE, DESCR FROM STATION WHERE STATE_CODE = ''?''',
	NULL,
	'Station',
	0,
	0,
	fn_sysdate(),
	'BASE',
	'BASE',
	'0',
	NULL,
	':state_code',
	0,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL
	);


COMMIT;


---4. For PAY_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 (
	'PAY_TABLE',
	'W_SITE_STAN_PAYTBL',
	'SELECT PAY_TABLE, DESCR FROM PAYTABLE',
	NULL,
	'Pay Table',
	0,
	0,
	fn_sysdate(),
	'BASE',
	'BASE',
	'0',
	NULL,
	NULL,
	0,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL
	);

COMMIT;


-- K) For new table SITE_STAN_PAYTBL

CREATE TABLE SITE_STAN_PAYTBL
	(
		SITE_CODE CHAR(5) NOT NULL ,
		STATE_CODE CHAR(5) NOT NULL ,
		STAN_CODE CHAR(5) NOT NULL ,
		PAY_TABLE CHAR(5) NOT NULL ,
		CHG_DATE DATE NOT NULL,
		CHG_USER VARCHAR2(10) NOT NULL,
		CHG_TERM VARCHAR2(15) NOT NULL
	);
ALTER TABLE SITE_STAN_PAYTBL ADD CONSTRAINT SITE_STAN_PAYTBL_X PRIMARY KEY (SITE_CODE,STATE_CODE,STAN_CODE);
ALTER TABLE SITE_STAN_PAYTBL ADD CONSTRAINT FK_SITESTANPAYTBL_SITE FOREIGN KEY ( SITE_CODE ) REFERENCES SITE ;
ALTER TABLE SITE_STAN_PAYTBL ADD CONSTRAINT FK_SITESTANPAYTBL_STAT FOREIGN KEY ( STATE_CODE ) REFERENCES STATE;


----------- System Entries for ITM ----------------

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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'w_site_stan_paytbl',
	'ITEMCHANGED',
	'1',
	'poic_itm_site_stan_paytbl',
	NULL,
	'0',
	fn_sysdate(),
	'BASE ',
	'BASE',
	'2',
	'SiteStanPayTbl',
	'EJB',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'w_site_stan_paytbl',
	'VALDATA',
	'1',
	'prv_itm_site_stan_paytbl',
	NULL,
	'0',
	fn_sysdate(),
	'BASE ',
	'BASE',
	'2',
	'SiteStanPayTbl',
	'EJB',
	NULL);

COMMIT;

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_itm_site_stan_paytbl',
	'itemchanged',
	'http://localhost:9090/axis/services/ValidatorService',
	NULL,
	'itemChanged',
	'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 (
	'prv_itm_site_stan_paytbl',
	'Navigate',
	'http://localhost:9090/axis/services/ValidatorService',
	NULL,
	'wf_val_data',
	NULL,
	'S',
	NULL,
	NULL,
	fn_sysdate(),
	'BASE ',
	'BASE');

COMMIT;

INSERT INTO system_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_itm_site_stan_paytbl',
	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 (
	'poic_itm_site_stan_paytbl',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	'SiteStanPayTbl');
 

INSERT INTO system_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_itm_site_stan_paytbl',
	3,
	'TAB_XML_DATA',
	'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 (
	'poic_itm_site_stan_paytbl',
	4,
	'TAB_XML_DATA_1',
	'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 (
	'poic_itm_site_stan_paytbl',
	5,
	'TAB_XML_DATA_2',
	'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 (
	'poic_itm_site_stan_paytbl',
	6,
	'OBJ_CONTEXT',
	'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 (
	'poic_itm_site_stan_paytbl',
	7,
	'FOCUSED_COLUMN',
	'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 (
	'poic_itm_site_stan_paytbl',
	8,
	'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 (
	'poic_itm_site_stan_paytbl',
	9,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);

 COMMIT;

INSERT INTO system_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_itm_site_stan_paytbl',
	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_itm_site_stan_paytbl',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	'SiteStanPayTbl');


INSERT INTO system_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_itm_site_stan_paytbl',
	3,
	'TAB_XML_DATA',
	'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 (
	'prv_itm_site_stan_paytbl',
	4,
	'TAB_XML_DATA_1',
	'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 (
	'prv_itm_site_stan_paytbl',
	5,
	'TAB_XML_DATA_2',
	'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 (
	'prv_itm_site_stan_paytbl',
	6,
	'OBJ_CONTEXT',
	'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 (
	'prv_itm_site_stan_paytbl',
	7,
	'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 (
	'prv_itm_site_stan_paytbl',
	8,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);
COMMIT;


------------------------ pfno_change --------------------
INSERT INTO obj_itemchange (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'pfno_change',
	'1',
	'emp_code',
	'Y');
commit;
-------------------------------------------------------------

------------------------ allowded --------------------
ALTER TABLE ALLWDEDN ADD UDF_TYPE CHAR(5);

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 ('ADM',2,8,0,0,0,'w_allowded','H. Allow./Ded.','Allowances/deductions definition','ADM.2.8.0.0.0',null,null,null,'M',null,null,null,null);

UPDATE ITM2MENU SET OBJ_TYPE = 'M' , ICON_PATH = 'e12_logo.gif' WHERE WIN_NAME='w_grade_site_lvetbl';

commit;

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,START_FORM,ISATTACHMENT,HEADER_FORM_NO,ALLOW_ATTACH,MSG_ONSAVE,CONFIRM_DATE_COL,CONFIRM_BY_COL,WF_STATUS,ISGWTINITIATED,RESTART_FORM) values ('w_allowded','2','2','M','_sppay_site,_pptran_date,AL,seq03',null,null,null,null,null,'N',fn_sysdate(),'BASE','1','0',null,null,null,null,null,null,null,'N','N','AD_CODE','0','0',null,null,null,null,null,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,'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);

update TRANSETUP set WORKFLOW_OPT = 0,TABLE_NAME = 'ALLWDEDN', APPLICATION='ADM',AUDIT_TRAIL_OPT = CASE WHEN AUDIT_TRAIL_OPT IS NULL THEN '0' ELSE AUDIT_TRAIL_OPT END where tran_window = 'w_allowded' ;

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,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,SELECTION_MODE,DEFAULT_VIEW,AUTO_ADDON_ENTRY) values ('w_allowded','Allowed Det',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,null);

update obj_forms set OBJ_BROW_NAME = 'd_allwdedn_brow',OBJ_EDIT_NAME = 'd_allwdedn_edit' 
where win_name='w_allowded';

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 ('allowded',1,'add~normal.gif','Adding New','a','a','A','Add','1',null,null,'S',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 ('allowded',2,'edit~normal.gif','Editing Existing Record','a','a','E','Edit','1',null,null,'S',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 ('allowded',4,'save~normal.gif','Saving','a','a','S','Save','1',null,null,'S',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 ('allowded',5,null,'View Audit Trail','audit_trail','1','X','View Audit','1',1,1,'U',null,null,null,null,null);

INSERT INTO OBJ_ITEMCHANGE (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'allowded',
	'1',
	'drop_yn',
	'Y');
INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'allowded',
	'1',
	'pay_tax',
	NULL);
INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'allowded',
	'1',
	'rnd_off',
	NULL);
INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'allowded',
	'1',
	'it_proj',
	NULL);
INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'allowded',
	'1',
	'prop_yn',
	NULL);
INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'allowded',
	'1',
	'payable',
	NULL);
INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'allowded',
	'1',
	'bal_opt',
	NULL);
INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'allowded',
	'1',
	'tauth_code',
	NULL);
INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'allowded',
	'1',
	'itm_default',
	NULL);
INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'allowded',
	'1',
	'itm_defaultedit',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'allowded',
	'post_validate',
	'1',
	'post_gen_val',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'GenValidate',
	'EJB',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'allowded',
	'pre_validate',
	'1',
	'prv_adm_default_1',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'nvo_bo_allowded',
	'WSR',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'allowded',
	'post_item_change',
	'1',
	'poic_adm_default_1',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'nvo_bo_allowded',
	'WSR',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'allowded',
	'audit_trail',
	'1',
	'project_audit_trail',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	NULL,
	NULL,
	NULL);



commit;

----------------- ald_slab ----------------------

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 ('ADM',2,9,0,0,0,'w_ald_slab','I. Allow./Dedn. Slabs','Allowance / deduction slab definition','ADM.2.9.0.0.0',null,null,null,'M',null,null,null,null);

UPDATE ITM2MENU SET OBJ_TYPE = 'M' , ICON_PATH = 'e12_logo.gif' WHERE WIN_NAME='w_grade_site_lvetbl';

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,START_FORM,ISATTACHMENT,HEADER_FORM_NO,ALLOW_ATTACH,MSG_ONSAVE,CONFIRM_DATE_COL,CONFIRM_BY_COL,WF_STATUS,ISGWTINITIATED,RESTART_FORM) values ('w_ald_slab','2','2','M',null,null,null,null,null,null,'N',fn_sysdate(),'BASE','1','0',null,null,null,'N',null,'E',null,'N',null,null,null,'0',null,null,null,null,null,null,null,null,null,null,'ad_slabs',null,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,null,null,null,null,null,null,null,null,null,null,null,null,null,null);

update TRANSETUP set WORKFLOW_OPT = 0,TABLE_NAME = 'ad_slabs', APPLICATION='ADM',AUDIT_TRAIL_OPT = CASE WHEN AUDIT_TRAIL_OPT IS NULL THEN '0' ELSE AUDIT_TRAIL_OPT END , 
TRAN_ID_COL = 'AD_CODE,SLAB_NO' where tran_window = 'w_ald_slab' ;

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,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,SELECTION_MODE,DEFAULT_VIEW,AUTO_ADDON_ENTRY) values ('w_ald_slab','Ald Slab',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,null);

update obj_forms set OBJ_BROW_NAME = 'd_aldslab_brow',OBJ_EDIT_NAME = 'd_aldslab_edit' 
where win_name='w_ald_slab';

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 ('ald_slab',1,'add~normal.gif','Adding New','a','a','A','Add','1',null,null,'S',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 ('ald_slab',2,'edit~normal.gif','Editing Existing Record','a','a','E','Edit','1',null,null,'S',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 ('ald_slab',3,'delete~normal.gif','Deleting','a','a','D','Delete','1',null,null,'S',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 ('ald_slab',4,'save~normal.gif','Saving','a','a','S','Save','1',null,null,'S',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 ('ald_slab',5,null,'View Audit Trail','audit_trail','1','X','View Audit','1',1,1,'U',null,null,null,null,null);

INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'ald_slab',
	'1',
	'itm_default',
	NULL);

INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'ald_slab',
	'1',
	'ad_code',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'ald_slab',
	'post_validate',
	'1',
	'post_gen_val',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'GenValidate',
	'EJB',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'ald_slab',
	'pre_validate',
	'1',
	'prv_adm_default_1',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'nvo_bo_ald_slab',
	'WSR',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'ald_slab',
	'post_item_change',
	'1',
	'poic_adm_default_1',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'nvo_bo_ald_slab',
	'WSR',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'ald_slab',
	'audit_trail',
	'1',
	'project_audit_trail',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	NULL,
	NULL,
	NULL);

commit;


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 (
	'AD_CODE',
	'X',
	'SELECT AD_CODE, DESCR FROM ALLWDEDN',
	NULL,
	'AD Codes',
	0,
	0,
	fn_sysdate(),
	'BASE',
	'BASE',
	'0',
	NULL,
	NULL,
	0,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL
	);
COMMIT;

------------ cadre_site_lvetbl ---------------------
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 ('ADM',2,10,3,0,0,'w_cadre_site_lvetbl','C. Cadre Leave Table',null,'ADM.2.10.3.0.0',null,null,null,'M',null,null,null,null);

UPDATE ITM2MENU SET OBJ_TYPE = 'M' , ICON_PATH = 'e12_logo.gif' WHERE WIN_NAME='w_grade_site_lvetbl';

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,START_FORM,ISATTACHMENT,HEADER_FORM_NO,ALLOW_ATTACH,MSG_ONSAVE,CONFIRM_DATE_COL,CONFIRM_BY_COL,WF_STATUS,ISGWTINITIATED,RESTART_FORM) values ('w_cadre_site_lvetbl','2','2','M','seq10',null,null,null,null,null,'Y',FN_SYSDATE(),'BASE','BASE','1',null,null,null,'Y',null,'E','N','N',null,'SITE_CODE,CADRE_CODE','0','0',null,null,null,null,null,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,'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);

update TRANSETUP set WORKFLOW_OPT = 0,TABLE_NAME = 'CADRE_SITE_LVETBL', APPLICATION='ADM',AUDIT_TRAIL_OPT = CASE WHEN AUDIT_TRAIL_OPT IS NULL THEN '0' ELSE AUDIT_TRAIL_OPT END, SITE_ACC_COL = 'SITE_CODE' where tran_window = 'w_cadre_site_lvetbl' ;

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,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,SELECTION_MODE,DEFAULT_VIEW,AUTO_ADDON_ENTRY) values ('w_cadre_site_lvetbl','CSite',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,null);

update obj_forms set OBJ_BROW_NAME = 'd_cadre_site_lvetbl_brow',OBJ_EDIT_NAME = 'd_cadre_site_lvetbl_edit' 
where win_name='w_cadre_site_lvetbl';

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 ('cadre_site_lvetbl',1,'add~normal.gif','Adding New','a','a','A','Add','1',null,null,'S',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 ('cadre_site_lvetbl',2,'edit~normal.gif','Editing Existing Record','a','a','E','Edit','1',null,null,'S',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 ('cadre_site_lvetbl',3,'delete~normal.gif','Deleting','a','a','D','Delete','1',null,null,'S',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 ('cadre_site_lvetbl',4,'save~normal.gif','Saving','a','a','S','Save','1',null,null,'S',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 ('cadre_site_lvetbl',5,null,'View Audit Trail','audit_trail','1','X','View Audit','1',1,1,'U',null,null,null,null,null);

INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'cadre_site_lvetbl',
	'1',
	'site_code',
	NULL);

INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'cadre_site_lvetbl',
	'1',
	'cadre_code',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'cadre_site_lvetbl',
	'post_validate',
	'1',
	'post_gen_val',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'GenValidate',
	'EJB',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'cadre_site_lvetbl',
	'pre_validate',
	'1',
	'prv_adm_default_1',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'nvo_bo_cadre_site_lvetbl',
	'WSR',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'cadre_site_lvetbl',
	'post_item_change',
	'1',
	'poic_adm_default_1',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'nvo_bo_cadre_site_lvetbl',
	'WSR',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'cadre_site_lvetbl',
	'audit_trail',
	'1',
	'project_audit_trail',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	NULL,
	NULL,
	NULL);

commit;

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 (
	'SITE_CODE',
	'X',
	'SELECT SITE_CODE,SH_DESCR,GEO_LOC,EDI_ADDR,CITY,STATE_CODE  FROM SITE',
	NULL,
	'Site Code',
	0,
	0,
	fn_sysdate(),
	'BASE',
	'BASE',
	'0',
	NULL,
	NULL,
	0,
	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 (
	'CADRE_CODE',
	'X',
	'SELECT CADRE_CODE,DESCR FROM CADRE',
	NULL,
	'Cadre Code',
	0,
	0,
	fn_sysdate(),
	'BASE',
	'BASE',
	'0',
	NULL,
	NULL,
	0,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL
	);

COMMIT;

------------ grade_site_lvetbl ---------------
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 ('ADM',2,10,4,0,0,'w_grade_site_lvetbl','D. Grade Leave Table',null,'ADM.2.10.4.0.0',null,null,null,null,null,null,null,null);

UPDATE ITM2MENU SET OBJ_TYPE = 'M' , ICON_PATH = 'e12_logo.gif' WHERE WIN_NAME='w_grade_site_lvetbl';


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,START_FORM,ISATTACHMENT,HEADER_FORM_NO,ALLOW_ATTACH,MSG_ONSAVE,CONFIRM_DATE_COL,CONFIRM_BY_COL,WF_STATUS,ISGWTINITIATED,RESTART_FORM) values ('w_grade_site_lvetbl','2','2','M','seq10',null,null,null,null,null,'Y',FN_SYSDATE(),'BASE','BASE','1',null,null,null,'Y',null,'E','N','N',null,'SITE_CODE,GRADE_CODE','0','0',null,null,null,null,null,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,'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);

update TRANSETUP set WORKFLOW_OPT = 0,TABLE_NAME = 'GRADE_SITE_LVETBL', APPLICATION='ADM',AUDIT_TRAIL_OPT = CASE WHEN AUDIT_TRAIL_OPT IS NULL THEN '0' ELSE AUDIT_TRAIL_OPT END, SITE_ACC_COL = 'SITE_CODE' where tran_window = 'w_grade_site_lvetbl' ;

REM INSERTING into OBJ_FORMS
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,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,SELECTION_MODE,DEFAULT_VIEW,AUTO_ADDON_ENTRY) values ('w_grade_site_lvetbl','GSite',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,null);

update obj_forms set OBJ_BROW_NAME = 'd_grade_site_lvetbl_brow',OBJ_EDIT_NAME = 'd_grade_site_lvetbl_EDIT' 
where win_name='w_grade_site_lvetbl';

REM INSERTING into OBJ_ACTIONS
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 ('grade_site_lvetbl',1,'add~normal.gif','Adding New','a','a','A','Add','1',null,null,'S',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 ('grade_site_lvetbl',2,'edit~normal.gif','Editing Existing Record','a','a','E','Edit','1',null,null,'S',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 ('grade_site_lvetbl',3,'delete~normal.gif','Deleting','a','a','D','Delete','1',null,null,'S',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 ('grade_site_lvetbl',4,'save~normal.gif','Saving','a','a','S','Save','1',null,null,'S',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 ('grade_site_lvetbl',5,null,'View Audit Trail','audit_trail','1','X','View Audit','1',1,1,'U',null,null,null,null,null);

INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'grade_site_lvetbl',
	'1',
	'grade_code',
	NULL);

INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'grade_site_lvetbl',
	'1',
	'site_code',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'grade_site_lvetbl',
	'post_validate',
	'1',
	'post_gen_val',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'GenValidate',
	'EJB',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'grade_site_lvetbl',
	'pre_validate',
	'1',
	'prv_adm_default_1',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'nvo_bo_grade_site_lvetbl',
	'WSR',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'grade_site_lvetbl',
	'post_item_change',
	'1',
	'poic_adm_default_1',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'nvo_bo_grade_site_lvetbl',
	'WSR',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'grade_site_lvetbl',
	'audit_trail',
	'1',
	'project_audit_trail',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	NULL,
	NULL,
	NULL);

commit;

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 (
	'GRADE_CODE',
	'X',
	'SELECT DESCR, GRADE_CODE FROM GRADE',
	NULL,
	'Grade Code',
	0,
	0,
	fn_sysdate(),
	'BASE',
	'BASE',
	'0',
	NULL,
	NULL,
	0,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL
	);

COMMIT;

------------ NCOIN --------------------------
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 ('ADM',2,12,0,0,0,'w_ncoin','L. Notes && Coins','Notes & Coins definition','ADM.2.12.0.0.0',null,null,null,null,null,null,null,null);

UPDATE ITM2MENU SET OBJ_TYPE = 'M' , ICON_PATH = 'e12_logo.gif' WHERE WIN_NAME='w_ncoin';

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,START_FORM,ISATTACHMENT,HEADER_FORM_NO,ALLOW_ATTACH,MSG_ONSAVE,CONFIRM_DATE_COL,CONFIRM_BY_COL,WF_STATUS,ISGWTINITIATED,RESTART_FORM) values ('w_ncoin','2','2','M','seq10',null,null,null,null,null,'Y',FN_SYSDATE(),'BASE','BASE','1',null,null,null,'Y',null,'E','N','N',null,'COIN','0','0',null,null,null,null,null,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,'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);

update TRANSETUP set WORKFLOW_OPT = 0,TABLE_NAME = 'NOTESNCOINS', APPLICATION='ADM',AUDIT_TRAIL_OPT = CASE WHEN AUDIT_TRAIL_OPT IS NULL THEN '0' ELSE AUDIT_TRAIL_OPT END where tran_window = 'w_ncoin' ;

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,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,SELECTION_MODE,DEFAULT_VIEW,AUTO_ADDON_ENTRY) values ('w_ncoin','NCoin',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,null);

update obj_forms set OBJ_BROW_NAME = 'd_ncoin_brow',OBJ_EDIT_NAME = 'd_ncoin_edit' where win_name='w_ncoin';

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 ('ncoin',1,'add~normal.gif','Adding New','a','a','A','Add','1',null,null,'S',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 ('ncoin',2,'edit~normal.gif','Editing Existing Record','a','a','E','Edit','1',null,null,'S',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 ('ncoin',3,'delete~normal.gif','Deleting','a','a','D','Delete','1',null,null,'S',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 ('ncoin',4,'save~normal.gif','Saving','a','a','S','Save','1',null,null,'S',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 ('ncoin',5,null,'View Audit Trail','audit_trail','1','X','View Audit','1',1,1,'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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'ncoin',
	'post_validate',
	'1',
	'post_gen_val',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'GenValidate',
	'EJB',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'ncoin',
	'pre_validate',
	'1',
	'prv_adm_default_1',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'nvo_bo_ncoin',
	'WSR',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'ncoin',
	'post_item_change',
	'1',
	'poic_adm_default_1',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'nvo_bo_ncoin',
	'WSR',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'ncoin',
	'audit_trail',
	'1',
	'project_audit_trail',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	NULL,
	NULL,
	NULL);

commit;

-------------- workshft ------------

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 ('ADM',2,13,1,0,0,'w_workshft','A. Work Shifts',null,'ADM.2.13.1.0.0',null,null,null,null,null,null,null,null);

UPDATE ITM2MENU SET OBJ_TYPE = 'M' , ICON_PATH = 'e12_logo.gif' , WIN_NAME = 'w_workshft' WHERE 
APPLICATION='ADM' AND LEVEL_1 = 2 AND LEVEL_2 = 13 AND LEVEL_3 = 1 AND LEVEL_4 = 0 AND LEVEL_5 = 0;

UPDATE ITM2MENU SET OBJ_TYPE = 'M' , ICON_PATH = 'e12_logo.gif'  WHERE WIN_NAME='w_workshft';

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,START_FORM,ISATTACHMENT,HEADER_FORM_NO,ALLOW_ATTACH,MSG_ONSAVE,CONFIRM_DATE_COL,CONFIRM_BY_COL,WF_STATUS,ISGWTINITIATED,RESTART_FORM) values ('w_workshft','2','2','M','seq10',null,null,null,null,null,'Y',FN_SYSDATE(),'BASE','BASE','1',null,null,null,'Y',null,'E','N','N','Y','DAY_NO,SHIFT','0','0',null,null,null,null,null,null,null,null,null,null,'workshft',null,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,null,null,null,null,null,null,null,null,null,null,null,null,null,null);

update TRANSETUP set WORKFLOW_OPT = 0,TABLE_NAME = 'workshft', APPLICATION='ADM',AUDIT_TRAIL_OPT = CASE WHEN AUDIT_TRAIL_OPT IS NULL THEN '0' ELSE AUDIT_TRAIL_OPT END  where tran_window = 'w_workshft' ;

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,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,SELECTION_MODE,DEFAULT_VIEW,AUTO_ADDON_ENTRY) values ('w_workshft','Workshft',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,null);

update obj_forms set OBJ_BROW_NAME = 'd_wrkshift_brow',OBJ_EDIT_NAME = 'd_wrkshift_edit' where win_name='w_workshft';

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 ('workshft',1,'add~normal.gif','Adding New','a','a','A','Add','1',null,null,'S',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 ('workshft',2,'edit~normal.gif','Editing Existing Record','a','a','E','Edit','1',null,null,'S',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 ('workshft',3,'delete~normal.gif','Deleting','a','a','D','Delete','1',null,null,'S',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 ('workshft',4,'delete~normal.gif','Saving','a','a','D','Save','1',null,null,'S',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 ('workshft',5,null,'View Audit Trail','audit_trail','1','X','View Audit','1',1,1,'U',null,null,null,null,null);

INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'workshft',
	'1',
	'itm_default',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'workshft',
	'post_validate',
	'1',
	'post_gen_val',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'GenValidate',
	'EJB',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'workshft',
	'pre_validate',
	'1',
	'prv_adm_default_1',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'nvo_bo_workshft',
	'WSR',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'workshft',
	'post_item_change',
	'1',
	'poic_adm_default_1',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'nvo_bo_workshft',
	'WSR',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'workshft',
	'audit_trail',
	'1',
	'project_audit_trail',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	NULL,
	NULL,
	NULL);

commit;

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 (
	'NEXT_SHIFT',
	'X',
	'SELECT SHIFT AS Code,DESCR AS Description,IN_TIME AS In_Time,OUT_TIME AS Out_Time FROM WORKSHFT WHERE DAY_NO = 1 AND SITE_CODE = ''?'' AND STATUS = ''A'' ORDER BY SHIFT',
	NULL,
	'Work Shift',
	0,
	0,
	fn_sysdate(),
	'BASE',
	'BASE',
	'0',
	NULL,
	':site_code',
	0,
	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 (
	'SHIFT',
	'X',
	'SELECT SHIFT AS Code,DESCR AS Description,IN_TIME AS In_Time,OUT_TIME AS Out_Time FROM WORKSHFT WHERE DAY_NO = 1 AND SITE_CODE = ''?'' AND STATUS = ''A'' ORDER BY SHIFT',
	NULL,
	'Work Shift',
	0,
	0,
	fn_sysdate(),
	'BASE',
	'BASE',
	'0',
	NULL,
	':site_code',
	0,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL
	);

COMMIT;

------------------ shift_pattern -----------
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 ('ADM',2,13,2,0,0,'w_dummy','B. Shift Pattern',null,'ADM.2.13.2.0.0',null,null,null,null,null,null,null,null);

UPDATE ITM2MENU SET OBJ_TYPE = 'M' , ICON_PATH = 'e12_logo.gif' , WIN_NAME='w_shift_pattern' WHERE APPLICATION = 'ADM' AND LEVEL_1 = 2 AND LEVEL_2 = 13 AND LEVEL_3 = 2 AND LEVEL_4 = 0 AND LEVEL_5 = 0;

UPDATE ITM2MENU SET OBJ_TYPE = 'M' , ICON_PATH = 'e12_logo.gif' WHERE WIN_NAME='w_shift_pattern';

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,START_FORM,ISATTACHMENT,HEADER_FORM_NO,ALLOW_ATTACH,MSG_ONSAVE,CONFIRM_DATE_COL,CONFIRM_BY_COL,WF_STATUS,ISGWTINITIATED,RESTART_FORM) values ('w_shift_pattern','2','2','M',null,null,null,null,null,null,'Y',FN_SYSDATE(),'BASE','01BASE215','1',null,null,null,'Y',null,null,'N','N',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'2',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,null,null,null,null,null,null,null,null,null,null,null,null,null,null);

update TRANSETUP set WORKFLOW_OPT = 0,TABLE_NAME = 'SHIFT_PATTERN', APPLICATION='ADM',AUDIT_TRAIL_OPT = CASE WHEN AUDIT_TRAIL_OPT IS NULL THEN '0' ELSE AUDIT_TRAIL_OPT END where tran_window = 'w_shift_pattern' ;

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,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,SELECTION_MODE,DEFAULT_VIEW,AUTO_ADDON_ENTRY) values ('w_shift_pattern','Shift Pattern',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,null);

update obj_forms set OBJ_BROW_NAME = 'd_shift_pattern_brow',OBJ_EDIT_NAME = 'd_shift_pattern_edit' where win_name='w_shift_pattern';

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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'shift_pattern',
	'post_validate',
	'1',
	'post_gen_val',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'GenValidate',
	'EJB',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'shift_pattern',
	'audit_trail',
	'1',
	'project_audit_trail',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	NULL,
	NULL,
	NULL);

commit;


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 (
	'PATTERN_CODE',
	'W_SHIFT_PATTERN',
	'SELECT PATTERN_CODE AS Code,TO_CHAR(START_DATE,''DD-MON-YYYY'') AS Start_date,SHIFT_PATTERN AS Pattern FROM SHIFT_PATTERN WHERE SITE_CODE = ''?'' ORDER BY PATTERN_CODE',
	NULL,
	'Pattern Codes',
	0,
	0,
	fn_sysdate(),
	'BASE',
	'BASE',
	'0',
	NULL,
	':site_code',
	0,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL
	);

COMMIT;

-------------- work_balance -----------

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 ('ADM',2,13,3,0,0,'w_dummy','C. Work Balance',null,'ADM.2.13.3.0.0',null,'M',null,null,null,null,null,null);

UPDATE ITM2MENU SET OBJ_TYPE = 'M' , ICON_PATH = 'e12_logo.gif' , WIN_NAME='w_work_balance' WHERE APPLICATION = 'ADM' AND LEVEL_1 = 2 AND LEVEL_2 = 13 AND LEVEL_3 = 3 AND LEVEL_4 = 0 AND LEVEL_5 = 0;

UPDATE ITM2MENU SET OBJ_TYPE = 'M' , ICON_PATH = 'e12_logo.gif' WHERE WIN_NAME='w_work_balance';

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,START_FORM,ISATTACHMENT,HEADER_FORM_NO,ALLOW_ATTACH,MSG_ONSAVE,CONFIRM_DATE_COL,CONFIRM_BY_COL,WF_STATUS,ISGWTINITIATED,RESTART_FORM) values ('w_work_balance','2','2','M',null,null,null,null,null,null,'Y',FN_SYSDATE(),'BASE','01BASE215','0',null,null,null,'Y',null,null,'N','N',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'2',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,null,null,null,null,null,null,null,null,null,null,null,null,null,null);

update TRANSETUP set WORKFLOW_OPT = 0,TABLE_NAME = 'work_table', APPLICATION='ADM',AUDIT_TRAIL_OPT = CASE WHEN AUDIT_TRAIL_OPT IS NULL THEN '0' ELSE AUDIT_TRAIL_OPT END where tran_window = 'w_work_balance' ;

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,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,SELECTION_MODE,DEFAULT_VIEW,AUTO_ADDON_ENTRY) values ('w_work_balance','Work Balance',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,null);

update obj_forms set OBJ_BROW_NAME = 'd_work_balance_brow',OBJ_EDIT_NAME = 'd_work_balance_EDIT' where win_name='w_work_balance';

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 ('work_balance',1,'add~normal.gif','Adding New','a','a','A','Add','1',null,null,'S',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 ('work_balance',2,'edit~normal.gif','Editing Existing Record','a','a','E','Edit','1',null,null,'S',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 ('work_balance',3,'delete~normal.gif','Deleting','a','a','D','Delete','1',null,null,'S',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 ('work_balance',4,'save~normal.gif','Saving','a','a','S','Save','1',null,null,'S',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 ('work_balance',5,null,'View Audit Trail','audit_trail','1','X','View Audit','1',1,1,'U',null,null,null,null,null);

INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'work_balance',
	'1',
	'start_date',
	NULL);

INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'work_balance',
	'1',
	'end_date',
	NULL);

INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'work_balance',
	'1',
	'itm_default',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'work_balance',
	'post_validate',
	'1',
	'post_gen_val',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'GenValidate',
	'EJB',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'work_balance',
	'pre_validate',
	'1',
	'prv_work_balance_1',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'AttendanceWorkBal',
	'EJB',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'work_balance',
	'post_item_change',
	'1',
	'poic_work_balance_1',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'AttendanceWorkBal',
	'EJB',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'work_balance',
	'audit_trail',
	'1',
	'project_audit_trail',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	NULL,
	NULL,
	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_work_balance_1',
    'PreValidate',
    'http://localhost:9090/axis/services/ValidatorService',
    'BASE',
    'wfValData',
    '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
  (
    'poic_work_balance_1',
    'ItemChange',
    'http://localhost:9090/axis/services/ValidatorService',
    'BASE',
    'itemChanged',
    '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 ('prv_work_balance_1',1,'COMPONENT_TYPE','I',null,'S',null,FN_SYSDATE(),'MANOJ','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_work_balance_1',2,'COMPONENT_NAME','I',null,'S',null,FN_SYSDATE(),'MANOJ','BASE','AttendanceWorkBal');
Insert into SYSTEM_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_work_balance_1',3,'XML_DATA','I',null,'S',null,FN_SYSDATE(),'MANOJ','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_work_balance_1',4,'XML_DATA_1','I',null,'S',null,FN_SYSDATE(),'MANOJ','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_work_balance_1',5,'XML_DATA_ALL','I',null,'S',null,FN_SYSDATE(),'MANOJ','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_work_balance_1',6,'OBJ_CONTEXT','I',null,'S',null,FN_SYSDATE(),'MANOJ','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_work_balance_1',7,'EDIT_FLAG','I',null,'S',null,FN_SYSDATE(),'MANOJ','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_work_balance_1',8,'XTRA_PARAMS','I',null,'S',null,FN_SYSDATE(),'MANOJ','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_work_balance_1',1,'COMPONENT_TYPE','I',null,'S',null,FN_SYSDATE(),'MANOJ','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_work_balance_1',2,'COMPONENT_NAME','I',null,'S',null,FN_SYSDATE(),'MANOJ','BASE','AttendanceWorkBal');
Insert into SYSTEM_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_work_balance_1',3,'XML_DATA','I',null,'S',null,FN_SYSDATE(),'MANOJ','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_work_balance_1',4,'XML_DATA_1','I',null,'S',null,FN_SYSDATE(),'MANOJ','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_work_balance_1',5,'XML_DATA_ALL','I',null,'S',null,FN_SYSDATE(),'MANOJ','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_work_balance_1',6,'OBJ_CONTEXT','I',null,'S',null,FN_SYSDATE(),'MANOJ','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_work_balance_1',7,'FOCUSED_COLUMN','I',null,'S',null,FN_SYSDATE(),'MANOJ','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_work_balance_1',8,'EDIT_FLAG','I',null,'S',null,FN_SYSDATE(),'MANOJ','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_work_balance_1',9,'XTRA_PARAMS','I',null,'S',null,FN_SYSDATE(),'MANOJ','BASE',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 (
	'PRD_CODE__PAY',
	'W_WORK_BALANCE',
	'select descr,code from period',
	NULL,
	'Pay Period',
	0,
	0,
	fn_sysdate(),
	'BASE',
	'BASE',
	'0',
	NULL,
	NULL,
	2,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL
	);

COMMIT;


---------------- site_holtbl -----------------

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 ('ADM',2,25,0,0,0,'w_site_holtbl','Y. Site wise Holiday',null,'ADM.2.25.0.0.0',null,null,null,null,FN_SYSDATE(),'BASE','BASE',null);

UPDATE ITM2MENU SET OBJ_TYPE = 'M' , ICON_PATH = 'e12_logo.gif' WHERE WIN_NAME='w_site_holtbl';

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,START_FORM,ISATTACHMENT,HEADER_FORM_NO,ALLOW_ATTACH,MSG_ONSAVE,CONFIRM_DATE_COL,CONFIRM_BY_COL,WF_STATUS,ISGWTINITIATED,RESTART_FORM) values ('w_site_holtbl','2','2','M','seq10',null,null,null,null,null,'Y',FN_SYSDATE(),'BASE','BASE','1','site_code',null,'N','N',null,null,'N','N',null,null,'0',null,null,null,null,null,null,null,null,null,null,null,'site_holtbl_map','ADM',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,null,null,null,null,null,null,null,null,null,null,null,null,null,null);

update TRANSETUP set WORKFLOW_OPT = 0,TABLE_NAME = 'site_holtbl_map', APPLICATION='ADM',AUDIT_TRAIL_OPT = CASE WHEN AUDIT_TRAIL_OPT IS NULL THEN '0' ELSE AUDIT_TRAIL_OPT END where tran_window = 'w_site_holtbl' ;

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,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,SELECTION_MODE,DEFAULT_VIEW,AUTO_ADDON_ENTRY) values ('w_site_holtbl','Holiday Table',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,null);

update obj_forms set OBJ_BROW_NAME = 'd_site_holtbl_BROW',OBJ_EDIT_NAME = 'd_site_holtbl_edit' where win_name='w_site_holtbl';

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 ('site_holtbl',1,'add~normal.gif','Adding New','a','a','A','Add','1',null,null,'S',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 ('site_holtbl',2,'edit~normal.gif','Editing Existing Record','a','a','E','Edit','1',null,null,'S',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 ('site_holtbl',3,'delete~normal.gif','Deleting','a','a','D','Delete','1',null,null,'S',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 ('site_holtbl',4,'save~normal.gif','Saving','a','a','S','Save','1',null,null,'S',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 ('site_holtbl',5,null,'View Audit Trail','audit_trail','1','X','View Audit','1',1,1,'U',null,null,null,null,null);

INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'site_holtbl',
	'1',
	'itm_default',
	NULL);

INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'site_holtbl',
	'1',
	'itm_defaultedit',
	NULL);

INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'site_holtbl',
	'1',
	'hol_tblno',
	NULL);

INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'site_holtbl',
	'1',
	'site_code',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'site_holtbl',
	'post_validate',
	'1',
	'post_gen_val',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'GenValidate',
	'EJB',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'site_holtbl',
	'pre_validate',
	'1',
	'prv_adm_default_1',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'nvo_bo_site_holtbl',
	'WSR',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'site_holtbl',
	'post_item_change',
	'1',
	'poic_adm_default_1',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'nvo_bo_site_holtbl',
	'WSR',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'site_holtbl',
	'audit_trail',
	'1',
	'project_audit_trail',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	NULL,
	NULL,
	NULL);

commit;

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 (
	'SITE_CODE',
	'W_SITE_HOLTBL',
	'SELECT  SITE_CODE , DESCR FROM SITE',
	NULL,
	'Site',
	0,
	0,
	fn_sysdate(),
	'BASE',
	'BASE',
	'0',
	NULL,
	NULL,
	0,
	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 (
	'HOL_TBLNO',
	'W_SITE_HOLTBL',
	'select descr as Description,trim(fld_value) as Code,sh_descr as Short_Description from gencodes where fld_name = ''HOL_TBLNO'' and active = ''Y''',
	NULL,
	'Site',
	0,
	0,
	fn_sysdate(),
	'BASE',
	'BASE',
	'0',
	NULL,
	NULL,
	2,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL
	);

COMMIT;

--------------- leave ------------------------

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 ('ADM',2,10,1,0,0,'w_leave','A. Leaves',null,'ADM.2.10.1.0.0',null,null,null,'M',null,null,null,null);

UPDATE ITM2MENU SET OBJ_TYPE = 'M' , ICON_PATH = 'e12_logo.gif'  WHERE WIN_NAME='w_leave';

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,START_FORM,ISATTACHMENT,HEADER_FORM_NO,ALLOW_ATTACH,MSG_ONSAVE,CONFIRM_DATE_COL,CONFIRM_BY_COL,WF_STATUS,ISGWTINITIATED,RESTART_FORM) values ('w_leave','2','2','M','seq10',null,null,null,null,null,'Y',FN_SYSDATE(),'BASE','BASE','1',null,null,null,'Y',null,'E','N','N',null,'LVE_CODE','0','0',null,null,null,null,null,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,'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);

update TRANSETUP set WORKFLOW_OPT = 0,TABLE_NAME = 'leaves', APPLICATION='ADM',AUDIT_TRAIL_OPT = CASE WHEN AUDIT_TRAIL_OPT IS NULL THEN '0' ELSE AUDIT_TRAIL_OPT END  where tran_window = 'w_leave' ;

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,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,SELECTION_MODE,DEFAULT_VIEW,AUTO_ADDON_ENTRY) values ('w_leave','Leaves',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,null);

update obj_forms set OBJ_BROW_NAME = 'd_leave_brow',OBJ_EDIT_NAME = 'd_leave_edit' where win_name='w_leave';

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 ('leave',1,'add~normal.gif','Adding New','a','a','A','Add','1',null,null,'S',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 ('leave',2,'edit~normal.gif','Editing Existing Record','a','a','E','Edit','1',null,null,'S',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 ('leave',3,'delete~normal.gif','Deleting','a','a','D','Delete','1',null,null,'S',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 ('leave',4,'save~normal.gif','Saving','a','a','S','Save','1',null,null,'S',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 ('leave',5,null,'View Audit Trail','audit_trail','1','X','View Audit','1',1,1,'U',null,null,null,null,null);

Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('leave','1','accumulate',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('leave','1','ad_code__ench',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('leave','1','encashable',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('leave','1','itm_defaultedit',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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'leave',
	'post_validate',
	'1',
	'post_gen_val',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'GenValidate',
	'EJB',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'leave',
	'pre_validate',
	'1',
	'prv_adm_default_1',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'nvo_bo_leave',
	'WSR',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'leave',
	'post_item_change',
	'1',
	'poic_adm_default_1',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'nvo_bo_leave',
	'WSR',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'leave',
	'audit_trail',
	'1',
	'project_audit_trail',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	NULL,
	NULL,
	NULL);

commit;

ALTER TABLE LEAVES ADD ALLOW_ADV_LEAVE CHAR(1);

UPDATE LEAVES SET ALLOW_ADV_LEAVE = CASE WHEN BAL_OPT = 'Y' THEN 'Y' ELSE 'N' END WHERE ALLOW_ADV_LEAVE IS NULL ;
COMMIT;

INSERT INTO OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) VALUES ('leave','1','bal_opt',null);
COMMIT;

--------- lvetable --------------------

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 ('ADM',2,10,2,0,0,'w_lvetable','B. Leave Table',null,'ADM.2.10.2.0.0',null,null,null,'M',null,null,null,null);

UPDATE ITM2MENU SET OBJ_TYPE = 'M' , ICON_PATH = 'e12_logo.gif'  WHERE WIN_NAME='w_lvetable';

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,START_FORM,ISATTACHMENT,HEADER_FORM_NO,ALLOW_ATTACH,MSG_ONSAVE,CONFIRM_DATE_COL,CONFIRM_BY_COL,WF_STATUS,ISGWTINITIATED,RESTART_FORM) values ('w_lvetable','2','2','M','seq10',null,null,null,null,null,'Y',FN_SYSDATE(),'BASE','BASE','1',null,null,null,'Y',null,'E','N','N',null,'LVE_TBLNO,LVE_CODE','0','0',null,null,null,null,null,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,'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);

update TRANSETUP set WORKFLOW_OPT = 0,TABLE_NAME = 'LVETABLE', APPLICATION='ADM',AUDIT_TRAIL_OPT = CASE WHEN AUDIT_TRAIL_OPT IS NULL THEN '0' ELSE AUDIT_TRAIL_OPT END  where tran_window = 'w_lvetable' ;

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,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,SELECTION_MODE,DEFAULT_VIEW,AUTO_ADDON_ENTRY) values ('w_lvetable','Leave  Table',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,null);

update obj_forms set OBJ_BROW_NAME = 'd_lvetable_brow',OBJ_EDIT_NAME = 'd_lvetable_edit' where win_name='w_lvetable';

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 ('lvetable',1,'add~normal.gif','Adding New','a','a','A','Add','1',null,null,'S',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 ('lvetable',2,'edit~normal.gif','Editing Existing Record','a','a','E','Edit','1',null,null,'S',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 ('lvetable',3,'delete~normal.gif','Deleting','a','a','D','Delete','1',null,null,'S',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 ('lvetable',4,'save~normal.gif','Saving','a','a','S','Save','1',null,null,'S',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 ('lvetable',5,null,'View Audit Trail','audit_trail','1','X','View Audit','1',1,1,'U',null,null,null,null,null);

INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'lvetable',
	'1',
	'itm_default',
	NULL);
INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'lvetable',
	'1',
	'itm_defaultedit',
	NULL);
INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'lvetable',
	'1',
	'lve_code',
	NULL);
INSERT INTO OBJ_ITEMCHANGE  (
	obj_name ,
	form_no ,
	field_name ,
	mandatory )
VALUES (
	'lvetable',
	'1',
	'accumulate',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'lvetable',
	'post_validate',
	'1',
	'post_gen_val',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'GenValidate',
	'EJB',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'lvetable',
	'pre_validate',
	'1',
	'prv_adm_default_1',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'nvo_bo_lvetable',
	'WSR',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'lvetable',
	'post_item_change',
	'1',
	'poic_adm_default_1',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	'nvo_bo_lvetable',
	'WSR',
	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_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'lvetable',
	'audit_trail',
	'1',
	'project_audit_trail',
	NULL,
	'0',
	fn_sysdate(),
	'BASE',
	'BASE',
	'2',
	NULL,
	NULL,
	NULL);

commit;


ALTER TABLE LVETABLE ADD ALLOW_ADV_LEAVE CHAR(1);
UPDATE LVETABLE SET ALLOW_ADV_LEAVE = (SELECT CASE WHEN BAL_OPT = 'Y' THEN 'Y' ELSE 'N' END FROM 
	LEAVES WHERE LEAVES.LVE_CODE = LVETABLE.LVE_CODE)
WHERE ALLOW_ADV_LEAVE IS NULL ;
COMMIT;

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 (
	'LVE_TBLNO',
	'X',
	'SELECT RTRIM(FLD_VALUE), DESCR, SH_DESCR  FROM GENCODES WHERE FLD_NAME = ''LVE_TBLNO''',
	NULL,
	'Leave Table No',
	0,
	0,
	fn_sysdate(),
	'BASE',
	'BASE',
	'0',
	NULL,
	NULL,
	0,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL
	);
COMMIT;


update system_events set service_code = 'poic_adm_default_1' where 
obj_name in (
'allowded',
'ald_slab',
'cadre_site_lvetbl',
'grade_site_lvetbl',
'ncoin',
'workshft',
'site_holtbl',
'leave',
'lvetable' ) and event_code = 'post_item_change' and service_code='poic_default_1';
commit;

update system_events set service_code = 'prv_adm_default_1' where 
obj_name in (
'allowded',
'ald_slab',
'cadre_site_lvetbl',
'grade_site_lvetbl',
'ncoin',
'workshft',
'site_holtbl',
'leave',
'lvetable' ) and event_code = 'pre_validate' and service_code='prv_default_1';
commit;

