DECLARE @HotelSetupNumber INT

select @HotelSetupNumber = HotelSetupNumber from HotelSetup (nolock)
	where SearchKey = 'RoomUsedInNightAudit' AND KeyValue = '1'

SET @HotelSetupNumber = ISNULL(@HotelSetupNumber, 0)

IF @HotelSetupNumber > 0
BEGIN
	INSERT INTO HotelSetup (SearchKey, LabelName, KeyValue, TextValue)
	VALUES ('CleanStatusNightAuditRoomDeparture', 'Room departure', '1', 'Yes')

	INSERT INTO HotelSetup (SearchKey, LabelName, KeyValue, TextValue)
	VALUES ('CleanStatusNightAuditOOORoomDeparture', 'Room departure', '1', 'Yes')

	INSERT INTO HotelSetup (SearchKey, LabelName, KeyValue, TextValue)
	VALUES ('CleanStatusNightAuditHallDeparture', 'Hall departure', '1', 'Yes')

	INSERT INTO HotelSetup (SearchKey, LabelName, KeyValue, TextValue)
	VALUES ('CleanStatusNightAuditPickup', 'Based on ware', '1', 'Yes')

	INSERT INTO HotelSetup (SearchKey, LabelName, KeyValue, TextValue)
	VALUES ('CleanStatusNightAuditCalcInhouse', 'Based on ware', '1', 'Yes')

	INSERT INTO HotelSetup (SearchKey, LabelName, KeyValue, TextValue)
	VALUES ('CleanStatusNightAuditWare', 'Based on ware', '1', 'Yes')

	DELETE FROM HotelSetupLog 
	WHERE HotelSetupNumber = @HotelSetupNumber

	DELETE FROM HotelSetup 
	WHERE HotelSetupNumber = @HotelSetupNumber
END

