Automatic unpaid invoice notification - email

Hello,

I have activated a cron job to run the automatic email notification that is sent for unpaid invoices.

In the example proposed by Dolibarr in the latest version 14.0.3, it is indicated " Send an emails when the unpaid invoices reach a due date + n days = today. First param is the offset n of days, second parameter is “all” or a payment mode code, last paramater is the code of email template to use (an email template with EmailTemplateCode must exists. the version in the language of the thirdparty will be used in priority)."

I have set the parameter to 10,all,EMAILCOD

For tests, I have created an invoice with due date 11/11/2021 and I was expecting to get a notification on 21/11/2021 since I have set 10 days as the offset days but I did not any notification and on the planified task, I have a message indicating that this task is looking for invoices that have a due date 31/11/2021 so I do not understand how it works since it should look for invoices that have due date 11/11/2021.

Any idea how it works and if I missed something?

Thank you in advance

Regards

Would -10 work as expected? Just wondering.

Hello,

Thank you for your reply.

In fact I have tried to put -10 and seems to be working. I am waiting to retest this evening.

By the way, I have checked the function facture.class.php and found this comment
@param int $nbdays Delay after due date (or before if delay is negative)”

Either it is a problem with the comment or the code works in the way around :slight_smile:

I will keep you posted
Regards