diff --git a/Layout/default/Emailtemplates/preorder-invoice/rml/invoice-email-anb.php b/Layout/default/Emailtemplates/preorder-invoice/rml/invoice-email-anb.php index d5438fefc..98981ecb8 100644 --- a/Layout/default/Emailtemplates/preorder-invoice/rml/invoice-email-anb.php +++ b/Layout/default/Emailtemplates/preorder-invoice/rml/invoice-email-anb.php @@ -5,18 +5,47 @@ $this->setReturnValue([ 'subject' => "Ihre ".(($invoice->total < 0) ? "Gutschrift" : "Rechnung" )." ".$invoice->invoice_number, 'from_email' => "no-reply@rmlinfrastruktur.at", - 'from_email_name' => "Verrechnung | RML Infrastruktur GmbH" + 'from_email_name' => "Rechnung | RML Infrastruktur GmbH" ]); -?> -Sehr geehrte Damen und Herren, -im Anhang übersenden wir Ihnen unsere Abrechnung invoice_date))->modify("-1 month")?> -Im Anhang erhalten Sie Ihre aktuelle total < 0) ? "Gutschrift" : "Rechnung"?>. +$period = "monthly"; + +$netowner_config = TT_PREORDER_BILLING[$invoice->netowner_id]; +$netoperator_config = $netowner_config["netoperators"][$invoice->owner_id]; + +if($period == "monthly") { + $fmt = new IntlDateFormatter( + MFLOCALE_TIME, + IntlDateFormatter::NONE, + IntlDateFormatter::NONE, + "Europe/Vienna", + IntlDateFormatter::GREGORIAN, + 'MMMM' + ); + + $period_date = new DateTime($invoice->invoice_date); + $period_date->modify("-1 month"); + $period_text = $fmt->format($period_date). " ".$period_date->format("Y"); +} +if($period == "quarterly") { + $period_date = new DateTime($invoice->invoice_date); + $period_date->modify("-1 month"); + $bill_quarter = ceil($period_date->format("n") / 3); + $period_text = "Q$bill_quarter ".$period_date->format("Y"); +} +?> +Sg. Damen und Herren, + +im Anhang übersenden wir Ihnen unsere Abrechnung für . Beste Grüße, +RML Infrastruktur GmbH + +Wir bekommen ein Upgrade. Glasfaser für die Region Liezen. +Dieses Projekt wird aus Mitteln der FFG gefördert. www.ffg.at + RML Infrastruktur GmbH Wirtschaftspark A | 8940 Liezen -+43 664 128 10 40 rechnung@rmlinfrastruktur.at | www.rmlinfrastruktur.at www.facebook.com/rmlinfrastruktur diff --git a/Layout/default/Emailtemplates/preorder-invoice/rml/invoice-email.php b/Layout/default/Emailtemplates/preorder-invoice/rml/invoice-email.php new file mode 100644 index 000000000..ee0a6bbe8 --- /dev/null +++ b/Layout/default/Emailtemplates/preorder-invoice/rml/invoice-email.php @@ -0,0 +1,25 @@ +setReturnValue([ + 'subject' => "Ihre ".(($invoice->total < 0) ? "Gutschrift" : "Rechnung" )." ".$invoice->invoice_number, + 'from_email' => "no-reply@rmlinfrastruktur.at", + 'from_email_name' => "Verrechnung | RML Infrastruktur GmbH" +]); +?> +Sehr geehrte Damen und Herren, + +Im Anhang erhalten Sie die Rechnung für die Herstellung Ihres Glasfaseranschlusses. + +Beste Grüße, +RML Infrastruktur GmbH + +Wir bekommen ein Upgrade. Glasfaser für die Region Liezen. +Dieses Projekt wird aus Mitteln der FFG gefördert. www.ffg.at + + +RML Infrastruktur GmbH +Wirtschaftspark A | 8940 Liezen +rechnung@rmlinfrastruktur.at | www.rmlinfrastruktur.at +www.facebook.com/rmlinfrastruktur diff --git a/application/AddressDB/AddressDB.php b/application/AddressDB/AddressDB.php index 156a25d01..163c20c3d 100644 --- a/application/AddressDB/AddressDB.php +++ b/application/AddressDB/AddressDB.php @@ -147,7 +147,7 @@ class AddressDB { if(!$wohneinheit_id) return true; $log = mfLoghandler::singleton(); - //echo "in handleRimoStatusUpdate\n"; + $log->debug(__METHOD__.": =============================== in handleRimoStatusUpdate"); $wohneinheit = new ADBWohneinheit($wohneinheit_id); if(!$wohneinheit->id) { @@ -190,6 +190,14 @@ class AddressDB { $status_matrix = array_reverse(TT_PREORDER_RIMO_STATUS_MATRIX); + $log->debug(__METHOD__.": b_ex_state: ".$b_ex_state); + $log->debug(__METHOD__.": b_op_state: ".$b_op_state); + $log->debug(__METHOD__.": h_ex_state: ".$h_ex_state); + $log->debug(__METHOD__.": h_op_state: ".$h_op_state); + $log->debug(__METHOD__.": wo_state: ".$wo_state); + $log->debug(__METHOD__.": order_type: ".$order_type); + + foreach($status_matrix as $matrix) { //var_dump($matrix); if($matrix["rbop"]) { @@ -218,8 +226,22 @@ class AddressDB { $log->debug(__METHOD__.": new Preorder Status: ".$matrix["p"]); if($preorder) { - $preorderstatus = $matrix["p"]; + $preorderstatus = null; + $preorderstatus_flag = null; + if(array_key_exists("p", $matrix) && $matrix["p"]) { + $preorderstatus = $matrix["p"]; + } + if(array_key_exists("pf", $matrix) && $matrix["pf"]) { + $preorderstatus_flag = $matrix["pf"]; + } + if($preorderstatus) { + $log->debug(__METHOD__.": Setting Preorder Status to ".$preorderstatus); + $preorder->setNewStatusCode($preorderstatus); + $preorder->save(); + } + if($preorderstatus_flag) { + $log->debug(__METHOD__.": Setting Preorder Status Flag ".$preorderstatus); $preorder->setNewStatusCode($preorderstatus); $preorder->save(); }