[Skip to main content](#vessel-content)

#   Have different invoice and order numbers

##

- **[Hodgebw](/forum/user/2167-hodgebw "View Hodgebw's Profile")**
- [![Hodgebw's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/2167-hodgebw "View Hodgebw's Profile")
- [ Offline](/forum/user/2167-hodgebw)

Less More

- Posts: 105
- Thank you received: 0
-
-

13 years 4 days ago [\#133442](#133442) by [Hodgebw](/forum/user/2167-hodgebw "View Hodgebw's Profile")  Replied by *[Hodgebw](/forum/user/2167-hodgebw "View Hodgebw's Profile")* on topic *[Have different invoice and order numbers](/forum/4-how-to/81772-have-different-invoice-and-order-numbers?start=20#133442 "Hi, two questions about invoices.  1) I want to have an order number and a different invoice number.  I read the documentation and in hikashop&gt; Configuration&gt; Main&gt; Order I set order number as {automatic&#95;code} and invoice number as {date format=&quot;Y&quot;}{id size=&quot;5&quot;} but when I see the pre-print invoice the invoice number is the same as order number.  How can I have different numbers?  2) I want to print the order number in the invoice, just above the invoice number, between the date and the invoice number. How?")*

OK. I went to that file and searched for the code you gave me, (plugins/hikashop/attachinvoice/attachinvoice/invoice.php of the plugin), but...

1. I could not find the code:
Code:

&lt;?php if(!isset($order-&gt;order_invoice_number)) $order-&gt;order_invoice_number = $order-&gt;order_number; ?&gt;

.

2. I could only find the code:
Code:

&lt;div class="invoicetitle"&gt;&lt;?php echo JText::_('INVOICE').' '.$order-&gt;order_invoice_number; ?&gt;&lt;/div&gt;

3. I therefore substituted that code which I could find in the file with the new code you gave me, but all that did was change the Text Invoice Number to the Order number, but failed to insert any numbers at all - see attached.

The Order Number should read: TEST-00045-11/2013
The Invoice Number should read: B3Q7

4. See attached screenshot of the order page itself.

5. The other thing that is happening is the Shipping Invoice is not being produced any more, when I set the order on another TEST order to shipped.

I am beginning to wonder if Hikashop update loaded properly or if I did something wrong somewhere. So I reuploaded the update but the same thing is still happening.

Any ideas?

Kind regards

Kind regards.

- [ ![hbcabcfe.png](/forum/attachment/13819) ](/forum/attachment/13819 "hbcabcfe.png") [ ](/forum/attachment/13819?download=1 "hbcabcfe.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzgxNzcyLWhhdmUtZGlmZmVyZW50LWludm9pY2UtYW5kLW9yZGVyLW51bWJlcnM/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Hodgebw](/forum/user/2167-hodgebw "View Hodgebw's Profile")**
- [![Hodgebw's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/2167-hodgebw "View Hodgebw's Profile")
- [ Offline](/forum/user/2167-hodgebw)

Less More

- Posts: 105
- Thank you received: 0
-
-

13 years 4 days ago [\#133449](#133449) by [Hodgebw](/forum/user/2167-hodgebw "View Hodgebw's Profile")  Replied by *[Hodgebw](/forum/user/2167-hodgebw "View Hodgebw's Profile")* on topic *[Have different invoice and order numbers](/forum/4-how-to/81772-have-different-invoice-and-order-numbers?start=20#133449 "Hi, two questions about invoices.  1) I want to have an order number and a different invoice number.  I read the documentation and in hikashop&gt; Configuration&gt; Main&gt; Order I set order number as {automatic&#95;code} and invoice number as {date format=&quot;Y&quot;}{id size=&quot;5&quot;} but when I see the pre-print invoice the invoice number is the same as order number.  How can I have different numbers?  2) I want to print the order number in the invoice, just above the invoice number, between the date and the invoice number. How?")*

Hello,

OK. I did the following to change the file name as you suggested in the attachinvoice.php file:

Regarding the file name, you can change the line:
$invoiceFile = JText::_('INVOICE').'-'.$orderid.'_'.time().'.pdf';

to:
$invoiceFile = JText::_('INVOICE').'-'.$data-&gt;data-&gt;order_invoice_id.'_'.time().'.pdf';

1. This did not change the file name of the invoice pdf file that was downloaded to invoice_49.pdf. That stayed as Invoice_51, which is from the Order Number: TEST-00051-11/2013. Incidentally, the Invoice only downloads, it does not appear in the pop-up window on screen - that pop-up window appears, but remains blank white.

2. What changing the InvoiceFile text did do though was add the text "Invoice 49" to the Shipping Invoice - see attached.

I checked if it had added anything to the Invoice itself once it had downloaded, but no it had not.

Any further ideas? I am sure you are just as frustrated as I am with this, but I do very much appreciate your help. I need to sort this out before I train up the person using the system.

Kind regards

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzgxNzcyLWhhdmUtZGlmZmVyZW50LWludm9pY2UtYW5kLW9yZGVyLW51bWJlcnM/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86583
- Thank you received: 14324
-
-

13 years 3 days ago [\#133583](#133583) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Have different invoice and order numbers](/forum/4-how-to/81772-have-different-invoice-and-order-numbers?start=20#133583 "Hi, two questions about invoices.  1) I want to have an order number and a different invoice number.  I read the documentation and in hikashop&gt; Configuration&gt; Main&gt; Order I set order number as {automatic&#95;code} and invoice number as {date format=&quot;Y&quot;}{id size=&quot;5&quot;} but when I see the pre-print invoice the invoice number is the same as order number.  How can I have different numbers?  2) I want to print the order number in the invoice, just above the invoice number, between the date and the invoice number. How?")*

Hi,

My copy/paste was a bit fast. Of course, you need to change the names of the variables as they are not the same between the backend invoice and the pdf plugin.
It should be: Code:

&lt;div class="invoicetitle"&gt;&lt;?php if(!empty($order-&gt;order_invoice_number)) { echo JText::_('INVOICE').': '.$order-&gt;order_invoice_number; } echo JText::_('ORDER_NUMBER').': '.@$order-&gt;order_number; ?&gt;&lt;/div&gt;

The modification I provided for the invoice name was only for the invoice that is included in the email notifications.
For the invoices that you print in the backend, you will have to change the line:
if(count($orderIds) == 1) $fileName.= '_'.reset($orderIds);
to:
if(count($orderIds) == 1) $fileName.= '_'.$order-&gt;order_invoice_id;

Please remember that what we're doing here is waaayyy outside standard support. That's clearly code customization which is not included in the standard support of HikaShop commercial editions.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzgxNzcyLWhhdmUtZGlmZmVyZW50LWludm9pY2UtYW5kLW9yZGVyLW51bWJlcnM/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Hodgebw](/forum/user/2167-hodgebw "View Hodgebw's Profile")**
- [![Hodgebw's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/2167-hodgebw "View Hodgebw's Profile")
- [ Offline](/forum/user/2167-hodgebw)

Less More

- Posts: 105
- Thank you received: 0
-
-

13 years 3 days ago [\#133600](#133600) by [Hodgebw](/forum/user/2167-hodgebw "View Hodgebw's Profile")  Replied by *[Hodgebw](/forum/user/2167-hodgebw "View Hodgebw's Profile")* on topic *[Have different invoice and order numbers](/forum/4-how-to/81772-have-different-invoice-and-order-numbers?start=20#133600 "Hi, two questions about invoices.  1) I want to have an order number and a different invoice number.  I read the documentation and in hikashop&gt; Configuration&gt; Main&gt; Order I set order number as {automatic&#95;code} and invoice number as {date format=&quot;Y&quot;}{id size=&quot;5&quot;} but when I see the pre-print invoice the invoice number is the same as order number.  How can I have different numbers?  2) I want to print the order number in the invoice, just above the invoice number, between the date and the invoice number. How?")*

Thank you so much. I am very grateful - I will try that and if that doesn't work, I will adapt. The only reason I got on to this was because someone else was asking the same question a while back on your forum, so I tried to do what you had suggested to them, but it didn't work.

The company is based in Zimbabwe, and paypal, banks, etc., do not pay in to Zimbabwean bank accounts, so it has to be done by bank transfer on an individual case by case basis not through paypal, etc.. Also there are so many different variables for each order, as we need export certificates, etc., and couriers like UPS are not able to supply the service online here that the rest of the world has. Therefore, we have had to adapt so that we can send out invoices after adding the extra costs, and not streamline the process so it is all done in one step online.

We thank you for your understanding and will try to keep to a minimum future requests for support.

Kind regards

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzgxNzcyLWhhdmUtZGlmZmVyZW50LWludm9pY2UtYW5kLW9yZGVyLW51bWJlcnM/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.050 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
