declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
begin
  execute immediate 'CREATE TABLE GP_PRICING (	
			PRICING_ID NUMBER(7,0) NOT NULL ENABLE, 
			EMPRESA_ID NUMBER(7,0), 
			NOMBPRICING VARCHAR2(60 BYTE), 
			CANTBOLETO NUMBER(3,0), 
			DESCUENTOPORCENTAJE NUMBER(7,2), 
			DESCUENTOPORCREDONDO NUMBER(5,2), 
			INDTRANSFERIBLE NUMBER(1,0), 
			INDRESERVABLE NUMBER(1,0), 
			INDCANCELABLE NUMBER(1,0), 
			CANTDIASANTICIPACION NUMBER(2,0), 
			ACTIVO NUMBER(1,0), 
			FECMODIF DATE, 
			USUARIO_ID NUMBER(7,0), 
			INDGENERAFERIADOVIAJE VARCHAR2(3 BYTE), 
			INDGENERAFERIADOVENTA VARCHAR2(3 BYTE), 
			EXIBEVENDA NUMBER(1,0), 
			CONSTRAINT PK__GP_PRICING PRIMARY KEY (PRICING_ID),
			CONSTRAINT PK__GP_EMPRESA FOREIGN KEY(EMPRESA_ID) REFERENCES EMPRESA (EMPRESA_ID)
		)';
  exception when object_exists then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE SEQUENCE GP_PRICING_SEQ START WITH 1 INCREMENT BY 1';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE TABLE GP_PRICING_ASIENTO (	
				PRICINGASIENTO_ID NUMBER(7,0) NOT NULL ENABLE, 
				PRICING_ID NUMBER(7,0), 
				NUMEASIENTO VARCHAR2(9 BYTE), 
				PORCENTAJE NUMBER(5,2), 
				ACTIVO NUMBER(1,0), 
				FECMODIF DATE, 
				USUARIO_ID NUMBER(7,0), 
				NOMBIMAGEN VARCHAR2(60 BYTE), 
				CONSTRAINT PK_GP_PRICING_ASIENTO PRIMARY KEY (PRICINGASIENTO_ID),
				CONSTRAINT FK_GP_PRICING_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID)
		)';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE SEQUENCE GP_PRICING_ASIENTO_SEQ START WITH 1 INCREMENT BY 1';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE TABLE GP_PRICING_MERCADO (	
			PRICINGPARADA_ID NUMBER(10,0) NOT NULL ENABLE, 
			PRICING_ID NUMBER(7,0), 
			ORIGEN_ID NUMBER(7,0), 
			DESTINO_ID NUMBER(7,0), 
			ACTIVO NUMBER(1,0), 
			FECMODIF DATE, 
			USUARIO_ID NUMBER(7,0), 
			CONSTRAINT PK_GP_PRICING_MERCADO PRIMARY KEY (PRICINGPARADA_ID),
			CONSTRAINT FK_GP_MERC_DESTINO_ID FOREIGN KEY(DESTINO_ID) REFERENCES PARADA (PARADA_ID),
			CONSTRAINT FK_GP_MERC_ORIGEM_ID FOREIGN KEY(ORIGEN_ID) REFERENCES PARADA (PARADA_ID),
			CONSTRAINT FK_GP_MERC_PRICING_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID)	
		)';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE SEQUENCE GP_PRICING_MERCADO_SEQ START WITH 1 INCREMENT BY 1';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE TABLE GP_PRICING_MARCA (	
			PRICINGMARCA_ID NUMBER(7,0) NOT NULL ENABLE, 
			PRICING_ID NUMBER(7,0), 
			MARCA_ID NUMBER(3,0), 
			ACTIVO NUMBER(1,0), 
			FECMODIF DATE, 
			USUARIO_ID NUMBER(7,0), 
			CONSTRAINT PK_MARGA_PRICING PRIMARY KEY (PRICINGMARCA_ID),
			CONSTRAINT FK_GP_MARCA_PRICING_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID),	
			CONSTRAINT FK_GP_PRICING_MARCA_ID FOREIGN KEY(MARCA_ID) REFERENCES MARCA (MARCA_ID)
		)';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE SEQUENCE GP_PRICING_MARCA_SEQ START WITH 1 INCREMENT BY 1';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE TABLE GP_PRICING_RUTA (
			PRICINGRUTA_ID NUMBER(7,0) NOT NULL ENABLE, 
			PRICING_ID NUMBER(7,0), 
			RUTA_ID NUMBER(7,0), 
			ACTIVO NUMBER(1,0), 
			FECMODIF DATE, 
			USUARIO_ID NUMBER(7,0), 
			CONSTRAINT PK_GP_PRICING_RUTA PRIMARY KEY (PRICINGRUTA_ID),
			CONSTRAINT FK_GP_RUTA_PRICING_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID),
			CONSTRAINT FK_GP_RUTA_ID FOREIGN KEY(RUTA_ID) REFERENCES RUTA (RUTA_ID)
		)';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE SEQUENCE GP_PRICING_RUTA_SEQ START WITH 1 INCREMENT BY 1';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE TABLE GP_PRICING_DIA (
			PRICINGDIA_ID NUMBER(7,0) NOT NULL ENABLE, 
			PRICING_ID NUMBER(7,0), 
			INDLUNES NUMBER(1,0), 
			INDMARTES NUMBER(1,0), 
			INDMIERCOLES NUMBER(1,0), 
			INDJUEVES NUMBER(1,0), 
			INDVIERNES NUMBER(1,0), 
			INDSABADO NUMBER(1,0), 
			INDDOMINGO NUMBER(1,0), 
			HORARIOINICIO DATE, 
			HORARIOFIN DATE, 
			FECMODIF DATE, 
			ACTIVO NUMBER(1,0), 
			USUARIO_ID NUMBER(7,0), 
			INDFECVIAJE NUMBER(1,0), 
			INDFECVENTA NUMBER(1,0), 
			CONSTRAINT PK_GP_PRICING_DIA PRIMARY KEY (PRICINGDIA_ID),
			CONSTRAINT FK_GP_PRICING_DIA_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID)
		)';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE SEQUENCE GP_PRICING_DIA_SEQ START WITH 1 INCREMENT BY 1';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE TABLE GP_PRICING_IMPORTE (
			PRICINGIMPORTE_ID NUMBER(7,0) NOT NULL ENABLE, 
			PRICING_ID NUMBER(7,0), 
			MONEDA_ID NUMBER(7,0), 
			IMPORTE NUMBER(7,2), 
			ACTIVO NUMBER(1,0), 
			FECMODIF DATE, 
			USUARIO_ID NUMBER(7,0), 
			CONSTRAINT PK_GP_PRICING_IMPORTE PRIMARY KEY (PRICINGIMPORTE_ID),
			CONSTRAINT FK_GP_PRICING_IMP_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID),
			CONSTRAINT FK_GP_PRICING_MONEDA_ID FOREIGN KEY(MONEDA_ID) REFERENCES MONEDA (MONEDA_ID)
		)';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE SEQUENCE GP_PRICING_IMPORTE_SEQ START WITH 1 INCREMENT BY 1';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE TABLE GP_PRICING_TIPOPTOVTA (
			PRICINGTIPOPTOVTA_ID NUMBER(7,0) NOT NULL ENABLE, 
			PRICING_ID NUMBER(7,0), 
			TIPOPTOVTA_ID NUMBER(2,0), 
			ACTIVO NUMBER(1,0), 
			FECMODIF DATE, 
			USUARIO_ID NUMBER(7,0), 
			CONSTRAINT PK_GP_PRICING_TIPOPTVA PRIMARY KEY (PRICINGTIPOPTOVTA_ID),
			CONSTRAINT FK_GP_PRICING_TIPOPTVA_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID),
			CONSTRAINT FK_GP_TIPOPTVA_ID FOREIGN KEY(TIPOPTOVTA_ID) REFERENCES TIPO_PTOVTA (TIPOPTOVTA_ID)
		)';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE SEQUENCE GP_PRICING_TIPOPTOVTA_SEQ START WITH 1 INCREMENT BY 1';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE TABLE GP_PRICING_CATEGORIA (
			PRICINGCATEGORIA_ID NUMBER(7,0) NOT NULL ENABLE, 
			PRICING_ID NUMBER(7,0), 
			CATEGORIA_ID NUMBER(7,0), 
			ACTIVO NUMBER(1,0), 
			FECMODIF DATE, 
			USUARIO_ID NUMBER(7,0), 
			CONSTRAINT PK_GP_PRICING_CATEGORIA PRIMARY KEY (PRICINGCATEGORIA_ID),
			CONSTRAINT FK_GP_PRICING_CAT_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID),
			CONSTRAINT FK_GP_CATEGORIA_ID FOREIGN KEY(CATEGORIA_ID) REFERENCES CATEGORIA (CATEGORIA_ID)
		)';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE SEQUENCE GP_PRICING_CATEGORIA_SEQ START WITH 1 INCREMENT BY 1';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE TABLE GP_PRICING_VIGENCIA (
			PRICINGVIGENCIA_ID NUMBER(10,0) NOT NULL ENABLE, 
			PRICING_ID NUMBER(7,0), 
			FECINICIOVIAJE DATE, 
			FECFINVIAJE DATE, 
			FECINICIOVENTA DATE, 
			FECFINVENTA DATE, 
			ACTIVO NUMBER(1,0), 
			FECMODIF DATE, 
			USUARIO_ID NUMBER(7,0), 
			CONSTRAINT PK_GP_PRICING_VIGENCIA PRIMARY KEY (PRICINGVIGENCIA_ID),
			CONSTRAINT FK_GP_PRICING_VIG_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID)
		)';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE SEQUENCE GP_PRICING_VIGENCIA_SEQ START WITH 1 INCREMENT BY 1';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE TABLE GP_PRICING_CLASE (
			PRICINGCLASE_ID NUMBER(7,0) NOT NULL ENABLE, 
			PRICING_ID NUMBER(7,0), 
			CLASESERVICIO_ID NUMBER(2,0), 
			ACTIVO NUMBER(1,0), 
			FECMODIF DATE, 
			USUARIO_ID NUMBER(7,0), 
			CONSTRAINT PK_GP_PRICING_CLASSE PRIMARY KEY (PRICINGCLASE_ID),
			CONSTRAINT FK_GP_PRICING_CLASE_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID),
			CONSTRAINT FK_GP_CLASE_SERVICIO_ID FOREIGN KEY(CLASESERVICIO_ID) REFERENCES CLASE_SERVICIO (CLASESERVICIO_ID)
		)';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE SEQUENCE GP_PRICING_CLASE_SEQ START WITH 1 INCREMENT BY 1';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE TABLE GP_PRICING_CORRIDA (
				PRICINGCORRIDA_ID NUMBER(7,0) NOT NULL ENABLE, 
				PRICING_ID NUMBER(7,0), 
				CORRIDA_ID NUMBER(7,0), 
				ACTIVO NUMBER(1,0), 
				FECMODIF DATE, 
				USUARIO_ID NUMBER(7,0), 
				CONSTRAINT PK_GP_PRICING_CORRIDA_ID PRIMARY KEY (PRICINGCORRIDA_ID),
				CONSTRAINT FK_GP_PRICING_CORRIDA_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID),
				CONSTRAINT FK_GP_PRICING_CORRIDA_CTRL_ID FOREIGN KEY(CORRIDA_ID) REFERENCES CORRIDA_CTRL (CORRIDA_ID)
			)';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE SEQUENCE GP_PRICING_CORRIDA_SEQ START WITH 1 INCREMENT BY 1';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE TABLE GP_PRICING_PUNTOVENTA (
			PRICINGPTOVTA_ID NUMBER(7,0) NOT NULL ENABLE, 
			PRICING_ID NUMBER(7,0), 
			PUNTOVENTA_ID NUMBER(7,0), 
			ACTIVO NUMBER(1,0), 
			FECMODIF DATE, 
			USUARIO_ID NUMBER(7,0), 
			CONSTRAINT PK_GP_PRICING_PTVTA PRIMARY KEY (PRICINGPTOVTA_ID),
			CONSTRAINT FK_GP_PRICING_PTVTA_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID),
			CONSTRAINT FK_GP_PRICING_PTVTA FOREIGN KEY(PUNTOVENTA_ID) REFERENCES PUNTO_VENTA (PUNTOVENTA_ID)
		)';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE SEQUENCE GP_PRICING_PUNTOVENTA_SEQ START WITH 1 INCREMENT BY 1';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE TABLE GP_PRICING_TIPOSERVICIO (
			PRICINGTIPOSERVICIO_ID NUMBER(7,0) NOT NULL ENABLE, 
			PRICING_ID NUMBER(7,0) NOT NULL ENABLE, 
			TIPOSERVICIO_ID NUMBER(2,0) NOT NULL ENABLE, 
			ACTIVO NUMBER(1,0) NOT NULL ENABLE, 
			FECMODIF DATE NOT NULL ENABLE, 
			USUARIO_ID NUMBER(7,0) NOT NULL ENABLE, 
			CONSTRAINT PK_GP_PRICING_TPOSERVICIO PRIMARY KEY (PRICINGTIPOSERVICIO_ID),
			CONSTRAINT FK_GP_PRICING_TPOSERVICIO FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID),
			CONSTRAINT FK_GP_PRICING_TIPO_SERVICIO FOREIGN KEY(TIPOSERVICIO_ID) REFERENCES TIPO_SERVICIO (TIPOSERVICIO_ID)
		)';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE SEQUENCE GP_PRICING_TIPOSERVICIO_SEQ START WITH 1 INCREMENT BY 1';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate '  CREATE TABLE GP_PRICING_CLASSE_TARIFARIA (
			PRICINGCLASSETARIFARIA_ID NUMBER(7,0) NOT NULL ENABLE, 
			DESCCLASSE_TARIFARIA VARCHAR2(20 BYTE), 
			SIGLA VARCHAR2(1 BYTE), 
			ACTIVO NUMBER(1,0), 
			FECMODIF DATE, 
			USUARIO_ID NUMBER(7,0), 
			CONSTRAINT PK_GP_PRICING_CLASSE_TAR PRIMARY KEY (PRICINGCLASSETARIFARIA_ID)
		)';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE SEQUENCE GP_PRICING_CLAS_TAR_SEQ START WITH 1 INCREMENT BY 1';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE TABLE GP_PRICING_OCUPA_ANTECIPA (
			PRICINGOCUPAANTECIPA_ID NUMBER(7,0) NOT NULL ENABLE, 
			PRICING_ID NUMBER(7,0), 
			CANTASIENTOSMIN NUMBER(2,0), 
			CANTASIENTOSMAX NUMBER(2,0), 
			CANTDIASMIN NUMBER(3,0), 
			CANTDIASMAX NUMBER(3,0), 
			PORCENTAJE NUMBER(5,2), 
			IMPORTE NUMBER(5,2), 
			ACTIVO NUMBER(1,0), 
			FECMODIF DATE, 
			USUARIO_ID NUMBER(7,0), 
			OCUPACIONINICIAL NUMBER(5,2), 
			OCUPACIONFINAL NUMBER(5,2), 
			PRICINGCLASSETARIFARIA_ID NUMBER(7,0), 
			CONSTRAINT PK_GP_PRICING_OCUPA_ANTECIPA PRIMARY KEY (PRICINGOCUPAANTECIPA_ID),
			CONSTRAINT FK_GP_PRICING_OCUPA_ANTECIPA FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID),
			CONSTRAINT FK_GP_PRICING_CLAS_TAR FOREIGN KEY(PRICINGCLASSETARIFARIA_ID) REFERENCES GP_PRICING_CLASSE_TARIFARIA (PRICINGCLASSETARIFARIA_ID)
		)';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE SEQUENCE GP_PRICING_OCUPA_ANTECIPA_SEQ START WITH 1 INCREMENT BY 1';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE TABLE GP_PRICING_FORMAPAGO (
			PRICINGFORMAPAGO_ID NUMBER(7,0) NOT NULL ENABLE, 
			PRICING_ID NUMBER(7,0), 
			FORMAPAGO_ID NUMBER(2,0), 
			INDEXCEPCION NUMBER(1,0), 
			ACTIVO NUMBER(1,0), 
			FECMODIF DATE, 
			USUARIO_ID NUMBER(7,0), 
			CONSTRAINT PK_GP_PRICING_FORMAPAGO PRIMARY KEY (PRICINGFORMAPAGO_ID),
			CONSTRAINT FK_GP_PRICING_FORMAPAGO FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID),
			CONSTRAINT FK_GP_PRICING_FORMA_PAGO FOREIGN KEY(FORMAPAGO_ID) REFERENCES FORMA_PAGO (FORMAPAGO_ID)
		)';
	exception when others  then null;
end;
/
declare
  object_exists exception;
  pragma exception_init (object_exists , -00955);
    begin
    execute immediate 'CREATE SEQUENCE GP_PRICING_FORMAPAGO_SEQ START WITH 1 INCREMENT BY 1';
	exception when others  then null;
end;