ItemPerc
instead.public class ItemPercentage extends org.sistema.persist.Persistent implements IItemPercentage
Constructor and Description |
---|
ItemPercentage()
Deprecated.
Creates a new instance of ItemPercentage
|
Modifier and Type | Method and Description |
---|---|
java.math.BigDecimal |
getAmount()
Deprecated.
Calculates the amount.
|
java.math.BigDecimal |
getAmount(java.math.BigDecimal baseAmount,
java.math.BigDecimal runningSum)
Deprecated.
Calculates the amount of a percentage given a base amount and running sum.
|
java.lang.Integer |
getId()
Deprecated.
|
java.lang.Byte |
getOrder()
Deprecated.
|
IItem |
getParent()
Deprecated.
Retrieves the item to which value this percentage affects.
|
PercentageType |
getPercentageType()
Deprecated.
Retrieves the type of percentage being represented.
|
java.math.BigDecimal |
getRate()
Deprecated.
When
isFixed is true,
the fixed value, the rate otherwise. |
java.math.BigDecimal |
getRunningSum()
Deprecated.
Implementation using a recursive algorithm
|
boolean |
isAddToItemAmount()
Deprecated.
|
boolean |
isFixed()
Deprecated.
Indicates whether the "value" field contains a fixed number,
or a rate to perform a calculation.
|
boolean |
isOperateOnBaseAmount()
Deprecated.
|
void |
setAddToItemAmount(java.lang.Boolean value)
Deprecated.
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)
Deprecated.
Sets the value of this percentage as a fixed one.
|
void |
setId(java.lang.Integer id)
Deprecated.
Sets the number that uniquely identified this object.
|
void |
setOperateOnBaseAmount(java.lang.Boolean value)
Deprecated.
Specifies how the operation is calculated.
|
void |
setOrder(java.lang.Byte order)
Deprecated.
Sets the order of a percentage as part of an item.
|
void |
setParent(IItem parent)
Deprecated.
Sets the item to which value this percentage affects.
|
void |
setPercentageType(PercentageType child)
Deprecated.
Sets the type of percentage.
|
void |
setValue(java.math.BigDecimal value)
Deprecated.
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 ItemPercentage()
public java.math.BigDecimal getAmount()
getAmount
in interface IItemPercentage
public java.math.BigDecimal getAmount(java.math.BigDecimal baseAmount, java.math.BigDecimal runningSum)
IItemPercentage
getAmount
in interface IItemPercentage
baseAmount
and added to runningSum
.public PercentageType getPercentageType()
IItemPercentage
getPercentageType
in interface IItemPercentage
PercentageType
child or null
if none has been set.public java.lang.Integer getId()
getId
in interface org.sistema.persist.IPersistent
public java.lang.Byte getOrder()
getOrder
in interface IItemPercentage
public IItem getParent()
IItemPercentage
getParent
in interface IItemPercentage
public java.math.BigDecimal getRate()
IItemPercentage
isFixed
is true,
the fixed value, the rate otherwise.getRate
in interface IItemPercentage
public java.math.BigDecimal getRunningSum()
Implementation using a recursive algorithm
getRunningSum
in interface IItemPercentage
public boolean isAddToItemAmount()
isAddToItemAmount
in interface IItemPercentage
public boolean isFixed()
isFixed
in interface IItemPercentage
public boolean isOperateOnBaseAmount()
public void setAddToItemAmount(java.lang.Boolean value)
IItemPercentage
setAddToItemAmount
in interface IItemPercentage
value
- true
adds the result of the calculation
to the amount of the item ,
false
will not add it.public void setPercentageType(PercentageType child)
IItemPercentage
setPercentageType
in interface IItemPercentage
public void setFixed(java.lang.Boolean fixed)
IItemPercentage
The value of a fixed percentage is based on its amount and rate.
setFixed
in interface IItemPercentage
public void setId(java.lang.Integer id)
public void setOperateOnBaseAmount(java.lang.Boolean value)
IItemPercentage
setOperateOnBaseAmount
in interface IItemPercentage
value
- true
takes the item base amount,
false
takes the running sum.public void setOrder(java.lang.Byte order)
IItemPercentage
setOrder
in interface IItemPercentage
public void setParent(IItem parent)
IItemPercentage
setParent
in interface IItemPercentage
public void setValue(java.math.BigDecimal value)
IItemPercentage
setValue
in interface IItemPercentage