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

#   Invoice number is always as for {automatic\_code}

##

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

Less More

- Posts: 15
- Thank you received: 0
-
-

9 years 4 months ago [\#272512](#272512) by [marios](/forum/user/32513-marios "View marios's Profile")  *[Invoice number is always as for {automatic\_code}](/forum/35-orders-management/890847-invoice-number-is-always-as-for-automatic-code#272512 "-- HikaShop version -- : 3.0.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 5.6.30  Dears,  I observe incorect behaviour on generated Invoices (backend), generated invoice number stays in format corresponding for {automatic&#95;code} when Invoice number format is changed as below:  My settings:  Order number format: {automatic&#95;code} Invoice Number format: {order&#95;id size=&quot;5&quot;}/{date format=&quot;m/Y&quot;} ")* was created by *[marios](/forum/user/32513-marios "View marios's Profile")*

-- HikaShop version -- : 3.0.1
-- Joomla version -- : 3.7.2
-- PHP version -- : 5.6.30

Dears,

I observe incorect behaviour on generated Invoices (backend),
generated invoice number stays in format corresponding for {automatic_code} when Invoice number format is changed as below:

My settings:
**Order number format: {automatic\_code}
Invoice Number format: {order\_id size="5"}/{date format="m/Y"}**

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg5MDg0Ny1pbnZvaWNlLW51bWJlci1pcy1hbHdheXMtYXMtZm9yLWF1dG9tYXRpYy1jb2RlP3RtcGw9bWFya2Rvd24=) 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: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

