Can't create invoice after editing Invoice Group Next ID

Installed Invoice Plane today and when I changed the Invoice Default group’s Next ID from 2 (I had already created an invoice and then deleted it) to 1011 I could no longer create an invoice. I changed the Next ID back to 2 and still no luck. I created a new group. No luck. I can no longer create invoices.

linux
x84_64
php 5.4.33

pastebin link (log data from point where I try to create Invoice):
http://pastebin.com/RtX7zSzX

Is there any error or message shown? Because there are no errors in the log file.

No error. The Create Invoice dialogue box opens and seems to allow me to enter the info. I can choose an existing client’s name and select Invoice Default using the Invoice Group dropdown. But clicking the Submit button has no effect. I can click on Cancel and the dialogue box disappears so the process hasn’t hung. There is simply no response to clicking Submit.

Please open your browsers error console (search on Google for the specific shortcut) and post a screenshot of what is shown in the console.

Hmmm… New users can’t upload images apparently. How else can I get it to you?

Upload it somewhere and paste a link.

https://plus.google.com/photos/105543654356911393911/albums/6140182351741646673?authkey=CMD5lpvwmsKk4wE

“Internal Server Error” this means we need to take a look at your webserver’s error logs.

[21-Apr-2015 10:52:02 America/New_York] PHP Fatal error: Uncaught exception ‘Exception’ with message ‘DateInterval::__construct(): Unknown or bad format (PD)’ in /home/mcgratht/public_html/greenhands/application/modules/invoices/models/mdl_invoices.php:309
Stack trace:
-#0 /home/mcgratht/public_html/greenhands/application/modules/invoices/models/mdl_invoices.php(309): DateInterval->__construct(‘PD’)
-#1 /home/mcgratht/public_html/greenhands/application/modules/invoices/models/mdl_invoices.php(286): Mdl_Invoices->get_date_due(‘2015-04-21’)
-#2 /home/mcgratht/public_html/greenhands/application/core/MY_Model.php(181): Mdl_Invoices->db_array()
-#3 /home/mcgratht/public_html/greenhands/application/core/Response_Model.php(30): MY_Model->save(NULL, NULL)
-#4 /home/mcgratht/public_html/greenhands/application/modules/invoices/models/mdl_invoices.php(166): Response_Model->save(NULL, NULL)
-#5 /home/mcgratht/public_html/greenhands/application/modules/invoices/controllers/ajax.php(141): Mdl_Invoices->create()
-#6 [internal function]: Ajax->create()
-#7 /home/mcgratht/public_html/green in /home/mcgratht/public_html/greenhands/application/modules/invoices/models/mdl_invoices.php on line 309

What’s the date format you using?

I think it’s the default…
04/21/2015

One other thing I did before I noticed this problem was to import a bunch of invoice data. The ip_invoices table has the dates in there as YYYY-MM-DD of course.

Ok. Figured it out.
I had ALSO removed the default value for “Invoices Due After (Days)” but should have set it to 0, not blank. Put a 0 in and invoices are now being created with the correct Next ID.
Sorry for the runaround.

1 Like