Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoice acceptRecommendation calculation and default-report.xml content discrepancy #42

Open
chumbalum opened this issue Nov 16, 2020 · 0 comments

Comments

@chumbalum
Copy link

chumbalum commented Nov 16, 2020

Hi,

we currently use the accept flag calculated by the validator in a webservice. The validator sets the flag to REJECTED if there is a failed assertion, even if it's only a warning

.anyMatch(FailedAssert.class::isInstance)

https://github.com/itplr-kosit/validator/blob/113f1c79264e751cf8a9779504034b7c6213adc0/src/main/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceAction.java#L71-L74

grafik

In the default-report.xml though, the calculation of the recommendation differs from the calculation of the validator. There, only real errors will lead to a reject recommendation. The invoice may contain warnings which are not taken into account here.

In the end the xml-report says "accept" although the report-result says "reject"

select="count(//rep:message[@level eq 'error'])"
select="count(//rep:message[rep:custom-level(.) eq 'error'])"

<xsl:variable name="e1" as="xs:integer"
select="count(//rep:message[@level eq 'error'])" />
<xsl:variable name="e2" as="xs:integer"
select="count(//rep:message[rep:custom-level(.) eq 'error'])" />
<xsl:choose>
<xsl:when test="empty(rep:scenarioMatched) or rep:scenarioMatched/s:scenario/s:name[ contains( lower-case(text()), 'fallback')]">
<p class="important error"
>Bewertung: Es wird empfohlen das Dokument zurückzuweisen. Da kein Pruefszenario gegriffen hat.</p>
</xsl:when>
<xsl:when test="$e1 eq 0 and $e2 eq 0">
<p class="important"
>Bewertung: Es wird empfohlen das Dokument anzunehmen und weiter zu verarbeiten.</p>
</xsl:when>
<xsl:when test="$e1 gt 0 and $e2 eq 0">
<p class="important"
>Bewertung: Es wird empfohlen das Dokument anzunehmen und zu verarbeiten, da die vorhandenen Fehler derzeit toleriert werden.</p>
</xsl:when>
<xsl:otherwise>
<p class="important error"
>Bewertung: Es wird empfohlen das Dokument zurückzuweisen.</p>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

We are wondering if this discrepancy is intended, since the report-result and generated xml-report say something different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant