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
+15 -2
View File
@@ -44,11 +44,23 @@
<p><strong>Unterlagen:</strong> {{ item.paperwork_status or 'Offen' }}{% if item.consent_accepted %} | Einwilligung bestätigt{% endif %}</p>
<p><strong>Kontaktdaten:</strong> {{ item.booking_data.get('contact_person', '-') }} | {{ item.booking_data.get('contact_email', '-') }} | {{ item.booking_data.get('billing_city', '-') }}</p>
{% endif %}
<div style="margin: 0.5rem 0; padding: 0.5rem; background: #f4f8fa; border-radius: 8px;">
{% if item.pdf_path %}
<p><strong>PDF:</strong> <a href="{{ url_for('static', filename=item.pdf_path) }}" target="_blank" rel="noopener">Ansehen</a>
<button class="print-btn" type="button" onclick="printPdf('{{ url_for('static', filename=item.pdf_path) }}')">PDF drucken</button>
<p style="margin:0.2rem 0;"><strong>Rechnungs-PDF:</strong>
<a href="{{ url_for('static', filename=item.pdf_path) }}" target="_blank" rel="noopener">Ansehen</a>
</p>
{% endif %}
{% if item.hauptvertrag_data is defined or item.get('hauptvertrag_filename') %}
<p style="margin:0.2rem 0;"><strong>Hauptvertrag (aus MongoDB):</strong>
<a href="{{ url_for('view_hauptvertrag', invoice_id=item.id) }}" target="_blank" rel="noopener">
{{ item.hauptvertrag_filename or 'Hauptvertrag öffnen' }}
</a>
</p>
{% else %}
<p style="margin:0.2rem 0; color: #777;"><strong>Hauptvertrag:</strong> Noch nicht in MongoDB hochgeladen</p>
{% endif %}
</div>
<form method="post" class="inline-form" enctype="multipart/form-data">
<input type="hidden" name="action" value="update">
<input type="hidden" name="invoice_id" value="{{ item.id }}">
@@ -82,6 +94,7 @@
<form method="post" style="display:inline-block; margin-right:0.6rem;">
<input type="hidden" name="action" value="create_from_provision">
<input type="hidden" name="prov_id" value="{{ prov.id }}">
<input type="file" name="contract_file" accept=".pdf,.png,.jpg,.jpeg,.webp">
<input type="text" name="period" placeholder="Zeitraum (optional)">
<input type="text" name="due_date" placeholder="Fälligkeit (YYYY-MM-DD)">
<button type="submit">Rechnung erzeugen</button>