UFN_CREDITMEMO_GETSTATUS

Gets the status of the credit memo.

Return

Return Type
nvarchar(50)

Parameters

Parameter Parameter Type Mode Description
@BALANCE money IN
@AMOUNT money IN

Definition

Copy


create function dbo.UFN_CREDITMEMO_GETSTATUS(
    @BALANCE as money,
    @AMOUNT as money
    )
returns nvarchar(50)
with execute as caller
as begin
    -- do work here and return a value

    declare @STATUS nvarchar(50)

    select @STATUS = case
        when @BALANCE = 0 then 'Paid'
        when @AMOUNT>@BALANCE then 'Partially paid'
        else 'Unpaid' end

    return @STATUS
end