no message
This commit is contained in:
@@ -397,7 +397,6 @@ class Abrechnung extends IPSModule
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function GetCalculatedPowerCosts($userId)
|
private function GetCalculatedPowerCosts($userId)
|
||||||
{
|
{
|
||||||
$html = "
|
$html = "
|
||||||
@@ -422,10 +421,22 @@ private function GetCalculatedPowerCosts($userId)
|
|||||||
.row-even { background-color: #f7f7f7; }
|
.row-even { background-color: #f7f7f7; }
|
||||||
.row-odd { background-color: #ffffff; }
|
.row-odd { background-color: #ffffff; }
|
||||||
.row-empty { background-color: #e0e0e0; height: 5px; }
|
.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;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
.total-row {
|
||||||
|
border-top: 3px double black;
|
||||||
|
font-weight: bold;
|
||||||
|
background-color: #ddd;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<table class='powercost'>
|
<table class='powercost'>
|
||||||
@@ -444,52 +455,52 @@ private function GetCalculatedPowerCosts($userId)
|
|||||||
<th>Total CHF</th>
|
<th>Total CHF</th>
|
||||||
</tr>";
|
</tr>";
|
||||||
|
|
||||||
if (empty($this->powerCostCache) || !isset($this->powerCostCache[$userId])) {
|
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>";
|
$html .= "<tr><td colspan='12' align='center'>Keine Stromzähler für diesen Benutzer</td></tr></table>";
|
||||||
return ['html' => $html, 'sum' => 0.0];
|
return ['html' => $html, 'sum' => 0.0];
|
||||||
}
|
}
|
||||||
|
|
||||||
$sum = 0.0;
|
$sum = 0.0;
|
||||||
$rowIndex = 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']);
|
$subtotal = $a['cost_grid'] + $a['cost_solar'] - ($a['rev_feedin'] + $a['rev_zev']);
|
||||||
$sum += $subtotal;
|
$sum += $subtotal;
|
||||||
|
|
||||||
$rowClass = ($rowIndex % 2 === 0) ? "row-even" : "row-odd";
|
$rowClass = ($rowIndex % 2 === 0) ? "row-even" : "row-odd";
|
||||||
$rowIndex++;
|
$rowIndex++;
|
||||||
|
|
||||||
// Datenzeile
|
// Datenzeile
|
||||||
$html .= "<tr class='{$rowClass}'>
|
$html .= "<tr class='{$rowClass}'>
|
||||||
<td>{$a['name']}</td>
|
<td>{$a['name']}</td>
|
||||||
<td align='right'>" . number_format($a['imp'], 3) . "</td>
|
<td class='num'>" . number_format($a['imp'], 3) . "</td>
|
||||||
<td align='right'>" . number_format($a['exp'], 3) . "</td>
|
<td class='num'>" . number_format($a['exp'], 3) . "</td>
|
||||||
<td align='right'>" . number_format($a['solar_bezug'], 3) . "</td>
|
<td class='num'>" . number_format($a['solar_bezug'], 3) . "</td>
|
||||||
<td align='right'>" . number_format($a['netz_bezug'], 3) . "</td>
|
<td class='num'>" . number_format($a['netz_bezug'], 3) . "</td>
|
||||||
<td align='right'>" . number_format($a['solareinspeisung'], 3) . "</td>
|
<td class='num'>" . number_format($a['solareinspeisung'], 3) . "</td>
|
||||||
<td align='right'>" . number_format($a['solarverkauf'], 3) . "</td>
|
<td class='num'>" . number_format($a['solarverkauf'], 3) . "</td>
|
||||||
<td align='right'>" . number_format($a['cost_solar'], 2) . "</td>
|
<td class='num'>" . number_format($a['cost_solar'], 2) . "</td>
|
||||||
<td align='right'>" . number_format($a['cost_grid'], 2) . "</td>
|
<td class='num'>" . number_format($a['cost_grid'], 2) . "</td>
|
||||||
<td align='right'>" . number_format($a['rev_feedin'], 2) . "</td>
|
<td class='num'>" . number_format($a['rev_feedin'], 2) . "</td>
|
||||||
<td align='right'>" . number_format($a['rev_zev'], 2) . "</td>
|
<td class='num'>" . number_format($a['rev_zev'], 2) . "</td>
|
||||||
<td align='right'>" . number_format($subtotal, 2) . "</td>
|
<td class='num'>" . number_format($subtotal, 2) . "</td>
|
||||||
</tr>";
|
</tr>";
|
||||||
|
|
||||||
// Leerzeile zwischen Zählern
|
// Leerzeile
|
||||||
$html .= "<tr class='row-empty'><td colspan='12'></td></tr>";
|
$html .= "<tr class='row-empty'><td colspan='12'></td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Totalzeile
|
// Gesamttotal
|
||||||
$html .= "
|
$html .= "
|
||||||
<tr class='total-row'>
|
<tr class='total-row'>
|
||||||
<td colspan='11' align='right'><b>Total</b></td>
|
<td colspan='11' align='right'><b>Gesamttotal</b></td>
|
||||||
<td align='right'><b>" . number_format($sum, 2) . "</b></td>
|
<td class='num'><b>" . number_format($sum, 2) . "</b></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>";
|
</table>";
|
||||||
|
|
||||||
return ['html' => $html, 'sum' => $sum];
|
return ['html' => $html, 'sum' => $sum];
|
||||||
}
|
}
|
||||||
|
|
||||||
// ====================== Nebenkosten Wasser/Wärme ======================
|
// ====================== Nebenkosten Wasser/Wärme ======================
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user