 /* SQL Updated by Priyanka Shinde on 26/MAR/14 for Freight Rate(DI3GSUN047)  */
ALTER TABLE TARODEV.FREIGHT_RATE ADD TRANS_MODE                      CHAR(1);
ALTER TABLE TARODEV.FREIGHT_RATE ADD MIN_WEIGHT                       NUMBER(14,3);
ALTER TABLE TARODEV.FREIGHT_RATE ADD MAX_WEIGHT                       NUMBER(14,3);

update system_events SET COMP_TYPE='EJB',COMP_NAME='FreightRateIC',SERVICE_CODE='prv_default_ejb',CHG_DATE=sysdate where obj_name='frt_rate' and EVENT_CODE='pre_validate'; 

update system_events SET COMP_TYPE='EJB',COMP_NAME='FreightRateIC',SERVICE_CODE='poic_default_ejb',CHG_DATE=sysdate where obj_name='frt_rate' and EVENT_CODE='post_item_change';


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,mob_deploy,close_icon)
VALUES ('FRT',1,5,0,0,0,'w_frt_rate','Freight Rate',NULL,'FRT.1.5.0.0.0','e12_logo.gif','T',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,auto_confirm,ledg_post_conf,tran_id_col,workflow_opt,ref_ser,tax_forms,wrkflw_init,audit_trail_opt) 
VALUES ('w_frt_rate','2','2','M',NULL,'N',TO_DATE('20-11-2008 19:22:59','DD-MM-YYYY HH24:MI:SS'),'BASE      ','BASE           ','0',NULL,NULL,NULL,'N','N',NULL,NULL,'F-RAT',NULL,NULL,NULL);


INSERT INTO obj_forms 	(win_name,title,obj_brow_name,obj_edit_name,cross_update_expr,expr_fld_info,target_fld_info,expr_comment,form_no )
VALUES ('w_frt_rate','FrtRt','d_frt_rate_brow','d_frt_rate_edit',NULL,NULL,NULL,NULL,'1');

INSERT INTO obj_forms 	(win_name,title,obj_brow_name,obj_edit_name,cross_update_expr,expr_fld_info,target_fld_info,expr_comment,form_no )
VALUES ('w_frt_rate','Details','d_frt_rate_det_brow','d_frt_rate_det_edit',NULL,NULL,NULL,NULL,'2');

INSERT into  obj_actions (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER,IS_CONFIRMATION_REQ) 
values ('frt_rate',1,'add.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 ('frt_rate',2,'edit.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 ('frt_rate',4,'save.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 ('frt_rate',21,'menu.bmp','View Audit Trail','audit_trail','1','X','View Audit','1','1','1','U',null,null,null,null,null);

INSERT INTO MESSAGES (msg_no , msg_str , msg_descr ,  msg_type ,  msg_opt , chg_date , chg_user , chg_term )
VALUES ('VTFMTOTMVD', 'Invalid To Day/Time','To Day/Time Can not be less than From Day/Time !', 'E', 'Y', SYSDATE, 'BASE', 'BASE');

INSERT INTO MESSAGES (msg_no , msg_str , msg_descr ,  msg_type ,  msg_opt , chg_date , chg_user , chg_term )
VALUES ('VMCHGAMT', 'Invalid Amount','Amount should be greater than Zero. !', 'E', 'Y', SYSDATE, 'BASE', 'BASE');

INSERT INTO MESSAGES (msg_no , msg_str , msg_descr ,  msg_type ,  msg_opt , chg_date , chg_user , chg_term )
VALUES ('VMSEQ2', 'Invalid Sequence','Sequence should not be Zero. !', 'E', 'Y', SYSDATE, 'BASE', 'BASE');

INSERT INTO MESSAGES (msg_no , msg_str , msg_descr ,  msg_type ,  msg_opt , chg_date , chg_user , chg_term )
VALUES ('VMMINWGT', 'Invalid Weight','Min weight should be less than max weight.. !', 'E', 'Y', SYSDATE, 'BASE', 'BASE');

INSERT INTO MESSAGES (msg_no , msg_str , msg_descr ,  msg_type ,  msg_opt , chg_date , chg_user , chg_term )
VALUES ('VTFRLNTEXT', 'Invalid FreightList','Freight List does not exists', 'E', 'Y', SYSDATE, 'BASE', 'BASE');

INSERT INTO MESSAGES (msg_no , msg_str , msg_descr ,  msg_type ,  msg_opt , chg_date , chg_user , chg_term )
VALUES ('VTTRMODE', 'Invalid TransporterMode','Transporter Mode cannot be empty.', 'E', 'Y', SYSDATE, 'BASE', 'BASE');

INSERT INTO MESSAGES (msg_no , msg_str , msg_descr ,  msg_type ,  msg_opt , chg_date , chg_user , chg_term )
VALUES ('VTMINWGT', 'Invalid MinimumWeight','Minimum Weight cannot be empty.', 'E', 'Y', SYSDATE, 'BASE', 'BASE');

INSERT INTO MESSAGES (msg_no , msg_str , msg_descr ,  msg_type ,  msg_opt , chg_date , chg_user , chg_term )
VALUES ('VTMAXWGT', 'Invalid MaximumWeight','MaximumW Weight cannot be empty.', 'E', 'Y', SYSDATE, 'BASE', 'BASE')

INSERT INTO MESSAGES (msg_no , msg_str , msg_descr ,  msg_type ,  msg_opt , chg_date , chg_user , chg_term )
VALUES ('VMFLTVLD', 'Invalid LoadType','Load type not defined for freight list master.', 'E', 'Y', SYSDATE, 'BASE', 'BASE')


INSERT INTO obj_itemchange(OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY)
VALUES ('frt_rate',1,'itm_defaultedit',NULL);

INSERT INTO pophelp (FIELD_NAME,MOD_NAME,SQL_STR,MSG_TITLE,WIDTH,HEIGHT,CHG_DATE,CHG_USER,CHG_TERM,DIST_OPT,HELP_OPTION)
VALUES ('TRANS_MODE','X','select rtrim(fld_value),descr from gencodes where fld_name = ''TRANS_MODE'' and mod_name = ''X''','TRANSPORTER MODE',0,0,SYSDATE,'BASE','BASE','0','0');

COMMIT