diff --git a/Layout/default/PreorderBillingInvoice/PDF_HEADER-4807.html b/Layout/default/PreorderBillingInvoice/PDF_HEADER-4807.html index d79ebcb60..412174ee2 100644 --- a/Layout/default/PreorderBillingInvoice/PDF_HEADER-4807.html +++ b/Layout/default/PreorderBillingInvoice/PDF_HEADER-4807.html @@ -100,6 +100,7 @@
{{ addressLine_3 }}
{{ addressLine_4 }}
{{ addressLine_5 }}
+
{{ addressLine_6 }}
@@ -115,6 +116,7 @@ {{ vatHtml }} + {{ orderNumberHtml }}
{{ customerNumber }}
diff --git a/application/PreorderBillingInvoice/PreorderBillingInvoice.php b/application/PreorderBillingInvoice/PreorderBillingInvoice.php index f970d5e18..6e659f1ab 100644 --- a/application/PreorderBillingInvoice/PreorderBillingInvoice.php +++ b/application/PreorderBillingInvoice/PreorderBillingInvoice.php @@ -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 ? "Ihre UID:" . $this->uid . "" : "", $headerHtml); + if($netop_conf) { + if(array_key_exists("order-number", $netop_conf) && $netop_conf["order-number"]) { + $headerHtml = str_replace("{{ orderNumberHtml }}", "Auftrag:" . $netop_conf["order-number"] . "", $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);