CREATE procedure DBO.GetCancellationFeeFromReservation (@ReferenceNumber int, @guestnumber int, @FirstAddressNumber INT = 0, @IgnoreStatus INT = 1) as
SET NOCOUNT ON

/*
  Changes:
--nb20140721 FolioIdentity discontinued
    KJ 20070411: Department rewrite
    Last change: 12/03-2003 Jacob Pedersen
*/

declare @totalprice money
declare @fee money

if @GuestNumber = 0
  exec ChargeAndCalcCancellationFee @referencenumber, @GuestNumber, @totalprice output, @fee output, 1, -1, -1, 1, @FirstAddressNumber, @IgnoreStatus
else
  exec ChargeAndCalcCancellationFee @referencenumber, @GuestNumber, @totalprice output, @fee output, 1, -1, -1, 0, @FirstAddressNumber, @IgnoreStatus

select @fee as fee

