<?xml version="1.0" encoding="UTF-8"?>
<!--
  ==========================================================================
  XRECHNUNG UBL 2.1 — ABSICHTLICH UNGÜLTIGES TESTDOKUMENT
  XRechnung UBL 2.1 — Intentionally Invalid Test Document
  ==========================================================================
  Format:    XRechnung 3.0.x (CIUS), UBL 2.1 Invoice
  Zweck:     Zum Testen von Validatoren und Fehlerbehandlung
  Purpose:   For testing validators and error handling workflows

  WARNUNG / WARNING:
  Dieses Dokument ist ABSICHTLICH ungültig. Es darf NICHT als echte
  Rechnung verwendet werden.
  This document is INTENTIONALLY invalid. It MUST NOT be used as a real
  invoice.

  Die Datei ist wohlgeformt, entspricht dem UBL-2.1-Schema (XSD) und trägt
  die Kennung für XRechnung 3.0. Der KoSIT-Validator wählt daher das
  Szenario "EN16931 XRechnung (UBL Invoice)" und führt alle
  Schematron-Regeln aus. Ergebnis: Empfehlung "reject" mit genau
  10 Befunden (9 fatal, 1 Warnung).
  The file is well-formed, valid against the UBL 2.1 schema (XSD) and
  carries the XRechnung 3.0 identifier, so the KoSIT validator selects the
  scenario "EN16931 XRechnung (UBL Invoice)" and runs all Schematron rules.
  Result: recommendation "reject" with exactly 10 findings (9 fatal,
  1 warning).

  Enthaltene Fehler / Errors included (Regel-ID wie im KoSIT-Prüfbericht):
  1. BT-10 Käuferreferenz fehlt / buyer reference missing
       -> BR-DE-15 (fatal)
  2. Keine USt-IdNr. (BT-31) und keine Steuernummer (BT-32) des Verkäufers
     / no seller VAT ID or tax number
       -> BR-DE-16 (fatal), BR-S-02 (fatal)
  3. Ort des Verkäufers (BT-37) fehlt / seller city missing
       -> BR-DE-3 (fatal)
  4. Skonto-Zeile in BT-20 falsch formatiert (PROZENT=2 statt 2.00)
     / Skonto line badly formatted
       -> BR-DE-18 (fatal)
  5. Zahlungsart 30 (Überweisung) ohne Konto (BG-17, BT-84)
     / credit transfer without payment account
       -> BR-DE-23-a (fatal), BR-61 (fatal)
  6. BT-106 = 999.99, Summe der Positionen (BT-131) = 1000.00
     / sum of line net amounts does not match
       -> BR-CO-10 (fatal)
  7. BT-115 = 1500.00 statt BT-112 1189.99 (keine Vorauszahlung)
     / amount due does not match the total with VAT
       -> BR-CO-16 (fatal)
  8. Rechnungstyp 384 (Rechnungskorrektur) ohne Bezug auf die
     ursprüngliche Rechnung (BG-3) / corrected invoice without
     preceding invoice reference
       -> BR-DE-26 (warning)

  Geprüft mit / Verified with: KoSIT validator 1.5.0 with
  validator-configuration-xrechnung 2024-10-31, and the Schematron of
  validator-configuration-xrechnung 2026-08-31 (same 10 findings).

  Quelle / Source: docutools.pro — https://docutools.pro/vorlagen
  ==========================================================================
