



CREATE PROCEDURE DBO.ReleaseAllotment @SystemDateStr CHAR (8) = '' AS
SET NOCOUNT ON
/*
    Created by Jacob Pedersen

    JP20041118 Changed to call new release routine to just have one
    Last Updated: Anders Vindal 23-06-2003 save available rooms before release
    Last Updated: Jacob Pedersen 16-12-2003 Fix for ReleaseDays = NULL at some hotels
    Last Updated: Jacob Pedersen 01-05-2003 Why should it not fix minus allotment on all days? Moved this fix to generateavail because the error occurs during the day!

*/

DECLARE @NightAuditsRunning INT

IF @SystemDateStr = ''
  SELECT  @SystemDateStr = SYSTEMDATE FROM System  WITH (NOLOCK) WHERE NUMBER = 1
SELECT @NightAuditsRunning = COUNT (*) FROM Terminals WITH (NOLOCK) WHERE NightAuditRunning=1

EXEC GA_AllotmentRelease @SystemDateStr, @NightAuditsRunning

