added fields to PreorderBillingInvoice PDF

This commit is contained in:
Frank Schubert
2025-08-26 14:48:12 +02:00
parent 5f2011358b
commit 75b09a6c97
2 changed files with 30 additions and 4 deletions

View File

@@ -100,6 +100,7 @@
<div>{{ addressLine_3 }}</div>
<div>{{ addressLine_4 }}</div>
<div>{{ addressLine_5 }}</div>
<div>{{ addressLine_6 }}</div>
</td>
<td>
<table class="info-table">
@@ -115,6 +116,7 @@
<td>{{ customerNumber }}</td>
</tr>
{{ vatHtml }}
{{ orderNumberHtml }}
</table>
</td>
</tr>

View File

@@ -42,6 +42,10 @@ class PreorderBillingInvoice extends mfBaseModel {
}
$conf = TT_PREORDER_BILLING[$this->netowner_id];
$netop_conf = null;
if($this->owner_id && array_key_exists($this->owner_id, TT_PREORDER_BILLING[$this->netowner_id]["netoperators"])) {
$netop_conf = TT_PREORDER_BILLING[$this->netowner_id]["netoperators"][$this->owner_id];
}
$filename = "";
$positions = $this->getProperty("positions");
@@ -68,18 +72,38 @@ class PreorderBillingInvoice extends mfBaseModel {
$headerHtml = str_replace("{{ basedir }}", BASEDIR, $headerHtml);
$headerHtml = str_replace("{{ addressLine_1 }}", $this->company ? $this->company : "", $headerHtml);
$headerHtml = str_replace("{{ addressLine_2 }}", $this->firstname . " " . $this->lastname, $headerHtml);
$headerHtml = str_replace("{{ addressLine_3 }}", nl2br($this->street), $headerHtml);
$headerHtml = str_replace("{{ addressLine_4 }}", $this->zip . " " . $this->city, $headerHtml);
$headerHtml = str_replace("{{ addressLine_5 }}", $this->country != "Österreich" ? $this->country : "", $headerHtml);
$headerHtml = str_replace("{{ addressLine_4 }}", nl2br($this->street), $headerHtml);
$headerHtml = str_replace("{{ addressLine_5 }}", $this->zip . " " . $this->city, $headerHtml);
$headerHtml = str_replace("{{ addressLine_6 }}", $this->country != "Österreich" ? $this->country : "", $headerHtml);
$headerHtml = str_replace("{{ customerNumber }}", $this->fibu_account_number, $headerHtml);
$headerHtml = str_replace("{{ invoiceNumber }}", $invoice_number, $headerHtml);
$headerHtml = str_replace("{{ invoiceDate }}", $invoice_date->format("d.m.Y"), $headerHtml);
$headerHtml = str_replace("{{ caseWorker }}", $me->name, $headerHtml);
$headerHtml = str_replace("{{ caseWorkerPhone }}", $me->mobile, $headerHtml);
$headerHtml = str_replace("{{ caseWorkerEmail }}", $me->email, $headerHtml);
$headerHtml = str_replace("{{ orderNumber }}", "WVR / 52", $headerHtml);
//$headerHtml = str_replace("{{ orderNumber }}", "WVR / 52", $headerHtml);
$headerHtml = str_replace("{{ vatHtml }}", $this->uid ? "<tr><th>Ihre UID:</th><td>" . $this->uid . "</td></tr>" : "", $headerHtml);
if($netop_conf) {
if(array_key_exists("order-number", $netop_conf) && $netop_conf["order-number"]) {
$headerHtml = str_replace("{{ orderNumberHtml }}", "<tr><th>Auftrag:</th><td>" . $netop_conf["order-number"] . "</td></tr>", $headerHtml);
} else {
$headerHtml = str_replace("{{ orderNumberHtml }}", "", $headerHtml);
}
if(array_key_exists("address-rctp-extra-text", $netop_conf) && $netop_conf["address-rctp-extra-text"]) {
$headerHtml = str_replace("{{ addressLine_3 }}", $netop_conf["address-rctp-extra-text"], $headerHtml);
} else {
$headerHtml = str_replace("{{ addressLine_3 }}", "", $headerHtml);
}
} else {
$headerHtml = str_replace("{{ orderNumberHtml }}", "", $headerHtml);
$headerHtml = str_replace("{{ addressLine_3 }}", "", $headerHtml);
}
$headerFile = BASEDIR . "/var/temp/invoice_header-" . date("U") . "-" . rand(1000, 9999) . ".html";
file_put_contents($headerFile, $headerHtml);