ALTER TABLE sord_alloc
ADD EMP_CODE__APRV   CHAR(10); 

ALTER TABLE sord_alloc
ADD  CONFIRMED  CHAR(1);

ALTER TABLE sord_alloc
ADD  CONF_DATE DATE;

ALTER TABLE sord_alloc_det
ADD  PENDING_QTY NUMBER(14,3);



INSERT INTO ITM2MENU 
(
	APPLICATION,
	LEVEL_1,
	LEVEL_2,
	LEVEL_3,
	LEVEL_4,
	LEVEL_5,
	WIN_NAME,
	DESCR,
	COMMENTS,
	MENU_PATH,
	ICON_PATH,
	OBJ_TYPE,
	CHG_USER,
	CHG_TERM,
	CHG_DATE,
	OPEN_ICON,
	CLOSE_ICON
)
VALUES
(
	'WMS',
	1,1,4,0,0,
	'w_sord_alloc',
	'Manual Stock Allocation',
	null,
	'WMS.1.1.4.0.0',
	null,
	null,
	null,
	null,
	null,
	null,
	null
)


INSERT INTO TRANSETUP
(TRAN_WINDOW,SAVE_FLAG,VAL_FLAG,KEY_FLAG,KEY_STRING,REPEATE_ADD,CHG_DATE,CHG_USER,CHG_TERM,
 EDI_OPTION,SITE_ACC_COL,CONFIRM_COL,CONFIRM_VAL,LEDG_POST_CONF,CHG_DATE_ON_CONF,TRAN_ID_COL,
 CONFIRM_MODE,MAIL_OPTION,GARBAGE_OPT,REF_SER,VIEW_MODE) 
VALUES 
('w_sord_alloc','2','2','A','seq04','Y',sysdate,'BASE','BASE',
 '0','SITE_CODE','confirmed','Y','N','Y','TRAN_ID',
 '0','0','N','S-STK',null);	
 
 INSERT INTO SYSTEM_EVENTS
(
	OBJ_NAME,
	EVENT_CODE,
	EVENT_CONTEXT,
	SERVICE_CODE,
	METHOD_RULE,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	RESULT_HANDLE,
	OVERWRITE_CORE,
	COMP_TYPE,
	COMP_NAME,
	COMM_FORMAT
) VALUES (
	'sord_alloc',
	'pre_validate',
	'1',
	'prv_default_ejb1',
	null,
	sysdate,
	'BASE',
	'BASE',
	'2',
	'0',
	'EJB',
	'StockAllocIc',
	NULL
);

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

INSERT INTO SYSTEM_EVENTS
(	
	OBJ_NAME,
	EVENT_CODE,
	EVENT_CONTEXT,
	SERVICE_CODE,
	METHOD_RULE,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	RESULT_HANDLE,
	OVERWRITE_CORE,
	COMP_TYPE,
	COMP_NAME,
	COMM_FORMAT
) VALUES (
	'sord_alloc',
	'pre_confirm',
	'1',
	'prcm_default_ejb',
	null,
	sysdate,
	'BASE',
	'BASE',
	'2',
	'0',
	'EJB',
	'StockAllocIcConf',
	NULL
);



insert into obj_itemchange(
	OBJ_NAME,       
	FORM_NO,        
	FIELD_NAME
)
values
(
	'sord_alloc',
	1,
	'itm_default'
); 

insert into obj_itemchange(
	OBJ_NAME,       
	FORM_NO,        
	FIELD_NAME
)
values
(
	'sord_alloc',
	1,
	'itm_defaultedit'
); 

insert into obj_itemchange(
	OBJ_NAME,       
	FORM_NO,        
	FIELD_NAME
)
values
(
	'sord_alloc',
	1,
	'sale_order'
); 

insert into obj_itemchange(
	OBJ_NAME,       
	FORM_NO,        
	FIELD_NAME
)
values
(
	'sord_alloc',
	2,
	'item_code'
); 


