no message
This commit is contained in:
@@ -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;
|
||||
}
|
||||
</style>
|
||||
|
||||
<table class='powercost'>
|
||||
@@ -444,52 +455,52 @@ private function GetCalculatedPowerCosts($userId)
|
||||
<th>Total CHF</th>
|
||||
</tr>";
|
||||
|
||||
if (empty($this->powerCostCache) || !isset($this->powerCostCache[$userId])) {
|
||||
$html .= "<tr><td colspan='12' align='center'>Keine Stromzähler für diesen Benutzer</td></tr></table>";
|
||||
return ['html' => $html, 'sum' => 0.0];
|
||||
}
|
||||
if (empty($this->powerCostCache) || !isset($this->powerCostCache[$userId])) {
|
||||
$html .= "<tr><td colspan='12' align='center'>Keine Stromzähler für diesen Benutzer</td></tr></table>";
|
||||
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 .= "<tr class='{$rowClass}'>
|
||||
<td>{$a['name']}</td>
|
||||
<td align='right'>" . number_format($a['imp'], 3) . "</td>
|
||||
<td align='right'>" . number_format($a['exp'], 3) . "</td>
|
||||
<td align='right'>" . number_format($a['solar_bezug'], 3) . "</td>
|
||||
<td align='right'>" . number_format($a['netz_bezug'], 3) . "</td>
|
||||
<td align='right'>" . number_format($a['solareinspeisung'], 3) . "</td>
|
||||
<td align='right'>" . number_format($a['solarverkauf'], 3) . "</td>
|
||||
<td align='right'>" . number_format($a['cost_solar'], 2) . "</td>
|
||||
<td align='right'>" . number_format($a['cost_grid'], 2) . "</td>
|
||||
<td align='right'>" . number_format($a['rev_feedin'], 2) . "</td>
|
||||
<td align='right'>" . number_format($a['rev_zev'], 2) . "</td>
|
||||
<td align='right'>" . number_format($subtotal, 2) . "</td>
|
||||
</tr>";
|
||||
// Datenzeile
|
||||
$html .= "<tr class='{$rowClass}'>
|
||||
<td>{$a['name']}</td>
|
||||
<td class='num'>" . number_format($a['imp'], 3) . "</td>
|
||||
<td class='num'>" . number_format($a['exp'], 3) . "</td>
|
||||
<td class='num'>" . number_format($a['solar_bezug'], 3) . "</td>
|
||||
<td class='num'>" . number_format($a['netz_bezug'], 3) . "</td>
|
||||
<td class='num'>" . number_format($a['solareinspeisung'], 3) . "</td>
|
||||
<td class='num'>" . number_format($a['solarverkauf'], 3) . "</td>
|
||||
<td class='num'>" . number_format($a['cost_solar'], 2) . "</td>
|
||||
<td class='num'>" . number_format($a['cost_grid'], 2) . "</td>
|
||||
<td class='num'>" . number_format($a['rev_feedin'], 2) . "</td>
|
||||
<td class='num'>" . number_format($a['rev_zev'], 2) . "</td>
|
||||
<td class='num'>" . number_format($subtotal, 2) . "</td>
|
||||
</tr>";
|
||||
|
||||
// Leerzeile zwischen Zählern
|
||||
$html .= "<tr class='row-empty'><td colspan='12'></td></tr>";
|
||||
}
|
||||
// Leerzeile
|
||||
$html .= "<tr class='row-empty'><td colspan='12'></td></tr>";
|
||||
}
|
||||
|
||||
// Totalzeile
|
||||
$html .= "
|
||||
// Gesamttotal
|
||||
$html .= "
|
||||
<tr class='total-row'>
|
||||
<td colspan='11' align='right'><b>Total</b></td>
|
||||
<td align='right'><b>" . number_format($sum, 2) . "</b></td>
|
||||
<td colspan='11' align='right'><b>Gesamttotal</b></td>
|
||||
<td class='num'><b>" . number_format($sum, 2) . "</b></td>
|
||||
</tr>
|
||||
</table>";
|
||||
|
||||
return ['html' => $html, 'sum' => $sum];
|
||||
}
|
||||
return ['html' => $html, 'sum' => $sum];
|
||||
}
|
||||
|
||||
// ====================== Nebenkosten Wasser/Wärme ======================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user