This commit is contained in:
2026-01-30 22:24:36 +01:00
parent 3d02fd56ea
commit c6421049c8
6 changed files with 78 additions and 47 deletions

View File

@@ -24,7 +24,7 @@
<% }); %>
</select>
<% } %>
<a href="/logout" class="btn btn-secondary">Abmelden</a>
<a href="/logout" class="btn btn-logout">Abmelden</a>
</div>
</div>
</div>

View File

@@ -25,7 +25,7 @@
<% }); %>
</select>
<% } %>
<a href="/logout" class="btn btn-secondary">Abmelden</a>
<a href="/logout" class="btn btn-logout">Abmelden</a>
</div>
</div>
</div>

View File

@@ -98,6 +98,12 @@
font-weight: 600;
color: #2c3e50;
}
.summary-value.overtime-positive {
color: #27ae60 !important;
}
.summary-value.overtime-negative {
color: #e74c3c !important;
}
</style>
</head>
<body>
@@ -117,7 +123,7 @@
<% }); %>
</select>
<% } %>
<a href="/logout" class="btn btn-secondary">Abmelden</a>
<a href="/logout" class="btn btn-logout">Abmelden</a>
</div>
</div>
</div>
@@ -142,6 +148,10 @@
<span class="summary-label">Verbleibend:</span>
<span class="summary-value" id="remainingOvertime">-</span>
</div>
<div class="summary-item" id="offsetItem" style="display: none;">
<span class="summary-label">Manuelle Korrektur (Verwaltung):</span>
<span class="summary-value" id="overtimeOffset">-</span>
</div>
</div>
<div id="loading" class="loading">Lade Daten...</div>
@@ -231,17 +241,38 @@
totalOvertime += week.overtime_hours;
totalOvertimeTaken += week.overtime_taken;
});
const remainingOvertime = totalOvertime - totalOvertimeTaken + (data.overtime_offset_hours || 0);
const overtimeOffset = data.overtime_offset_hours || 0;
const remainingOvertime = totalOvertime - totalOvertimeTaken + overtimeOffset;
// Zusammenfassung anzeigen
document.getElementById('totalOvertime').textContent =
const totalOvertimeEl = document.getElementById('totalOvertime');
totalOvertimeEl.textContent =
(totalOvertime >= 0 ? '+' : '') + totalOvertime.toFixed(2) + ' h';
document.getElementById('totalOvertimeTaken').textContent =
totalOvertimeEl.className =
'summary-value ' + (totalOvertime >= 0 ? 'overtime-positive' : 'overtime-negative');
const totalOvertimeTakenEl = document.getElementById('totalOvertimeTaken');
totalOvertimeTakenEl.textContent =
totalOvertimeTaken.toFixed(2) + ' h';
document.getElementById('remainingOvertime').textContent =
totalOvertimeTakenEl.className = 'summary-value overtime-positive';
const remainingOvertimeEl = document.getElementById('remainingOvertime');
remainingOvertimeEl.textContent =
(remainingOvertime >= 0 ? '+' : '') + remainingOvertime.toFixed(2) + ' h';
document.getElementById('remainingOvertime').className =
remainingOvertimeEl.className =
'summary-value ' + (remainingOvertime >= 0 ? 'overtime-positive' : 'overtime-negative');
// Manuelle Korrektur anzeigen (nur wenn vorhanden)
const offsetItem = document.getElementById('offsetItem');
const offsetValue = document.getElementById('overtimeOffset');
if (overtimeOffset !== 0) {
offsetValue.textContent = (overtimeOffset >= 0 ? '+' : '') + overtimeOffset.toFixed(2) + ' h';
offsetValue.className = 'summary-value ' + (overtimeOffset >= 0 ? 'overtime-positive' : 'overtime-negative');
offsetItem.style.display = 'flex';
} else {
offsetItem.style.display = 'none';
}
summaryBoxEl.style.display = 'block';
// Tabelle füllen

View File

@@ -24,7 +24,7 @@
<% }); %>
</select>
<% } %>
<a href="/logout" class="btn btn-secondary">Abmelden</a>
<a href="/logout" class="btn btn-logout">Abmelden</a>
</div>
</div>
</div>