SPIN PDF can now have custom netowner data

This commit is contained in:
Frank Schubert
2023-01-18 17:50:47 +01:00
parent 3fe324d762
commit 079ab6fbe9
22 changed files with 534 additions and 96 deletions

View File

@@ -0,0 +1,81 @@
<?php
$this->setReturnValue([
'filename' => "Wichtige Kundeninformation ".$owner->customer_number.".pdf"
]);
?>
<!DOCTYPE html>
<html>
<head>
<title>Wichtige Kundeninformation zu Ihrem Glasfaseranschluss</title>
<meta charset="utf-8" />
<link href="<?=$ressourcePathPrefix?>fontawesome/css/all.min.css" rel="stylesheet" type="text/css" />
<!--<link href="<?=$ressourcePathPrefix?>assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />-->
<link href="<?=$ressourcePathPrefix?>assets/css/print.css" rel="stylesheet" type="text/css" />
</head>
<body styl="font-size: 36pt;">
<!--div style="border-top: 1pt solid #000">
&nbsp;
</div-->
<table style="width: 100%">
<tr>
<td style="width:50%">
<img src="<?=$ressourcePathPrefix?>assets/pdf/logo-address-<?=$netowner->id?>.png" style="max-width: 100%"/>
</td>
<td style="width:50%; text-align: right;">&nbsp;</td>
</tr>
</table>
<div style="height:24pt;"></div>
<div>
<?php if($owner->company): ?>
<?=nl2br($owner->company)?><br />
<?php endif; ?>
<?php if($owner->getFullName()): ?>
<?=$owner->getFullName()?><br />
<?php endif; ?>
<?=$owner->street?><br />
<?=$owner->zip?> <?=$owner->city?>
</div>
<div style="height:24pt;"></div>
<div class="center">
<h2>Wichtige Kundeninformation zu Ihrem Glasfaseranschluss</h2>
</div>
<div>
<p>Sehr geehrte Damen und Herren,</p>
<p>wir freuen uns sehr, dass Sie sich für einen Glasfaseranschluss im Netz der <?=$netowner->company?> entschieden haben. Hiermit möchten wir Ihnen gerne den Eingang Ihrer Bestellung bestätigen.</p>
<p>Bezüglich der gegebenenfalls erforderlichen Termine für die Installation melden wir uns (bzw. unsere Partner vom Leitungsbau) sobald die Herstellung möglich ist.</p>
<p>Ihr persönlicher Service-PIN lautet: <?=$owner->spin?></p>
<p>Gemäß der EU-Datenschutzverordnung sind wir dazu verpflichtet, mit den uns anvertrauten Kundendaten sorgsam umzugehen. Dazu gehört die Abfrage eines Service-PINs mit welchem Sie bei uns auch
telefonische Auskünfte (z.B. vergessene Passwörter, Rechnungsauskünfte, etc.) erhalten können. Unsere Mitarbeiter werden Sie vor Beantwortung Ihrer Fragen um die Nennung des Service-PINs bitte.
Bitte haben Sie Verständnis, dass wir <strong>ohne</strong> korrekte Nennung Ihres <strong>PIN</strong>s keine Auskünfte erteilen können.</p>
</div>
<div style="height:1.5pt;"></div>
<div>
<p class="bold">Sollten Sie noch Fragen haben, erreichen Sie uns per Mail an <span style="white-space: nowrap"><?=$netowner->email?></span> oder telefonisch unter der Rufnummer <span style="white-space: nowrap"><?=$netowner->phone?>.</span></p>
</div>
<div style="height:1.5pt;"></div>
<div>
<p>Mit freundlichen Grüßen,</p>
</div>
<div style="height:1.5pt;"></div>
<div>
<p>Ihr Team der <?=$netowner->company?></p>
</div>
</body>
</html>

View File

@@ -0,0 +1,15 @@
<?php
$this->setReturnValue([
'subject' => "Ihre Bestellung wurde erfasst",
'from_email' => $netowner->email,
'from_email_name' => $netowner->company." Kundenservice"
]);
?>
Sehr geehrte Damen und Herren,
im Anhang finden Sie weitere Informationen zur Ihrer Glasfaserbestellung, sowie Ihren persönlichen Service-PIN.
Mit freundlichen Grüßen,
Ihr Team der <?=$netowner->company?>

