AmountOffFromDiscountLine Method
Returns the unrounded amount of money subtracted by the discount line.
Assumes the discount line only has one of Amount or Percent which are non-zero.
Namespace: Microsoft.Dynamics.Commerce.Runtime
Assembly: Microsoft.Dynamics.Commerce.Runtime (in Microsoft.Dynamics.Commerce.Runtime.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Function AmountOffFromDiscountLine ( _
salesLine As SalesLine, _
discountLine As DiscountLine _
) As Decimal
'Usage
Dim salesLine As SalesLine
Dim discountLine As DiscountLine
Dim returnValue As Decimal
returnValue = salesLine.AmountOffFromDiscountLine(discountLine)
public static decimal AmountOffFromDiscountLine(
this SalesLine salesLine,
DiscountLine discountLine
)
[ExtensionAttribute]
public:
static Decimal AmountOffFromDiscountLine(
SalesLine^ salesLine,
DiscountLine^ discountLine
)
Parameters
- salesLine
Type: Microsoft.Dynamics.Commerce.Runtime.DataModel.SalesLine
- discountLine
Type: Microsoft.Dynamics.Commerce.Runtime.DataModel.DiscountLine
Return Value
Type: System.Decimal
Unrounded amount off due to discount line.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type SalesLine. When you use instance method syntax to call this method, omit the first parameter. For more information, see b8020aae-374d-46a9-bcb7-8cc2390b93b6 or 175ce3ff-9bbf-4e64-8421-faeb81a0bb51.
Remarks
This does not work perfectly with compounded retail periodic percent discounts. They will differ depending on the order of application as each successive percent applied has less to subtract from.