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

#   Order number and Invoice number

##

- **[Nello](/forum/user/1361-nello "View Nello's Profile")**
- [![Nello's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1361-nello "View Nello's Profile") Topic Author
- [ Offline](/forum/user/1361-nello)

Less More

- Posts: 251
- Thank you received: 2
-
-

11 years 1 month ago [\#217056](#217056) by [Nello](/forum/user/1361-nello "View Nello's Profile")  *[Order number and Invoice number](/forum/4-how-to/879813-order-number-and-invoice-number#217056 "-- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.4  Hi, I need to start the order number and invoice number from a specific number. The order number must be 222, and the invoice number must be 003.  So for the order number I can use this on my DB my Sql: ALTER TABLE hd&#95;hikashop&#95;order AUTO&#95;INCREMENT = 222; How can I alter the start number for the invoice?  Thank you!")* was created by *[Nello](/forum/user/1361-nello "View Nello's Profile")*

-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.4

Hi,
I need to start the order number and invoice number from a specific number.
The order number must be 222, and the invoice number must be 003.

So for the order number I can use this on my DB my Sql: ALTER TABLE hd_hikashop_order AUTO_INCREMENT = 222;
How can I alter the start number for the invoice?

Thank you!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg3OTgxMy1vcmRlci1udW1iZXItYW5kLWludm9pY2UtbnVtYmVyP3RtcGw9bWFya2Rvd24=) 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: 86561
- Thank you received: 14307
-
-

11 years 1 month ago [\#217078](#217078) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Order number and Invoice number](/forum/4-how-to/879813-order-number-and-invoice-number#217078 "-- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.4  Hi, I need to start the order number and invoice number from a specific number. The order number must be 222, and the invoice number must be 003.  So for the order number I can use this on my DB my Sql: ALTER TABLE hd&#95;hikashop&#95;order AUTO&#95;INCREMENT = 222; How can I alter the start number for the invoice?  Thank you!")*

Hi,

The start number for the invoices comes from the biggest value of order_invoice_id in the orders already in the database.
So if you don't have yet any order, create a fake one with the order_invoice_id being set to 2 via your phpmyadmin and that should do it.

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

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

Less More

- Posts: 9
- Thank you received: 0
-
-

10 years 2 months ago [\#247923](#247923) by [ali](/forum/user/31871-ali "View ali's Profile")  Replied by *[ali](/forum/user/31871-ali "View ali's Profile")* on topic *[Order number and Invoice number](/forum/4-how-to/879813-order-number-and-invoice-number#247923 "-- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.4  Hi, I need to start the order number and invoice number from a specific number. The order number must be 222, and the invoice number must be 003.  So for the order number I can use this on my DB my Sql: ALTER TABLE hd&#95;hikashop&#95;order AUTO&#95;INCREMENT = 222; How can I alter the start number for the invoice?  Thank you!")*

Sorry to dig up an old message, but I don't understand your statement in the case of
"Invoice number reset frequency = Every year".

My problem is that I have set Code:

Invoice Number format = F-{date format="y"}{id size="5"} Invoice number reset frequency = Every year

and, having orders since 2014, want to apply this only for 2016 orders.

What I did is set, directly with SQL:
\#__hikashop_order.order_invoice_id of 2016 only from 1 to 98
\#__hikashop_order.order_invoice_number of 2016 only from F-1600001 to F-1600098
(98 if or the example).
The next order posted registered in the database with
\#__hikashop_order.order_invoice_id = 1 and #__hikashop_order.order_invoice_number = F-1600001
instead of #__hikashop_order.order_invoice_id = 99 and #__hikashop_order.order_invoice_number = F-1600099
Why?

And according to your statement "The start number for the invoices comes from the biggest value of order_invoice_id in the orders already in the database" what will happen if, let say, the next order is in 2017. Will it be?
\#__hikashop_order.order_invoice_id = 1 and #__hikashop_order.order_invoice_number = F-1700001

It looks like that the start rely on some other value coming from another table than #__hikashop_order.

How does it work?

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4080
-
- [](http://obsi.dev)
-

10 years 2 months ago [\#247932](#247932) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Order number and Invoice number](/forum/4-how-to/879813-order-number-and-invoice-number#247932 "-- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.4  Hi, I need to start the order number and invoice number from a specific number. The order number must be 222, and the invoice number must be 003.  So for the order number I can use this on my DB my Sql: ALTER TABLE hd&#95;hikashop&#95;order AUTO&#95;INCREMENT = 222; How can I alter the start number for the invoice?  Thank you!")*

Hi,

> having orders since 2014, want to apply this only for 2016 orders.

Once an "order number" or an "invoice number" is generated ; it becomes a fixed value.
So you can change your configuration afterwards, it won't affect old (confirmed) orders.

**order\_invoice\_id generation**
In the orders you also have a field for the order_invoice_created ; which is the used field to get the orders in a time period.
If the field is empty, the order is considered as "not confirmed".

So you should put a date (timestamp) in the 2016 orders to let them be considered as 2016 orders by HikaShop.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

The following user(s) said Thank You: [ali](/forum/user/31871-ali "View ali's Profile")

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

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

Less More

- Posts: 9
- Thank you received: 0
-
-

10 years 2 months ago [\#247983](#247983) by [ali](/forum/user/31871-ali "View ali's Profile")  Replied by *[ali](/forum/user/31871-ali "View ali's Profile")* on topic *[Order number and Invoice number](/forum/4-how-to/879813-order-number-and-invoice-number#247983 "-- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.4  Hi, I need to start the order number and invoice number from a specific number. The order number must be 222, and the invoice number must be 003.  So for the order number I can use this on my DB my Sql: ALTER TABLE hd&#95;hikashop&#95;order AUTO&#95;INCREMENT = 222; How can I alter the start number for the invoice?  Thank you!")*

Thanks a lot for your answer.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg3OTgxMy1vcmRlci1udW1iZXItYW5kLWludm9pY2UtbnVtYmVyP3RtcGw9bWFya2Rvd24=) 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.057 seconds

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