From de49d24d1b9982d8a4c44b03ab8bc1efa9d1d52d Mon Sep 17 00:00:00 2001 From: ThomasNgr-OpenDSI Date: Fri, 3 Oct 2025 10:04:27 +0200 Subject: [PATCH] QUAL Remove duplicate code block (#35591) * QUAL Remove duplicate code block * fix PHPStan --------- Co-authored-by: Laurent Destailleur --- .../facture/doc/pdf_sponge.modules.php | 3 +- ...terface_50_modTicket_TicketEmail.class.php | 28 ------------------- 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 502740512d4..5545a7b1636 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1745,8 +1745,7 @@ class pdf_sponge extends ModelePDFFactures $total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); // Total remise - $total_line_remise = 0; - $total_line_remise_print = 0; + $total_line_remise_print = $total_line_remise = 0; foreach ($object->lines as $i => $line) { $resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2); $total_line_remise += (is_numeric($resdiscount) ? $resdiscount : 0); diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 8fe6a3bdcb4..486da7aa88b 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -198,34 +198,6 @@ class InterfaceTicketEmail extends DolibarrTriggers } } - // Send email to assignee if an assignee was set at creation - if ($object->fk_user_assign > 0 && $object->fk_user_assign != $user->id && empty($object->context['disableticketemail'])) { - $userstat = new User($this->db); - $res = $userstat->fetch($object->fk_user_assign); - if ($res > 0) { - // Send email to notification email - if (!getDolGlobalString('TICKET_DISABLE_ALL_MAILS')) { - // Send email to assigned user - $sendto = $userstat->email; - if (!getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) { - $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO; - $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; - } - - if (!empty($sendto)) { - $this->composeAndSendAssigneeMessage($sendto, $subject_assignee, $body_assignee, $see_ticket_assignee, $object, $langs); - } - - if (!getDolUserString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) { - $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; - } - } - } else { - $this->error = $userstat->error; - $this->errors = $userstat->errors; - } - } - // Send email to customer // Note: $object->context['disableticketemail'] is set to 1 by public interface at creation because email sending is already managed by page // $object->context['createdfrompublicinterface'] may also be defined when creation done from public interface