insert into obj_itemchange(
	OBJ_NAME,       
	FORM_NO,        
	FIELD_NAME
)
values
(
	'sord_alloc',
	2,
	'itm_default'
); 

insert into obj_itemchange(
	OBJ_NAME,       
	FORM_NO,        
	FIELD_NAME
)
values
(
	'sord_alloc',
	2,
	'itm_defaultedit'
); 




insert into obj_itemchange(
	OBJ_NAME,       
	FORM_NO,        
	FIELD_NAME
)
values
(
	'sord_alloc',
	2,
	'sale_order'
); 


insert into obj_itemchange(
	OBJ_NAME,       
	FORM_NO,        
	FIELD_NAME
)
values
(
	'sord_alloc',
	2,
	'line_no__sord'
); 


insert into obj_itemchange(
	OBJ_NAME,       
	FORM_NO,        
	FIELD_NAME
)
values
(
	'sord_alloc',
	2,
	'exp_lev'
); 



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



INSERT INTO OBJ_FORMS
(
win_name,
title,
obj_brow_name,
obj_edit_name,	
form_no,
auto_accept_scan,
scan_metadata,
scan_flag,
scan_delimiter,
auto_accept_weighdata
)
values (
'w_sord_alloc',
'header',
'd_sord_alloc11',
'd_sord_alloc21',
'1',
null,
null,
'Y',
null,
null
);		

INSERT INTO OBJ_FORMS
(
win_name,
title,
obj_brow_name,
obj_edit_name,	
form_no,
auto_accept_scan,
scan_metadata,
scan_flag,
scan_delimiter,
auto_accept_weighdata
)
values (
'w_sord_alloc',
'Detail',
'd_sord_alloc12',
'd_sord_alloc22',
'2',
null,
null,
'Y',
null,
null
);


INSERT INTO obj_actions
	(OBJ_NAME ,
	LINE_NO ,
	RIGHTS_CHAR,
	INTERACTIVE,
	SERVICE_CODE,
	DESCRIPTION,
	TITLE,
	IMAGE,
	FORM_NO,
	SERVICE_HANDLER,
	PLACEMENT,
	ACTION_TYPE,
	TRAN_TYPE)
	VALUES (
	'w_sord_alloc',
	8,
	'R',
	'a',
	'act_stock',
	'Action Button for Stock',
	'Stock',
	null,
	'2',
	'4',
	NULL,
	'U',
	NULL);



INSERT INTO system_events
(
	OBJ_NAME,
	EVENT_CODE,
	EVENT_CONTEXT,
	SERVICE_CODE,
	METHOD_RULE,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	RESULT_HANDLE,
	OVERWRITE_CORE,
	COMP_TYPE,
	COMP_NAME,
	COMM_FORMAT
) 
 VALUES (
	'sord_alloc',
	'act_stock',
	'1',
	'astock_despatch',
	NULL,
	fn_sysdate(),
	'Dipak   ',
	'Dipak',
	'2',
	'0',
	'EJB',
	'DespatchAct',
	NULL);









INSERT INTO SYSTEM_EVENTS
(	
	OBJ_NAME,
	EVENT_CODE,
	EVENT_CONTEXT,
	SERVICE_CODE,
	METHOD_RULE,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	RESULT_HANDLE,
	OVERWRITE_CORE,
	COMP_TYPE,
	COMP_NAME,
	COMM_FORMAT
) VALUES (
	'sord_alloc',
	'act_confirm',
	'1',
	'confirm_stock_alloc',
	null,
	sysdate,
	'BASE',
	'BASE',
	'2',
	'0',
	'EJB',
	'StockAllocPrc',
	NULL
);


insert into system_event_services(
service_code,
service_descr,
service_uri,
service_provider,
method_name,
return_value,
return_type,
chg_date,
chg_user,
chg_term)
values
('confirm_stock_alloc',
'Action To confirm',
'http://localhost:9090/axis/services/ActionHandlerService',
'Base Information',
'confirm',
'String',
'S',
sysdate,
'base',
'base');