9 years 4 months ago [\#272519](#272519) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Invoice number is always as for {automatic\_code}](/forum/35-orders-management/890847-invoice-number-is-always-as-for-automatic-code#272519 "-- HikaShop version -- : 3.0.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 5.6.30  Dears,  I observe incorect behaviour on generated Invoices (backend), generated invoice number stays in format corresponding for {automatic&#95;code} when Invoice number format is changed as below:  My settings:  Order number format: {automatic&#95;code} Invoice Number format: {order&#95;id size=&quot;5&quot;}/{date format=&quot;m/Y&quot;} ")*

Hello,

I'm sorry but I am not able to understand your message and the problem you're describing.
Please clarify.

Regards,

---

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

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

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

Less More

- Posts: 15
- Thank you received: 0
-
-

9 years 4 months ago [\#272611](#272611) by [marios](/forum/user/32513-marios "View marios's Profile")  Replied by *[marios](/forum/user/32513-marios "View marios's Profile")* on topic *[Invoice number is always as for {automatic\_code}](/forum/35-orders-management/890847-invoice-number-is-always-as-for-automatic-code#272611 "-- HikaShop version -- : 3.0.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 5.6.30  Dears,  I observe incorect behaviour on generated Invoices (backend), generated invoice number stays in format corresponding for {automatic&#95;code} when Invoice number format is changed as below:  My settings:  Order number format: {automatic&#95;code} Invoice Number format: {order&#95;id size=&quot;5&quot;}/{date format=&quot;m/Y&quot;} ")*

Hmm, in other words, when I generate Invoice by pressing Invoice button on order details page,
**I get there invoice number in form M2M64** (which would be correct but for {automatic_code} in invoice number format)
**while I have Invoice Number format: set to {order\_id size="5"}/{date format="m/Y"}**
which should result in invoice number something like 00264/7/2017 not B1M99, am I right ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg5MDg0Ny1pbnZvaWNlLW51bWJlci1pcy1hbHdheXMtYXMtZm9yLWF1dG9tYXRpYy1jb2RlP3RtcGw9bWFya2Rvd24=) 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: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

9 years 4 months ago [\#272617](#272617) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Invoice number is always as for {automatic\_code}](/forum/35-orders-management/890847-invoice-number-is-always-as-for-automatic-code#272617 "-- HikaShop version -- : 3.0.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 5.6.30  Dears,  I observe incorect behaviour on generated Invoices (backend), generated invoice number stays in format corresponding for {automatic&#95;code} when Invoice number format is changed as below:  My settings:  Order number format: {automatic&#95;code} Invoice Number format: {order&#95;id size=&quot;5&quot;}/{date format=&quot;m/Y&quot;} ")*

Hello,

If you try to display an invoice (sorry, it is NOT a generation) while there is no invoice number ; the order number will be shown instead.

Now if you're talking about generation of the invoice number ; you need to configure HikaShop order statuses (HikaShop &gt; System &gt; Order statuses).
You need to check the "invoice order status".
[ www.hikashop.com/support/documentation/5...nfig.html#main\_order](https://www.hikashop.com/support/documentation/54-hikashop-config.html#main_order)

Regards,

---

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

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

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

Less More

- Posts: 15
- Thank you received: 0
-
-

9 years 4 months ago [\#272665](#272665) by [marios](/forum/user/32513-marios "View marios's Profile")  Replied by *[marios](/forum/user/32513-marios "View marios's Profile")* on topic *[Invoice number is always as for {automatic\_code}](/forum/35-orders-management/890847-invoice-number-is-always-as-for-automatic-code#272665 "-- HikaShop version -- : 3.0.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 5.6.30  Dears,  I observe incorect behaviour on generated Invoices (backend), generated invoice number stays in format corresponding for {automatic&#95;code} when Invoice number format is changed as below:  My settings:  Order number format: {automatic&#95;code} Invoice Number format: {order&#95;id size=&quot;5&quot;}/{date format=&quot;m/Y&quot;} ")*

Hello Jerome,

Thanks for your explanation. Displaying then printing is generation of invoice for most people,
I understand that in your opinion in some technical/internal terms of HS it isn't but you are in minority of all people ![;-)](/media/kunena/emoticons/14.png ";-)")

For reducing your support work some some requests/hints:
In my opinion there should be tag or mark on invoice if Invoice No not correct / isn't consistent with specification,
and/or there should be haze in configuration option which states, there could be no Inv.No assigned if order is treated as not confirmed
and there will be Incorrect information there.
and/or HS manual page near description of "Invoice number format:..." should state as above

if any of above would be existent than I would bother you

Only sentence on linked manual, which is not clear for me,
but maybe suggest actual HS behavior,
is in section for old HS version &lt; 3.0
(*...Before HikaShop 3.0,.... If "created" is listed, you will have the same invoice number than the order number....*)

Some auxiliary questions:
How could I change order number and/or next available/free order nr ?

I'm asking because after migration and restoration of site
and making some test order my order numbering advanced and was persistent even after test order delete,
but here Tax Office wants continuity in invoice numbers,
it looks that Invoice Numbers are hardly connected to order number code which would lead to Invoice Numbering discontinuity ?
also for case when order was cancelled

How to handle above ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg5MDg0Ny1pbnZvaWNlLW51bWJlci1pcy1hbHdheXMtYXMtZm9yLWF1dG9tYXRpYy1jb2RlP3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14269
-
-

9 years 4 months ago [\#272669](#272669) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Invoice number is always as for {automatic\_code}](/forum/35-orders-management/890847-invoice-number-is-always-as-for-automatic-code#272669 "-- HikaShop version -- : 3.0.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 5.6.30  Dears,  I observe incorect behaviour on generated Invoices (backend), generated invoice number stays in format corresponding for {automatic&#95;code} when Invoice number format is changed as below:  My settings:  Order number format: {automatic&#95;code} Invoice Number format: {order&#95;id size=&quot;5&quot;}/{date format=&quot;m/Y&quot;} ")*

Hi,

Thank you for your feedback. I've added some text on the settings to make it more clear:
[ www.hikashop.com/support/documentation/5...nfig.html#main\_order](https://www.hikashop.com/support/documentation/54-hikashop-config.html#main_order)

In HikaShop you have two ids and two numbers for an order:
- the order id is generated when the order is created and it is incremental.
- the order number is generated out of the order id based on your order number format at the same time.
- the invoice id is generated when the order is changed based on how you configured the "invoice" column in the menu System&gt;Order statuses. By default, the invoice id is generated when the order goes from the status created to the status confirmed (that's the way you usually want it on an online shop).
- the invoice number is generated out of the order id based on your invoice number format at the same time as the invoice id.
So the order ids/numbers are contiguous for all the orders and the invoice ids/numbers are contiguous for all the confirmed (paid) orders.
An order that was confirmed at some point and then would be refunded/cancelled would still keep it's invoice id/number.
By default that is. That's also how most online shops need it.
To have a different behavior, it's possible to change the order statuses settings and/or the formats.

If you want to reset the numbering of invoices, you need to delete all the confirmed/cancelled/refunded/shipped orders.
If you want to also reset the numbering of orders, you need to empty the hikashop_order table in your phpmyadmin:
[ codex.wordpress.org/Emptying\_a\_Database\_Table](https://codex.wordpress.org/Emptying_a_Database_Table)
Emptying a table in MySQL will remove all its entries and reset its automatic increment to 0.
If you want the orders to start at a specific id from the next order, you need to set the automatic increment in the same table via phpmyadmin: [ stackoverflow.com/questions/5665571/auto...rement-in-phpmyadmin](https://stackoverflow.com/questions/5665571/auto-increment-in-phpmyadmin)
If you want the invoices to start at a specific id from the next invoice, you need to have a confirmed order with the id before the one you want in the "order_invoice_id" column. You will have to set that manually via phpmyadmin.

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

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

Less More

- Posts: 15
- Thank you received: 0
-
-

9 years 4 months ago [\#272764](#272764) by [marios](/forum/user/32513-marios "View marios's Profile")  Replied by *[marios](/forum/user/32513-marios "View marios's Profile")* on topic *[Invoice number is always as for {automatic\_code}](/forum/35-orders-management/890847-invoice-number-is-always-as-for-automatic-code#272764 "-- HikaShop version -- : 3.0.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 5.6.30  Dears,  I observe incorect behaviour on generated Invoices (backend), generated invoice number stays in format corresponding for {automatic&#95;code} when Invoice number format is changed as below:  My settings:  Order number format: {automatic&#95;code} Invoice Number format: {order&#95;id size=&quot;5&quot;}/{date format=&quot;m/Y&quot;} ")*

Thank you very much for you clarification.

Complementary question is only hikashop_order table to be modified regarding mentioned numbers
or there are others ? (some cross-references)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg5MDg0Ny1pbnZvaWNlLW51bWJlci1pcy1hbHdheXMtYXMtZm9yLWF1dG9tYXRpYy1jb2RlP3RtcGw9bWFya2Rvd24=) 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: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

9 years 4 months ago [\#272767](#272767) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Invoice number is always as for {automatic\_code}](/forum/35-orders-management/890847-invoice-number-is-always-as-for-automatic-code#272767 "-- HikaShop version -- : 3.0.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 5.6.30  Dears,  I observe incorect behaviour on generated Invoices (backend), generated invoice number stays in format corresponding for {automatic&#95;code} when Invoice number format is changed as below:  My settings:  Order number format: {automatic&#95;code} Invoice Number format: {order&#95;id size=&quot;5&quot;}/{date format=&quot;m/Y&quot;} ")*

Hello,

In the "hikashop_order" table only the "order_id" field is used by other tables for cross-references.

Regards,

---

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

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

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

[](#top)
