Files
thetool/Layout/default/Emailtemplates/order/billing_external_energie.php
2024-02-20 20:20:48 +01:00

132 lines
3.5 KiB
PHP

<?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->name?>
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->name?>
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; ?>