Package org.mustangproject
Class Charge
- java.lang.Object
-
- org.mustangproject.Charge
-
- All Implemented Interfaces:
IZUGFeRDAllowanceCharge
- Direct Known Subclasses:
Allowance
public class Charge extends java.lang.Object implements IZUGFeRDAllowanceCharge
Absolute and relative charges for document and item level
-
-
Field Summary
Fields Modifier and Type Field Description protected java.math.BigDecimalbasisAmountthe value the percentage is applied uponprotected java.lang.StringcategoryCodethe category ID why this charge has been appliedprotected java.math.BigDecimalpercentthe percentage, null if not relative at allprotected java.lang.Stringreasona simple human readable descriptionprotected java.lang.StringreasonCodeCode from list UNTDID 5189protected java.math.BigDecimaltaxPercentthe tax rate the charge belongs toprotected java.math.BigDecimaltotalAmountthe absolute value if not percentage
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.math.BigDecimalgetBasisAmount()returns a basis the precentage is calculated fromjava.lang.StringgetCategoryCode()the category ID why this has been appliedjava.math.BigDecimalgetPercent()returns a percentage, if relative abount, or null for absolute amountsjava.lang.StringgetReason()get a description for the allowance/chargejava.lang.StringgetReasonCode()get the code for the allowance/chargejava.math.BigDecimalgetTaxPercent()get the applicable tax percentage for the allowance/chargejava.math.BigDecimalgetTotalAmount()java.math.BigDecimalgetTotalAmount(IAbsoluteValueProvider currentItem)returns the absolute amount, even if it was relative in the first placebooleanisCharge()Always to return true for IZUGFeRDAllowanceChargeChargesetBasisAmount(java.math.BigDecimal basis)sets a potential basis for the potential percentageChargesetCategoryCode(java.lang.String categoryCode)the category ID why this has been appliedChargesetPercent(java.math.BigDecimal percent)if relative charge: percent to increase the itemChargesetReason(java.lang.String reason)Freetext (?)ChargesetReasonCode(java.lang.String reasonCode)Reason code for the chargeChargesetTaxPercent(java.math.BigDecimal taxPercent)charges can be applied to VAT items, in which case they take the same VAT rateChargesetTotalAmount(java.math.BigDecimal totalAmount)sets the total amount to be changed to, e.g. if not specified via constructor
-
-
-
Field Detail
-
percent
protected java.math.BigDecimal percent
the percentage, null if not relative at all
-
totalAmount
protected java.math.BigDecimal totalAmount
the absolute value if not percentage
-
basisAmount
protected java.math.BigDecimal basisAmount
the value the percentage is applied upon
-
taxPercent
protected java.math.BigDecimal taxPercent
the tax rate the charge belongs to
-
reason
protected java.lang.String reason
a simple human readable description
-
reasonCode
protected java.lang.String reasonCode
Code from list UNTDID 5189
-
categoryCode
protected java.lang.String categoryCode
the category ID why this charge has been applied
-
-
Method Detail
-
setTotalAmount
public Charge setTotalAmount(java.math.BigDecimal totalAmount)
sets the total amount to be changed to, e.g. if not specified via constructor- Parameters:
totalAmount- 2 decimal money amount- Returns:
- fluid setter
-
setPercent
public Charge setPercent(java.math.BigDecimal percent)
if relative charge: percent to increase the item- Parameters:
percent- as bigdecimal- Returns:
- fluid setter
-
setTaxPercent
public Charge setTaxPercent(java.math.BigDecimal taxPercent)
charges can be applied to VAT items, in which case they take the same VAT rate- Parameters:
taxPercent- the tax percentage on the charge- Returns:
- fluid setter
-
getReason
public java.lang.String getReason()
Description copied from interface:IZUGFeRDAllowanceChargeget a description for the allowance/charge- Specified by:
getReasonin interfaceIZUGFeRDAllowanceCharge- Returns:
- the description
-
setReason
public Charge setReason(java.lang.String reason)
Freetext (?) reason for the charge- Parameters:
reason- freetext- Returns:
- fluid setter
-
getBasisAmount
public java.math.BigDecimal getBasisAmount()
Description copied from interface:IZUGFeRDAllowanceChargereturns a basis the precentage is calculated from- Specified by:
getBasisAmountin interfaceIZUGFeRDAllowanceCharge- Returns:
- null or the basis
-
setBasisAmount
public Charge setBasisAmount(java.math.BigDecimal basis)
sets a potential basis for the potential percentage- Parameters:
basis- the basis amount- Returns:
- fluid setter
-
getReasonCode
public java.lang.String getReasonCode()
Description copied from interface:IZUGFeRDAllowanceChargeget the code for the allowance/charge- Specified by:
getReasonCodein interfaceIZUGFeRDAllowanceCharge- Returns:
- the code
-
setReasonCode
public Charge setReasonCode(java.lang.String reasonCode)
Reason code for the charge- Parameters:
reasonCode- from list UNTDID 5189- Returns:
- fluid setter
-
getTotalAmount
public java.math.BigDecimal getTotalAmount(IAbsoluteValueProvider currentItem)
Description copied from interface:IZUGFeRDAllowanceChargereturns the absolute amount, even if it was relative in the first place- Specified by:
getTotalAmountin interfaceIZUGFeRDAllowanceCharge- Parameters:
currentItem- the class delivering the initial value- Returns:
- the calculated value (e.g. when percentage)
-
getTotalAmount
public java.math.BigDecimal getTotalAmount()
-
getPercent
public java.math.BigDecimal getPercent()
Description copied from interface:IZUGFeRDAllowanceChargereturns a percentage, if relative abount, or null for absolute amounts- Specified by:
getPercentin interfaceIZUGFeRDAllowanceCharge- Returns:
- null or Percentage as Bigdecimal
-
getTaxPercent
public java.math.BigDecimal getTaxPercent()
Description copied from interface:IZUGFeRDAllowanceChargeget the applicable tax percentage for the allowance/charge- Specified by:
getTaxPercentin interfaceIZUGFeRDAllowanceCharge- Returns:
- the percentage
-
isCharge
public boolean isCharge()
Always to return true for IZUGFeRDAllowanceCharge- Specified by:
isChargein interfaceIZUGFeRDAllowanceCharge- Returns:
- true since it is supposed to be calculated negatively
-
getCategoryCode
public java.lang.String getCategoryCode()
Description copied from interface:IZUGFeRDAllowanceChargethe category ID why this has been applied- Specified by:
getCategoryCodein interfaceIZUGFeRDAllowanceCharge- Returns:
- default value Standard rate=S
-
setCategoryCode
public Charge setCategoryCode(java.lang.String categoryCode)
the category ID why this has been applied- Parameters:
categoryCode- usually S- Returns:
- fluid setter
-
-