 


ALTER TABLE DISTROUTE MODIFY (STAN_CODE__FR  NULL);
ALTER TABLE DISTROUTE MODIFY (STAN_CODE__TO  NULL);
ALTER TABLE DISTROUTE ADD CUST_CODE CHAR(10) ;



ALTER TABLE DISTROUTEDET ADD MIN_WEIGHT NUMBER(14,6) default 0;
ALTER TABLE DISTROUTEDET ADD MAX_WEIGHT NUMBER(14,6) default 0;

ALTER TABLE DISTROUTEDET MODIFY (MAX_WEIGHT NOT NULL);
ALTER TABLE DISTROUTEDET MODIFY (MIN_WEIGHT NOT NULL);


ALTER TABLE DISTROUTEDET ADD STATE_CODE__TO CHAR(5) default ' ';
ALTER TABLE DISTROUTEDET ADD STATE_CODE__FR CHAR(5) default ' ';
ALTER TABLE DISTROUTEDET MODIFY (STATE_CODE__TO NOT NULL);
ALTER TABLE DISTROUTEDET MODIFY (STATE_CODE__FR NOT NULL);
ALTER TABLE DISTROUTEDET ADD LOC_TYPE CHAR(3) ;


insert into obj_itemchange(obj_name,form_no,field_name) values ('distroute',1,'cust_code');


insert into obj_itemchange(obj_name,form_no,field_name) values ('distroute',2,'state_code__to');
insert into obj_itemchange(obj_name,form_no,field_name) values ('distroute',2,'state_code__fr');


insert into messages(
MSG_NO,         
MSG_STR ,       
MSG_DESCR,      
MSG_TYPE,
MSG_OPT,
chg_date,
chg_user,
chg_term
)
values(
'VTSTANDB',
'Invalid  Stan Code To',
'Stan Code To and Stan Code From Combination is dublicate',
'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(
'VTCURRBK',
'Invalid  Currency Code',
'Invalid  Currency Code,Currency code can not be blank ',
'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(
'VTSTATEFR',
'Invalid Station',
'Station Code From  not define in State Code From',
'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(
'VTSTATETO',
'Invalid Station',
'Station Code To not define in State Code To',
'E',
'Y',
sysdate,
'base',
'base'
);



insert into refseq (ref_ser,ref_prefix,seq_no,chg_date,chg_user,chg_term)
values('D-RTE','D','00001',sysdate,'kunal','kunal') ;

update transetup set ref_ser = 'D-RTE' where TRAN_WINDOW = 'w_distroute';


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 (	'CUST_CODE',	'W_DISTROUTE',	'select cust_code,cust_name from customer',
	NULL,	'Cust Code           ',	0,	0,	sysdate,	'kunal',	'Kunal',	'0',	NULL,	NULL,	NULL,	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 (	'STAN_CODE_FROM',	'W_DISTROUTE',	'select stan_code,descr from station',
	NULL,	'Stan Code From      ',	0,	0,	sysdate,	'kunal',	'Kunal',	'0',	NULL,	NULL,	NULL,	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 (	'STAN_CODE_TO',	'W_DISTROUTE',	'select stan_code,descr from station',
	NULL,	'Stan Code To        ',	0,	0,	sysdate,	'kunal',	'Kunal',	'0',	NULL,	NULL,	NULL,	NULL,	NULL,	NULL,	NULL,	NULL,	NULL,	NULL);

	
alter table  distroutedet
add pin__fr varchar2(10);

alter table  distroutedet
add pin__to varchar2(10);

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 (
	'VTFRVAL',
	'Data Error',
	'Atleast Enter One of the value in Station Code From,State Code From, Pin code From  ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'kunal',
	'kunal',
	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 (
	'VTTOVAL',
	'Data Error',
	'Atleast Enter One of the value in Station Code To,State Code To, Pin code To ',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	sysdate,
	'kunal',
	'kunal',
	NULL,
	NULL);
  
  