New Preorder cancelling

This commit is contained in:
Frank Schubert
2024-02-15 20:44:04 +01:00
parent 0d62e07d3e
commit dfa8d7ca1d
14 changed files with 138 additions and 44 deletions
@@ -363,13 +363,12 @@ class PreordernotificationController extends mfBaseController {
// get and save preorder count
$preorder_filter = json_decode($notification->preorder_filter, true);
$preorder_filter['preordercampaign_id'] = $notification->preordercampaign_id;
$preorder_filter['deleted'] = null;
$preorder_count = PreorderModel::count($preorder_filter);
$preorder_count = PreorderModel::countActive($preorder_filter);
$notification->recipient_count = $preorder_count;
$notification->save();
if($r->send_testmail && $r->testmail_to) {
$preorder = PreorderModel::getFirst($preorder_filter);
$preorder = PreorderModel::getFirstActive($preorder_filter);
if(!$preorder) {
$this->layout()->setFlash("Testmail konnte nicht versendet werden. Keine Empfänger gefunden", "warn");
$this->redirect("Preordernotification", "edit", ['id' => $new_id]);