UFN_ORDER_GETMANUALDISCOUNTS

List the manual/promo code discounts on an order

Return

Return Type
table

Parameters

Parameter Parameter Type Mode Description
@SALESORDERID uniqueidentifier IN

Definition

Copy


create function dbo.UFN_ORDER_GETMANUALDISCOUNTS(@SALESORDERID uniqueidentifier)
returns table
as return 
    select
        SOMD.ID,
        DISCOUNT.NAME,
        dbo.UFN_DISCOUNT_GENERATEVALUEDESCRIPTION(DISCOUNT.ID) as DESCRIPTION,
        SOMD.PROMOTIONALCODE
    from
        dbo.SALESORDERMANUALDISCOUNT SOMD
        inner join dbo.DISCOUNT on SOMD.DISCOUNTID = DISCOUNT.ID
    where
        SALESORDERID = @SALESORDERID