When creating a new invoice and setting the Invoice Date and Due Date everything seems fine, however once the invoice is sent via email to the client the Due Date reverts back to the Invoice Date.
eg:
Invoice created and saved with an invoice date of 07/07/2023
Invoice Due Date set to 10/07/2023 and saved
Invoice checked via PDF and reads correctly
Invoice sent to client
Invoice Due Date reverts back to Invoice Date, ie 07/07/2023
When checking the PDF sent to the client the Due Date also show 07/07/2023, not the Due Date of 10/07/2023
@webbouk can you doublecheck if below questions are answered correctly?
It’s the bug report template we need to reproduce bugs.
If we can reproduce the bug, we can post it as a bug report and make a pull-request
Expected Behavior
When an Invoice Due Date is set to 10/07/2023 and sent to the client, the Due Date shouldn’t change (to the Creation Date)
Current Behavior
When checking the PDF after it was sent to the client, the Due Date also show 07/07/2023, not the Due Date of 10/07/2023
Possible Solution
After a PDF is sent to the client, triple check that the Due Date is not updated.
Steps to Reproduce
Invoice created and saved with an invoice date of 07/07/2023
Invoice Due Date set to 10/07/2020 and saved
Invoice checked via PDF and reads correctly
Invoice sent to client
Invoice Due Date reverts back to Invoice Date, ie 07/07/2023
Detailed Description
When creating a new invoice and setting the Invoice Date and Due Date everything seems fine, however once the invoice is sent via email to the client the Due Date reverts back to the Invoice Date.
I must say that I cannot reproduce this bug in any way.
If I understand correctly, the due date on the pdf has been changed to the creation date after sending the mail. @webbouk:
Is this only on the sent PDF or is the original due date also changed in other places, e.g. on your original invoice page and/or also when you view your invoice via the menu item “Options - Download PDF”?
Is the correct due date listed when you view the “Guest URL” (if you have not changed the InvoicePlane_Web template)?
Also check here what you see when you click the “Download PDF” button.
If this only happens on the transmitted PDF then I would suggest taking a look at your template to see if that is where the problem is…
Basically when I create and save with today’s date as the invoice date
Then set the Invoice Due Date to a date in the future, eg plus 7 days, and save
I then check the invoice by downloading the PDF and it reads correctly
The Invoice is then sent to the client
Upon checking the invoice after it has been sent,
The Invoice Due Date reverts back to the Invoice Date
When checking the PDF sent to the client from a BCC’d email to myself the Due Date also shows the invoice date, not the Due Date (eg plus 7 days)
Likewise when checking the Guest URL
If I change the Due date back to plus 7 days it is then correct in the Guest Url and likewise if I check the PDF
The date change only seems to happen once the invoice has been emailed to the client
One other thing I’ve just noticed relating to the above, I’ve just resent an invoice as ‘overdue’ with a creation date of 21/07/2023 and a due date of 23/07/2023 which I changed after the initial sending (the due date when first sent reverted back to the creation date). Both the creation date and the due date changed to today’s date after the reminder email was sent (just now)
It seems that whenever an invoice is sent via email, the creation date and the due date is set to the date the email is sent, if that makes sense.
@webbouk
I see in the title of this post that it would be a problem with version V1.6.0.
However in one of your last post (#7) at the bottom it says V1.6.1.
Can you specify which version that you are effectively using here?
One little note, the description of the field in Settings>System Settings> Invoices is missing it’s text, please see the screenshot below:
I think that one was added / improved in version 1.6.1
The solution is:
open /application/language/english/ip_lang.php
add: 'no_update_invoice_due_date_mail' => 'Disable the change of invoice date and due date before emailing',
When you want to send an invoice the creation date of the invoice is automatically changed to today’s date of sending the email.
Add the number of due days and this then gives the invoice due date.
Example: (Invoices Due After (Days)) = 14 days. The invoice is created on July 01 and changed on July 05 and on July 07. The invoice is then sent on July 10. So the invoice (shipping) date is changed to July 10 and the due date is then automatically set to July 24.
Previous procedure … (Yes)
If you don’t want the above method then you should set the setting to Yes and then the old way is kept and the set invoice date and due date are adopted.
Interesting problem but still not a bug.
So this functionality works as designed.
If in the invoice settings (Invoices Due After (Days)) is set to 0 days then when the invoice is sent, the due date (as in this case and if the setting has not been changed to Yes) will automatically be set or equal to the send date.
Conclusion: set your number of due days to e.g. 14 or 30 days (and not 0 )