View File

@@ -0,0 +1,131 @@
<?php
$term_id = $order->terminations[0]->id;
$op = OrderProductModel::getFirst(['order_id' => $order->id, 'termination_id' => $term_id]);
$billing_start = date('U');
if($op->billing_delay) {
$billing_start = strtotime("+".$op->billing_delay." months");
}
$subject = "";
if($order->upgrade) {
$subject .= "[UPGRADE] ";
}
$subject .= $order->partner_number." - "
."hergestellt am ".date("d.m.Y", $order->finish_date) . " - "
."Verrechnung ab ".date("m", $billing_start)."/".date("Y", $billing_start)." - "
.str_replace("\n", " ", str_replace("\r", "", $order->owner->getCompanyOrName()));
$this->setReturnValue([
'subject' => $subject,
'from_email' => TT_OUTGOING_EMAIL,
'from_email_name' => "XINON Partnerservice"
]);
?>
<?php if($order->upgrade): ?>
Achtung: UPGRADE
<?php endif; ?>
Rechnungspositionen
====================
Anzahl | Produktname | Verrechungsperiode | Preis periodisch | Preis Herstellung
-----------------------------------------------------------------------------------------------------------------------
<?php foreach($order->products as $op): ?>
<?=sprintf("%-12s", substr($op->amount,0,12))?> | <?=utf8_encode(sprintf("%-42s", utf8_decode(substr($op->product->name,0,42))))?> | <?=utf8_encode(sprintf("%-18s", utf8_decode(($op->billing_period == 12) ? "Jährlich " : (($op->billing_period == 1) ? "Monatlich" : $op->billing_period."-monatlich")) ))?> | <?=sprintf("EUR %-12s", substr($op->price,0,12))?> | EUR <?=$op->price_setup?>
-----------------------------------------------------------------------------------------------------------------------
<?php endforeach; ?>
<?php if(is_array($order->terminations) && count($order->terminations)): ?>
Anschluss
==========
<?php foreach($order->terminations as $term): ?>
<?=$term->getAddress()?>
<?php endforeach; ?>
<?php endif; ?>
Bestelldetails
===============
Bestelldatum: <?=date("d.m.Y", $order->order_date)?>
Bestellung abgeschlossen: <?=date("d.m.Y", $order->finish_date)?>
Einwilligung Datenschutz: <?=($order->allow_contact)? "Ja" : "Nein"?>
Vertragsinhaber
================
Firma: <?=$order->owner->company?>
Vorname: <?=$order->owner->firstname?>
Nachname: <?=$order->owner->lastname?>
Straße: <?=$order->owner->street?>
PLZ: <?=$order->owner->zip?>
Ort: <?=$order->owner->city?>
Land: <?=$order->owner->country?>
Telefon: <?=$order->owner->phone?>
Fax: <?=$order->owner->fax?>
Mobiltelefon: <?=$order->owner->mobile?>
Email: <?=$order->owner->email?>
<?php if($order->billingaddress_id > 0 && $order->billingaddress_id != $order->owner_id): ?>
Rechnungsempfänger
===================
Firma: <?=$order->billingaddress->company?>
Vorname: <?=$order->billingaddress->firstname?>
Nachname: <?=$order->billingaddress->lastname?>
Straße: <?=$order->billingaddress->street?>
PLZ: <?=$order->billingaddress->zip?>
Ort: <?=$order->billingaddress->city?>
Land: <?=$order->billingaddress->country?>
Telefon: <?=$order->billingaddress->phone?>
Fax: <?=$order->billingaddress->fax?>
Mobiltelefon: <?=$order->billingaddress->mobile?>
Email: <?=$order->billingaddress->email?>
<?php endif; ?>
Verrechnung
============
<?php if($order->billing_type == "invoice"): ?>
Verrechnungsart: Rechnung
<?php else: ?>
Verrechnungsart: SEPA Bankeinzug
Bank: <?=$order->bank_account_bank?>
Kontoinhaber: <?=$order->bank_account_owner?>
IBAN: <?=$order->bank_account_iban?>
BIC: <?=$order->bank_account_bic?>
<?php endif; ?>

View File

