Relance facture

Bonjour,

L’option cachée FACTURE_SHOW_SEND_REMINDER permet d’activer les relances des factures, malheureusement souvent nécessaires, mais le template email est buggé car il n’utilise pas la traduction « PredefinedMailContentSendInvoiceReminder », mais « PredefinedMailContentSendInvoice ».

Le problème vient du fichier compta/facture.php qui fait le test suivant " if ($action == ‹ prerelance ›)", en ligne 3151 alors qu’en ligne 3148, il défini une autre valeur.

Donc forcément, on ne fait jamais de relance …

Je propose donc le correctif suivant :

Avant :

else
            {
                /*
                 * Affiche formulaire mail
                 */

                // By default if $action=='presend'
                $titreform='SendBillByMail';
                $topicmail='SendBillRef';
                $action='send';
                $modelmail='facture_send';

                if ($action == 'prerelance')	// For backward compatibility
                {
                    $titrefrom='SendReminderBillByMail';
                    $topicmail='SendReminderBillRef';
                    $action='relance';
                    $modelmail='facture_relance';
                }

                $ref = dol_sanitizeFileName($object->ref);
                include_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
                $fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref);
                $file=$fileparams['fullname'];

Après :

 else
            {
                /*
                 * Affiche formulaire mail
                 */

                // By default if $action=='presend'
                if ($action == 'prerelance')	// For backward compatibility
                {
                    $titrefrom='SendReminderBillByMail';
                    $topicmail='SendReminderBillRef';
                    $action='relance';
                    $modelmail='facture_relance';
                }
				else
				{
					$titreform='SendBillByMail';
					$topicmail='SendBillRef';
					$action='send';
					$modelmail='facture_send';
				}

                $ref = dol_sanitizeFileName($object->ref);
                include_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
                $fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref);
                $file=$fileparams['fullname'];

Cela affectait Dolibarr 3.1 et affecte aussi Dolibarr 3.2

1 « J'aime »

Bonjour Maxime,

Ce sujet est déjà un peu ancien, mais visiblement toujours d’actualité
sur la version 3.2.3.

Merci pour cette astuce qui m’a été fort utile.
En espérant pouvoir revenir avec une prochaine version à un fonctionnement
plus « naturel ».

Cordialement,
Benoist.