Jump to content

Order number as invoice number


Recommended Posts

Hi everybody,

 

I'm not just a newbie here in prestashop, but a newbie at almost everything.

My problem is this:

 

I want to show my order reference number as the same as my invoice number.

I have set my invoice prefix and generation fine.

 

Prestashop version: 1.5.3.1

 

This, I believe is common practice, order number = invoice number.

 

I've spent the last 4-5 hours on the forum trying to find out how to do this and have been unable to.

 

Does anyone have the "Idiots Guide" to setting the order reference number to the same as the invoice number?

 

I would really appreciate this help.

 

Thanks in advance for your kind guidance.

 

Is there nobody out there whose had this problem?

It's taking a really long time.

Ah well - if I can't get the info/help, I'll have to move on!

That's the problem with these opensource things - you get f**kall support unless you pay an arm and a leg. They they mither you to death.

 

We'll see

Edited by mkwdmike (see edit history)
Link to comment
Share on other sites

  • 2 months later...

Solved v 1.5.4 Order number #23 reference number (000023) and invoice number #IN000023 can be same.

[sharedmedia=core:attachments:72198

if your order invoice number is different then make changes in your database in these tables id_order_invoice , id_order both field should be same in ps18_order_invoice_payment table

id_order_invoice id_order number ps18_order_invoice all these should be same.

Edited by iansari13 (see edit history)
  • Like 1
Link to comment
Share on other sites

Solved v 1.5.4 Order number #23 reference number (000023) and invoice number #IN000023 can be same.

 

 

if your order invoice number is different then make changes in your database in these tables

 

id_order_invoice , id_order both field should be same in ps18_order_invoice_payment table

 

id_order_invoice , id_order ,number ps18_order_invoice all these should be same.

Link to comment
Share on other sites

stumble on the problem today, when decided to change the order ref from lets say FSJJSKSAJKJBS to 747569835 using the free module "modrefchange". that led to the need of a custom order id, identical to ref id 747569835. browsed around and found another free mod "numerique" in which you can choose the order id starting point. Combined the two modules gave me identic ref and order ids. i thought it was all in order, until ive made a test order and saw the invoice id still #23. it came as a shock as i thought its related to order id. for now i will just change the invoice number from BO to match my order and ref. number.

If any of you got ideas how to make invoice# follow order # it would be great.thanks.

Link to comment
Share on other sites

stumble on the problem today, when decided to change the order ref from lets say FSJJSKSAJKJBS to 747569835 using the free module "modrefchange". that led to the need of a custom order id, identical to ref id 747569835. browsed around and found another free mod "numerique" in which you can choose the order id starting point. Combined the two modules gave me identic ref and order ids. i thought it was all in order, until ive made a test order and saw the invoice id still #23. it came as a shock as i thought its related to order id. for now i will just change the invoice number from BO to match my order and ref. number.

If any of you got ideas how to make invoice# follow order # it would be great.thanks.

 

it can be achieved through php myadmin database find out the tables related to order and change the value to "int" to get the order or reference number as 747569835.

  • Like 1
Link to comment
Share on other sites

  • 3 months later...

Just edit the following and change what I put in bold:

 

classes/pdf/HTMLTemplateInvoice.php:

 

line 46:

$this->title = HTMLTemplateInvoice::l('Invoice ').' #'.Configuration::get('PS_INVOICE_PREFIX', $id_lang).sprintf('%06d', $order_invoice->id_order);

 

line 141:

return Configuration::get('PS_INVOICE_PREFIX').sprintf('%06d', $this->order_invoice->id_order).'.pdf';

  • Like 1
Link to comment
Share on other sites

  • 5 months later...

Hi there,

 

I have a default install of PrestaShop 1.5.6.1 but the code is different to the example above. Could you please advise what to chage on the below in order to get the order numbers to tally up with the invoice numbers.

The code I have on line 46:

 

$this->title = HTMLTemplateInvoice::l('Invoice ').' #'.Configuration::get('PS_INVOICE_PREFIX', $id_lang, null, (int)$this->order->id_shop).sprintf('%06d', $order_invoice->number);
        // footer informations
        $this->shop = new Shop((int)$this->order->id_shop);

 

The code I have on line 141:

return Configuration::get('PS_INVOICE_PREFIX', Context::getContext()->language->id, null, $this->order->id_shop).sprintf('%06d', $this->order_invoice->number).'.pdf';
 

Any help is much appreciated.

Link to comment
Share on other sites

  • 3 months later...

Just edit the following and change what I put in bold:

 

classes/pdf/HTMLTemplateInvoice.php:

 

line 46:

$this->title = HTMLTemplateInvoice::l('Invoice ').' #'.Configuration::get('PS_INVOICE_PREFIX', $id_lang).sprintf('%06d', $order_invoice->id_order);

 

line 141:

return Configuration::get('PS_INVOICE_PREFIX').sprintf('%06d', $this->order_invoice->id_order).'.pdf';

 

This works, but it does not change the document name (ie. the name of the pdf file that is attached to emails). It still uses the old numbering system. Also the old invoice number appears in the back-office in the orders page. How can we update these with the above method?

 

Thanks!

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...