starting with document level charges/allowances via invoice class
This commit is contained in:
@@ -484,14 +484,31 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
||||
xml = xml + buildPaymentTermsXml();
|
||||
}
|
||||
|
||||
xml = xml + " <ram:SpecifiedTradeSettlementHeaderMonetarySummation>\n"
|
||||
|
||||
String chargeTotalLine="";
|
||||
|
||||
IZUGFeRDAllowanceCharge[] allowances= trans.getZFAllowances();
|
||||
BigDecimal allowanceTotal=new BigDecimal(0);
|
||||
if ((allowances!=null) && (allowances.length>0)) {
|
||||
for (IZUGFeRDAllowanceCharge currentAllowance:allowances) {
|
||||
allowanceTotal=allowanceTotal.add(currentAllowance.getTotalAmount(trans));
|
||||
}
|
||||
}
|
||||
String allowanceTotalLine="<ram:AllowanceTotalAmount currencyID=\"+trans.getCurrency()+\">"+currencyFormat(allowanceTotal)+"</ram:AllowanceTotalAmount>";
|
||||
|
||||
IZUGFeRDAllowanceCharge[] charges= trans.getZFCharges();
|
||||
BigDecimal chargesTotal=new BigDecimal(0);
|
||||
if ((charges!=null) && (charges.length>0)) {
|
||||
for (IZUGFeRDAllowanceCharge currentCharge:charges) {
|
||||
chargesTotal=chargesTotal.add(currentCharge.getTotalAmount(trans));
|
||||
}
|
||||
}
|
||||
String chargesTotalLine="<ram:ChargeTotalAmount currencyID=\""+trans.getCurrency()+"\">"+currencyFormat(chargesTotal)+"</ram:ChargeTotalAmount>";
|
||||
|
||||
xml = xml + " <ram:SpecifiedTradeSettlementHeaderMonetarySummation>\n"
|
||||
+ " <ram:LineTotalAmount>" + currencyFormat(getTotal()) + "</ram:LineTotalAmount>\n" //$NON-NLS-2$
|
||||
// currencyID=\"EUR\"
|
||||
+ " <ram:ChargeTotalAmount>0.00</ram:ChargeTotalAmount>\n"
|
||||
+ " <ram:AllowanceTotalAmount>0.00</ram:AllowanceTotalAmount>\n" //
|
||||
// currencyID=\"EUR\"
|
||||
// + " <ChargeTotalAmount currencyID=\"EUR\">5.80</ChargeTotalAmount>\n"
|
||||
// + " <AllowanceTotalAmount currencyID=\"EUR\">14.73</AllowanceTotalAmount>\n"
|
||||
+ chargesTotalLine
|
||||
+ allowanceTotalLine
|
||||
+ " <ram:TaxBasisTotalAmount>" + currencyFormat(getTotal()) + "</ram:TaxBasisTotalAmount>\n" //$NON-NLS-2$
|
||||
// //
|
||||
// currencyID=\"EUR\"
|
||||
|
||||
Reference in New Issue
Block a user