CREATE PROCEDURE [dbo].[GA_AllotmentReleaseSpecific] @AllotmentNumber INT, @SystemDate DATETIME AS
SET NOCOUNT ON
/*

   DEPRECATED!



    Created by Jacob Pedersen 20051010

    Last Changed:
    20060627 JP: OPTIMIZE: prefixed tables with .dbo
    20060504 JP: OPTIMIZE: no need to check for MarkAsDeleted

  NOTE:
	i+t-c=0
	t=c-i

  AvailBeforeRelease must not be updated since this routine is called in periods which is already released!
  */
  UPDATE dbo.AllotmentLines SET
    TotalChange = dbo.GetCurrentCount(AllotmentLines.AllotmentNumber,RoomTypeNumber,DateStamp) - InitialCount
  FROM dbo.Allotments, dbo.AllotmentLines
  WHERE Allotments.AllotmentNumber=AllotmentLines.AllotmentNumber AND AllotmentLines.AllotmentNumber=@AllotmentNumber AND CONVERT(DateTime,DateStamp, 112) BETWEEN @SystemDate AND @SystemDate + IsNull(ReleaseDays, 0) - 1


