CREATE PROCEDURE [dbo].[OnlineHallRebuildReservation] @AReferenceNumber INT, @AGuestNumber INT
, @AOnlineBookTypeNumber INT,  @AHotelNumber INT = -1 AS 

/*
	Created by ??

    LJE 20110426: Added: RESERVATIONCONFERENCELINE.Children1, . Children2.
	TB20090316: Added LEFT OUTER JOIN
	TB20090316: Added LEFT OUTER JOIN
*/

SELECT RESERVATIONCONFERENCELINE.ReservationConfLineNumber
, CONFERENCEROOMS.Name
, CONFERENCEROOMS.Number AS HallNumber
, RESERVATIONCONFERENCELINE.NumberOfRooms
, RESERVATIONCONFERENCELINE.ArrivalDate
, RESERVATIONCONFERENCELINE.ArrivalTime
, RESERVATIONCONFERENCELINE.DepartureDate
, RESERVATIONCONFERENCELINE.DepartureTime
, RESERVATIONCONFERENCELINE.ProductNumber
, RESERVATIONCONFERENCELINE.Price
, RESERVATIONCONFERENCELINE.TotalPrice
, RESERVATIONCONFERENCELINE.Adults
, RESERVATIONCONFERENCELINE.Children1
, RESERVATIONCONFERENCELINE.Children2
, RESERVATIONCONFERENCELINE.ConferenceRoomNumber
, CONFERENCEROOMTYPES.Type
, CONFERENCEROOMTYPES.ConferenceRoomTypeNumber
FROM RESERVATIONCONFERENCELINE (NOLOCK) 
LEFT OUTER JOIN CONFERENCEROOMS (NOLOCK) ON RESERVATIONCONFERENCELINE.ConferenceRoomNumber = CONFERENCEROOMS.ConferenceRoomNumber 
LEFT OUTER JOIN CONFERENCEROOMTYPES (NOLOCK) ON CONFERENCEROOMS.ConferenceRoomTypeNumber = CONFERENCEROOMTYPES.ConferenceRoomTypeNumber 
WHERE RESERVATIONCONFERENCELINE.ReferenceNumber =@AReferenceNumber AND RESERVATIONCONFERENCELINE.GuestNo = @AGuestNumber
GO

