Jump to content

[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

Link to comment
Share on other sites

  • 2 weeks later...

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
Link to comment
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

Link to comment
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.

Link to comment
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

Link to comment
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.

Link to comment
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() .')';

Link to comment
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
Link to comment
Share on other sites

  • 4 weeks later...

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...

Link to comment
Share on other sites

  • 2 weeks later...
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
Link to comment
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
Link to comment
Share on other sites

  • 1 month later...

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!

Link to comment
Share on other sites

  • 5 months later...
  • 1 year later...
  • 4 weeks later...
  • 10 months later...

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.

Link to comment
Share on other sites

  • 3 months later...
  • 2 months later...
  • 1 month later...

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!

Link to comment
Share on other sites

  • 11 months later...
  • 9 months later...
  • 9 months later...

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...