itplr-kosit / validator-configuration-xrechnung

Configuration for validating documents against the German XRechnung standard using the KoSIT validation tool
https://xeinkauf.de/xrechnung/
Apache License 2.0
64 stars 17 forks source link

Incorrect [BR-DEX-02] warning when SubInvoiceLine has LineExtensionAmount = 0 #97

Open dogonbb opened 1 month ago

dogonbb commented 1 month ago

The Problem

When having a SubInvoiceLine, with InvoicedQuantity = 0 and therefore LineExtensionAmount = 0, the validator returns a [BR-DEX-02].

[BR-DEX-02] Der Wert von "Invoice line net amount" (BT-131) einer "INVOICE LINE" (BG-25) oder einer "SUB INVOICE LINE" (BG-DEX-01) soll der Summe der "Invoice line net amount" (BT-131) der direkt darunterliegenden "SUB INVOICE LINE" (BG-DEX-01) entsprechen.

Example for a SubInvoiceLine:

<cac:SubInvoiceLine>
  <cbc:ID>01.01.0020</cbc:ID>
  <cbc:InvoicedQuantity unitCode="C62">0</cbc:InvoicedQuantity>
  <cbc:LineExtensionAmount currencyID="EUR">0</cbc:LineExtensionAmount>
  <cac:Item>
    <cbc:Name>Pos01010020</cbc:Name>
    <cac:ClassifiedTaxCategory>
      <cbc:ID>S</cbc:ID>
      <cbc:Percent>19</cbc:Percent>
      <cac:TaxScheme>
        <cbc:ID>VAT</cbc:ID>
      </cac:TaxScheme>
    </cac:ClassifiedTaxCategory>
  </cac:Item>
  <cac:Price>
    <cbc:PriceAmount currencyID="EUR">2</cbc:PriceAmount>
    <cbc:BaseQuantity unitCode="C62">1</cbc:BaseQuantity>
  </cac:Price>
</cac:SubInvoiceLine>

As far as I understand, the LineExtensionAmount (=0) should not affect other LineExtensionAmounts. Therefore, this warning shouldn't be triggered. There should rather be a warning that there must not be any SubInvoiceLine with LineExtensionAmount = 0.

TestXRechnung.zip

lkumai commented 1 month ago

Thank you for your question! As far I can see, you are right. We will check this! You can track the issue here: https://projekte.kosit.org/xrechnung/xrechnung-schematron/-/issues/195