diff --git a/library/src/main/java/org/mustangproject/CashDiscount.java b/library/src/main/java/org/mustangproject/CashDiscount.java index b1993a02..d27b3dcb 100644 --- a/library/src/main/java/org/mustangproject/CashDiscount.java +++ b/library/src/main/java/org/mustangproject/CashDiscount.java @@ -21,7 +21,9 @@ public class CashDiscount implements IZUGFeRDCashDiscount { /*** * the period (usually days) count how long the percent apply */ - protected Integer days=null; + protected Integer days; + + protected BigDecimal basisAmount; /*** * Create a cash discount (skonto) with the specified height in the specified period. @@ -61,18 +63,31 @@ public class CashDiscount implements IZUGFeRDCashDiscount { return this; } + public BigDecimal getBasisAmount() { + return basisAmount; + } + + public CashDiscount setBasisAmount(BigDecimal basisAmount) { + this.basisAmount = basisAmount; + return this; + } + /*** * @return this particular cash discount as cross industry invoice XML */ @JsonIgnore public String getAsCII() { - return ""+ - "Cash Discount"+ - " "+ - " "+days+""+ - " "+XMLTools.nDigitFormat(percent,3)+""+ - " "+ - ""; + String s = "" + + " Cash Discount" + + " " + + " " + days + ""; + if (basisAmount != null) { + s += " " + XMLTools.nDigitFormat(basisAmount, 2) + ""; + } + s += " "+XMLTools.nDigitFormat(percent,3)+""+ + " "+ + ""; + return s; } /*** @@ -84,8 +99,4 @@ public class CashDiscount implements IZUGFeRDCashDiscount { public String getAsXRechnung() { return "#SKONTO#TAGE="+days+"#PROZENT="+XMLTools.nDigitFormat(percent,2)+"#\n"; } - - - - }