-->
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
         xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
         xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">

  <cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0</cbc:CustomizationID>
  <cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID>

  <!-- BT-1: Rechnungsnummer / invoice number -->
  <cbc:ID>FEHLER-RECHNUNG-001</cbc:ID>
  <cbc:IssueDate>2026-05-15</cbc:IssueDate>
  <cbc:DueDate>2026-05-29</cbc:DueDate>

  <!-- FEHLER 8 / ERROR 8: 384 = korrigierte Rechnung, aber unten fehlt
       cac:BillingReference (BG-3) -> BR-DE-26 (warning) -->
  <cbc:InvoiceTypeCode>384</cbc:InvoiceTypeCode>
  <cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>

  <!-- FEHLER 1 / ERROR 1: BT-10 fehlt -> BR-DE-15 (fatal).
       Richtig wäre z. B. / Correct would be e.g.:
       <cbc:BuyerReference>04011000-1234512345-06</cbc:BuyerReference> -->

  <cac:AccountingSupplierParty>
    <cac:Party>
      <cbc:EndpointID schemeID="EM">rechnung@fehler-firma.de</cbc:EndpointID>
      <cac:PartyName>
        <cbc:Name>Fehler GmbH</cbc:Name>
      </cac:PartyName>
      <!-- FEHLER 3 / ERROR 3: cbc:CityName (BT-37) fehlt -> BR-DE-3 (fatal) -->
      <cac:PostalAddress>
        <cbc:StreetName>Teststraße 1</cbc:StreetName>
        <cbc:PostalZone>12345</cbc:PostalZone>
        <cac:Country>
          <cbc:IdentificationCode>DE</cbc:IdentificationCode>
        </cac:Country>
      </cac:PostalAddress>
      <!-- FEHLER 2 / ERROR 2: kein cac:PartyTaxScheme, also weder USt-IdNr.
           (BT-31) noch Steuernummer (BT-32), obwohl Kategorie S verwendet
           wird -> BR-DE-16 (fatal), BR-S-02 (fatal). Richtig wäre z. B.:
           <cac:PartyTaxScheme>
             <cbc:CompanyID>DE123456789</cbc:CompanyID>
             <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
           </cac:PartyTaxScheme> -->
      <cac:PartyLegalEntity>
        <cbc:RegistrationName>Fehler GmbH</cbc:RegistrationName>
        <cbc:CompanyID>HRB 98765</cbc:CompanyID>
      </cac:PartyLegalEntity>
      <cac:Contact>
        <cbc:Name>Erika Test</cbc:Name>
        <cbc:Telephone>+49 30 9876543</cbc:Telephone>
        <cbc:ElectronicMail>rechnung@fehler-firma.de</cbc:ElectronicMail>
      </cac:Contact>
    </cac:Party>
  </cac:AccountingSupplierParty>

  <cac:AccountingCustomerParty>
    <cac:Party>
      <cbc:EndpointID schemeID="EM">eingang@test-behoerde.de</cbc:EndpointID>
      <cac:PostalAddress>
        <cbc:StreetName>Empfängerweg 5</cbc:StreetName>
        <cbc:CityName>Empfängerstadt</cbc:CityName>
        <cbc:PostalZone>54321</cbc:PostalZone>
        <cac:Country>
          <cbc:IdentificationCode>DE</cbc:IdentificationCode>
        </cac:Country>
      </cac:PostalAddress>
      <cac:PartyLegalEntity>
        <cbc:RegistrationName>Test Behörde</cbc:RegistrationName>
      </cac:PartyLegalEntity>
    </cac:Party>
  </cac:AccountingCustomerParty>

  <!-- BT-72: Lieferdatum / actual delivery date -->
  <cac:Delivery>
    <cbc:ActualDeliveryDate>2026-05-12</cbc:ActualDeliveryDate>
  </cac:Delivery>

  <!-- FEHLER 5 / ERROR 5: Zahlungsart 30 (Überweisung) ohne
       cac:PayeeFinancialAccount mit IBAN (BG-17, BT-84)
       -> BR-DE-23-a (fatal), BR-61 (fatal) -->
  <cac:PaymentMeans>
    <cbc:PaymentMeansCode>30</cbc:PaymentMeansCode>
  </cac:PaymentMeans>

  <!-- FEHLER 4 / ERROR 4: PROZENT=2 statt PROZENT=2.00 (zwei Nachkommastellen
       sind Pflicht) -> BR-DE-18 (fatal). Richtig / correct:
       #SKONTO#TAGE=14#PROZENT=2.00# gefolgt von einem Zeilenumbruch -->
  <cac:PaymentTerms>
    <cbc:Note>Zahlbar innerhalb von 14 Tagen.
#SKONTO#TAGE=14#PROZENT=2#
</cbc:Note>
  </cac:PaymentTerms>

  <cac:TaxTotal>
    <cbc:TaxAmount currencyID="EUR">190.00</cbc:TaxAmount>
    <cac:TaxSubtotal>
      <cbc:TaxableAmount currencyID="EUR">999.99</cbc:TaxableAmount>
      <cbc:TaxAmount currencyID="EUR">190.00</cbc:TaxAmount>
      <cac:TaxCategory>
        <cbc:ID>S</cbc:ID>
        <cbc:Percent>19</cbc:Percent>
        <cac:TaxScheme>
          <cbc:ID>VAT</cbc:ID>
        </cac:TaxScheme>
      </cac:TaxCategory>
    </cac:TaxSubtotal>
  </cac:TaxTotal>

  <cac:LegalMonetaryTotal>
    <!-- FEHLER 6 / ERROR 6: BT-106 = 999.99, aber die Positionen ergeben
         600.00 + 400.00 = 1000.00 -> BR-CO-10 (fatal) -->
    <cbc:LineExtensionAmount currencyID="EUR">999.99</cbc:LineExtensionAmount>
    <cbc:TaxExclusiveAmount currencyID="EUR">999.99</cbc:TaxExclusiveAmount>
    <cbc:TaxInclusiveAmount currencyID="EUR">1189.99</cbc:TaxInclusiveAmount>
    <!-- FEHLER 7 / ERROR 7: BT-115 muss BT-112 - BT-113 + BT-114 = 1189.99
         sein -> BR-CO-16 (fatal) -->
    <cbc:PayableAmount currencyID="EUR">1500.00</cbc:PayableAmount>
  </cac:LegalMonetaryTotal>

  <cac:InvoiceLine>
    <cbc:ID>1</cbc:ID>
    <cbc:InvoicedQuantity unitCode="HUR">10</cbc:InvoicedQuantity>
    <cbc:LineExtensionAmount currencyID="EUR">600.00</cbc:LineExtensionAmount>
    <cac:Item>
      <cbc:Description>Testleistung A</cbc:Description>
      <cbc:Name>Testleistung A</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">60.00</cbc:PriceAmount>
    </cac:Price>
  </cac:InvoiceLine>

  <cac:InvoiceLine>
    <cbc:ID>2</cbc:ID>
    <cbc:InvoicedQuantity unitCode="H87">4</cbc:InvoicedQuantity>
    <cbc:LineExtensionAmount currencyID="EUR">400.00</cbc:LineExtensionAmount>
    <cac:Item>
      <cbc:Description>Testleistung B</cbc:Description>
      <cbc:Name>Testleistung B</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">100.00</cbc:PriceAmount>
    </cac:Price>
  </cac:InvoiceLine>

</Invoice>
