fixed email logic in Order/Save

This commit is contained in:
Frank Schubert
2024-08-01 14:34:33 +02:00
parent dd6f8c0dc2
commit 059d0968f3
2 changed files with 8 additions and 5 deletions

View File

@@ -74,7 +74,10 @@ class ContractqueueController extends mfBaseController {
protected function importFinishedOrdersAction() {
$o = 0;
$max_orders = 1500;
foreach(OrderModel::search(["finish_date<" => date("U")]) as $order) {
$not_before = new DateTime("2024-07-10");
foreach(OrderModel::search(["finish_date" => true, "finish_date<" => date("U"), "finish_date>" => $not_before->getTimestamp()]) as $order) {
if(!is_array($order->products) || !count($order->products)) {
//echo "keine Produkte in Order ".$order->id."\n";
continue;

View File

@@ -1161,7 +1161,7 @@ class OrderController extends mfBaseController {
// send order finish email
if($send_to_bill_email) {
if($ext_products && !$int_products) {
if($ext_products) {
if(!$order->sendExtBillinfoEmail(new Address($ext_product_owner_id))) {
$this->layout()->setFlash("Beim Senden der externen Billing Benachrichtigung ist ein Fehler aufgetreten.", "warning");
}
@@ -1173,12 +1173,12 @@ class OrderController extends mfBaseController {
}
}
}
if($int_products) {
/*if($int_products) {
if(!$order->sendIntBillinfoEmail()) {
$this->layout()->setFlash("Beim Senden der Billing Benachrichtigung ist ein Fehler aufgetreten.", "warning");
}
}
}*/
if($int_products && $ext_products) {
//$this->layout()->setFlash("Eigene und Fremdprodukte gefunden, nur interne Billing Benachrichtigung verschickt.", "warning");