Jump to content

Invoice number different of order number


Recommended Posts

Hi All,

 

As I say in my title, the N° of invoice is different of N° of order.

That means in the table ps_order_invoice the field "number" content is not the same of "id_order" filed.

 

Of course I can create a request update to correct that but it's not the solution.

Which php file I can modify ? I would like the system enters the data number = id_order on the insert request step (when the order is paid and invoice generated) 

 

I saw a solution which consists to modify the invoice template, but I'm not sure it's fine.

Could you help me ?

Link to comment
Share on other sites

If you want the id_order to appear on your invoice you should change the order reference.

It is quite normal that after a while the id_order doesn't match the id_order_invoice, because with every cancelled order just the order number increases, whereas the id_order_invoice would only be increased by generating an invoice.

This is just a question of practical logic.

Link to comment
Share on other sites

Yes, true.

But if the order is N° 11835 and the invoice PDF shows invoice 11842 then the customer is lost.

 

I found this solution in the classes/pdfHTMLTemplateInvoice.php in the construct :

 

$this->title = (int)$this->order_invoice->id_order;

 

instead of :

 

$this->title = $order_invoice->getInvoiceNumberFormatted($id_lang);

 

Thanks for your help.

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