Jump to content

How to Change the initial order number?


Recommended Posts

Unfortunately, I don't think this is possible. But still as it seems you want to include the date in the order number. You can always check the order date if you have the order ID.

The only option would be to manually alter those in the database which will most probably cause discrepancies.

Finally if you want to change the order no. for the invoice only so it is provided differently for your customer you can edit the PDF before sending it, then again this would be too much work.

Link to comment
Share on other sites

Do not change the invoice number !!!.
This will crash your shop and no orders can be placed anymore...


What a load of rubbish!!
This is an option in the BO for changing the invoice number. Why would you not be able to accept orders??
I have used it and my shop works perfectly.
Link to comment
Share on other sites

What a load of rubbish!!
This is an option in the BO for changing the invoice number. Why would you not be able to accept orders??
I have used it and my shop works perfectly.


Not a load of rubbish (what a un-nice word).
There is a confirmed bug (1.3.0) see here

So to put it bluntly again. Do not put the invoice number at 0...
Go ahead try it. ;-)
Link to comment
Share on other sites

Why put the invoice number to 0.
If you know that causes a problem start the invoices at 1.
I am using version 1.2.4 and have changed the invoice number to a higher number to follow on from my last shop and it works no problem.
Just because you had a problem with changing the invoice number does not mean that it will stop all orders and make the shop stop working. The feature is there for a reason, to change the invoice number.
There is no mention they want to set this to 0, so instead of all the doom and gloom why could you not have responded that if they are using 1.3.0 do not set the number to 0.

Link to comment
Share on other sites

Well, the reason is to inform you & others that if you put the invoice on 0, (and why not) then
the ordering will not function properly. (in 1.2.5 & 1.3.0.1). All your order will fail with a "Invalid Invoice Number".

There are multiple users complaining about this, so this is a helpful comment. And the bug has been solved in the SVN.

Link to comment
Share on other sites

hello.

Not sure if this will be of any use, but we edited pdf.php so that the Invoice No.# gets replaced with the Order No#. Solves the problem of different order and invoice numbers on pdf invoices, as that can happen once in a while if you're deleting test orders etc. Also you don't need to enter the current correct invoice number into the backend before printing your invoices

http://www.prestashop.com/forums/viewthread/42954/

thanks

Link to comment
Share on other sites

Did you encounter any bugs after changing them over?


hello.

Not sure if this will be of any use, but we edited pdf.php so that the Invoice No.# gets replaced with the Order No#. Solves the problem of different order and invoice numbers on pdf invoices, as that can happen once in a while if you're deleting test orders etc. Also you don't need to enter the current correct invoice number into the backend before printing your invoices

http://www.prestashop.com/forums/viewthread/42954/

thanks
Link to comment
Share on other sites

No, it's fine - we've had it running on 3 seperate installations without any problems for the last week. I think if any problems arose with it, I doubt it would affect the back-end/database anyway as the pdf.php file just takes info from the database to create the pdfs, rather than putting information into it.

thanks

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
  • 1 year later...

Hi,

 

I needed similar custom invoice change so maybe this can help someone:

  • if you need invoice number e.g. FG2011001, just enter FG2011001 as a Invoice number in BO > Orders > Invoices and next number will be FG2011001, then FG2011002 etc.
  • You can do the same by entering the prefix FG2011 and number as 1 and change following in /classes/PDF.php

from

 

 

$this->Cell(77, 10, self::l('INVOICE #').' '.Tools::iconv('utf-8', self::encoding(), Configuration::get('PS_INVOICE_PREFIX', intval($cookie->id_lang))).sprintf('%06d', self::$order->invoice_number), 0, 1, 'R');

 

to

 

$this->Cell(77, 10, self::l('INVOICE #').' '.Tools::iconv('utf-8', self::encoding(), Configuration::get('PS_INVOICE_PREFIX', intval($cookie->id_lang))).sprintf('%03d', self::$order->invoice_number), 0, 1, 'R');

 

Not sure if there are some dependencies, I personally used the first solution and didn't test this further so TEST IT CAREFULLY before you set this to production, but it should work and affact the generated PDF invoice only, because sprintf function just adds the leading zeroes to the number, so we are just changing it from 6 digits to required value. This is the place in code where you can probably add some php function to add date into the invoice number as well.

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