Skip to content

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

Open
@chumbalum

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions