
 
------------------------------------------------------------------------------
/* CREATE TABLE bol*/
------------------------------------------------------------------------------
CREATE TABLE bol
(
	TRAN_ID									 CHAR(10) NOT NULL,
	SITE_CODE		             			 CHAR(5) NOT NULL,
	ADD1		                    			 VARCHAR2(40) not null,
	ADD2		                     			 VARCHAR2(40) not null,
	CITY		                       			     VARCHAR2(20) not null,
	STATE_CODE	            			 CHAR(5) not null,
	PIN					             			 VARCHAR2(15) not null,
	CUST_CODE__DLV			 			 CHAR(10),
	DLV_ADD1					 	  			 VARCHAR2(40) ,
	DLV_ADD2					     			 VARCHAR2(40) ,
	DLV_CITY 					     			 VARCHAR2(40) ,
	STATE_CODE__DLV					 CHAR(5) ,
	DLV_PIN									 CHAR(20),
	SORD_NO									 CHAR(10),
	DESP_ID					  				 CHAR(10),
	CUSTOMER_CODE						 CHAR(10),
	REMARKS		          					 VARCHAR2(100) , 
	BOL_NO		          					 CHAR(35),
	TRAN_CODE		            			 CHAR(10),
	SCAC		                 				 CHAR(4),
	PRO_NO		          					 CHAR(35),
	FRT_TERM		          				 CHAR(1),
	CUSTOMER_ORDER__NO		     VARCHAR2(20) , 
	SHIP_FLAG		                         CHAR(1),
	HAZARD_YN		          			     CHAR(1), 
	NMFC_DESCR		         		     VARCHAR2(40) , 
	NMFC_CODE		       				     CHAR(10), 
	FREIGHT_CLASS		         	     CHAR(1), 
	SHIP_DATE		          				 DATE,
	CHG_USER   								 CHAR(10) ,
	CHG_TERM  								 VARCHAR2(15) ,
	CHG_DATE   								 DATE )TABLESPACE ITM_MFG_D1;

------------------------------------------------------------------------------
/* SET PRIMARY KEY FOR bol */
------------------------------------------------------------------------------

 ALTER TABLE bol ADD CONSTRAINT bol_X PRIMARY KEY (tran_id) USING INDEX TABLESPACE 
 ITM_MFG_I1;

/* Altering ITEM table to ADD New Columns namely NMFC_CODE & NMFC_DESCR */
ALTER TABLE ITEM
ADD NMFC_CODE  CHAR(10);

ALTER TABLE ITEM
ADD NMFC_DESCR   VARCHAR2(40);

--------------------------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_USER,
	CHG_TERM,
	CHG_DATE)
VALUES (
	'SFA',
	1,
	20,
	0,
	0,
	0,
	'w_bol',
	'Bill of Lading',
	'Bill of Lading',
	'SFA.1.20.0.0.0',
	'e12_logo.gif',
	NULL,
	NULL,
	NULL,
	'BASE',
	'BASE',
	TO_DATE('2-01-2011 00:00:00','DD-MM-YYYY HH24:MI:SS')	);
	
	