@@ -0,0 +1,31 @@
<?php
$contacts = $order->owner->getChildrenByType("techcontact");
if(!is_array($contacts) || !count($contacts)) {
$contacts = [$order->owner];
}
$tos = [];
foreach($contacts as $contact) {
if($contact->email) {
$tos[] = $contact->email;
}
}
$customer_string = str_replace(["\r","\n"], " ", $order->owner->getCompanyOrName());
$subject = "Ihr Übergabeprotokoll / Technikerstammblatt";
$this->setReturnValue([
'subject' => $subject,
'to' => $tos,
'from_email' => "support@xinon.at",
'from_email_name' => "XINON Kundenservice"
]);
?>
Sehr geehrte Damen und Herren,
im Anhang erhalten Sie das technische Übergabeprotokoll zum Anschluss des Kunden <?=$customer_string?> zur weiteren Verwendung.
Ihr XINON Team

View File

@@ -0,0 +1,19 @@
<?php
$customer_string = str_replace(["\r","\n"], " ", $order->owner->getCompanyOrName())." [".$order->owner->customer_number."]";
$subject = "Neue PBX-Bestellung eingelangt ($customer_string)";
$this->setReturnValue([
'subject' => $subject,
'to' => "einkauf@xinon.at",
'from_email' => TT_OUTGOING_EMAIL,
'from_email_name' => TT_OUTGOING_EMAIL_NAME
]);
?>
<?=str_replace(["\r","\n"], " ", $file->creator->name)?> hat die Bestellung einer Telefonanlage für den Kunden <?=$customer_string?> angelegt - siehe Dokument im Anhang. Bitte um technische Prüfung und Materialabklärung bzw. Herstellungsfreigabe.
TheTool OrderROBOT (-;
https://<?=$_SERVER['HTTP_HOST']?><?=self::getUrl("Order","Index",['id' => $order->id])?>

View File

@@ -0,0 +1,19 @@
<?php
$customer_string = str_replace(["\r","\n"], " ", $order->owner->getCompanyOrName())." [".$order->owner->customer_number."]";
$subject = "Neue Projektbestellung eingelangt ($customer_string)";
$this->setReturnValue([
'subject' => $subject,
'to' => "einkauf@xinon.at",
'from_email' => TT_OUTGOING_EMAIL,
'from_email_name' => TT_OUTGOING_EMAIL_NAME
]);
?>
<?=str_replace(["\r","\n"], " ", $file->creator->name)?> hat eine Projektbestellung für den Kunden <?=$customer_string?> angelegt - siehe Dokument im Anhang. Bitte um technische Prüfung und Materialabklärung bzw. Herstellungsfreigabe.
TheTool OrderROBOT (-;
https://<?=$_SERVER['HTTP_HOST']?><?=self::getUrl("Order","Index",['id' => $order->id])?>

View File

@@ -0,0 +1,19 @@
<?php
$customer_string = str_replace(["\r","\n"], " ", $order->owner->getCompanyOrName())." [".$order->owner->customer_number."]";
$subject = "Neue Einzugsermächtigung eingelangt ($customer_string)";
$this->setReturnValue([
'subject' => $subject,
'to' => "billing@xinon.at",
'from_email' => TT_OUTGOING_EMAIL,
'from_email_name' => TT_OUTGOING_EMAIL_NAME
]);
?>
<?=str_replace(["\r","\n"], " ", $file->creator->name)?> hat soeben eine Einzugsermächtigung für den Kunden <?=$customer_string?> angelegt - siehe Dokument im Anhang. Bitte um Prüfung und Aktualisierung der Bankdaten des Kunden.
TheTool OrderROBOT (-;
https://<?=$_SERVER['HTTP_HOST']?><?=self::getUrl("Order","Index",['id' => $order->id])?>

View File

@@ -0,0 +1,19 @@
<?php
$customer_string = str_replace(["\r","\n"], " ", $order->owner->getCompanyOrName())." [".$order->owner->customer_number."]";
$subject = "Neue Rufnummerportierung ($customer_string)";
$this->setReturnValue([
'subject' => $subject,
'to' => "portierung@xinon.at",
'from_email' => TT_OUTGOING_EMAIL,
'from_email_name' => TT_OUTGOING_EMAIL_NAME
]);
?>
<?=str_replace(["\r","\n"], " ", $file->creator->name)?> hat soeben eine Rufnummerportierung für den Kunden <?=$customer_string?> angelegt - siehe Dokument im Anhang. Bitte um Prüfung des Herstellungstermins und Einreichung.
TheTool OrderROBOT (-;
https://<?=$_SERVER['HTTP_HOST']?><?=self::getUrl("Order","Index",['id' => $order->id])?>

View File

@@ -0,0 +1,79 @@
<?php
$term_id = $order->terminations[0]->id;
$op = OrderProductModel::getFirst(['order_id' => $order->id, 'termination_id' => $term_id]);
if($order->finish_date) {
$billing_start = $order->finish_date;
} else {
$billing_start = date('U');
}
if($op->billing_delay) {
$billing_start = strtotime("+".$op->billing_delay." months");
}
$subject = "";
if($order->upgrade) {
$subject .= "[UPGRADE] ";
}
$subject .= $order->terminations[0]->building->network->name." - "
."Verr. ab ".date("m", $billing_start)."/".date("Y", $billing_start)." - "
.$order->owner->customer_number." - "
.str_replace("\n", "", str_replace("\r\n", " ", $order->owner->getCompanyOrName()));
$this->setReturnValue([
'subject' => $subject,
'from_email' => TT_OUTGOING_EMAIL,
'from_email_name' => TT_OUTGOING_EMAIL_NAME
]);
$nne_products = [];
?>
<?php if($order->upgrade): ?>
Achtung: UPGRADE
<?php endif; ?>
Netzgebiet: <?=$order->terminations[0]->building->network->name?>
Bauabschnitt: <?=(($order->terminations[0]->building->networksection_id) ? $order->terminations[0]->building->networksection->name : "<kein Bauabschnitt>")?>
Kundennummer: <?=$order->owner->customer_number?>
Kunde: <?=str_replace("\n", "", str_replace("\r\n", " ", $order->owner->getCompanyOrName()))?>
Verrechungsstart: <?=date("m", $billing_start)?>/<?=date("Y", $billing_start)?>
Rechnungspositionen
====================
Anzahl | Produktname | Verrechungsperiode | Preis periodisch | Preis Herstellung
-----------------------------------------------------------------------------------------------------------------------
<?php foreach($order->products as $op): ?>
<?php if($op->price_nne > 0.0) $nne_products[] = $op; ?>
<?=sprintf("%-12s", substr($op->amount,0,12))?> | <?=utf8_encode(sprintf("%-42s", utf8_decode(substr($op->product->name,0,42))))?> | <?=utf8_encode(sprintf("%-18s", utf8_decode(($op->billing_period == 12) ? "Jährlich " : (($op->billing_period == 1) ? "Monatlich" : $op->billing_period."-monatlich")) ))?> | <?=sprintf("EUR %-12s", substr($op->price,0,12))?> | EUR <?=$op->price_setup?>
-----------------------------------------------------------------------------------------------------------------------
<?php endforeach; ?>
<?php if(count($nne_products)): ?>
Gutschriften
=============
<?php if($order->terminations[0]->building->network->owner): ?>
Netzeigentümer: <?=$order->terminations[0]->building->network->owner->getCompanyOrName()?>
<?php endif; ?>
Anzahl | Produktname | Verrechungsperiode | Bauabschnitt | NNE
-----------------------------------------------------------------------------------------------------------------------
<?php foreach($nne_products as $op): ?>
<?=sprintf("%-12s", substr($op->amount,0,12))?> | <?=utf8_encode(sprintf("%-42s", utf8_decode(substr($op->product->name,0,42))))?> | <?=utf8_encode(sprintf("%-18s", utf8_decode(($op->billing_period == 12) ? "Jährlich " : (($op->billing_period == 1) ? "Monatlich" : $op->billing_period."-monatlich")) ))?> | <?=sprintf("%-24s", substr(($op->termination->building->networksection_id) ? $op->termination->building->networksection->name : "<Kein Bauabschnitt>",0,24))?> | EUR <?=$op->price_nne?>
-----------------------------------------------------------------------------------------------------------------------
<?php endforeach; ?>
<?php endif; // (count($nne_products))?>