Merge branch 'fronkdev' into 'master'

Rimo Import: Fixed setting Preorderstatus to 140 when setting flag 141

See merge request fronk/thetool!1226
This commit is contained in:
Frank Schubert
2025-04-15 13:29:35 +00:00
3 changed files with 84 additions and 8 deletions

View File

@@ -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 <?=(new DateTime($invoice->invoice_date))->modify("-1 month")?>
Im Anhang erhalten Sie Ihre aktuelle <?=($invoice->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 <?=$period_text?>.
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

View File

@@ -0,0 +1,25 @@
<?php
/**
* @var Invoice $invoice
*/
$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"
]);
?>
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

View File

@@ -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();
}