CREATE PROCEDURE dbo.OnlineFindConfirmTemplate  AS
SET NOCOUNT ON
/*
    Created by Troels Buch Sep 2005
    
    Changes:

    NOTES: 	- 
*/


--DECLARE @Templatename VARCHAR(75)
DECLARE @Templatenumber INT
--SET @Templatenumber = 308

SELECT @Templatenumber = keyvalue FROM Hotelsetup WITH (NOLOCK) WHERE searchkey = 'OnlineConfirmmailTemplate'


SELECT [Name] FROM Templates WITH (NOLOCK) WHERE TemplateNumber = @Templatenumber


/*
set @Text = 'Created'
INSERT INTO FollowUp ([Date], Type, Priority, State, Note, CreatedDate, CreatedBy, SubType)
VALUES (@SystemDateTime, 5, 12, 3, @Text, @SystemDateTime, @UserIDNumber, 1)
SELECT @NewFollowUpNumber = @@identity
INSERT INTO ReservationFollowUpXTab (ReferenceNumber, GuestNumber, FollowUpNumber) VALUES (@ReferenceNumber, 0, @NewFollowUpNumber)
*/
/*
DECLARE @AttchmentID INT
DECLARE @MailTemplateNumber INT

SELECT @MailTemplateNumber =  Keyvalue FROM Hotelsetup (NOLOCK) WHERE  searchkey= 'OnlineConfirmmailTemplate'

IF @MailTemplateNumber <> 0
BEGIN
   INSERT INTO Attachment ([Name], [FileGroup], DateStamp, ReadOnly, Batch, AddressTypeNumber, TemplateNumber) VALUES (@Templatename, 1, @DateNow, 0, 1, @GuestType, @MailTemplateNumber)
   SET @AttchmentID = @@identity
   INSERT INTO ReservationAttachmentXTab (ReferenceNumber, GuestNumber, AttachmentNumber) VALUES (@Referancenumber, 0, @@identity)
END
*/


