V1.6.0 Invoice due date reverts to invoice date post email

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

Good issue and you described it in a good way.

@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

  1. Invoice created and saved with an invoice date of 07/07/2023
  2. Invoice Due Date set to 10/07/2020 and saved
  3. Invoice checked via PDF and reads correctly
  4. Invoice sent to client
  5. 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.

Hi, that is correct, Step2 2020 is a typo (Invoice Due Date set to 10/07**/2020** and saved), should read 10/07/2023, my bad,

Regards, Dave

1 Like

Hi all,

Is there an update to this bug as it’s causing a few issues when sending invoices out as credit periods are not being honoured on the invoices?

Regards,

I thought i had posted it as a bug, but i hadn’t.

I just created this bug, just a few seconds ago, my apologies.

If no-one else takes on the challenge of solving it then i’ll do it.
I’ll let you know when it’s done.

Hello,

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

V1.6.0

(edit: fixed typo in version number)

1 Like

The Due date is also changed on the original invoice page and also when the invoice is downloaded as a PDF after the email has been sent

1 Like

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.

Screenshot of the PDF file prior to sending:

Screenshot of the PDF file sent (today 04/08/2023) using the email function:

Screenshot of the invoice page prior to sending:

Screenshot of the invoice page after sending the email:

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

That’s going to be a bug report.
Would you mind adding the exact steps we need to to do to create that bug
Up until sending invoice, etc

@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?

Version 1.6.0 …

1 Like

The exact steps…

Create invoice with Invoice date 31/07/2023
Due date 11/08/2023…and Save

Download PDF from invoice creation page and check dates…

image

Email invoice from invoice creation page…

Send email and the browser goes to the invoice creation page. Both Invoice date and Due date have changed to today’s date…

Download the PDF file and the dates are also changed to today’s date…

image

Check email received with invoice attached and the Invoice date and due date are also changed to today’s date…

image

Check Guest link, and likewise also changed to today’s date…

Hope this helps

2 Likes

Thank you for those excellent steps!
Really appreciated

Here are the steps, to prevent this behaviour:
Go to Settings / Invoices
Scroll down to Other Settings

For your case … set it to Yes :slight_smile:

Before:


After:

Hope it helps!

2 Likes

Excellent, that has fixed the issue. I’ve resent the test invoice with the original dates and they have remained the same after sending :+1:

One little note, the description of the field in Settings>System Settings> Invoices is missing it’s text, please see the screenshot below:

Awesome work and support, many thanks.

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',

It will be added in version 1.6.1 for sure

1 Like

Thanks, I’ve added it…

2 Likes

So version 1.6.1 after all, as I suspected.

What is the effect of this setting?

  1. Current (default) procedure … (No)
  • 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.

  1. 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 :wink: )