INSERT INTO messages (
	msg_no,
	msg_str,
	msg_descr,
	msg_type,
	msg_opt,
	msg_time,
	alarm,
	err_source,
	chg_date,
	chg_user,
	chg_term,
	override_input,
	mail_option
)
 VALUES (
	'VMITMC1',
	'Invalid Item Code  ',
	'Please Enter Valid Item code',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'BASE      ',
	'BASE      ',
	NULL,
	NULL);


INSERT INTO messages (
	msg_no,
	msg_str,
	msg_descr,
	msg_type,
	msg_opt,
	msg_time,
	alarm,
	err_source,
	chg_date,
	chg_user,
	chg_term,
	override_input,
	mail_option
)
 VALUES (
	'VMSORD1',
	'Invalid Sorder Number  ',
	'Please Enter Valid Sorder Number',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'BASE      ',
	'BASE      ',
	NULL,
	NULL);


INSERT INTO messages (
	msg_no,
	msg_str,
	msg_descr,
	msg_type,
	msg_opt,
	msg_time,
	alarm,
	err_source,
	chg_date,
	chg_user,
	chg_term,
	override_input,
	mail_option
)
 VALUES (
	'VTTRAN1',
	'Transactiion Date cannot be null ',
	'Please Enter Transactiion Date',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'BASE      ',
	'BASE      ',
	NULL,
	NULL);



INSERT INTO messages (
	msg_no,
	msg_str,
	msg_descr,
	msg_type,
	msg_opt,
	msg_time,
	alarm,
	err_source,
	chg_date,
	chg_user,
	chg_term,
	override_input,
	mail_option
)
 VALUES (
	'VTLOCN1',
	'Location Code not valid ',
	'Please Enter Valid Location Code',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'BASE',
	'BASE',
	NULL,
	NULL);


INSERT INTO messages (
	msg_no,
	msg_str,
	msg_descr,
	msg_type,
	msg_opt,
	msg_time,
	alarm,
	err_source,
	chg_date,
	chg_user,
	chg_term,
	override_input,
	mail_option
)
 VALUES (
	'VTQUNT1',
	'Quantity not valid ',
	'Quantity must not exceed pending quantity',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'BASE',
	'BASE',
	NULL,
	NULL);


INSERT INTO messages (
	msg_no,
	msg_str,
	msg_descr,
	msg_type,
	msg_opt,
	msg_time,
	alarm,
	err_source,
	chg_date,
	chg_user,
	chg_term,
	override_input,
	mail_option
)
 VALUES (
	'CONFSUCCES',
	'Confirmation Successfull ',
	'Selected Transaction Confirmed Successfully!!',
	'P',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'BASE',
	'BASE',
	NULL,
	NULL);	



INSERT INTO messages (
	msg_no,
	msg_str,
	msg_descr,
	msg_type,
	msg_opt,
	msg_time,
	alarm,
	err_source,
	chg_date,
	chg_user,
	chg_term,
	override_input,
	mail_option
)
 VALUES (
	'VTEXPL1',
	'Exp Lev is not valid',
	'Please Enter Valid  Expansion Lev',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'BASE',
	'BASE',
	NULL,
	NULL);	



INSERT INTO messages (
	msg_no,
	msg_str,
	msg_descr,
	msg_type,
	msg_opt,
	msg_time,
	alarm,
	err_source,
	chg_date,
	chg_user,
	chg_term,
	override_input,
	mail_option
)
 VALUES (
	'VTEXPL2',
	'Exp Lev can not be null',
	'Please Enter Valid  Expansion Lev',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'BASE',
	'BASE',
	NULL,
	NULL);	


