
/****** Object:  StoredProcedure [dbo].[DSS_Rec_Pronos_Rese]    Script Date: 04/03/2013 11:30:22 ******/

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO

DROP PROCEDURE dbo.DSS_Rec_Pronos_Rese
GO

CREATE PROCEDURE dbo.DSS_Rec_Pronos_Rese
	   @Dia_Inicial DATETIME, 
	   @Dia_Salida DATETIME, 
	   @Dia_Reserv DATETIME, 
	   @TipoMoneda CHAR(3),
	   @id_oper INT
AS
BEGIN
	SET NOCOUNT ON
	DECLARE @Moneda INT
	DECLARE @Tasa_ext NUMERIC(13, 8) = 1


	DELETE dbo.HOTEDAIPG
	DELETE dbo.DEBGDAIPG
	
	SELECT @Moneda = id_mone
	FROM   SICLAMON 
	--WHERE cod_mone = @TipoMoneda  
	WHERE tasa = 1
	
	EXECUTE Pron_IngH_Reserva @Dia_Inicial, @Dia_Salida, @Dia_Reserv, @Moneda, @tasa_ext, @id_oper
	EXECUTE Pron_IngHE_Reserva @Dia_Inicial, @Dia_Salida, @Dia_Reserv, @Moneda, @tasa_ext, @id_oper
	EXECUTE Pron_IngR_Reserva @Dia_Inicial, @Dia_Salida, @Dia_Reserv, @Moneda, @tasa_ext, @id_oper
	EXECUTE Pron_IngO_Reserva @Dia_Inicial, @Dia_Salida, @Dia_Reserv, @Moneda, @tasa_ext, @id_oper
	EXECUTE Pron_IngAG_Reserva @Dia_Inicial, @Dia_Salida, @Dia_Reserv, @Moneda, @tasa_ext, @id_oper

	SELECT * FROM HOTEDAIPG

END 