Jump to content
foxnetwork

[Solved] Change invoice number in 1.4

Recommended Posts

I have been trying to change starting invoice number in BO under orders but it still wants to stay at the same number.
Delivery slips works but not the new invoice number. Still stuck on 2 instead of starting point of 500.

Is there some where I can do this directly in the database

Thanks

Share this post


Link to post
Share on other sites

yes go to your phpmyadmin, find the exact table for invoices and change auto increment number to your preference.

Share this post


Link to post
Share on other sites

I have looked in mysql and cannot find where to change it. There is no invoices database

Help on this needed urgently

Share this post


Link to post
Share on other sites

Ofc there is an DB in the configuration table, however i saw that there is option for that in the back office too. See the attached screenshot and fill the field Invoice number as you like.

to do it from the phpmyadmin, go to ps_configuration and find invoice number and change the value to the desired one. see the second screenshot.

46525_sjVWPHtJRwY3ZK23LR7H_t

46526_jvMOLefdm8fsCRdaPWT4_t

  • Like 2

Share this post


Link to post
Share on other sites

I tried the change of invoice number in BO but it will not change it stays the same.

I looked in the ps_configuration and I have only what is in the image attached. tried to change invoice start number from 4 to 550 but in BO it still says next invoice 6

Mayby this is why the BO invoice change doesnt work

Share this post


Link to post
Share on other sites

The change will be valid from the invoices created after the change. This won't change the number of the old invoices. If you want to change the number of the old invoices, you will have to look in the DB and browse your DB invoices and change the number of every invoice.

Share this post


Link to post
Share on other sites

Never attached the image last time. Here it is. Also I am not worried about the old invoice but after changing the number . I tried again and it gave me invoice of 6 not the number i put in

46531_YL43CSF0aiXeDtekXMu2_t

  • Like 1

Share this post


Link to post
Share on other sites

this is the invoice number that shows up in BO under the chage invoice number.

I went through the database and id 37 PS_INVOICE_NUMBER was missing so I added it and changed the number but still nothing still shows next invoice as no 6. If I create another sale the invoice goes to 7 so somewhere it is changing it but where. USing ps1.4.2

Share this post


Link to post
Share on other sites

Yes you are right, i test it on clean install 1.4.2.5 presta and Back Office start number don't work. i looked at AdminInvoices.php and it seems that script is calling missing database "PS_INVOICE_START_NUMBER", i had only "PS_INVOICE_NUMBER" and i'm not sure where should start number table must be.

I suggest to submit a bug in presta forge.

Share this post


Link to post
Share on other sites

I have submitted bug.
Also i have renamed 'PS_INVOICE_NUMBER to PS_INVOICE_START_NUMBER but it didn't work. The code in the AdminInvoices is


if ((int)(Tools::getValue('PS_INVOICE_START_NUMBER')) != 0 AND (int)(Tools::getValue('PS_INVOICE_START_NUMBER')) <= Order::getLastInvoiceNumber())
               $this->_errors[] = $this->l('Invalid invoice number (must be > ').Order::getLastInvoiceNumber() .')';

Share this post


Link to post
Share on other sites

Ok I think I fixed it

You have to change PS_INVOICE_START_NUMBER or even ad this to ps_configuration if it isnt already there.

Mine was but it had ps_INVOICE_START_NUMBER instead of PS_INVOICE_START_NUMBER

Changed this and went back to backoffice and invoice now changes


Thanks for your help

  • Like 1

Share this post


Link to post
Share on other sites

I changed the Invoice number in PS_INVOICE_START_NUMBER
But when I will order. The order will be with right invoice for example I changed PS_INVOICE_START_NUMBER for 10
Next order will be with invoice number 10.

But after next order again some kind of other digits...

Share this post


Link to post
Share on other sites
Ok I think I fixed it

You have to change PS_INVOICE_START_NUMBER or even ad this to ps_configuration if it isnt already there.

Mine was but it had ps_INVOICE_START_NUMBER instead of PS_INVOICE_START_NUMBER

Changed this and went back to backoffice and invoice now changes


Thanks for your help


Hi, I've checked and I do have the PS_INVOICE_START_NUMBER, changed the number value, then the next order was processed well, but then again back to number 0, so it doen't work for me.
do i have to change any code anywhere?
thanks

Share this post


Link to post
Share on other sites


Hi, thanks for replying.
Yeah, I saw that post before but haven't found the solution there.
I do have the PS_INVOICE_START_NUMBER field in the ps_configuration table but the number doesn't increase when having a new order, and changing the "state" of the order gives a numer like:
CU000000, the CU is the prefix and the zeros is the number it gives to the invoice.
The order also shows that was created: 0000-00-00 00:00:00 , so it's an error also.

Does it happen also with version 1.4.3?
thanks

Share this post


Link to post
Share on other sites

Ofc there is an DB in the configuration table, however i saw that there is option for that in the back office too. See the attached screenshot and fill the field Invoice number as you like.<br/><br/>to do it from the phpmyadmin, go to ps_configuration and find invoice number and change the value to the desired one. see the second screenshot.

 

Thanks Dreamtheme!

Share this post


Link to post
Share on other sites

hi guys - sorry for being a bit thick here but i cant find the table you described on invoices - could you direct me to it please? (ive scoured the whole site) - thanks

Jon

Share this post


Link to post
Share on other sites

I met this issue on PS 1.5.4 and my solution was to delete PS_INVOICE_START_NUMBER from table ps_configuration because this was there two times.

  • Like 1

Share this post


Link to post
Share on other sites

Ok I think I fixed it

 

You have to change PS_INVOICE_START_NUMBER or even ad this to ps_configuration if it isnt already there.

 

Mine was but it had ps_INVOICE_START_NUMBER instead of PS_INVOICE_START_NUMBER

 

Changed this and went back to backoffice and invoice now changes

 

 

Thanks for your help

 

 

Interesting this occurs in 1.6 also. Fixed it by using this method. There are two INVOICE_START_NUMBER tables in the db, why? A bug I expect.

Share this post


Link to post
Share on other sites

I can't believe this bug is still present in 1.6. I have the very last version and I was getting CRAZY trying to fix this problem. I'll try the solution given in the above posts, hope it works.

 

Thank you to everyone.

Share this post


Link to post
Share on other sites

Here with PS 1.6.0.9 same issue....Invoice number after changed on BO don't work and PDF Invoice still using "old" number...

 

Any solution ?!?

Share this post


Link to post
Share on other sites

I met this issue on PS 1.5.4 and my solution was to delete PS_INVOICE_START_NUMBER from table ps_configuration because this was there two times.

 

I thought that was an error too but It seem to relate with multistore function: it would have 2 tables, one for each store.

I solved this error changing the Id_shop number for 1 (in my case) instead "null" in one of the PS_INVOICE_START_NUMBER

Cheers!

Share this post


Link to post
Share on other sites

This solution works well! (1.5.6.2)

Go to your "ps_configuration" table, search for "PS_INVOICE_START_NUMBER" and change the value ;-)

 

 

post-769771-0-82648800-1452160300_thumb.jpg

Edited by fatum (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More