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;'>
|
<p style='font-size:10px; margin-top:10px;'>
|
||||||
<strong>Abrechnungszeitraum:</strong> " . date('d.m.Y', $from) . " – " . date('d.m.Y', $to) . "
|
<strong>Abrechnungszeitraum:</strong> " . date('d.m.Y', $from) . " – " . date('d.m.Y', $to) . "
|
||||||
</p>
|
</p>
|
||||||
<br><hr>
|
<br>
|
||||||
";
|
";
|
||||||
|
|
||||||
// ========================= Elektrizität =========================
|
// ========================= Elektrizität =========================
|
||||||
@@ -163,7 +163,7 @@ private function BuildUserInvoice($pdf, $user, $power, $water, $tariffs, $from,
|
|||||||
. " — <strong>" . number_format($t['price'], 2) . " Rp/kWh</strong>"
|
. " — <strong>" . number_format($t['price'], 2) . " Rp/kWh</strong>"
|
||||||
. "</li>";
|
. "</li>";
|
||||||
}
|
}
|
||||||
$html .= "</ul><br><hr>";
|
$html .= "</ul><br>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========================= Nebenkosten =========================
|
// ========================= Nebenkosten =========================
|
||||||
@@ -326,13 +326,13 @@ private function BuildUserInvoice($pdf, $user, $power, $water, $tariffs, $from,
|
|||||||
$html = "
|
$html = "
|
||||||
<table border='1' cellspacing='0' cellpadding='2' width='100%' style='font-size:6px;'>
|
<table border='1' cellspacing='0' cellpadding='2' width='100%' style='font-size:6px;'>
|
||||||
<tr style='background-color:#f0f0f0;'>
|
<tr style='background-color:#f0f0f0;'>
|
||||||
<th>ID</th>
|
<th>Zähler</th>
|
||||||
<th>Import</th>
|
<th>Import</th>
|
||||||
<th>Export</th>
|
<th>Export</th>
|
||||||
<th>Solarbezug</th>
|
<th>Solarbez.</th>
|
||||||
<th>Netzbezug</th>
|
<th>Netzbez.</th>
|
||||||
<th>Solar Einspeisung</th>
|
<th>Solar Eins.</th>
|
||||||
<th>Solarverkauf </th>
|
<th>Solarverk.</th>
|
||||||
<th>Solar CHF</th>
|
<th>Solar CHF</th>
|
||||||
<th>Netz CHF</th>
|
<th>Netz CHF</th>
|
||||||
<th>Einspeis. CHF</th>
|
<th>Einspeis. CHF</th>
|
||||||
@@ -366,13 +366,10 @@ $html = "
|
|||||||
</tr>";
|
</tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$html .= "
|
$html .= "<tr style='background-color:#f9f9f9; font-weight:bold;'>
|
||||||
<table width='100%' cellpadding='3' cellspacing='0' style='font-size:7px; margin-top:4px;'>
|
<td colspan='10' align='right'><b>Total Elektrizität:</b></td>
|
||||||
<tr>
|
<td align='right'><b>" . number_format($sum, 2) . " CHF</b></td>
|
||||||
<td width='80%' align='right'><strong>Total Elektrizität:</strong></td>
|
</tr></table><br>";
|
||||||
<td width='20%' align='right'><strong>" . number_format($result['sum'], 2) . " CHF</strong></td>
|
|
||||||
</tr>
|
|
||||||
</table><br>";
|
|
||||||
|
|
||||||
return ['html' => $html, 'sum' => $sum];
|
return ['html' => $html, 'sum' => $sum];
|
||||||
}
|
}
|
||||||
@@ -384,7 +381,7 @@ $html = "
|
|||||||
$html = "
|
$html = "
|
||||||
<table border='1' cellspacing='0' cellpadding='2' width='100%' style='font-size:6px;'>
|
<table border='1' cellspacing='0' cellpadding='2' width='100%' style='font-size:6px;'>
|
||||||
<tr style='background-color:#f0f0f0;'>
|
<tr style='background-color:#f0f0f0;'>
|
||||||
<th>ID</th>
|
<th>Zähler</th>
|
||||||
<th>Typ</th>
|
<th>Typ</th>
|
||||||
<th>Start</th>
|
<th>Start</th>
|
||||||
<th>Ende</th>
|
<th>Ende</th>
|
||||||
@@ -410,13 +407,11 @@ $html = "
|
|||||||
$usedTariffs = array_merge($usedTariffs, $cost['tariffs']);
|
$usedTariffs = array_merge($usedTariffs, $cost['tariffs']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$html .= "
|
$html .= "<tr style='background-color:#f9f9f9; font-weight:bold;'>
|
||||||
<table width='100%' cellpadding='3' cellspacing='0' style='font-size:7px; margin-top:4px;'>
|
<td colspan='8' align='right'><b>Total Nebenkosten:</b></td>
|
||||||
<tr>
|
<td align='right'><b>" . number_format($total, 2) . " CHF</b></td>
|
||||||
<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>";
|
||||||
</tr>
|
|
||||||
</table><br>";
|
|
||||||
|
|
||||||
if (!empty($usedTariffs)) {
|
if (!empty($usedTariffs)) {
|
||||||
$html .= "<p><strong>Angewendete Nebenkostentarife:</strong></p><ul>";
|
$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']) . ": " .
|
$html .= "<li>" . date('d.m.Y', $t['start']) . " – " . date('d.m.Y', $t['end']) . ": " .
|
||||||
number_format($t['price'], 2) . " Rp</li>";
|
number_format($t['price'], 2) . " Rp</li>";
|
||||||
}
|
}
|
||||||
$html .= "</ul><br><hr>";
|
$html .= "</ul><br>";
|
||||||
}
|
}
|
||||||
|
|
||||||
return ['html' => $html, 'sum' => $total];
|
return ['html' => $html, 'sum' => $total];
|
||||||
@@ -649,27 +644,5 @@ $html = "
|
|||||||
}
|
}
|
||||||
return end($cands);
|
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