QUAL Remove duplicate code block (#35591)

* QUAL Remove duplicate code block

* fix PHPStan

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
ThomasNgr-OpenDSI 2025-10-03 10:04:27 +02:00 committed by GitHub
parent 0bca7ac7a4
commit de49d24d1b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 30 deletions

View file

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

View file

@ -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