Files
Key-service-Server/Website/templates/my_invoices.html
T

292 lines
8.7 KiB
HTML

{% extends "base.html" %}
{% block title %}Meine Rechnungen{% endblock %}
{% block content %}
<div class="invoices-container">
<!-- Header Section -->
<section class="invoice-header">
<div class="header-text">
<h1>Rechnungseinsicht</h1>
<p>Alle Rechnungen und Dokumente auf einen Blick. Der Status zeigt dir den aktuellen Bearbeitungsstand.</p>
</div>
<div class="header-actions no-print">
<button class="btn btn-outline" type="button" onclick="printDocument()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9V2h12v7M6 18H4a2 2 0 01-2-2v-5a2 2 0 012-2h16a2 2 0 012 2v5a2 2 0 01-2 2h-2"/><rect x="6" y="14" width="12" height="8"/></svg>
Seite drucken
</button>
</div>
</section>
<!-- Table Section -->
<section class="table-card">
<div class="table-responsive">
<table class="custom-table">
<thead>
<tr>
<th>Rechnungs-Nr.</th>
<th>Zeitraum</th>
<th>Betrag</th>
<th>Fälligkeit</th>
<th>Status</th>
<th>Rechnung</th>
<th>Hauptvertrag</th>
</tr>
</thead>
<tbody>
{% for invoice in invoices %}
<tr>
<td class="font-semibold">{{ invoice.invoice_number }}</td>
<td>{{ invoice.period }}</td>
<td class="amount-cell">{{ '%.2f'|format(invoice.amount_eur) }} €</td>
<td class="text-muted">{{ invoice.due_date }}</td>
<td>
{% set status_lower = (invoice.status or '')|lower %}
<span class="badge {% if 'bezahlt' in status_lower %}badge-success{% elif 'prüfen' in status_lower %}badge-warning{% else %}badge-info{% endif %}">
{{ invoice.status or 'In Bearbeitung' }}
</span>
</td>
<td>
{% if invoice.pdf_path %}
<div class="action-group">
<a href="{{ url_for('static', filename=invoice.pdf_path) }}" target="_blank" rel="noopener" class="btn btn-link">
Ansehen
</a>
</div>
{% else %}
<span class="text-muted">-</span>
{% endif %}
</td>
<td>
{% if invoice.has_hauptvertrag %}
<a href="{{ url_for('view_hauptvertrag', invoice_id=invoice.id) }}" target="_blank" rel="noopener" class="btn btn-link btn-contract">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>
Vertrag öffnen
</a>
{% else %}
<form method="post" enctype="multipart/form-data" class="upload-inline-form">
<input type="hidden" name="action" value="upload_hauptvertrag">
<input type="hidden" name="invoice_id" value="{{ invoice.id }}">
<label class="file-dropzone">
<input type="file" name="hauptvertrag_file" accept="image/*,application/pdf" required onchange="this.form.submit()">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></svg>
<span>Datei wählen</span>
</label>
</form>
{% endif %}
</td>
</tr>
{% else %}
<tr>
<td colspan="7" class="empty-state">
<svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="#a0aec0" stroke-width="1.5"><rect x="2" y="4" width="20" height="16" rx="2"/><line x1="2" y1="10" x2="22" y2="10"/></svg>
<p>Noch keine Rechnungen vorhanden.</p>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</section>
</div>
<style>
/* Layout & Container */
.invoices-container {
max-width: 1200px;
margin: 0 auto;
display: flex;
flex-direction: column;
gap: 1.5rem;
font-family: inherit;
}
/* Header Styling */
.invoice-header {
background: #ffffff;
border: 1px solid #e2e8f0;
border-radius: 16px;
padding: 1.5rem 2rem;
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
}
.header-text h1 {
margin: 0 0 0.35rem 0;
font-size: 1.5rem;
color: #1a202c;
font-weight: 700;
}
.header-text p {
margin: 0;
color: #718096;
font-size: 0.925rem;
}
/* Table Card */
.table-card {
background: #ffffff;
border: 1px solid #e2e8f0;
border-radius: 16px;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
overflow: hidden;
}
.table-responsive {
overflow-x: auto;
}
.custom-table {
width: 100%;
border-collapse: collapse;
text-align: left;
font-size: 0.925rem;
}
.custom-table th {
background-color: #f8fafc;
color: #475569;
padding: 1rem 1.25rem;
font-weight: 600;
font-size: 0.825rem;
text-transform: uppercase;
letter-spacing: 0.05em;
border-bottom: 1px solid #e2e8f0;
}
.custom-table td {
padding: 1rem 1.25rem;
border-bottom: 1px solid #f1f5f9;
color: #334155;
vertical-align: middle;
}
.custom-table tbody tr:hover {
background-color: #f8fafc;
}
.custom-table tbody tr:last-child td {
border-bottom: none;
}
/* Typography Helpers */
.font-semibold { font-weight: 600; color: #0f172a; }
.amount-cell { font-weight: 700; color: #0f172a; }
.text-muted { color: #94a3b8; font-size: 0.875rem; }
/* Status Badges */
.badge {
display: inline-block;
padding: 0.35rem 0.75rem;
border-radius: 9999px;
font-size: 0.775rem;
font-weight: 600;
line-height: 1;
}
.badge-success { background-color: #dcfce7; color: #15803d; }
.badge-warning { background-color: #fef3c7; color: #b45309; }
.badge-info { background-color: #e0f2fe; color: #0369a1; }
/* Action Buttons & Links */
.btn {
display: inline-flex;
align-items: center;
gap: 0.4rem;
font-weight: 600;
font-size: 0.85rem;
padding: 0.5rem 1rem;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s ease;
border: none;
text-decoration: none;
}
.btn-outline {
background: #ffffff;
border: 1px solid #cbd5e1;
color: #334155;
}
.btn-outline:hover {
background: #f8fafc;
border-color: #94a3b8;
}
.btn-link {
color: #0284c7;
background: #f0f9ff;
padding: 0.4rem 0.75rem;
}
.btn-link:hover {
background: #e0f2fe;
color: #0369a1;
}
.btn-contract {
color: #0f766e;
background: #f0fdf4;
}
.btn-contract:hover {
background: #dcfce7;
color: #115e59;
}
/* Custom Inline File Upload Zone */
.upload-inline-form {
display: inline-block;
}
.file-dropzone {
display: inline-flex;
align-items: center;
gap: 0.4rem;
padding: 0.4rem 0.75rem;
background-color: #f8fafc;
border: 1.5px dashed #cbd5e1;
border-radius: 8px;
color: #475569;
font-size: 0.825rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease;
}
.file-dropzone:hover {
background-color: #f1f5f9;
border-color: #0284c7;
color: #0284c7;
}
.file-dropzone input[type="file"] {
display: none;
}
/* Empty State */
.empty-state {
text-align: center;
padding: 3rem 1rem !important;
}
.empty-state p {
margin: 0.5rem 0 0 0;
color: #94a3b8;
}
/* Mobile Adjustments */
@media (max-width: 768px) {
.invoice-header {
flex-direction: column;
align-items: flex-start;
}
}
</style>
{% endblock %}