<div class="invoice">
    <!-- Allgemeine Felder -->
    <h3>Rechnungsdetails</h3>
    <div class="section">
        <div class="field"><strong class="field-name">Rechnungsnummer:</strong> <kbd>{{id}}</kbd></div>
        {{#project_reference}}
            <div class="field"><strong class="field-name">Projektnummer:</strong> <kbd>{{id}}</kbd></div>
        {{/project_reference}}
        <div class="field"><strong class="field-name">Rechnungsdatum:</strong> {{issue_date}}</div>
        <div class="field"><strong class="field-name">Fälligkeitsdatum:</strong> {{due_date}}</div>
        <div class="field"><strong class="field-name">Währungscode:</strong> {{document_currency_code.value}}</div>
        <div class="field"><strong class="field-name">Käuferreferenz (Leitweg‑ID):</strong> {{buyer_reference}}</div>
    </div>

    <!-- Lieferantendetails -->
    <h3>Lieferantendetails</h3>
    <div class="section">
        <div class="field"><strong class="field-name">Elektronische Adresse:</strong> {{accounting_supplier_party.party.endpoint_id}}</div>
        <div class="field"><strong class="field-name">Voller Name:</strong> {{accounting_supplier_party.party.party_legal_entity.0.registration_name}}</div>
        <div class="field"><strong class="field-name">UID:</strong> {{accounting_supplier_party.party.party_tax_scheme.0.company_id}}</div>
        <div class="field"><strong class="field-name">Name:</strong> {{accounting_supplier_party.party.party_name.0.name}}</div>
        <div class="field"><strong class="field-name">Straße:</strong> {{accounting_supplier_party.party.postal_address.street_name}}</div>
        <div class="field"><strong class="field-name">Stadt:</strong> {{accounting_supplier_party.party.postal_address.city_name}}</div>
        <div class="field"><strong class="field-name">Postleitzahl:</strong> {{accounting_supplier_party.party.postal_address.postal_zone}}</div>
        <div class="field"><strong class="field-name">Land:</strong> {{accounting_supplier_party.party.postal_address.country.identification_code.value}}</div>
        <div class="field"><strong class="field-name">Kontakt - Name:</strong> {{accounting_supplier_party.party.contact.name}}</div>
        <div class="field"><strong class="field-name">Kontakt - Telefon:</strong> {{accounting_supplier_party.party.contact.telephone}}</div>
        <div class="field"><strong class="field-name">Kontakt - E-Mail:</strong> {{accounting_supplier_party.party.contact.electronic_mail}}</div>
        {{{additional_fields.accounting_supplier_party}}}
    </div>

    <!-- Kundendetails -->
    <h3>Kundendetails</h3>
    <div class="section">
        <div class="field"><strong class="field-name">Elektronische Adresse:</strong> {{accounting_customer_party.party.endpoint_id}}</div>
        <div class="field"><strong class="field-name">Voller Name:</strong> {{accounting_customer_party.party.party_legal_entity.0.registration_name}}</div>
        <div class="field"><strong class="field-name">UID:</strong> {{accounting_customer_party.party.party_tax_scheme.0.company_id}}</div>
        <div class="field"><strong class="field-name">Name:</strong> {{accounting_customer_party.party.party_name.0.name}}</div>
        <div class="field"><strong class="field-name">Straße:</strong> {{accounting_customer_party.party.postal_address.street_name}}</div>
        <div class="field"><strong class="field-name">Stadt:</strong> {{accounting_customer_party.party.postal_address.city_name}}</div>
        <div class="field"><strong class="field-name">Postleitzahl:</strong> {{accounting_customer_party.party.postal_address.postal_zone}}</div>
        <div class="field"><strong class="field-name">Land:</strong> {{accounting_customer_party.party.postal_address.country.identification_code.value}}</div>
        <div class="field"><strong class="field-name">Kontakt - Name:</strong> {{accounting_customer_party.party.contact.name}}</div>
        <div class="field"><strong class="field-name">Kontakt - Telefon:</strong> {{accounting_customer_party.party.contact.telephone}}</div>
        <div class="field"><strong class="field-name">Kontakt - E-Mail:</strong> {{accounting_customer_party.party.contact.electronic_mail}}</div>
        {{{additional_fields.accounting_customer_party}}}
    </div>

    <!-- Lieferdetails -->
    <h3>Lieferdetails</h3>
    <div class="section">
        <div class="field"><strong class="field-name">Lieferdatum:</strong> {{delivery.0.actual_delivery_date}}</div>
        {{{additional_fields.delivery}}}
    </div>

    <!-- Zahlungsdetails -->
    <h3>Zahlungsdetails</h3>
    <div class="section">
        <div class="field"><strong class="field-name">Zahlungsmethode:</strong> {{payment_means.0.payment_means_code}}</div>
        <div class="field"><strong class="field-name">Zahlungskonto:</strong> {{payment_means.0.payee_financial_account.id}}</div>
        {{{additional_fields.payment_means}}}
    </div>

    <!-- Rechnungspositionen -->
    <h3>Rechnungspositionen</h3>
    <table class="invoice-lines">
        <tr>
            <th>Nummer</th>
            <th>Artikel</th>
            <th>Menge</th>
            <th>Einzelpreis</th>
            <th>Gesamtbetrag</th>
            <th>Steuer</th>
            <th>Leistungszeitraum</th>
            <th><!-- Additional fields (Zusätzliche Felder) --></th>
        </tr>
        {{#invoice_lines}}
        <tr>
            <td>{{id}}</td>
            <td>{{item.name}}</td>
            <td>{{invoiced_quantity.value}} {{invoiced_quantity.unit_code}}</td>
            <td>{{price.price_amount.value}} {{price.price_amount.currency_id}}</td>
            <td>{{line_extension_amount.value}} {{line_extension_amount.currency_id}}</td>
            <td>{{item.classified_tax_category.id}} {{item.classified_tax_category.percent}} {{item.classified_tax_category.tax_scheme.id}}</td>
            <td>{{invoice_period.0.start_date}} - {{invoice_period.0.end_date}}</td>
            <td class="section">{{{additional_fields}}}</td>
        </tr>
        {{/invoice_lines}}
    </table>

    <!-- Steuerliche und rechtliche Summen -->
    <h3>Gesamtbetrag</h3>
    <div class="section">
        <div class="field"><strong class="field-name">Summe nach Abzug von Steuern und Skonti, einschließlich etwaiger Rundungsbeträge:</strong> {{legal_monetary_total.line_extension_amount.value}} {{legal_monetary_total.line_extension_amount.currency_id}}</div>
        <div class="field"><strong class="field-name">Netto-Rechnungsbetrag:</strong> {{legal_monetary_total.tax_exclusive_amount.value}} {{legal_monetary_total.tax_exclusive_amount.currency_id}}</div>
        <div class="field"><strong class="field-name">Brutto-Rechnungsbetrag:</strong> {{legal_monetary_total.tax_inclusive_amount.value}} {{legal_monetary_total.tax_inclusive_amount.currency_id}}</div>
        <div class="field"><strong class="field-name">Summe Nachlass:</strong> {{legal_monetary_total.allowance_total_amount.value}} {{legal_monetary_total.allowance_total_amount.currency_id}}</div>
        <div class="field"><strong class="field-name">Summe Abgabe:</strong> {{legal_monetary_total.charge_total_amount.value}} {{legal_monetary_total.charge_total_amount.currency_id}}</div>
        <div class="field"><strong class="field-name">Summe bereits gezahlter Beträge:</strong> {{legal_monetary_total.prepaid_amount.value}} {{legal_monetary_total.prepaid_amount.currency_id}}</div>
        <div class="field"><strong class="field-name">Rechnungsbetrag:</strong> {{legal_monetary_total.payable_amount.value}} {{legal_monetary_total.payable_amount.currency_id}}</div>
        {{{additional_fields.legal_monetary_total}}}
    </div>

    <h3>Steuer</h3>
    <div class="section">
        <div class="field"><strong class="field-name">Steuerbetrag:</strong> {{tax_total.0.tax_amount.value}} {{tax_total.0.tax_amount.currency_id}}</div>
        {{{additional_fields.tax_total}}}
    </div>

    <!-- Zusätzliche Felder (Generell) -->
    <h3>Zusätzliche Felder</h3>
    <div class="section">
        {{{additional_fields.general}}}
    </div>
</div>