--------------------------Object 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,
	SCAN_FLAG,
	SCAN_METADATA,
	AUTO_ACCEPT_SCAN,
	PROPERTY_INFO,
	SCAN_DELIMITER,
	AUTO_ACCEPT_WEIGHDATA,
	COLUMN_ON_SAVE,
	AFTER_SAVE,
	EXT_COM,
	EXT_METADATA,
	EXT_SETUP
) 
 VALUES (
	'w_bol',
	'Detail',
	'd_bol11',
	'd_bol21',
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

----------------------------Object Actions------------------------------------------------------------------------------------------------------
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 (
	'bol',
	1,
	'A',
	'a',
	'a',
	'Adding New',
	'Add',
	'add.gif',
	'1',
	NULL,
	NULL,
	'S',
	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 (
	'bol',
	2,
	'E',
	'a',
	'a',
	'Editing Existing Record',
	'Edit',
	'edit.gif',
	'1',
	NULL,
	NULL,
	'S',
	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 (
	'bol',
	5,
	'F',
	'a',
	'pre_confirm',
	'Confirmation',
	'Confirm',
	'confirm.gif',
	'1',
	'2',
	NULL,
	'U',
	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 (
	'bol',
	21,
	'X',
	'1',
	'audit_trail',
	'View Audit Trail',
	'View Audit',
	'menu.bmp',
	'1',
	'1',
	'1',
	'U',
	NULL);

------------------------------Transetup------------------------------------------------------------------------------------------------
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,
 MAIL_OPTION,SALES_PERS_ACC_COL,CUST_ACC_COL,SUPP_ACC_COL,ITEM_SER_ACC_COL,REF_SER) 
VALUES 
('w_bol','2','2','A','seq07','Y',sysdate,'BASE','BASE',
 '0','SITE_CODE','confirmed','Y','N','N','TRAN_ID',
 '0','BOL','FIN', 'BOL Calculation', null, 'F');	

 --------------------------System_events---------------------------------------------------------------------------

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 (
	'bol',
	'post_item_change',
	'1',
	'poic_default_ejb1',
	NULL,
	TO_DATE('21-01-2011 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BRIJESH   ',
	'BRIJESH',
	'2',
	'0',
	'EJB',
	'BolVal',
	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 (
	'bol',
	'pre_validate',
	'1',
	'prv_default_ejb1',
	NULL,
	TO_DATE('21-01-2011 00:00:00','DD-MM-YYYY HH24:MI:SS'),
	'BRIJESH   ',
	'BRIJESH',
	'2',
	'0',
	'EJB',
	'BolVal',
	NULL);
	

-------------------------------------------------------------------------------------------------------

/* for itemchange */

-------------------------------------------------------------------------------------------------------
insert into obj_itemchange(
	OBJ_NAME,       
	FORM_NO,        
	FIELD_NAME
)
 VALUES (
	'bol',
	'1',
	'site_code'
);
 
insert into obj_itemchange(
	OBJ_NAME,       
	FORM_NO,        
	FIELD_NAME
)
 VALUES (
	'bol',
	'1',
	'nmfc_code'
);

insert into obj_itemchange(
	OBJ_NAME,       
	FORM_NO,        
	FIELD_NAME
)
VALUES (
	'bol',
	'1',
	'itm_default');

insert into obj_itemchange(
	OBJ_NAME,       
	FORM_NO,        
	FIELD_NAME
)
 VALUES (
	'bol',
	'1',
	'itm_defaultedit');
	

	
insert into obj_itemchange(
	OBJ_NAME,       
	FORM_NO,        
	FIELD_NAME
)
 VALUES (
	'bol',
	'1',
	'tran_code');

insert into obj_itemchange(
	OBJ_NAME,       
	FORM_NO,        
	FIELD_NAME
)
 VALUES (
	'bol',
	'1',
	'cust_code__dlv');

insert into obj_itemchange(
	OBJ_NAME,       
	FORM_NO,        
	FIELD_NAME
)
 VALUES (
	'bol',
	'1',
	'customer_code');



/*validation 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 (
	'VMCCDLV',
	'Invalid Cust  Code DLV',
	'Please Enter Valid Cust Code DLV',
	'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 (
	'VMSORDN',
	'Invalid Sorder No',
	'Please Enter Valid Sales Order 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 (
	'VMDSPID',
	'Invalid Despatch ID',
	'Please Enter Valid Despatch ID',
	'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 (
	'VMCCDL1',
	'Invalid Cust  Code DLV',
	'Please Enter Valid Cust Code DLV',
	'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 (
	'VTSCACC',
	'Invalid Scac  Code ',
	'Please Enter Valid Scac 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 (
	'VTCUSTO',
	'Invalid Customer Order No. ',
	'Please Enter Valid Customer Order 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 (
	'VMWAVID',
	'Invalid Wave ID ',
	'Please Enter Valid Wave ID.',
	'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 (
	'VTNMFCC',
	'Invalid nmfc Code  ',
	'Please Enter Valid  nmfc 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 (
	'VMFRTCL',
	'Invalid freight code  ',
	'Please Enter Valid freight code',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	NULL,
	'BASE      ',
	'BASE      ',
	NULL,
	NULL);
	








------------------------------------------------------------------------------
