updated some javadoc
This commit is contained in:
@@ -7,14 +7,35 @@ import org.mustangproject.ZUGFeRD.IZUGFeRDExportableItem;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/***
|
||||
* Absolute and relative charges for document and item level
|
||||
*/
|
||||
public class Charge implements IZUGFeRDAllowanceCharge {
|
||||
|
||||
/**
|
||||
* the percentage, null if not relative at all
|
||||
*/
|
||||
protected BigDecimal percent = null;
|
||||
/**
|
||||
* the absolute value if not percentage
|
||||
*/
|
||||
protected BigDecimal totalAmount;
|
||||
/**
|
||||
* the tax rate the charge belongs to
|
||||
*/
|
||||
protected BigDecimal taxPercent;
|
||||
/**
|
||||
* a simple human readable description
|
||||
*/
|
||||
protected String reason;
|
||||
/**
|
||||
* the category ID why this charge has been applied
|
||||
*/
|
||||
protected String categoryCode;
|
||||
|
||||
/***
|
||||
* Bean connstructor
|
||||
*/
|
||||
public Charge() {
|
||||
taxPercent=BigDecimal.ZERO;
|
||||
}
|
||||
@@ -28,16 +49,31 @@ public class Charge implements IZUGFeRDAllowanceCharge {
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* sets the total amount to be changed to, e.g. if not specified via constructor
|
||||
* @param totalAmount 2 decimal money amount
|
||||
* @return fluid setter
|
||||
*/
|
||||
public Charge setTotalAmount(BigDecimal totalAmount) {
|
||||
this.totalAmount = totalAmount;
|
||||
return this;
|
||||
}
|
||||
|
||||
/***
|
||||
* if relative charge: percent to increase the item
|
||||
* @param percent as bigdecimal
|
||||
* @return fluid setter
|
||||
*/
|
||||
public Charge setPercent(BigDecimal percent) {
|
||||
this.percent = percent;
|
||||
return this;
|
||||
}
|
||||
|
||||
/***
|
||||
* charges can be applied to VAT items, in which case they take the same VAT rate
|
||||
* @param taxPercent the tax percentage on the charge
|
||||
* @return fluid setter
|
||||
*/
|
||||
public Charge setTaxPercent(BigDecimal taxPercent) {
|
||||
this.taxPercent = taxPercent;
|
||||
return this;
|
||||
@@ -49,6 +85,11 @@ public class Charge implements IZUGFeRDAllowanceCharge {
|
||||
return reason;
|
||||
}
|
||||
|
||||
/***
|
||||
* Freetext (?) reason for the charge
|
||||
* @param reason freetext
|
||||
* @return fluid setter
|
||||
*/
|
||||
public Charge setReason(String reason) {
|
||||
this.reason = reason;
|
||||
return this;
|
||||
@@ -77,6 +118,12 @@ public class Charge implements IZUGFeRDAllowanceCharge {
|
||||
return taxPercent;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***
|
||||
* Always to return true for IZUGFeRDAllowanceCharge
|
||||
* @return true since it is supposed to be calculated negatively
|
||||
*/
|
||||
@Override
|
||||
public boolean isCharge() {
|
||||
return true;
|
||||
@@ -91,6 +138,11 @@ public class Charge implements IZUGFeRDAllowanceCharge {
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* machine readable reason for this allowance/charge
|
||||
* @param categoryCode usually S
|
||||
* @return fluid setter
|
||||
*/
|
||||
public Charge setCategoryCode(String categoryCode) {
|
||||
this.categoryCode = categoryCode;
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user