public class LineItemDiscount extends AbstractDiscount
LineItem. The discount holds a amount (can be Money or
Percentage) which can only be set during creation (see AbstractDiscount.getAmount()).
Further it either applies per unit or per line (see isPerUnit()). In case it applies per unit it may be
limited to just a certain amount of units ( see getApplicableUnits() ).| Constructor and Description |
|---|
LineItemDiscount(AbstractAmount amount)
Creates a new line item discount with the given amount.
|
LineItemDiscount(AbstractAmount amount,
boolean perUnit)
Creates a new line item discount with given amount.
|
LineItemDiscount(AbstractAmount amount,
boolean perUnit,
int applicableUnits)
Creates a new line item discount with given amount.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getApplicableUnits()
In case this discount applied per unit this returns the maximum number of units that it should apply to.
|
boolean |
isPerUnit()
Tell whether this discount should be applied for each unit or just once for the whole line.
|
void |
setApplicableUnits(int numberOfUnits)
For the case this discount applies per unit this method changes the maximum number of units to apply to.
|
java.lang.String |
toString() |
getAmountpublic LineItemDiscount(AbstractAmount amount)
public LineItemDiscount(AbstractAmount amount, boolean perUnit)
amount - the discount amountperUnit - if true it applies per unit, otherwise per linepublic LineItemDiscount(AbstractAmount amount, boolean perUnit, int applicableUnits)
amount - the discount amountperUnit - if true it applies per unit, otherwise per lineapplicableUnits - when applying per unit this contains the maximum applicable number of unitspublic boolean isPerUnit()
getApplicableUnits().public int getApplicableUnits()
isPerUnit()public void setApplicableUnits(int numberOfUnits)
isPerUnit(),
getApplicableUnits()public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2018 SAP SE. All Rights Reserved.