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 @@ body {
/* Navbar */ /* Navbar */
.navbar { .navbar {
background-color: #2c3e50; background-color: #0066FF;
color: white; color: white;
padding: 15px 0; padding: 15px 0;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
@@ -104,6 +104,15 @@ body {
background-color: #7f8c8d; background-color: #7f8c8d;
} }
.btn-logout {
background-color: #e74c3c;
color: white;
}
.btn-logout:hover {
background-color: #c0392b;
}
.btn-success { .btn-success {
background-color: #27ae60; background-color: #27ae60;
color: white; color: white;
@@ -146,7 +155,7 @@ body {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
min-height: 100vh; min-height: 100vh;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); background: #0066FF;
} }
.login-box { .login-box {
@@ -310,7 +319,8 @@ body {
border-radius: 8px; border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
flex: 1; flex: 1;
min-width: 0; /* Ermöglicht Flexbox-Shrinking */ min-width: 0;
/* Ermöglicht Flexbox-Shrinking */
} }
/* User Stats Panel */ /* User Stats Panel */

View File

@@ -210,25 +210,15 @@ function registerVerwaltungRoutes(app) {
vacationDays += 0.5; vacationDays += 0.5;
vacationHours += 4; // Halber Tag = 4 Stunden vacationHours += 4; // Halber Tag = 4 Stunden
// Bei halbem Tag Urlaub können noch Arbeitsstunden vorhanden sein // Bei halbem Tag Urlaub können noch Arbeitsstunden vorhanden sein
// WICHTIG: total_hours enthält bereits Wochenend-Prozentsätze (aus timesheet.js)
if (entry.total_hours) { if (entry.total_hours) {
let hours = entry.total_hours; totalHours += parseFloat(entry.total_hours) || 0;
// Wochenend-Prozentsatz anwenden (nur auf tatsächlich gearbeitete Stunden)
const weekendPercentage = getWeekendPercentage(entry.date);
if (weekendPercentage >= 100 && hours > 0 && !entry.sick_status) {
hours = hours * (weekendPercentage / 100);
}
totalHours += hours;
} }
} else { } else {
// Kein Urlaub - zähle nur Arbeitsstunden // Kein Urlaub - zähle nur Arbeitsstunden
// WICHTIG: total_hours enthält bereits Wochenend-Prozentsätze (aus timesheet.js)
if (entry.total_hours) { if (entry.total_hours) {
let hours = entry.total_hours; totalHours += parseFloat(entry.total_hours) || 0;
// Wochenend-Prozentsatz anwenden (nur auf tatsächlich gearbeitete Stunden, nicht auf Krankheit)
const weekendPercentage = getWeekendPercentage(entry.date);
if (weekendPercentage > 0 && hours > 0 && !entry.sick_status) {
hours = hours * (1 + weekendPercentage / 100);
}
totalHours += hours;
} }
} }
}); });

View File

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

View File

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

View File

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

View File

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