From 136d6f9f286c3d231560e9005c724cb528087544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Wed, 11 Feb 2026 16:08:15 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20von=20BFI=20=C3=BCbernommen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/anwesenheit.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/anwesenheit.class.php b/include/anwesenheit.class.php index f601d6b95..9493a3d4b 100644 --- a/include/anwesenheit.class.php +++ b/include/anwesenheit.class.php @@ -489,7 +489,7 @@ class anwesenheit extends basis_db gesamt AS gesamtstunden, anwesend, nichtanwesend, - trunc(100-(nichtanwesend/gesamt)*100,2) AS prozent + CASE WHEN gesamt = 0 THEN 100.00 ELSE trunc(100-(nichtanwesend/(gesamt))*100,2) END AS prozent FROM( SELECT @@ -499,9 +499,10 @@ class anwesenheit extends basis_db lehrveranstaltung_id, bezeichnung, student_uid, - COUNT(stundenplan_id) AS gesamt, - CASE WHEN anwesend.summe IS NULL THEN 0 ELSE anwesend.summe END AS anwesend, - CASE WHEN nichtanwesend.summe IS NULL THEN 0 ELSE nichtanwesend.summe END AS nichtanwesend + --COUNT(stundenplan_id) AS gesamts, + COALESCE(anwesend.summe, 0) + COALESCE(nichtanwesend.summe, 0) AS gesamt, + COALESCE(anwesend.summe, 0) AS anwesend, + COALESCE(nichtanwesend.summe, 0) AS nichtanwesend FROM (