CREATE PROCEDURE [dbo].[MCC_GetMinibarFolioNumber]  @HotelNumber INT, @FolioNumber INT OUT

 AS
/*Created 20181001 By Carsten Cremer.
	Purpose : Get a new folionumber to be used for minibar postings.
	          

*/
     DECLARE @HotCustNo INT =  (SELECT CustomerNumber FROM dbo.Customer WITH (NOLOCK) WHERE (  (dbo.Customer.CustomerTypeNumber = 7) AND ( dbo.Customer.HotelNumber = @HotelNumber ) AND ISNULL( dbo.Customer.MARKASDELETED, 0) = 0 ))
     INSERT INTO dbo.Folios (OpenFolio,HotelCustomerNumber,GuestNumber,BillTypeNumber) 
--     VALUES ( 1 ,@HotCustNo ,0 ,14 )
     VALUES ( 1 ,@HotCustNo ,0 ,0 )
     SET @FolioNumber =  @@IDENTITY


