Fixed creating customer_passive_finished wf value on save

This commit is contained in:
Frank Schubert
2021-11-30 19:43:37 +01:00
parent a866c9e7c3
commit af82db73cf
2 changed files with 4 additions and 4 deletions
@@ -17,7 +17,6 @@
'from_email_name' => "XINON Partnerservice" 'from_email_name' => "XINON Partnerservice"
]); ]);
$nne_products = [];
?> ?>
Rechnungspositionen Rechnungspositionen
@@ -26,7 +25,6 @@ Rechnungspositionen
Anzahl | Produktname | Verrechungsperiode | Preis periodisch | Preis Herstellung Anzahl | Produktname | Verrechungsperiode | Preis periodisch | Preis Herstellung
----------------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------------------
<?php foreach($order->products as $op): ?> <?php foreach($order->products as $op): ?>
<?php if($op->product->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?> <?=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?>
----------------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------------------
+4 -2
View File
@@ -248,8 +248,10 @@ class LineworkController extends mfBaseController {
} }
$item = WorkflowitemModel::getFirst(["name" => "customer_passive_finished", "object_type" => "termination"]); $item = WorkflowitemModel::getFirst(["name" => "customer_passive_finished", "object_type" => "termination"]);
if(!$item->value) { $item->setObjectId($termination_id);
$item->setObjectId($termination_id);
if(!$item->value->id) {
$this->log->debug(__CLASS__."::save(): creating new value 0 for workflowitem because value of customer_passive_finished does not exist yet");
$item->value->value_int = 0; $item->value->value_int = 0;
$item->value->save(); $item->value->save();
} }