INSERT INTO messages (
	msg_no,
	msg_str,
	msg_descr,
	msg_type,
	msg_opt,
	msg_time,
	alarm,
	err_source,
	chg_date,
	chg_user,
	chg_term,
	override_input,
	mail_option
)
 VALUES (
	'VTQUNT2',
	'Quantity can not be null ',
	'Please enter quantity',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'BASE',
	'BASE',
	NULL,
	NULL);

INSERT INTO messages (
	msg_no,
	msg_str,
	msg_descr,
	msg_type,
	msg_opt,
	msg_time,
	alarm,
	err_source,
	chg_date,
	chg_user,
	chg_term,
	override_input,
	mail_option
)
 VALUES (
	'VTLOCN2',
	'Location Code can not be null ',
	'Please Enter Valid Location Code',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'BASE',
	'BASE',
	NULL,
	NULL);


INSERT INTO messages (
	msg_no,
	msg_str,
	msg_descr,
	msg_type,
	msg_opt,
	msg_time,
	alarm,
	err_source,
	chg_date,
	chg_user,
	chg_term,
	override_input,
	mail_option
)
 VALUES (
	'VMSORD2',
	'Sorder NO. must not null',
	'Please Enter Valid Sorder Number',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'BASE      ',
	'BASE      ',
	NULL,
	NULL);


INSERT INTO messages (
	msg_no,
	msg_str,
	msg_descr,
	msg_type,
	msg_opt,
	msg_time,
	alarm,
	err_source,
	chg_date,
	chg_user,
	chg_term,
	override_input,
	mail_option
)
 VALUES (
	'VMITMC2',
	'Item Code can not be null  ',
	'Please Enter Valid Item code',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'BASE      ',
	'BASE      ',
	NULL,
	NULL);



INSERT INTO messages (
	msg_no,
	msg_str,
	msg_descr,
	msg_type,
	msg_opt,
	msg_time,
	alarm,
	err_source,
	chg_date,
	chg_user,
	chg_term,
	override_input,
	mail_option
)
 VALUES (
	'VTLOTNO',
	'Lot No. can not be null  ',
	'Please Enter Valid Lot No.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'BASE      ',
	'BASE      ',
	NULL,
	NULL);



INSERT INTO messages (
	msg_no,
	msg_str,
	msg_descr,
	msg_type,
	msg_opt,
	msg_time,
	alarm,
	err_source,
	chg_date,
	chg_user,
	chg_term,
	override_input,
	mail_option
)
 VALUES (
	'VTLOTSL',
	'Lot Sl can not be null  ',
	'Please Enter Valid Lot Sl.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'BASE      ',
	'BASE      ',
	NULL,
	NULL);

<!-- change by Rohan -->

INSERT INTO messages (
	msg_no,
	msg_str,
	msg_descr,
	msg_type,
	msg_opt,
	msg_time,
	alarm,
	err_source,
	chg_date,
	chg_user,
	chg_term,
	override_input,
	mail_option
)
 VALUES (
	'VTSORDLINE',
	'Null Sord line no  ',
	'Please Enter Sord Line no.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'BASE      ',
	'BASE      ',
	NULL,
	NULL);

INSERT INTO messages (
	msg_no,
	msg_str,
	msg_descr,
	msg_type,
	msg_opt,
	msg_time,
	alarm,
	err_source,
	chg_date,
	chg_user,
	chg_term,
	override_input,
	mail_option
)
 VALUES (
	'VTQUANTITY',
	'Null Quantity ',
	'Please Enter Quantity.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'BASE      ',
	'BASE      ',
	NULL,
	NULL);

INSERT INTO messages (
	msg_no,
	msg_str,
	msg_descr,
	msg_type,
	msg_opt,
	msg_time,
	alarm,
	err_source,
	chg_date,
	chg_user,
	chg_term,
	override_input,
	mail_option
)
 VALUES (
	'VTSORDQTY',
	'Pending quantity Grater ',
	'Quantity is greater than pending Quantity.',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'BASE      ',
	'BASE      ',
	NULL,
	NULL);




