closes #1049
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
#1049
|
||||||
|
|
||||||
2.22.0
|
2.22.0
|
||||||
=======
|
=======
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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");
|
||||||
|
|||||||
Reference in New Issue
Block a user