This commit is contained in:
Jochen Stärk
2026-02-26 14:25:23 +01:00
parent fb0634f279
commit a59fce7dab
3 changed files with 12 additions and 4 deletions

View File

@@ -1,3 +1,4 @@
#1049
2.22.0 2.22.0
======= =======

View File

@@ -516,8 +516,9 @@ public class ZUGFeRDInvoiceImporter {
xpr = xpath.compile("//*[local-name()=\"SpecifiedTradeSettlementHeaderMonetarySummation\"]/*[local-name()=\"TaxTotalAmount\"]|//*[local-name()=\"TaxTotal\"]/*[local-name()=\"TaxAmount\"]"); xpr = xpath.compile("//*[local-name()=\"SpecifiedTradeSettlementHeaderMonetarySummation\"]/*[local-name()=\"TaxTotalAmount\"]|//*[local-name()=\"TaxTotal\"]/*[local-name()=\"TaxAmount\"]");
NodeList taxTotalNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET); NodeList taxTotalNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
if (taxTotalNodes.getLength() > 0) { if (taxTotalNodes.getLength() > 0) {
if (zpp instanceof CalculatedInvoice) { String taxTotalStr=XMLTools.trimOrNull(taxTotalNodes.item(0));
((CalculatedInvoice) zpp).setVATtotal(new BigDecimal(XMLTools.trimOrNull(taxTotalNodes.item(0)))); if ((zpp instanceof CalculatedInvoice)&&(taxTotalStr!=null)) {
((CalculatedInvoice) zpp).setVATtotal(new BigDecimal(taxTotalStr));
} }
} }
@@ -525,8 +526,9 @@ public class ZUGFeRDInvoiceImporter {
NodeList lineDueNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET); NodeList lineDueNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
BigDecimal duePayableAmount = null; BigDecimal duePayableAmount = null;
if (lineDueNodes.getLength() > 0) { if (lineDueNodes.getLength() > 0) {
duePayableAmount = new BigDecimal(XMLTools.trimOrNull(lineDueNodes.item(0))); String duePayableAmountStr=XMLTools.trimOrNull(lineDueNodes.item(0));
if (zpp instanceof CalculatedInvoice) { if ((zpp instanceof CalculatedInvoice) && (duePayableAmountStr!=null)) {
duePayableAmount = new BigDecimal(duePayableAmountStr);
((CalculatedInvoice) zpp).setDuePayable(duePayableAmount); ((CalculatedInvoice) zpp).setDuePayable(duePayableAmount);
} }
} }

View File

@@ -85,6 +85,9 @@ public class XMLValidatorTest extends ResourceCase {
} catch (final IrrecoverableValidationError e) { } catch (final IrrecoverableValidationError e) {
noException = false; noException = false;
} }
assertTrue(noException);
noException=true;// moving on...
final String res = xv.getXMLResult(); final String res = xv.getXMLResult();
/*OutputStream os = null; /*OutputStream os = null;
try { try {
@@ -166,6 +169,8 @@ public class XMLValidatorTest extends ResourceCase {
noException = false; noException = false;
} }
assertTrue(noException); assertTrue(noException);
noException=true;// moving on...
try { try {
ctx.clear(); ctx.clear();
tempFile = getResourceAsFile("invalidV2Root.xml"); tempFile = getResourceAsFile("invalidV2Root.xml");