insert into itm2menu (
APPLICATION,
LEVEL_1,
LEVEL_2,
LEVEL_3 ,
LEVEL_4,
LEVEL_5,
WIN_NAME,
DESCR ,
MENU_PATH ,
OBJ_TYPE,
CHG_DATE,
CHG_TERM,
CHG_USER  
)
values(
'DIS',
18,
2,
0,
0,
0,
'w_pod_process',
'POD Process',
'DIS.18.2.0.0.0',
'P',
sysdate,
'BASE',
'BASE'
);

insert into obj_forms (WIN_NAME,TITLE,
OBJ_BROW_NAME,OBJ_EDIT_NAME,FORM_NO)
values('w_pod_process','Header',
'proofof_delprc11','proofof_delprc11','1');


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 ('pod_process','post_item_change','1','poic_default_ejb',NULL,
	sysdate,
	'BASE','BASE','1','0','EJB','PODProcessIC',NULL);	

	
	
	
insert into obj_itemchange (obj_name,form_no,field_name,mandatory)
values('pod_process','1','itm_default',null);

insert into obj_itemchange (obj_name,form_no,field_name,mandatory)
values('pod_process','1','site_code',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 ('pod_process','process','1','pod_prc',NULL,
	sysdate,'BASE','BASE','2','0','EJB','PODProcess',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 ('pod_process',2,null,'Generated debit note fort pending POD','process','a','R','Process','2','3',null,'U',null,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 ('pod_prc','post consumption order','http://localhost/axis/services/ProcessService','Base Information','process','String','S',null,null,sysdate,'Dadaso','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 ('pod_prc',1,'COMPONENT_TYPE','I','Component Type','C.String',null,sysdate,'Dadaso','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 ('pod_prc',2,'COMPONENT_NAME','I','Component Name','C.String',null,sysdate,'Dadaso','BASE','PODProcess');
 
Insert into system_service_args (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE)
 values ('pod_prc',3,'XML_DATA_1','I','XML data of form no 1','S',null,sysdate,'Dadaso','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 ('pod_prc',4,'XML_DATA__ALL','I','XML data of form no 1','S',null,sysdate,'Dadaso','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 ('pod_prc',5,'OBJ_CONTEXT','I','Object Context','S',null,sysdate,'Dadaso','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 ('pod_prc',6,'XTRA_PARAMS','I','Extra Arguments','S',Null,sysdate,'Dadaso','BASE',Null);
 
 create table podtrace (
tran_id Char(10), 
line_no Number(3) NOT NULL,
tran_date Date NOT NULL,
invoice_id  Char(10) NOT NULL,
site_code Char(5) NOT NULL,
item_code Char(10) NOT NULL,
inv_type varchar2(3),
db_qty number(14,3),
db_rate number(14,3),
debit_note_amt	number(14,3),
success char (1),
partial char (1),
scheme char(1),
chg_date date NOT NULL,
chg_user char(10) NOT NULL,
chg_term char(15) NOT NULL
) TABLESPACE ITM_DIS_D1;


ALTER TABLE podtrace ADD CONSTRAINT podtrace_X PRIMARY KEY (TRAN_ID,LINE_NO) USING INDEX TABLESPACE ITM_DIS_I1;

ALTER TABLE podtrace ADD CONSTRAINT FK_podtrace_I FOREIGN KEY (INVOICE_ID) REFERENCES invoice (INVOICE_ID);
ALTER TABLE podtrace ADD CONSTRAINT FK_podtrace_S FOREIGN KEY (SITE_CODE) REFERENCES site (SITE_CODE);

 
 insert into messages
(msg_no,msg_str,msg_descr,msg_type,chg_date,chg_user,chg_term) 
values 
('VTPRCLND','Price list not define','Price list not define in site master','E',sysdate,'BASE','BASE');


insert into messages
(msg_no,msg_str,msg_descr,msg_type,chg_date,chg_user,chg_term) 
values 
('VTPRCLNE','Price list error','Price list must be greater than zero','E',sysdate,'BASE','BASE');

insert into messages
(msg_no,msg_str,msg_descr,msg_type,chg_date,chg_user,chg_term) 
values 
('VTPRCCSF','Process completed','Process completed successfully','P',sysdate,'BASE','BASE');

insert into messages
(msg_no,msg_str,msg_descr,msg_type,chg_date,chg_user,chg_term) 
values 
('VTPRCNCP','Process failed','Process not completed','E',sysdate,'BASE','BASE');

insert into messages
(msg_no,msg_str,msg_descr,msg_type,chg_date,chg_user,chg_term) 
values 
('VTINVTI','Invalid invoice type','Invoice type applicable only DM or IS','E',sysdate,'BASE','BASE');

insert into messages
(msg_no,msg_str,msg_descr,msg_type,chg_date,chg_user,chg_term) 
values 
('VTINVTNN','Invoice type empty','Invoice type cannot be empty','E',sysdate,'BASE','BASE');

insert into messages
(msg_no,msg_str,msg_descr,msg_type,chg_date,chg_user,chg_term) 
values 
('VTSCHME','Scheme expired!!','Scheme is expired for particular item,please check in bomdet','E',sysdate,'BASE','BASE');

insert into messages
(msg_no,msg_str,msg_descr,msg_type,chg_date,chg_user,chg_term) 
values 
('VTPPRCSF','partially successfully','POD process partially successfully.Please refer podtrace for more details.','P',sysdate,'BASE','BASE');

--06/MAR/14
insert into messages
(msg_no,msg_str,msg_descr,msg_type,chg_date,chg_user,chg_term) 
values 
('VTDNFIN','Data not Found','Invoice id not found for enters values','E',sysdate,'BASE','BASE');

insert into tarodev.messages
(msg_no,msg_str,msg_descr,msg_type,chg_date,chg_user,chg_term) 
values 
('VTNGAMTE','Negative amount','Net PTS Rate is less than invoice rate.Debit note not generated','E',sysdate,'BASE','BASE');

update messages set msg_type='P' where msg_no='VTPPRCSF';






