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

/*
  Changes:
    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, @FirstFolioNumber, @IgnoreStatus
else
  exec ChargeAndCalcCancellationFee @referencenumber, @GuestNumber, @totalprice output, @fee output, 1, -1, -1, 0, @FirstAddressNumber, @FirstFolioNumber, @IgnoreStatus

select @fee as fee

