You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -225,6 +228,11 @@ public function doValidateDraftInvoices($restrictonthirdpartyid = 0, $maxtoproce
225
228
}
226
229
227
230
$invoice->context['actionmsgmore'] = 'Invoice id = '.$invoice->id.' validated by doValidateDraftInvoices()';
231
+
if ($invoice->mode_reglement_code == $codepaiementtransfer) {
232
+
$invoice->context['actionmsgmore'] .= '. Payment mode is a credit transfer ('.$invoice->mode_reglement_code.') so we will send an email to the customer after validation to inform it about invoice availability.';
233
+
} else {
234
+
$invoice->context['actionmsgmore'] .= '. Payment mode is NOT a credit transfer ('.$invoice->mode_reglement_code.') so no email is sent after the invoice validation. May be done later by another process.';
235
+
}
228
236
229
237
$result = $invoice->validate($user); // Validate invoice (does not regenerate the PDF)
230
238
@@ -259,9 +267,6 @@ public function doValidateDraftInvoices($restrictonthirdpartyid = 0, $maxtoproce
259
267
if (!$errorforinvoice) {
260
268
dol_syslog("-- Check if invoice payment mode is a differed mode (direct debit or credit transfer): mode_reglement_code=".$invoice->mode_reglement_code);
261
269
262
-
$codepaiementdirectdebit = 'PRE';
263
-
$codepaiementtransfer = 'VIR';
264
-
265
270
if ($invoice->mode_reglement_code == $codepaiementdirectdebit || $invoice->mode_reglement_code == $codepaiementtransfer) {
266
271
// If customer invoice is an invoice to pay with a direct debit or is waiting a credit transfer
$moreinheader = 'X-Dolibarr-Info: doValidateInvoice invoice is available'."\r\n";
443
448
$addr_cc = '';
444
449
if (!empty($invoice->thirdparty->array_options['options_emailccinvoice'])) {
445
450
dol_syslog("We add the recipient ".$invoice->thirdparty->array_options['options_emailccinvoice']." as CC to warn about invoice availability (direct debit or credit transfer case)", LOG_DEBUG);
0 commit comments