<?xml version="1.0" encoding="UTF-8"?>
<ubl:Invoice xmlns:ubl="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">

  <!-- XRechnung 3.0 Profil-Identifikation -->
  <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>

  <!-- Rechnungsnummer (BT-1) -->
  <cbc:ID>RE-2026-001234</cbc:ID>

  <!-- Rechnungsdatum (BT-2) -->
  <cbc:IssueDate>2026-01-15</cbc:IssueDate>

  <!-- Fälligkeitsdatum (BT-9) -->
  <cbc:DueDate>2026-02-14</cbc:DueDate>

  <!-- Rechnungstyp: 380 = Handelsrechnung (BT-3) -->
  <cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>

  <!-- Währung: EUR (BT-5) -->
  <cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>

  <!-- Käuferreferenz / Bestellnummer (BT-10) -->
  <cbc:BuyerReference>BESTELLUNG-2026-5678</cbc:BuyerReference>

  <!-- ===== VERKÄUFER (BG-4) ===== -->
  <cac:AccountingSupplierParty>
    <cac:Party>
      <!-- Verkäufer elektronische Adresse (BT-34) -->
      <cbc:EndpointID schemeID="EM">rechnung@muster-webdesign.de</cbc:EndpointID>

      <!-- Firmenname (BT-27) -->
      <cac:PartyName>
        <cbc:Name>Muster Webdesign GmbH</cbc:Name>
      </cac:PartyName>

      <!-- Anschrift (BG-5) -->
      <cac:PostalAddress>
        <cbc:StreetName>Beispielstraße 42</cbc:StreetName>
        <cbc:CityName>Berlin</cbc:CityName>
        <cbc:PostalZone>10115</cbc:PostalZone>
        <cac:Country>
          <cbc:IdentificationCode>DE</cbc:IdentificationCode>
        </cac:Country>
      </cac:PostalAddress>

      <!-- USt-IdNr. (BT-31) -->
      <cac:PartyTaxScheme>
        <cbc:CompanyID>DE123456789</cbc:CompanyID>
        <cac:TaxScheme>
          <cbc:ID>VAT</cbc:ID>
        </cac:TaxScheme>
      </cac:PartyTaxScheme>

      <!-- Handelsregistereintrag (BT-30) -->
      <cac:PartyLegalEntity>
        <cbc:RegistrationName>Muster Webdesign GmbH</cbc:RegistrationName>
        <cbc:CompanyID schemeID="0204">HRB 12345 B</cbc:CompanyID>
      </cac:PartyLegalEntity>

      <!-- Kontaktdaten (BG-6) -->
      <cac:Contact>
        <cbc:Name>Max Mustermann</cbc:Name>
        <cbc:Telephone>+49 30 12345678</cbc:Telephone>
        <cbc:ElectronicMail>rechnung@muster-webdesign.de</cbc:ElectronicMail>
      </cac:Contact>
    </cac:Party>
  </cac:AccountingSupplierParty>

  <!-- ===== KÄUFER (BG-7) ===== -->
  <cac:AccountingCustomerParty>
    <cac:Party>
      <!-- Käufer elektronische Adresse (BT-49) -->
      <cbc:EndpointID schemeID="EM">eingang@stadtverwaltung-musterstadt.de</cbc:EndpointID>

      <!-- Leitweg-ID für Behörden (BT-10) -->
      <cac:PartyIdentification>
        <cbc:ID schemeID="0204">991-12345-67</cbc:ID>
      </cac:PartyIdentification>

      <!-- Firmenname (BT-44) -->
      <cac:PartyName>
        <cbc:Name>Stadtverwaltung Musterstadt</cbc:Name>
      </cac:PartyName>

      <!-- Anschrift (BG-8) -->
      <cac:PostalAddress>
        <cbc:StreetName>Rathausplatz 1</cbc:StreetName>
        <cbc:CityName>Musterstadt</cbc:CityName>
        <cbc:PostalZone>12345</cbc:PostalZone>
        <cac:Country>
          <cbc:IdentificationCode>DE</cbc:IdentificationCode>
        </cac:Country>
      </cac:PostalAddress>

      <!-- Handelsregistereintrag (BT-47) -->
      <cac:PartyLegalEntity>
        <cbc:RegistrationName>Stadtverwaltung Musterstadt</cbc:RegistrationName>
      </cac:PartyLegalEntity>
    </cac:Party>
  </cac:AccountingCustomerParty>

  <!-- Liefer-/Leistungsdatum (BT-72) -->
  <cac:Delivery>
    <cbc:ActualDeliveryDate>2026-01-15</cbc:ActualDeliveryDate>
  </cac:Delivery>

  <!-- ===== ZAHLUNGSINFORMATIONEN (BG-16) ===== -->
  <cac:PaymentMeans>
    <!-- Zahlungsart: 58 = SEPA-Überweisung (BT-81) -->
    <cbc:PaymentMeansCode>58</cbc:PaymentMeansCode>

    <!-- Verwendungszweck (BT-83) -->
    <cbc:PaymentID>RE-2026-001234</cbc:PaymentID>

    <!-- Bankverbindung (BG-17) -->
    <cac:PayeeFinancialAccount>
      <cbc:ID>DE89370400440532013000</cbc:ID>
      <cbc:Name>Muster Webdesign GmbH</cbc:Name>
      <cac:FinancialInstitutionBranch>
        <cbc:ID>COBADEFFXXX</cbc:ID>
      </cac:FinancialInstitutionBranch>
    </cac:PayeeFinancialAccount>
  </cac:PaymentMeans>

  <!-- Zahlungsbedingungen (BT-20) -->
  <cac:PaymentTerms>
    <cbc:Note>Zahlbar innerhalb von 30 Tagen ohne Abzug.</cbc:Note>
  </cac:PaymentTerms>

  <!-- ===== STEUERZUSAMMENFASSUNG (BG-22/BG-23) ===== -->
  <cac:TaxTotal>
    <!-- Gesamter Steuerbetrag (BT-110) -->
    <cbc:TaxAmount currencyID="EUR">475.00</cbc:TaxAmount>

    <!-- Steueraufschlüsselung (BG-23) -->
    <cac:TaxSubtotal>
      <!-- Steuerbemessungsgrundlage (BT-116) -->
      <cbc:TaxableAmount currencyID="EUR">2500.00</cbc:TaxableAmount>
      <!-- Steuerbetrag (BT-117) -->
      <cbc:TaxAmount currencyID="EUR">475.00</cbc:TaxAmount>
      <cac:TaxCategory>
        <!-- Steuerkategorie: S = Standard (BT-118) -->
        <cbc:ID>S</cbc:ID>
        <!-- Steuersatz: 19% (BT-119) -->
        <cbc:Percent>19</cbc:Percent>
        <cac:TaxScheme>
          <cbc:ID>VAT</cbc:ID>
        </cac:TaxScheme>
      </cac:TaxCategory>
    </cac:TaxSubtotal>
  </cac:TaxTotal>

  <!-- ===== RECHNUNGSSUMMEN (BG-22) ===== -->
  <cac:LegalMonetaryTotal>
    <!-- Summe der Positionsbeträge (BT-106) -->
    <cbc:LineExtensionAmount currencyID="EUR">2500.00</cbc:LineExtensionAmount>
    <!-- Rechnungssumme ohne USt. (BT-109) -->
    <cbc:TaxExclusiveAmount currencyID="EUR">2500.00</cbc:TaxExclusiveAmount>
    <!-- Rechnungssumme mit USt. (BT-112) -->
    <cbc:TaxInclusiveAmount currencyID="EUR">2975.00</cbc:TaxInclusiveAmount>
    <!-- Zu zahlender Betrag (BT-115) -->
    <cbc:PayableAmount currencyID="EUR">2975.00</cbc:PayableAmount>
  </cac:LegalMonetaryTotal>

  <!-- ===== RECHNUNGSPOSITIONEN (BG-25) ===== -->

  <!-- Position 1: Website-Entwicklung -->
  <cac:InvoiceLine>
    <!-- Positionsnummer (BT-126) -->
    <cbc:ID>1</cbc:ID>
    <!-- Menge (BT-129) -->
    <cbc:InvoicedQuantity unitCode="HUR">40</cbc:InvoicedQuantity>
    <!-- Positionsbetrag (BT-131) -->
    <cbc:LineExtensionAmount currencyID="EUR">2000.00</cbc:LineExtensionAmount>

    <!-- Artikelinformationen (BG-31) -->
    <cac:Item>
      <!-- Artikelbeschreibung (BT-154) -->
      <cbc:Description>Entwicklung einer responsiven Website inkl. CMS-Anbindung, Kontaktformular und SEO-Grundoptimierung</cbc:Description>
      <!-- Artikelname (BT-153) -->
      <cbc:Name>Website-Entwicklung (Responsive Design)</cbc:Name>

      <!-- Steuerkategorie der Position (BG-30) -->
      <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>

    <!-- Preisinformationen (BG-29) -->
    <cac:Price>
      <!-- Einzelpreis (BT-146) -->
      <cbc:PriceAmount currencyID="EUR">50.00</cbc:PriceAmount>
    </cac:Price>
  </cac:InvoiceLine>

  <!-- Position 2: Hosting-Setup -->
  <cac:InvoiceLine>
    <cbc:ID>2</cbc:ID>
    <cbc:InvoicedQuantity unitCode="C62">1</cbc:InvoicedQuantity>
    <cbc:LineExtensionAmount currencyID="EUR">300.00</cbc:LineExtensionAmount>

    <cac:Item>
      <cbc:Description>Einrichtung des Webhosting-Pakets, SSL-Zertifikat und DNS-Konfiguration</cbc:Description>
      <cbc:Name>Hosting-Setup und Domain-Konfiguration</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">300.00</cbc:PriceAmount>
    </cac:Price>
  </cac:InvoiceLine>

  <!-- Position 3: Schulung -->
  <cac:InvoiceLine>
    <cbc:ID>3</cbc:ID>
    <cbc:InvoicedQuantity unitCode="HUR">2</cbc:InvoicedQuantity>
    <cbc:LineExtensionAmount currencyID="EUR">200.00</cbc:LineExtensionAmount>

    <cac:Item>
      <cbc:Description>Einweisung in das Content-Management-System für zwei Mitarbeiter</cbc:Description>
      <cbc:Name>CMS-Schulung für Redakteure</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>

</ubl:Invoice>
