Merge pull request #921 from mkilian/xr-val-information
Treat schematron rule flag "information" as notice.
This commit is contained in:
@@ -536,12 +536,15 @@ public class XMLValidator extends Validator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ESeverity severity;
|
ESeverity severity;
|
||||||
|
Node failNode = currentFailNode.getAttributes().getNamedItem("flag");
|
||||||
|
String failVal = failNode == null ? null : failNode.getNodeValue();
|
||||||
if (defaultSeverity == ESeverity.notice) {
|
if (defaultSeverity == ESeverity.notice) {
|
||||||
severity = defaultSeverity;
|
severity = defaultSeverity;
|
||||||
} else if (currentFailNode.getAttributes().getNamedItem("flag") != null
|
} else if ("warning".equals(failVal)) {
|
||||||
&& "warning".equals(currentFailNode.getAttributes().getNamedItem("flag").getNodeValue())) {
|
|
||||||
// the XR issues warnings with flag=warning
|
// the XR issues warnings with flag=warning
|
||||||
severity = ESeverity.warning;
|
severity = ESeverity.warning;
|
||||||
|
} else if ("information".equals(failVal)) {
|
||||||
|
severity = ESeverity.notice;
|
||||||
} else {
|
} else {
|
||||||
severity = ESeverity.error;
|
severity = ESeverity.error;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ public class ZUGFeRDValidatorTest extends ResourceCase {
|
|||||||
|
|
||||||
assertThat(res).valueByXPath("count(//notice)")
|
assertThat(res).valueByXPath("count(//notice)")
|
||||||
.asInt()
|
.asInt()
|
||||||
.isEqualTo(0);
|
.isEqualTo(1);
|
||||||
assertThat(res).valueByXPath("/validation/summary/@status")
|
assertThat(res).valueByXPath("/validation/summary/@status")
|
||||||
.asString()
|
.asString()
|
||||||
.isEqualTo("valid");// expect to be valid because XR notices are, well, only notices
|
.isEqualTo("valid");// expect to be valid because XR notices are, well, only notices
|
||||||
@@ -216,14 +216,14 @@ public class ZUGFeRDValidatorTest extends ResourceCase {
|
|||||||
|
|
||||||
assertThat(res).valueByXPath("count(//error)")
|
assertThat(res).valueByXPath("count(//error)")
|
||||||
.asInt()
|
.asInt()
|
||||||
.isEqualTo(5);
|
.isEqualTo(4);
|
||||||
assertThat(res).valueByXPath("count(//warning)")
|
assertThat(res).valueByXPath("count(//warning)")
|
||||||
.asInt()
|
.asInt()
|
||||||
.isEqualTo(1);
|
.isEqualTo(1);
|
||||||
|
|
||||||
assertThat(res).valueByXPath("count(//notice)")
|
assertThat(res).valueByXPath("count(//notice)")
|
||||||
.asInt()
|
.asInt()
|
||||||
.isEqualTo(0); // 12 notices RE XRechnung 3.0
|
.isEqualTo(1); // 12 notices RE XRechnung 3.0
|
||||||
assertThat(res).valueByXPath("/validation/summary/@status")
|
assertThat(res).valueByXPath("/validation/summary/@status")
|
||||||
.asString()
|
.asString()
|
||||||
.isEqualTo("invalid");// expect to be valid
|
.isEqualTo("invalid");// expect to be valid
|
||||||
|
|||||||
@@ -102,6 +102,32 @@
|
|||||||
</ram:SpecifiedTradeSettlementLineMonetarySummation>
|
</ram:SpecifiedTradeSettlementLineMonetarySummation>
|
||||||
</ram:SpecifiedLineTradeSettlement>
|
</ram:SpecifiedLineTradeSettlement>
|
||||||
</ram:IncludedSupplyChainTradeLineItem>
|
</ram:IncludedSupplyChainTradeLineItem>
|
||||||
|
<ram:IncludedSupplyChainTradeLineItem>
|
||||||
|
<ram:AssociatedDocumentLineDocument>
|
||||||
|
<ram:LineID>Zeitlose Diensleistung</ram:LineID>
|
||||||
|
</ram:AssociatedDocumentLineDocument>
|
||||||
|
<ram:SpecifiedTradeProduct>
|
||||||
|
<ram:Name>Zeitlose Diensleistung</ram:Name>
|
||||||
|
</ram:SpecifiedTradeProduct>
|
||||||
|
<ram:SpecifiedLineTradeAgreement>
|
||||||
|
<ram:NetPriceProductTradePrice>
|
||||||
|
<ram:ChargeAmount>0.00</ram:ChargeAmount>
|
||||||
|
</ram:NetPriceProductTradePrice>
|
||||||
|
</ram:SpecifiedLineTradeAgreement>
|
||||||
|
<ram:SpecifiedLineTradeDelivery>
|
||||||
|
<ram:BilledQuantity unitCode="XPP">1</ram:BilledQuantity>
|
||||||
|
</ram:SpecifiedLineTradeDelivery>
|
||||||
|
<ram:SpecifiedLineTradeSettlement>
|
||||||
|
<ram:ApplicableTradeTax>
|
||||||
|
<ram:TypeCode>VAT</ram:TypeCode>
|
||||||
|
<ram:CategoryCode>S</ram:CategoryCode>
|
||||||
|
<ram:RateApplicablePercent>7</ram:RateApplicablePercent>
|
||||||
|
</ram:ApplicableTradeTax>
|
||||||
|
<ram:SpecifiedTradeSettlementLineMonetarySummation>
|
||||||
|
<ram:LineTotalAmount>0.00</ram:LineTotalAmount>
|
||||||
|
</ram:SpecifiedTradeSettlementLineMonetarySummation>
|
||||||
|
</ram:SpecifiedLineTradeSettlement>
|
||||||
|
</ram:IncludedSupplyChainTradeLineItem>
|
||||||
<ram:ApplicableHeaderTradeAgreement>
|
<ram:ApplicableHeaderTradeAgreement>
|
||||||
<ram:BuyerReference>04011000-12345-03</ram:BuyerReference>
|
<ram:BuyerReference>04011000-12345-03</ram:BuyerReference>
|
||||||
<ram:SellerTradeParty>
|
<ram:SellerTradeParty>
|
||||||
|
|||||||
Reference in New Issue
Block a user