Merge pull request #24609 from FHenry/17_fix_cron_invoice_contact

fix: cron sendEmailsRemindersOnInvoiceDueDate if contact exists and mail on thridparty exists there is an error
This commit is contained in:
Laurent Destailleur 2023-04-26 21:12:47 +02:00 committed by GitHub
commit 0878c53f02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5550,8 +5550,9 @@ class Facture extends CommonInvoice
}
if (empty($to) && !empty($recipient->email)) {
$to[] = $recipient->email;
} else {
$errormesg = "Failed to send remind to thirdparty id=".$tmpinvoice->socid.". No email defined for user.";
}
if (empty($to)) {
$errormesg = "Failed to send remind to thirdparty id=".$tmpinvoice->socid.". No email defined for invoice or customer.";
$error++;
}
} else {