no message
This commit is contained in:
@@ -143,7 +143,7 @@ private function BuildUserInvoice($pdf, $user, $power, $water, $tariffs, $from,
|
||||
<p style='font-size:10px; margin-top:10px;'>
|
||||
<strong>Abrechnungszeitraum:</strong> " . date('d.m.Y', $from) . " – " . date('d.m.Y', $to) . "
|
||||
</p>
|
||||
<br><hr>
|
||||
<br>
|
||||
";
|
||||
|
||||
// ========================= Elektrizität =========================
|
||||
@@ -163,7 +163,7 @@ private function BuildUserInvoice($pdf, $user, $power, $water, $tariffs, $from,
|
||||
. " — <strong>" . number_format($t['price'], 2) . " Rp/kWh</strong>"
|
||||
. "</li>";
|
||||
}
|
||||
$html .= "</ul><br><hr>";
|
||||
$html .= "</ul><br>";
|
||||
}
|
||||
|
||||
// ========================= Nebenkosten =========================
|
||||
@@ -326,13 +326,13 @@ private function BuildUserInvoice($pdf, $user, $power, $water, $tariffs, $from,
|
||||
$html = "
|
||||
<table border='1' cellspacing='0' cellpadding='2' width='100%' style='font-size:6px;'>
|
||||
<tr style='background-color:#f0f0f0;'>
|
||||
<th>ID</th>
|
||||
<th>Zähler</th>
|
||||
<th>Import</th>
|
||||
<th>Export</th>
|
||||
<th>Solarbezug</th>
|
||||
<th>Netzbezug</th>
|
||||
<th>Solar Einspeisung</th>
|
||||
<th>Solarverkauf </th>
|
||||
<th>Solarbez.</th>
|
||||
<th>Netzbez.</th>
|
||||
<th>Solar Eins.</th>
|
||||
<th>Solarverk.</th>
|
||||
<th>Solar CHF</th>
|
||||
<th>Netz CHF</th>
|
||||
<th>Einspeis. CHF</th>
|
||||
@@ -366,13 +366,10 @@ $html = "
|
||||
</tr>";
|
||||
}
|
||||
|
||||
$html .= "
|
||||
<table width='100%' cellpadding='3' cellspacing='0' style='font-size:7px; margin-top:4px;'>
|
||||
<tr>
|
||||
<td width='80%' align='right'><strong>Total Elektrizität:</strong></td>
|
||||
<td width='20%' align='right'><strong>" . number_format($result['sum'], 2) . " CHF</strong></td>
|
||||
</tr>
|
||||
</table><br>";
|
||||
$html .= "<tr style='background-color:#f9f9f9; font-weight:bold;'>
|
||||
<td colspan='10' align='right'><b>Total Elektrizität:</b></td>
|
||||
<td align='right'><b>" . number_format($sum, 2) . " CHF</b></td>
|
||||
</tr></table><br>";
|
||||
|
||||
return ['html' => $html, 'sum' => $sum];
|
||||
}
|
||||
@@ -384,7 +381,7 @@ $html = "
|
||||
$html = "
|
||||
<table border='1' cellspacing='0' cellpadding='2' width='100%' style='font-size:6px;'>
|
||||
<tr style='background-color:#f0f0f0;'>
|
||||
<th>ID</th>
|
||||
<th>Zähler</th>
|
||||
<th>Typ</th>
|
||||
<th>Start</th>
|
||||
<th>Ende</th>
|
||||
@@ -410,13 +407,11 @@ $html = "
|
||||
$usedTariffs = array_merge($usedTariffs, $cost['tariffs']);
|
||||
}
|
||||
|
||||
$html .= "
|
||||
<table width='100%' cellpadding='3' cellspacing='0' style='font-size:7px; margin-top:4px;'>
|
||||
<tr>
|
||||
<td width='80%' align='right'><strong>Total Nebenkosten:</strong></td>
|
||||
<td width='20%' align='right'><strong>" . number_format($result['sum'], 2) . " CHF</strong></td>
|
||||
</tr>
|
||||
</table><br>";
|
||||
$html .= "<tr style='background-color:#f9f9f9; font-weight:bold;'>
|
||||
<td colspan='8' align='right'><b>Total Nebenkosten:</b></td>
|
||||
<td align='right'><b>" . number_format($total, 2) . " CHF</b></td>
|
||||
|
||||
</tr></table><br>";
|
||||
|
||||
if (!empty($usedTariffs)) {
|
||||
$html .= "<p><strong>Angewendete Nebenkostentarife:</strong></p><ul>";
|
||||
@@ -424,7 +419,7 @@ $html = "
|
||||
$html .= "<li>" . date('d.m.Y', $t['start']) . " – " . date('d.m.Y', $t['end']) . ": " .
|
||||
number_format($t['price'], 2) . " Rp</li>";
|
||||
}
|
||||
$html .= "</ul><br><hr>";
|
||||
$html .= "</ul><br>";
|
||||
}
|
||||
|
||||
return ['html' => $html, 'sum' => $total];
|
||||
@@ -649,27 +644,5 @@ $html = "
|
||||
}
|
||||
return end($cands);
|
||||
}
|
||||
private function CollectTariffsForUser($tariffs, $types)
|
||||
{
|
||||
$result = [];
|
||||
$wanted = array_map('strtolower', $types);
|
||||
|
||||
foreach ($tariffs as $t) {
|
||||
$type = strtolower(trim($t['unit_type'] ?? ''));
|
||||
if (!in_array($type, $wanted)) continue;
|
||||
|
||||
$start = $this->toUnixTs($t['start'], false);
|
||||
$end = $this->toUnixTs($t['end'], true);
|
||||
|
||||
$result[] = [
|
||||
'start' => $start,
|
||||
'end' => $end,
|
||||
'price' => (float)$t['price']
|
||||
];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user