Add BasisAmount to CashDiscount.
This commit is contained in:
@@ -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 "<ram:SpecifiedTradePaymentTerms>"+
|
||||
"<ram:Description>Cash Discount</ram:Description>"+
|
||||
" <ram:ApplicableTradePaymentDiscountTerms>"+
|
||||
" <ram:BasisPeriodMeasure unitCode=\"DAY\">"+days+"</ram:BasisPeriodMeasure>"+
|
||||
" <ram:CalculationPercent>"+XMLTools.nDigitFormat(percent,3)+"</ram:CalculationPercent>"+
|
||||
String s = "<ram:SpecifiedTradePaymentTerms>"
|
||||
+ " <ram:Description>Cash Discount</ram:Description>"
|
||||
+ " <ram:ApplicableTradePaymentDiscountTerms>"
|
||||
+ " <ram:BasisPeriodMeasure unitCode=\"DAY\">" + days + "</ram:BasisPeriodMeasure>";
|
||||
if (basisAmount != null) {
|
||||
s += " <ram:BasisAmount>" + XMLTools.nDigitFormat(basisAmount, 2) + "</ram:BasisAmount>";
|
||||
}
|
||||
s += " <ram:CalculationPercent>"+XMLTools.nDigitFormat(percent,3)+"</ram:CalculationPercent>"+
|
||||
" </ram:ApplicableTradePaymentDiscountTerms>"+
|
||||
"</ram:SpecifiedTradePaymentTerms>";
|
||||
return s;
|
||||
}
|
||||
|
||||
/***
|
||||
@@ -84,8 +99,4 @@ public class CashDiscount implements IZUGFeRDCashDiscount {
|
||||
public String getAsXRechnung() {
|
||||
return "#SKONTO#TAGE="+days+"#PROZENT="+XMLTools.nDigitFormat(percent,2)+"#\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user