implementation of the upload

This commit is contained in:
2026-08-28 14:13:36 +02:00
parent 46478d5d1f
commit 9d600bc33a
3 changed files with 124 additions and 27 deletions
+17 -13
View File
@@ -6,7 +6,7 @@
<section class="panel" style="display:flex; align-items:center; justify-content:space-between; gap:1rem;">
<div>
<h1>Rechnungseinsicht</h1>
<p style="margin:0">Alle Rechnungen im Überblick. Der Admin prüft neue Rechnungen zuerst; der Status zeigt dir, ob die Rechnung noch geprüft wird oder bereits bearbeitet wurde.</p>
<p style="margin:0">Alle Rechnungen im Überblick.</p>
</div>
<div class="no-print">
<button class="print-btn" type="button" onclick="printDocument()">Seite drucken</button>
@@ -22,7 +22,8 @@
<th>Betrag</th>
<th>Fälligkeit</th>
<th>Status</th>
<th>PDF</th>
<th>Rechnung PDF</th>
<th>Hauptvertrag</th>
</tr>
</thead>
<tbody>
@@ -36,26 +37,29 @@
<td>
{% if invoice.pdf_path %}
<a href="{{ url_for('static', filename=invoice.pdf_path) }}" target="_blank" rel="noopener">PDF ansehen</a>
<button class="print-btn" type="button" onclick="printPdf('{{ url_for('static', filename=invoice.pdf_path) }}')">PDF drucken</button>
{% else %}
-
{% endif %}
</td>
<td>
{% if invoice.has_hauptvertrag %}
<a href="{{ url_for('view_hauptvertrag', invoice_id=invoice.id) }}" target="_blank" rel="noopener">Hauptvertrag ansehen</a>
{% else %}
<form method="post" enctype="multipart/form-data" style="display:flex; gap:0.3rem; align-items:center;">
<input type="hidden" name="action" value="upload_hauptvertrag">
<input type="hidden" name="invoice_id" value="{{ invoice.id }}">
<input type="file" name="hauptvertrag_file" accept="image/*,application/pdf" required style="font-size:0.8rem;">
<button type="submit" style="padding: 0.2rem 0.6rem; font-size:0.8rem;">Hochladen</button>
</form>
{% endif %}
</td>
</tr>
{% else %}
<tr>
<td colspan="6">Noch keine Rechnungen vorhanden.</td>
<td colspan="7">Noch keine Rechnungen vorhanden.</td>
</tr>
{% endfor %}
</tbody>
</table>
</section>
<style>
.panel { margin-bottom: 1rem; }
.table-wrap { background: #fff; border: 1px solid #d8e1e8; border-radius: 14px; padding: 1rem; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.7rem; border-bottom: 1px solid #e8eef2; }
a { color: #0a4c74; font-weight: 700; }
</style>
{% endblock %}
{% endblock %}