Ver Fonte

Detailseiten aufgeteilt

gc-server3 há 1 semana atrás
pai
commit
5986d785a9

+ 10 - 643
templates/forderungen/details/details.html

@@ -4,347 +4,10 @@
 <br>
 <h2>{{forderung_kopf[0].Beleg }}</h2>
 <br>
-<div class="row mb-3">
-  <div class="col-4">
-    <table class="table table-sm">
-      <tr>
-        <th colspan="2">Grunddaten</th>
-      </tr>
-      <tr>
-        <td><strong>Hauptbetrieb:</strong></td>
-        <td>{{forderung_kopf[0].Hauptbetrieb_Name }}</td>
-      </tr>
 
-      <tr>
-        <td><strong>Standort:</strong></td>
-        <td>{{forderung_kopf[0].Standort_Name }}</td>
-      </tr>
-      <tr>
-        <td><strong>Benutzer:</strong></td>
-        <td>{{forderung_kopf[0].User_ID }}</td>
-      </tr>
+{%include 'forderungen/details/details_uebersicht.html' %}
 
-      <tr>
-        <td><strong>Verursacher:</strong></td>
-        <td>{{forderung_kopf[0].Verursacher }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Bereich:</strong></td>
-        <td>{{forderung_kopf[0].Bereich }}</td>
-      </tr>
-
-    </table>
-  </div>
-  <div class="col-4">
-    <table class="table table-sm">
-      <tr>
-        <th colspan="2">Beleg</th>
-      </tr>
-      <tr>
-        <td><strong>Belegart:</strong></td>
-        <td>{{forderung_kopf[0].Rechnung_Gutschrift }}</td>
-      </tr>
-      <tr>
-        <td><strong>Beleg-Nr:</strong></td>
-        <td>{{forderung_kopf[0].Document_No }}</td>
-      </tr>
-      <tr>
-        <td><strong>Betrag:</strong></td>
-        <td>{{forderung_kopf[0].offen|number_format }} &euro;</td>
-      </tr>
-      <tr>
-        <td><strong>Rechnungsdatum:</strong></td>
-        <td>{{forderung_kopf[0].Invoice_Date|date_format }}</td>
-      </tr>            
-      <tr>
-        <td><strong>Lieferdatum:</strong></td>
-        <td>{{forderung_kopf[0].Invoice_Date|date_format }}</td>
-      </tr>
-      <tr>
-        <td><strong>Fälligkeitsdatum:</strong></td>
-        <td>{{forderung_kopf[0].Invoice_Date|date_format }}</td>
-      </tr>
-
-
-
-    </table>
-  </div>
-  <div class="col-4">
-    <table class="table table-sm">
-      <tr>
-        <th colspan="2">Forderung</th>
-      </tr>
-      <tr>
-        <td><strong>offen:</strong></td>
-        <td>{{forderung_kopf[0].offen|number_format }} &euro;</td>
-      </tr>
-
-      <tr>
-        <td><strong>offen (Kunde gesamt):</strong></td>
-        <td>{{forderung_kopf[0].offen_Kunde_gesamt|number_format }} &euro;</td>
-      </tr>
-
-      <tr>
-        <td><strong>Tage:</strong></td>
-        <td>{{forderung_kopf[0].Tage }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Staffel:</strong></td>
-        <td>{{forderung_kopf[0].Staffel }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Mahnstufe:</strong></td>
-        <td>{{forderung_kopf[0].Mahnstufe }}</td>
-      </tr>
-    </table>
-  </div>
-
-
-  <div class="col-4">
-    <table class="table table-sm">
-      <tr>
-        <th colspan="2">Kunde</th>
-      </tr>
-
-      <tr>
-        <td><strong>Kunden-Nr:</strong></td>
-        <td>{{forderung_kopf[0].Kunde_Nr }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Name:</strong></td>
-        <td>{{forderung_kopf[0].Kunde_Name }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Adresse:</strong></td>
-        <td>{{forderung_kopf[0].Kunde_Adresse }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>PLZ / Ort:</strong></td>
-        <td>{{forderung_kopf[0].Kunde_PLZ }} {{forderung_kopf[0].Kunde_Ort }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Land:</strong></td>
-        <td>{{forderung_kopf[0].Kunde_Land }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Telefon:</strong></td>
-        <td>{{forderung_kopf[0].Kunde_Telefon }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>E-Mail:</strong></td>
-        <td><a href="mailto:{{forderung_kopf[0].Kunde_Email }}?subject={{forderung_kopf[0].Document_No }}" hx-disable="true">{{forderung_kopf[0].Kunde_Email }}</a></td>
-      </tr>
-
-      <tr>
-        <td><strong>Payment_Terms_Code:</strong></td>
-        <td>{{forderung_kopf[0].Payment_Terms_Code }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Kundengruppe:</strong></td>
-        <td>{{forderung_kopf[0].Customer_Group_Description }}</td>
-      </tr>
-
-    </table>
-  </div>
-{% if forderung_kopf[0].Fahrzeug_Leasing == 'J' %}
-<div class="col-4">
-    <table class="table table-sm">
-      <tr>
-        <th colspan="2">Leasing-Kunde</th>
-      </tr>
-
-      <tr>
-        <td><strong>Kunden-Nr:</strong></td>
-        <td>{{forderung_kopf[0].Leasing_Kunde_Nr }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Name:</strong></td>
-        <td>{{forderung_kopf[0].Leasing_Kunde_Name }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Adresse:</strong></td>
-        <td>{{forderung_kopf[0].Leasing_Kunde_Adresse }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>PLZ / Ort:</strong></td>
-        <td>{{forderung_kopf[0].Leasing_Kunde_PLZ }} {{forderung_kopf[0].Leasing_Kunde_Ort }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Land:</strong></td>
-        <td>{{forderung_kopf[0].Leasing_Kunde_Land }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Telefon:</strong></td>
-        <td>{{forderung_kopf[0].Leasing_Kunde_Telefon }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>E-Mail:</strong></td>
-        <td><a href="mailto:{{forderung_kopf[0].Leasing_Kunde_Email }}?subject={{forderung_kopf[0].Document_No }}" hx-disable="true">{{forderung_kopf[0].Leasing_Kunde_Email }}</a></td>
-      </tr>
-    </table>
-  </div>
-{% endif %}
-
-
-{% if forderung_kopf[0].Versicherung == 'J' and forderung_kopf[0].Vers_Adresse_ID != '' %}
-  <div class="col-4">
-    <table class="table table-sm">
-      <tr>
-        <th colspan="2">Versicherung</th>
-      </tr>
-      <tr>
-        <td><strong>Name:</strong></td>
-        <td>{{forderung_kopf[0].Vers_Name }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Adresse:</strong></td>
-        <td>{{forderung_kopf[0].Vers_Adresse }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>PLZ / Ort:</strong></td>
-        <td>{{forderung_kopf[0].Vers_PLZ }} {{forderung_kopf[0].Vers_Ort }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Telefon:</strong></td>
-        <td>{{forderung_kopf[0].Vers_Telefon }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Telefax:</strong></td>
-        <td>{{forderung_kopf[0].Vers_Telefax }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Webseite:</strong></td>
-        <td><a href="{{forderung_kopf[0].Vers_Web }}" hx-disable="true" target="_blank">{{forderung_kopf[0].Vers_Web }}</a></td>
-      </tr>
-
-      <tr>
-        <td><strong>Vers_Email:</strong></td>
-        <td><a href="mailto:{{forderung_kopf[0].Vers_Email }}?subject={{forderung_kopf[0].Document_No }}" hx-disable="true">{{forderung_kopf[0].Vers_Email }}</a></td>
-      </tr>
-    </table>
-  </div>
-{% endif %}
-
-
-  <div class="col-4">
-    <table class="table table-sm">
-      <tr>
-        <th colspan="2">Fahrzeug</th>
-      </tr>
-      <tr>
-        <td><strong>VIN:</strong></td>
-        <td>{{forderung_kopf[0].Fahrzeug_VIN }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Marke:</strong></td>
-        <td>{{forderung_kopf[0].Fahrzeug_Marke_Nr }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Modell:</strong></td>
-        <td>{{forderung_kopf[0].Fahrzeug_Modell_Nr }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Modell Name:</strong></td>
-        <td>{{forderung_kopf[0].Fahrzeug_Modell_Name }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Kategoriecode:</strong></td>
-        <td>{{forderung_kopf[0].Fahrzeug_Kategoriecode }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Halter:</strong></td>
-        <td>{{forderung_kopf[0].Fahrzeug_Kunde_Nr }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Kennzeichen:</strong></td>
-        <td>{{forderung_kopf[0].Fahrzeug_Kennzeichen }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>KM-Stand:</strong></td>
-        <td>{{forderung_kopf[0].Fahrzeug_Kmstand }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Antriebsart:</strong></td>
-        <td>{{forderung_kopf[0].Fahrzeug_Antriebsart }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Erstzulassung:</strong></td>
-        <td>{{forderung_kopf[0].Fahrzeug_Erstzulassung|date_format }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Kaufdatum:</strong></td>
-        <td>{{forderung_kopf[0].Fahrzeug_Kaufdatum|date_format }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Fahrzeug_Vorbesitzer_Anzahl:</strong></td>
-        <td>{{forderung_kopf[0].Fahrzeug_Vorbesitzer_Anzahl }}</td>
-      </tr>
-
-      <tr>
-        <td><strong>Vorbesitzer:</strong></td>
-        <td>{{forderung_kopf[0].Fahrzeug_Vorbesitzer_Kunde_Nr }}</td>
-      </tr>
-    </table>
-  </div>
-</div>
-<!--
-
-<h3>Kommentare</h3>
-
-<table class="table table-striped table-bordered">
-  <thead>
-    <tr>
-      <th>Timestamp</th>
-      <th>Name</th>
-      <th>Rolle</th>
-      <th>Kommentar</th>
-    </tr>
-  </thead>
-  <tbody>
-    {% for row in forderung_kommentar %}
-    <tr>
-      <td>{{ row.Timestamp|date_format }}</td>
-      <td>{{ row.Name }}</td>
-      <td>{{ row.Rolle }}</td>
-      <td>{{ row.Kommentar or '' }}</td>
-    </tr>
-    {% endfor %}
-  </tbody>
-</table>
-
--->
+{%include 'forderungen/details/details_kommentare.html' %}
 
 <br>
 <br>
@@ -360,191 +23,9 @@
 </div>
 
 <div class="col-6">
-<form class="row g-3">
-  <div class="col-12">
-    <div class="form-check" data-coreui-toggle="collapse" data-coreui-target="#VersicherungCollapse"
-      aria-expanded="{{ forderung_kopf[0].Versicherung|truefalse }}" aria-controls="VersicherungCollapse">
-      <input class="form-check-input" type="checkbox" name="Versicherung" id="Versicherung" {{ forderung_kopf[0].Versicherung|checked }}>
-      <label class="form-check-label" for="Versicherung">
-        <strong>Versicherungsfall</strong>
-      </label>
-    </div>
-  </div>
-
-  <div class="collapse {{ forderung_kopf[0].Versicherung|show }}" id="VersicherungCollapse">
-    <div class="card card-body">
-      <div class="row mb-3">
-        <label for="Versicherung_Name" class="col-sm-2 col-form-label">Versicherung</label>
-        <div class="col-sm-3">
-          <select id="Versicherung_Name" name="Vers_Adresse_ID" class="form-select">
-            <option value="" selected>-</option>
-            {% for v in versicherungen %}
-            {% if v.Vers_Adresse_ID == forderung_kopf[0].Vers_Adresse_ID %}
-            <option value="{{ v.Vers_Adresse_ID }}" selected>{{ v.Vers_Name }}</option>
-            {% else %}
-            <option value="{{ v.Vers_Adresse_ID }}">{{ v.Vers_Name }}</option>
-            {% endif %}
-            {% endfor %}
-          </select>
-        </div>
-        <div class="col-sm-3">
-          <select id="Versicherung_Typ" name="Versicherung_Typ" class="form-select">
-            <option value="" selected>-</option>
-            {% for v in ('Haftpflicht', 'Teilkasko', 'Vollkasko', 'Ausländisch') %}
-            {% if v == forderung_kopf[0].Versicherung_Typ %}
-            <option value="{{ v }}" selected>{{ v }}</option>
-            {% else %}
-            <option value="{{ v }}">{{ v }}</option>
-            {% endif %}
-            {% endfor %}
-
-          </select>
-        </div>
-      </div>
-      <div class="row mb-3">
-        <label for="Selbstbeteiligung" class="col-sm-2 col-form-label">Selbstbeteiligung</label>
-        <div class="col-sm-2">
-          <select id="Selbstbeteiligung" name="Selbstbeteiligung" class="form-select">
-            <option value="" {{ (forderung_kopf[0].Selbstbeteiligung=="" )|selected }}>-</option>
-            <option {{ (forderung_kopf[0].Selbstbeteiligung=="Versicherung" )|selected }}>Versicherung</option>
-            <option {{ (forderung_kopf[0].Selbstbeteiligung=="Kunde" )|selected }}>Kunde</option>
-            <option {{ (forderung_kopf[0].Selbstbeteiligung=="Autohaus" )|selected }}>Autohaus</option>
-          </select>
-        </div>
-        <div class="col-sm-2">
-          <input type="text" class="form-control" id="Selbstbeteiligung_Betrag" name="Selbstbeteiligung_Betrag" placeholder="Betrag" value="{{ forderung_kopf[0].Selbstbeteiligung_Betrag }}">
-        </div>
-      </div>
-      <div class="row mb-3">
-        <label for="MwSt" class="col-sm-2 col-form-label">MwSt</label>
-        <div class="col-sm-2">
-          <select id="MwSt" name="Mwst" class="form-select">
-            <option value="" {{ (forderung_kopf[0].MwSt=="" )|selected }}>-</option>
-            <option {{ (forderung_kopf[0].Mwst=="Versicherung" )|selected }}>Versicherung</option>
-            <option {{ (forderung_kopf[0].Mwst=="Kunde" )|selected }}>Kunde</option>
-            <option {{ (forderung_kopf[0].Mwst=="Autohaus" )|selected }}>Autohaus</option>
-          </select>
-        </div>
-        <div class="col-sm-2">
-          <input type="text" class="form-control" id="Mwst_Betrag" name="Mwst_Betrag" placeholder="Betrag" value="{{ forderung_kopf[0].Mwst_Betrag|number_format }}">
-        </div>
-        <div class="col-sm-2">
-          <a class="btn btn-primary" hx-disable="true"
-            onclick="document.getElementById('Mwst_Betrag').value='{{ forderung_kopf[0].Mwst_Betrag_berechnet|number_format }}';">
-            <i class="cil-arrow-thick-left"></i>
-            {{ forderung_kopf[0].Mwst_Betrag_berechnet|number_format }}</a>
-        </div>
-      </div>
-      <div class="col-3">
-        <a class="btn btn-secondary" hx-disable="true"
-          href="/app/forderungen/export/{{forderung_kopf[0].Client_DB}}_{{forderung_kopf[0].Document_No}}">Mahnung
-          erstellen</a>
-      </div>
-
-    </div>
-  </div>
-
-  <div class="col-12">
-    <div class="form-check" data-coreui-toggle="collapse" data-coreui-target="#ReklamationCollapse"
-      aria-expanded="{{ forderung_kopf[0].Reklamation|truefalse }}" aria-controls="ReklamationCollapse">
-      <input class="form-check-input" type="checkbox" id="Reklamation" name="Reklamation" {{ forderung_kopf[0].Reklamation|checked }}>
-      <label class="form-check-label" for="Reklamation">
-        <strong>Reklamation</strong>
-      </label>
-    </div>
-  </div>
-
-  <div class="collapse {{ forderung_kopf[0].Reklamation|show }}" id="ReklamationCollapse">
-    <div class="card card-body">
-      <div class="row mb-3">
-        <label for="Reklamation_Begruendung" class="col-sm-2 col-form-label">Begründung</label>
-        <div class="col-sm-3">
-          <input type="text" class="form-control" id="Reklamation_Begruendung" name="Reklamation_Begruendung" value="{{ forderung_kopf[0].Reklamation_Begruendung }}">
-        </div>
-      </div>
-    </div>
-  </div>
-
-  <div class="col-12">
-    <div class="form-check" data-coreui-toggle="collapse" data-coreui-target="#RechtsanwaltCollapse"
-      aria-expanded="{{ forderung_kopf[0].Rechtsanwalt|truefalse }}" aria-controls="RechtsanwaltCollapse">
-      <input class="form-check-input" type="checkbox" id="Rechtsanwalt" name="Rechtsanwalt" {{ forderung_kopf[0].Rechtsanwalt|checked }}>
-      <label class="form-check-label" for="Rechtsanwalt">
-        <strong>Rechtsanwalt</strong>
-      </label>
-    </div>
-  </div>
-
-
-
-  <div class="collapse {{ forderung_kopf[0].Rechtsanwalt|show }}" id="RechtsanwaltCollapse">
-    <div class="card card-body">
-      <div class="row mb-3">
-        <label for="Rechtsanwalt_Begruendung" class="col-sm-2 col-form-label">Begründung</label>
-        <div class="col-sm-3">
-          <input type="text" class="form-control" id="Rechtsanwalt_Begruendung" name="Rechtsanwalt_Begruendung" value="{{ forderung_kopf[0].Rechtsanwalt_Begruendung }}">
-        </div>
-      </div>
-      <div class="row mb-3">
-        <label for="Rechtsanwalt_Aktenzeichen" class="col-sm-2 col-form-label">Aktenzeichen</label>
-        <div class="col-sm-3">
-          <input type="text" class="form-control" id="Rechtsanwalt_Aktenzeichen" name="Rechtsanwalt_Aktenzeichen" value="{{ forderung_kopf[0].Rechtsanwalt_Aktenzeichen }}">
-        </div>
-      </div>
-      <div class="row mb-3">
-        <label for="Rechtsanwalt_Stand" class="col-sm-2 col-form-label">Aktueller Stand</label>
-        <div class="col-sm-3">
-          <input type="text" class="form-control" id="Rechtsanwalt_Stand" name="Rechtsanwalt_Stand" value="{{ forderung_kopf[0].Rechtsanwalt_Stand }}">
-        </div>
-      </div>
-      <div class="col-3">
-        <a class="btn btn-secondary" hx-disable="true"
-          href="/app/forderungen/export/{{forderung_kopf[0].Client_DB}}_{{forderung_kopf[0].Document_No}}">Beitreibungsauftrag</a>
-      </div>
-    </div>
-  </div>
-
 
-  <div class="col-12">
-    <div class="form-check" data-coreui-toggle="collapse" data-coreui-target="#MahnenCollapse"
-      aria-expanded="{{ forderung_kopf[0].Mahnen_aussetzen|truefalse }}" aria-controls="MahnenCollapse">
-      <input class="form-check-input" type="checkbox" id="Mahnen" name="Mahnen_aussetzen" {{ forderung_kopf[0].Mahnen_aussetzen|checked }}>
-      <label class="form-check-label" for="Mahnen">
-        <strong>Mahnlauf aussetzen</strong>
-      </label>
-    </div>
-  </div>
+{%include 'forderungen/details/details_formular.html' %}
 
-  <div class="collapse {{ forderung_kopf[0].Mahnen_aussetzen|show }}" id="MahnenCollapse">
-    <div class="card card-body">
-      <div class="row mb-3">
-        <label for="Mahnen_Begründung" class="col-sm-2 col-form-label">Begründung</label>
-        <div class="col-sm-3">
-
-          <input type="text" class="form-control" id="Mahnen_Begruendung" name="Mahnen_Begruendung" value="{{ forderung_kopf[0].Mahnen_Begruendung }}">
-        </div>
-      </div>
-    </div>
-  </div>
-
-  <div class="col-3">
-    <label for="Wiedervorlage" class="form-label">Wiedervorlage</label>
-    <input type="date" class="form-control" id="Wiedervorlage" name="Wiedervorlage"
-      value="{{ forderung_kopf[0].Wiedervorlage.strftime("%Y-%m-%d") }}">
-  </div>
-  <div class="col-2">
-    <a class="btn btn-primary" 
-    onclick="document.getElementById('Wiedervorlage').value='{{ add7days.strftime("%Y-%m-%d") }}';" hx-disable="true">
-      +7 Tage
-  </a>
-  </div>
-
-  <div class="col-12">
-    <button class="btn btn-primary" hx-post=""    hx-trigger="click"    hx-swap="none" hx-push-url="false"  >Speichern</button>
-  </div>
-
-
-</form>
 </div>
 </div>
 <br>
@@ -561,26 +42,12 @@
     <div id="flush-collapseOne" class="accordion-collapse collapse" data-coreui-parent="#accordionFlushExample">
       <div class="accordion-body">
 
-        <table class="table table-striped table-bordered">
-          <thead>
-            <tr>
-              <th>Datum</th>
-              <th>Dateiname</th>
-            </tr>
-          </thead>
-          <tbody>
-            {% for row in files %}
-            <tr>
-              <td></td>
-              <td><a href="/files/?name={{ row }}" hx-disable="true">{{ row }}</a></td>
-            </tr>
-            {% endfor %}
-          </tbody>
-        </table>
+        {%include 'forderungen/details/details_dateien.html' %}
 
       </div>
     </div>
   </div>
+
   <div class="accordion-item">
     <h2 class="accordion-header">
       <button class="accordion-button collapsed" type="button" data-coreui-toggle="collapse"
@@ -591,35 +58,7 @@
     <div id="flush-collapseTwo" class="accordion-collapse collapse" data-coreui-parent="#accordionFlushExample">
       <div class="accordion-body">
 
-
-
-        <table class="table table-striped table-bordered">
-          <div>
-            <!--
-          {% for row in forderung_kopf %}
-
-            {% for key, value in row._asdict().items() %}
-            <tr>
-              <td><strong>{{ key }}:</strong></td>
-              <td>{{ '{{' }}forderung_kopf[0].{{ key }} {{ '}}' }}</td>
-            </tr>
-            {% endfor %}
-            {% endfor %}
-          -->
-          </div>
-          <tbody>
-            {% for row in forderung_kopf %}
-
-            {% for key, value in row._asdict().items() %}
-            <tr>
-              <th>{{ key }}</th>
-              <td>{{ value }}</td>
-            </tr>
-            {% endfor %}
-            {% endfor %}
-          </tbody>
-        </table>
-
+        {%include 'forderungen/details/details_rohdaten.html' %}
 
       </div>
     </div>
@@ -634,37 +73,7 @@
     <div id="flush-collapseThree" class="accordion-collapse collapse" data-coreui-parent="#accordionFlushExample">
       <div class="accordion-body">
 
-        <table class="table table-striped table-bordered">
-          <thead>
-            <tr>
-              <th>Kunde_Nr</th>
-              <th>Mahnung_Nr</th>
-              <th>Mahndatum</th>
-              <th>Mahnstufe</th>
-              <th>Rechnung_Nr</th>
-              <th>Rechnung_Datum</th>
-              <th>Betrag</th>
-              <th>Offen</th>
-            </tr>
-          </thead>
-          <tbody>
-            {% for row in forderung_mahnung %}
-            <tr>
-              <td>{{ row.Kunde_Nr }}</td>
-              <td>{{ row.Mahnung_Nr }}</td>
-              <td>{{ row.Mahndatum|date_format }}</td>
-              <td>{{ row.Mahnstufe }}</td>
-              <td>{{ row.Rechnung_Nr }}</td>
-              <td>{{ row.Rechnung_Datum|date_format }}</td>
-              <td class="text-end">{{ row.Betrag|number_format }}</td>
-              <td class="text-end">{{ row.Offen|number_format }}</td>
-            </tr>
-            {% endfor %}
-          </tbody>
-        </table>
-
-
-
+        {%include 'forderungen/details/details_mahnungen.html' %}
 
       </div>
     </div>
@@ -681,22 +90,8 @@
     <div id="flush-collapseFour" class="accordion-collapse collapse" data-coreui-parent="#accordionFlushExample">
       <div class="accordion-body">
 
-        <table class="table table-bordered">
-          <thead>
-            <tr>
-              <th>Auftrag_Position</th>
-              <th>Betrag</th>
-            </tr>
-          </thead>
-          <tbody>
-            {% for row in auftrag_positionen %}
-            <tr>
-              <td>{{ row.Auftrag_Position }}</td>
-              <td class="text-end">{{ row.Betrag|number_format }}</td>
-            </tr>
-            {% endfor %}
-          </tbody>
-        </table>
+        {%include 'forderungen/details/details_positionen.html' %}
+        
       </div>
     </div>
   </div>
@@ -712,35 +107,7 @@
     <div id="flush-collapseFive" class="accordion-collapse collapse" data-coreui-parent="#accordionFlushExample">
       <div class="accordion-body">
 
-        <table class="table table-striped table-bordered">
-          <thead>
-            <tr>
-              <th>Fahrzeug</th>
-              <th>Rechnungsnr.</th>
-              <th>Rechnungsdatum</th>
-              <th>Beschreibung</th>
-              <th>Betrag</th>
-              <th>Offen</th>
-              <th>Benutzer</th>
-            </tr>
-          </thead>
-          <tbody>
-            {% for row in forderung_belege %}
-            <tr>
-              <td>{{ row.Fahrzeug_Nr }}</td>
-              <td>{{ row.Beleg_Nr }}</td>
-              <td>{{ row.Beleg_Datum|date_format }}</td>
-              <td>{{ row.Beleg_Beschreibung }}</td>
-              <td class="text-end">{{ row.Betrag|number_format }}</td>
-              <td>{{ row.Status }}</td>
-              <td>{{ row.Benutzer }}</td>
-            </tr>
-            {% endfor %}
-          </tbody>
-        </table>
-
-
-
+        {%include 'forderungen/details/details_buchungen.html' %}
 
       </div>
     </div>

+ 26 - 0
templates/forderungen/details/details_buchungen.html

@@ -0,0 +1,26 @@
+<table class="table table-striped table-bordered">
+    <thead>
+        <tr>
+            <th>Fahrzeug</th>
+            <th>Rechnungsnr.</th>
+            <th>Rechnungsdatum</th>
+            <th>Beschreibung</th>
+            <th>Betrag</th>
+            <th>Offen</th>
+            <th>Benutzer</th>
+        </tr>
+    </thead>
+    <tbody>
+        {% for row in forderung_belege %}
+        <tr>
+            <td>{{ row.Fahrzeug_Nr }}</td>
+            <td>{{ row.Beleg_Nr }}</td>
+            <td>{{ row.Beleg_Datum|date_format }}</td>
+            <td>{{ row.Beleg_Beschreibung }}</td>
+            <td class="text-end">{{ row.Betrag|number_format }}</td>
+            <td>{{ row.Status }}</td>
+            <td>{{ row.Benutzer }}</td>
+        </tr>
+        {% endfor %}
+    </tbody>
+</table>

+ 16 - 0
templates/forderungen/details/details_dateien.html

@@ -0,0 +1,16 @@
+<table class="table table-striped table-bordered">
+    <thead>
+        <tr>
+            <th>Datum</th>
+            <th>Dateiname</th>
+        </tr>
+    </thead>
+    <tbody>
+        {% for row in files %}
+        <tr>
+            <td></td>
+            <td><a href="/files/?name={{ row }}" hx-disable="true">{{ row }}</a></td>
+        </tr>
+        {% endfor %}
+    </tbody>
+</table>

+ 185 - 0
templates/forderungen/details/details_formular.html

@@ -0,0 +1,185 @@
+<form class="row g-3">
+  <div class="col-12">
+    <div class="form-check" data-coreui-toggle="collapse" data-coreui-target="#VersicherungCollapse"
+      aria-expanded="{{ forderung_kopf[0].Versicherung|truefalse }}" aria-controls="VersicherungCollapse">
+      <input class="form-check-input" type="checkbox" name="Versicherung" id="Versicherung" {{ forderung_kopf[0].Versicherung|checked }}>
+      <label class="form-check-label" for="Versicherung">
+        <strong>Versicherungsfall</strong>
+      </label>
+    </div>
+  </div>
+
+  <div class="collapse {{ forderung_kopf[0].Versicherung|show }}" id="VersicherungCollapse">
+    <div class="card card-body">
+      <div class="row mb-3">
+        <label for="Versicherung_Name" class="col-sm-2 col-form-label">Versicherung</label>
+        <div class="col-sm-3">
+          <select id="Versicherung_Name" name="Vers_Adresse_ID" class="form-select">
+            <option value="" selected>-</option>
+            {% for v in versicherungen %}
+            {% if v.Vers_Adresse_ID == forderung_kopf[0].Vers_Adresse_ID %}
+            <option value="{{ v.Vers_Adresse_ID }}" selected>{{ v.Vers_Name }}</option>
+            {% else %}
+            <option value="{{ v.Vers_Adresse_ID }}">{{ v.Vers_Name }}</option>
+            {% endif %}
+            {% endfor %}
+          </select>
+        </div>
+        <div class="col-sm-3">
+          <select id="Versicherung_Typ" name="Versicherung_Typ" class="form-select">
+            <option value="" selected>-</option>
+            {% for v in ('Haftpflicht', 'Teilkasko', 'Vollkasko', 'Ausländisch') %}
+            {% if v == forderung_kopf[0].Versicherung_Typ %}
+            <option value="{{ v }}" selected>{{ v }}</option>
+            {% else %}
+            <option value="{{ v }}">{{ v }}</option>
+            {% endif %}
+            {% endfor %}
+
+          </select>
+        </div>
+      </div>
+      <div class="row mb-3">
+        <label for="Selbstbeteiligung" class="col-sm-2 col-form-label">Selbstbeteiligung</label>
+        <div class="col-sm-2">
+          <select id="Selbstbeteiligung" name="Selbstbeteiligung" class="form-select">
+            <option value="" {{ (forderung_kopf[0].Selbstbeteiligung=="" )|selected }}>-</option>
+            <option {{ (forderung_kopf[0].Selbstbeteiligung=="Versicherung" )|selected }}>Versicherung</option>
+            <option {{ (forderung_kopf[0].Selbstbeteiligung=="Kunde" )|selected }}>Kunde</option>
+            <option {{ (forderung_kopf[0].Selbstbeteiligung=="Autohaus" )|selected }}>Autohaus</option>
+          </select>
+        </div>
+        <div class="col-sm-2">
+          <input type="text" class="form-control" id="Selbstbeteiligung_Betrag" name="Selbstbeteiligung_Betrag" placeholder="Betrag" value="{{ forderung_kopf[0].Selbstbeteiligung_Betrag }}">
+        </div>
+      </div>
+      <div class="row mb-3">
+        <label for="MwSt" class="col-sm-2 col-form-label">MwSt</label>
+        <div class="col-sm-2">
+          <select id="MwSt" name="Mwst" class="form-select">
+            <option value="" {{ (forderung_kopf[0].MwSt=="" )|selected }}>-</option>
+            <option {{ (forderung_kopf[0].Mwst=="Versicherung" )|selected }}>Versicherung</option>
+            <option {{ (forderung_kopf[0].Mwst=="Kunde" )|selected }}>Kunde</option>
+            <option {{ (forderung_kopf[0].Mwst=="Autohaus" )|selected }}>Autohaus</option>
+          </select>
+        </div>
+        <div class="col-sm-2">
+          <input type="text" class="form-control" id="Mwst_Betrag" name="Mwst_Betrag" placeholder="Betrag" value="{{ forderung_kopf[0].Mwst_Betrag|number_format }}">
+        </div>
+        <div class="col-sm-2">
+          <a class="btn btn-primary" hx-disable="true"
+            onclick="document.getElementById('Mwst_Betrag').value='{{ forderung_kopf[0].Mwst_Betrag_berechnet|number_format }}';">
+            <i class="cil-arrow-thick-left"></i>
+            {{ forderung_kopf[0].Mwst_Betrag_berechnet|number_format }}</a>
+        </div>
+      </div>
+      <div class="col-3">
+        <a class="btn btn-secondary" hx-disable="true"
+          href="/app/forderungen/export/{{forderung_kopf[0].Client_DB}}_{{forderung_kopf[0].Document_No}}">Mahnung
+          erstellen</a>
+      </div>
+
+    </div>
+  </div>
+
+  <div class="col-12">
+    <div class="form-check" data-coreui-toggle="collapse" data-coreui-target="#ReklamationCollapse"
+      aria-expanded="{{ forderung_kopf[0].Reklamation|truefalse }}" aria-controls="ReklamationCollapse">
+      <input class="form-check-input" type="checkbox" id="Reklamation" name="Reklamation" {{ forderung_kopf[0].Reklamation|checked }}>
+      <label class="form-check-label" for="Reklamation">
+        <strong>Reklamation</strong>
+      </label>
+    </div>
+  </div>
+
+  <div class="collapse {{ forderung_kopf[0].Reklamation|show }}" id="ReklamationCollapse">
+    <div class="card card-body">
+      <div class="row mb-3">
+        <label for="Reklamation_Begruendung" class="col-sm-2 col-form-label">Begründung</label>
+        <div class="col-sm-3">
+          <input type="text" class="form-control" id="Reklamation_Begruendung" name="Reklamation_Begruendung" value="{{ forderung_kopf[0].Reklamation_Begruendung }}">
+        </div>
+      </div>
+    </div>
+  </div>
+
+  <div class="col-12">
+    <div class="form-check" data-coreui-toggle="collapse" data-coreui-target="#RechtsanwaltCollapse"
+      aria-expanded="{{ forderung_kopf[0].Rechtsanwalt|truefalse }}" aria-controls="RechtsanwaltCollapse">
+      <input class="form-check-input" type="checkbox" id="Rechtsanwalt" name="Rechtsanwalt" {{ forderung_kopf[0].Rechtsanwalt|checked }}>
+      <label class="form-check-label" for="Rechtsanwalt">
+        <strong>Rechtsanwalt</strong>
+      </label>
+    </div>
+  </div>
+
+
+
+  <div class="collapse {{ forderung_kopf[0].Rechtsanwalt|show }}" id="RechtsanwaltCollapse">
+    <div class="card card-body">
+      <div class="row mb-3">
+        <label for="Rechtsanwalt_Begruendung" class="col-sm-2 col-form-label">Begründung</label>
+        <div class="col-sm-3">
+          <input type="text" class="form-control" id="Rechtsanwalt_Begruendung" name="Rechtsanwalt_Begruendung" value="{{ forderung_kopf[0].Rechtsanwalt_Begruendung }}">
+        </div>
+      </div>
+      <div class="row mb-3">
+        <label for="Rechtsanwalt_Aktenzeichen" class="col-sm-2 col-form-label">Aktenzeichen</label>
+        <div class="col-sm-3">
+          <input type="text" class="form-control" id="Rechtsanwalt_Aktenzeichen" name="Rechtsanwalt_Aktenzeichen" value="{{ forderung_kopf[0].Rechtsanwalt_Aktenzeichen }}">
+        </div>
+      </div>
+      <div class="row mb-3">
+        <label for="Rechtsanwalt_Stand" class="col-sm-2 col-form-label">Aktueller Stand</label>
+        <div class="col-sm-3">
+          <input type="text" class="form-control" id="Rechtsanwalt_Stand" name="Rechtsanwalt_Stand" value="{{ forderung_kopf[0].Rechtsanwalt_Stand }}">
+        </div>
+      </div>
+      <div class="col-3">
+        <a class="btn btn-secondary" hx-disable="true"
+          href="/app/forderungen/export/{{forderung_kopf[0].Client_DB}}_{{forderung_kopf[0].Document_No}}">Beitreibungsauftrag</a>
+      </div>
+    </div>
+  </div>
+
+
+  <div class="col-12">
+    <div class="form-check" data-coreui-toggle="collapse" data-coreui-target="#MahnenCollapse"
+      aria-expanded="{{ forderung_kopf[0].Mahnen_aussetzen|truefalse }}" aria-controls="MahnenCollapse">
+      <input class="form-check-input" type="checkbox" id="Mahnen" name="Mahnen_aussetzen" {{ forderung_kopf[0].Mahnen_aussetzen|checked }}>
+      <label class="form-check-label" for="Mahnen">
+        <strong>Mahnlauf aussetzen</strong>
+      </label>
+    </div>
+  </div>
+
+  <div class="collapse {{ forderung_kopf[0].Mahnen_aussetzen|show }}" id="MahnenCollapse">
+    <div class="card card-body">
+      <div class="row mb-3">
+        <label for="Mahnen_Begründung" class="col-sm-2 col-form-label">Begründung</label>
+        <div class="col-sm-3">
+
+          <input type="text" class="form-control" id="Mahnen_Begruendung" name="Mahnen_Begruendung" value="{{ forderung_kopf[0].Mahnen_Begruendung }}">
+        </div>
+      </div>
+    </div>
+  </div>
+
+  <div class="col-3">
+    <label for="Wiedervorlage" class="form-label">Wiedervorlage</label>
+    <input type="date" class="form-control" id="Wiedervorlage" name="Wiedervorlage"
+      value="{{ forderung_kopf[0].Wiedervorlage.strftime("%Y-%m-%d") }}">
+  </div>
+  <div class="col-2">
+    <a class="btn btn-primary" 
+    onclick="document.getElementById('Wiedervorlage').value='{{ add7days.strftime("%Y-%m-%d") }}';" hx-disable="true">
+      +7 Tage
+  </a>
+  </div>
+
+  <div class="col-12">
+    <button class="btn btn-primary" hx-post=""    hx-trigger="click"    hx-swap="none" hx-push-url="false"  >Speichern</button>
+  </div>
+
+
+</form>

+ 27 - 0
templates/forderungen/details/details_kommentare.html

@@ -0,0 +1,27 @@
+<!--
+<br>
+<br>
+<h3>Kommentare</h3>
+
+<table class="table table-striped table-bordered">
+  <thead>
+    <tr>
+      <th>Timestamp</th>
+      <th>Name</th>
+      <th>Rolle</th>
+      <th>Kommentar</th>
+    </tr>
+  </thead>
+  <tbody>
+    {% for row in forderung_kommentar %}
+    <tr>
+      <td>{{ row.Timestamp|date_format }}</td>
+      <td>{{ row.Name }}</td>
+      <td>{{ row.Rolle }}</td>
+      <td>{{ row.Kommentar or '' }}</td>
+    </tr>
+    {% endfor %}
+  </tbody>
+</table>
+
+-->

+ 28 - 0
templates/forderungen/details/details_mahnungen.html

@@ -0,0 +1,28 @@
+<table class="table table-striped table-bordered">
+    <thead>
+        <tr>
+            <th>Kunde_Nr</th>
+            <th>Mahnung_Nr</th>
+            <th>Mahndatum</th>
+            <th>Mahnstufe</th>
+            <th>Rechnung_Nr</th>
+            <th>Rechnung_Datum</th>
+            <th>Betrag</th>
+            <th>Offen</th>
+        </tr>
+    </thead>
+    <tbody>
+        {% for row in forderung_mahnung %}
+        <tr>
+            <td>{{ row.Kunde_Nr }}</td>
+            <td>{{ row.Mahnung_Nr }}</td>
+            <td>{{ row.Mahndatum|date_format }}</td>
+            <td>{{ row.Mahnstufe }}</td>
+            <td>{{ row.Rechnung_Nr }}</td>
+            <td>{{ row.Rechnung_Datum|date_format }}</td>
+            <td class="text-end">{{ row.Betrag|number_format }}</td>
+            <td class="text-end">{{ row.Offen|number_format }}</td>
+        </tr>
+        {% endfor %}
+    </tbody>
+</table>

+ 16 - 0
templates/forderungen/details/details_positionen.html

@@ -0,0 +1,16 @@
+<table class="table table-bordered">
+    <thead>
+        <tr>
+            <th>Auftrag_Position</th>
+            <th>Betrag</th>
+        </tr>
+    </thead>
+    <tbody>
+        {% for row in auftrag_positionen %}
+        <tr>
+            <td>{{ row.Auftrag_Position }}</td>
+            <td class="text-end">{{ row.Betrag|number_format }}</td>
+        </tr>
+        {% endfor %}
+    </tbody>
+</table>

+ 26 - 0
templates/forderungen/details/details_rohdaten.html

@@ -0,0 +1,26 @@
+<table class="table table-striped table-bordered">
+    <div>
+        <!--
+          {% for row in forderung_kopf %}
+
+            {% for key, value in row._asdict().items() %}
+            <tr>
+              <td><strong>{{ key }}:</strong></td>
+              <td>{{ '{{' }}forderung_kopf[0].{{ key }} {{ '}}' }}</td>
+            </tr>
+            {% endfor %}
+            {% endfor %}
+          -->
+    </div>
+    <tbody>
+        {% for row in forderung_kopf %}
+
+        {% for key, value in row._asdict().items() %}
+        <tr>
+            <th>{{ key }}</th>
+            <td>{{ value }}</td>
+        </tr>
+        {% endfor %}
+        {% endfor %}
+    </tbody>
+</table>

+ 316 - 0
templates/forderungen/details/details_uebersicht.html

@@ -0,0 +1,316 @@
+
+<div class="row mb-3">
+  <div class="col-4">
+    <table class="table table-sm">
+      <tr>
+        <th colspan="2">Grunddaten</th>
+      </tr>
+      <tr>
+        <td><strong>Hauptbetrieb:</strong></td>
+        <td>{{forderung_kopf[0].Hauptbetrieb_Name }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Standort:</strong></td>
+        <td>{{forderung_kopf[0].Standort_Name }}</td>
+      </tr>
+      <tr>
+        <td><strong>Benutzer:</strong></td>
+        <td>{{forderung_kopf[0].User_ID }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Verursacher:</strong></td>
+        <td>{{forderung_kopf[0].Verursacher }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Bereich:</strong></td>
+        <td>{{forderung_kopf[0].Bereich }}</td>
+      </tr>
+
+    </table>
+  </div>
+  <div class="col-4">
+    <table class="table table-sm">
+      <tr>
+        <th colspan="2">Beleg</th>
+      </tr>
+      <tr>
+        <td><strong>Belegart:</strong></td>
+        <td>{{forderung_kopf[0].Rechnung_Gutschrift }}</td>
+      </tr>
+      <tr>
+        <td><strong>Beleg-Nr:</strong></td>
+        <td>{{forderung_kopf[0].Document_No }}</td>
+      </tr>
+      <tr>
+        <td><strong>Betrag:</strong></td>
+        <td>{{forderung_kopf[0].offen|number_format }} &euro;</td>
+      </tr>
+      <tr>
+        <td><strong>Rechnungsdatum:</strong></td>
+        <td>{{forderung_kopf[0].Invoice_Date|date_format }}</td>
+      </tr>            
+      <tr>
+        <td><strong>Lieferdatum:</strong></td>
+        <td>{{forderung_kopf[0].Invoice_Date|date_format }}</td>
+      </tr>
+      <tr>
+        <td><strong>Fälligkeitsdatum:</strong></td>
+        <td>{{forderung_kopf[0].Invoice_Date|date_format }}</td>
+      </tr>
+
+
+
+    </table>
+  </div>
+  <div class="col-4">
+    <table class="table table-sm">
+      <tr>
+        <th colspan="2">Forderung</th>
+      </tr>
+      <tr>
+        <td><strong>offen:</strong></td>
+        <td>{{forderung_kopf[0].offen|number_format }} &euro;</td>
+      </tr>
+
+      <tr>
+        <td><strong>offen (Kunde gesamt):</strong></td>
+        <td>{{forderung_kopf[0].offen_Kunde_gesamt|number_format }} &euro;</td>
+      </tr>
+
+      <tr>
+        <td><strong>Tage:</strong></td>
+        <td>{{forderung_kopf[0].Tage }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Staffel:</strong></td>
+        <td>{{forderung_kopf[0].Staffel }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Mahnstufe:</strong></td>
+        <td>{{forderung_kopf[0].Mahnstufe }}</td>
+      </tr>
+    </table>
+  </div>
+
+
+  <div class="col-4">
+    <table class="table table-sm">
+      <tr>
+        <th colspan="2">Kunde</th>
+      </tr>
+
+      <tr>
+        <td><strong>Kunden-Nr:</strong></td>
+        <td>{{forderung_kopf[0].Kunde_Nr }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Name:</strong></td>
+        <td>{{forderung_kopf[0].Kunde_Name }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Adresse:</strong></td>
+        <td>{{forderung_kopf[0].Kunde_Adresse }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>PLZ / Ort:</strong></td>
+        <td>{{forderung_kopf[0].Kunde_PLZ }} {{forderung_kopf[0].Kunde_Ort }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Land:</strong></td>
+        <td>{{forderung_kopf[0].Kunde_Land }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Telefon:</strong></td>
+        <td>{{forderung_kopf[0].Kunde_Telefon }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>E-Mail:</strong></td>
+        <td><a href="mailto:{{forderung_kopf[0].Kunde_Email }}?subject={{forderung_kopf[0].Document_No }}" hx-disable="true">{{forderung_kopf[0].Kunde_Email }}</a></td>
+      </tr>
+
+      <tr>
+        <td><strong>Payment_Terms_Code:</strong></td>
+        <td>{{forderung_kopf[0].Payment_Terms_Code }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Kundengruppe:</strong></td>
+        <td>{{forderung_kopf[0].Customer_Group_Description }}</td>
+      </tr>
+
+    </table>
+  </div>
+{% if forderung_kopf[0].Fahrzeug_Leasing == 'J' %}
+<div class="col-4">
+    <table class="table table-sm">
+      <tr>
+        <th colspan="2">Leasing-Kunde</th>
+      </tr>
+
+      <tr>
+        <td><strong>Kunden-Nr:</strong></td>
+        <td>{{forderung_kopf[0].Leasing_Kunde_Nr }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Name:</strong></td>
+        <td>{{forderung_kopf[0].Leasing_Kunde_Name }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Adresse:</strong></td>
+        <td>{{forderung_kopf[0].Leasing_Kunde_Adresse }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>PLZ / Ort:</strong></td>
+        <td>{{forderung_kopf[0].Leasing_Kunde_PLZ }} {{forderung_kopf[0].Leasing_Kunde_Ort }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Land:</strong></td>
+        <td>{{forderung_kopf[0].Leasing_Kunde_Land }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Telefon:</strong></td>
+        <td>{{forderung_kopf[0].Leasing_Kunde_Telefon }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>E-Mail:</strong></td>
+        <td><a href="mailto:{{forderung_kopf[0].Leasing_Kunde_Email }}?subject={{forderung_kopf[0].Document_No }}" hx-disable="true">{{forderung_kopf[0].Leasing_Kunde_Email }}</a></td>
+      </tr>
+    </table>
+  </div>
+{% endif %}
+
+
+{% if forderung_kopf[0].Versicherung == 'J' and forderung_kopf[0].Vers_Adresse_ID != '' %}
+  <div class="col-4">
+    <table class="table table-sm">
+      <tr>
+        <th colspan="2">Versicherung</th>
+      </tr>
+      <tr>
+        <td><strong>Name:</strong></td>
+        <td>{{forderung_kopf[0].Vers_Name }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Adresse:</strong></td>
+        <td>{{forderung_kopf[0].Vers_Adresse }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>PLZ / Ort:</strong></td>
+        <td>{{forderung_kopf[0].Vers_PLZ }} {{forderung_kopf[0].Vers_Ort }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Telefon:</strong></td>
+        <td>{{forderung_kopf[0].Vers_Telefon }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Telefax:</strong></td>
+        <td>{{forderung_kopf[0].Vers_Telefax }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Webseite:</strong></td>
+        <td><a href="{{forderung_kopf[0].Vers_Web }}" hx-disable="true" target="_blank">{{forderung_kopf[0].Vers_Web }}</a></td>
+      </tr>
+
+      <tr>
+        <td><strong>Vers_Email:</strong></td>
+        <td><a href="mailto:{{forderung_kopf[0].Vers_Email }}?subject={{forderung_kopf[0].Document_No }}" hx-disable="true">{{forderung_kopf[0].Vers_Email }}</a></td>
+      </tr>
+    </table>
+  </div>
+{% endif %}
+
+
+  <div class="col-4">
+    <table class="table table-sm">
+      <tr>
+        <th colspan="2">Fahrzeug</th>
+      </tr>
+      <tr>
+        <td><strong>VIN:</strong></td>
+        <td>{{forderung_kopf[0].Fahrzeug_VIN }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Marke:</strong></td>
+        <td>{{forderung_kopf[0].Fahrzeug_Marke_Nr }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Modell:</strong></td>
+        <td>{{forderung_kopf[0].Fahrzeug_Modell_Nr }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Modell Name:</strong></td>
+        <td>{{forderung_kopf[0].Fahrzeug_Modell_Name }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Kategoriecode:</strong></td>
+        <td>{{forderung_kopf[0].Fahrzeug_Kategoriecode }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Halter:</strong></td>
+        <td>{{forderung_kopf[0].Fahrzeug_Kunde_Nr }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Kennzeichen:</strong></td>
+        <td>{{forderung_kopf[0].Fahrzeug_Kennzeichen }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>KM-Stand:</strong></td>
+        <td>{{forderung_kopf[0].Fahrzeug_Kmstand }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Antriebsart:</strong></td>
+        <td>{{forderung_kopf[0].Fahrzeug_Antriebsart }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Erstzulassung:</strong></td>
+        <td>{{forderung_kopf[0].Fahrzeug_Erstzulassung|date_format }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Kaufdatum:</strong></td>
+        <td>{{forderung_kopf[0].Fahrzeug_Kaufdatum|date_format }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Fahrzeug_Vorbesitzer_Anzahl:</strong></td>
+        <td>{{forderung_kopf[0].Fahrzeug_Vorbesitzer_Anzahl }}</td>
+      </tr>
+
+      <tr>
+        <td><strong>Vorbesitzer:</strong></td>
+        <td>{{forderung_kopf[0].Fahrzeug_Vorbesitzer_Kunde_Nr }}</td>
+      </tr>
+    </table>
+  </div>
+</div>