public interface IItemPerc
extends org.sistema.persist.IPersistent
Modifier and Type | Method and Description |
---|---|
java.math.BigDecimal |
getAmount()
Calculates the amount based on the fixed and base amount attributes..
|
java.math.BigDecimal |
getAmount(java.math.BigDecimal baseAmount,
java.math.BigDecimal runningSum)
Calculates the amount given a base amount and running sum.
|
java.lang.Integer |
getId() |
java.lang.Byte |
getOrder() |
IItem |
getParent()
Retrieves the item to which value this percentage affects.
|
IPercType |
getPercentageType()
Retrieves the type of percentage being represented.
|
java.math.BigDecimal |
getRate()
When
isFixed is true,
the fixed value, the rate otherwise. |
java.math.BigDecimal |
getRunningSum()
Calculates the running sum before the given
ItemPercentage instance. |
boolean |
isAddToItemAmount() |
boolean |
isFixed()
Indicates if the "value" is a fixed number,
or a rate to perform a calculation.
|
void |
setAddToItemAmount(java.lang.Boolean a)
Specifies whether the result of the calculation (item amount * percentage value)
should be added to the amount of the item or not.
|
void |
setFixed(java.lang.Boolean f)
Sets the value of this percentage as a fixed one.
|
void |
setId(java.lang.Integer id)
Sets the unique identifier.
|
void |
setOperateOnBaseAmount(java.lang.Boolean o)
Specifies how the operation is calculated.
|
void |
setOrder(java.lang.Byte o)
Sets the order of a percentage as part of an item.
|
void |
setParent(IItem i)
Sets the item to which value this percentage affects.
|
void |
setPercentageType(IPercType t)
Sets the type of percentage.
|
void |
setValue(java.math.BigDecimal v)
Sets a number representing a fixed number
or a rate to perform a calculation.
|
java.math.BigDecimal getAmount()
java.math.BigDecimal getAmount(java.math.BigDecimal baseAmount, java.math.BigDecimal runningSum)
baseAmount
- runningSum
- java.lang.Integer getId()
getId
in interface org.sistema.persist.IPersistent
java.lang.Byte getOrder()
IItem getParent()
IPercType getPercentageType()
PercentageType
child or null
if none has been set.java.math.BigDecimal getRate()
isFixed
is true,
the fixed value, the rate otherwise.java.math.BigDecimal getRunningSum()
ItemPercentage
instance.boolean isAddToItemAmount()
boolean isFixed()
void setAddToItemAmount(java.lang.Boolean a)
a
- true
adds the result of the calculation
to the amount of the item ,
false
will not add it.void setFixed(java.lang.Boolean f)
The value of a fixed percentage is based on its amount and rate.
f
- void setId(java.lang.Integer id)
id
- void setOperateOnBaseAmount(java.lang.Boolean o)
o
- true
takes the item base amount,
false
takes the running sum.void setOrder(java.lang.Byte o)
o
- void setParent(IItem i)
i
- void setPercentageType(IPercType t)
t
- void setValue(java.math.BigDecimal v)
v
-