diff --git a/Abrechnung/module.php b/Abrechnung/module.php index 39c29f8..b157d65 100644 --- a/Abrechnung/module.php +++ b/Abrechnung/module.php @@ -397,7 +397,6 @@ class Abrechnung extends IPSModule } } - private function GetCalculatedPowerCosts($userId) { $html = " @@ -422,10 +421,22 @@ private function GetCalculatedPowerCosts($userId) .row-even { background-color: #f7f7f7; } .row-odd { background-color: #ffffff; } .row-empty { background-color: #e0e0e0; height: 5px; } - .total-row { - background-color: #ddd; + + /* Neue Formatierungen */ + .num { + text-align: right; + font-family: monospace; + width: 90px; + } + .subtotal-row { + border-top: 1px solid black; font-weight: bold; } + .total-row { + border-top: 3px double black; + font-weight: bold; + background-color: #ddd; + } @@ -444,52 +455,52 @@ private function GetCalculatedPowerCosts($userId) "; - if (empty($this->powerCostCache) || !isset($this->powerCostCache[$userId])) { - $html .= "
Total CHF
Keine Stromzähler für diesen Benutzer
"; - return ['html' => $html, 'sum' => 0.0]; - } + if (empty($this->powerCostCache) || !isset($this->powerCostCache[$userId])) { + $html .= "Keine Stromzähler für diesen Benutzer"; + return ['html' => $html, 'sum' => 0.0]; + } - $sum = 0.0; - $rowIndex = 0; + $sum = 0.0; + $rowIndex = 0; - foreach ($this->powerCostCache[$userId] as $name => $a) { + foreach ($this->powerCostCache[$userId] as $name => $a) { - $subtotal = $a['cost_grid'] + $a['cost_solar'] - ($a['rev_feedin'] + $a['rev_zev']); - $sum += $subtotal; + $subtotal = $a['cost_grid'] + $a['cost_solar'] - ($a['rev_feedin'] + $a['rev_zev']); + $sum += $subtotal; - $rowClass = ($rowIndex % 2 === 0) ? "row-even" : "row-odd"; - $rowIndex++; + $rowClass = ($rowIndex % 2 === 0) ? "row-even" : "row-odd"; + $rowIndex++; - // Datenzeile - $html .= " - {$a['name']} - " . number_format($a['imp'], 3) . " - " . number_format($a['exp'], 3) . " - " . number_format($a['solar_bezug'], 3) . " - " . number_format($a['netz_bezug'], 3) . " - " . number_format($a['solareinspeisung'], 3) . " - " . number_format($a['solarverkauf'], 3) . " - " . number_format($a['cost_solar'], 2) . " - " . number_format($a['cost_grid'], 2) . " - " . number_format($a['rev_feedin'], 2) . " - " . number_format($a['rev_zev'], 2) . " - " . number_format($subtotal, 2) . " - "; + // Datenzeile + $html .= " + {$a['name']} + " . number_format($a['imp'], 3) . " + " . number_format($a['exp'], 3) . " + " . number_format($a['solar_bezug'], 3) . " + " . number_format($a['netz_bezug'], 3) . " + " . number_format($a['solareinspeisung'], 3) . " + " . number_format($a['solarverkauf'], 3) . " + " . number_format($a['cost_solar'], 2) . " + " . number_format($a['cost_grid'], 2) . " + " . number_format($a['rev_feedin'], 2) . " + " . number_format($a['rev_zev'], 2) . " + " . number_format($subtotal, 2) . " + "; - // Leerzeile zwischen Zählern - $html .= ""; - } + // Leerzeile + $html .= ""; + } - // Totalzeile - $html .= " + // Gesamttotal + $html .= " - Total - " . number_format($sum, 2) . " + Gesamttotal + " . number_format($sum, 2) . " "; - return ['html' => $html, 'sum' => $sum]; - } + return ['html' => $html, 'sum' => $sum]; +} // ====================== Nebenkosten Wasser/Wärme ======================