public class ItemPerc extends org.sistema.persist.Persistent implements IItemPerc
Item
Constructor and Description |
---|
ItemPerc() |
Modifier and Type | Method and Description |
---|---|
java.math.BigDecimal |
getAmount()
Calculates the amount.
|
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()
Implementation using a recursive algorithm
|
boolean |
isAddToItemAmount() |
boolean |
isFixed()
Indicates whether the "value" field contains a fixed number,
or a rate to perform a calculation.
|
boolean |
isOperateOnBaseAmount() |
void |
setAddToItemAmount(java.lang.Boolean value)
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 fixed)
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 value)
Specifies how the operation is calculated.
|
void |
setOrder(java.lang.Byte order)
Sets the order of a percentage as part of an item.
|
void |
setParent(IItem parent)
Sets the item to which value this percentage affects.
|
void |
setPercentageType(IPercType child)
Sets the type of percentage.
|
void |
setValue(java.math.BigDecimal value)
Sets a number representing a fixed number
or a rate to perform a calculation.
|
addAttribute, addAttribute, equals, getAttribute, getAttributeMaximumLength, getAttributeMinimumLength, getAttributeValue, getField, getFieldFlagValue, getFieldNames, getFields, getFieldsUnsavedElements, getFieldValue, getPrimaryKey, getValue, hasUnsavedElements, isAttributeEditable, isAttributeRequired, isAttributeVisible, isAttributeVisible, isDeletable, isDeleted, isEditable, isFieldModified, isFieldState, isModified, isModifiedBase, isNew, setAttributeValue, setDeletable, setDeleted, setFieldFlag, setFieldState, setFieldValue, setNew
public java.math.BigDecimal getAmount()
public java.math.BigDecimal getAmount(java.math.BigDecimal baseAmount, java.math.BigDecimal runningSum)
IItemPerc
public IPercType getPercentageType()
IItemPerc
getPercentageType
in interface IItemPerc
PercentageType
child or null
if none has been set.public java.lang.Integer getId()
public java.lang.Byte getOrder()
public IItem getParent()
IItemPerc
public java.math.BigDecimal getRate()
IItemPerc
isFixed
is true,
the fixed value, the rate otherwise.public java.math.BigDecimal getRunningSum()
Implementation using a recursive algorithm
getRunningSum
in interface IItemPerc
public boolean isAddToItemAmount()
isAddToItemAmount
in interface IItemPerc
public boolean isFixed()
public boolean isOperateOnBaseAmount()
public void setAddToItemAmount(java.lang.Boolean value)
IItemPerc
setAddToItemAmount
in interface IItemPerc
value
- true
adds the result of the calculation
to the amount of the item ,
false
will not add it.public void setPercentageType(IPercType child)
IItemPerc
setPercentageType
in interface IItemPerc
public void setFixed(java.lang.Boolean fixed)
IItemPerc
The value of a fixed percentage is based on its amount and rate.
public void setId(java.lang.Integer id)
IItemPerc
public void setOperateOnBaseAmount(java.lang.Boolean value)
IItemPerc
setOperateOnBaseAmount
in interface IItemPerc
value
- true
takes the item base amount,
false
takes the running sum.public void setOrder(java.lang.Byte order)
IItemPerc
public void setParent(IItem parent)
IItemPerc