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

#   Progressive invoice number without "holes"

##

- **[lanzanet](/forum/user/7823-lanzanet "View lanzanet's Profile")**
- [![lanzanet's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7823.png)](/forum/user/7823-lanzanet "View lanzanet's Profile")
- [ Offline](/forum/user/7823-lanzanet)

Less More

- Posts: 107
- Thank you received: 3
-
-

13 years 10 months ago [\#84693](#84693) by [lanzanet](/forum/user/7823-lanzanet "View lanzanet's Profile")  Replied by *[lanzanet](/forum/user/7823-lanzanet "View lanzanet's Profile")* on topic *[Re: Progressive invoice number without "holes"](/forum/4-how-to/61837-progressive-invoice-number-without-holes?start=40#84693 "I would like to know if Hikashop can generate invoices like Italian laws requires.  We need progressive invoice number starting at the beginning of every new year from number 1 and must be progressive 1,2,3,4,5,......1347 etc without &quot;holes&quot; in numeration; we cannot have 1,4,6,12, etc we must have 2,3,5,7,8,9,10,11 etc.. in this example.  My doubt is: if I delete an order I also generate an &quot;hole&quot; in the numeration? Example, I had generated invoices 1,2,3,4. Now for some reason the order with ID 5 is deleted or user do not confirm it. What happens to invoice sequence? It will go on with number 6? and what about number 5?  Also, think about that order with ID number 5 is generated but the payment not yet completed. In the meanwhile the order number 6 is placed and payed. What happens this case? I have the order number 5 with a date bigger that order 6??? I cannot have it this way. I should have a pro-forma invoice that will be converted with the subsequential order number when payment is completed so in that case the order with ID 5 will become invoice number 6 after real payment.  Last I would have a number invoice like this:  Fattura numero 1/01 del 14 Maggio 2012 Fattura numero 2/01 del 14 Maggio 2012 Fattura numero 3/01 del 16 Maggio 2012 Fattura numero 4/01 del 19 Maggio 2012 Fattura numero 5/01 del 25 Maggio 2012 and so on...  Is all that possible?  Thanks in advice?")*

Hi.

For those who can't wait to reset the INVOICE number, I've got a simple procedure to get this.

Please, don't use it before someone of the hikashop support gives the ok to this steps. Now it's working for me.

With my MySQL client I've oppened the hikashop table 'hikashop_order' and reset to '0' the column 'order_invoice_id'. I think this column only stores the last generated invoice number, and has no other purpose once the real invoice number is generated and formatted acording to the specified format in hikashop config. So if you reset this column to '0', the next invoice number will be '1', and you will lose no data. To have a clear invoice number sequence, I've configured the format with the year, something like {date format="y"}/{id size="5"}, resulting in 13/00001. This has no effect in the order number, that will follow the sequence of the prior year (I've also configured the order format including the year), but with this steps I've solved the 'legal' problem of the invoices, to start in number '1' each beginnig of a new year.

One you have oppened your database with your MySQL client, the query you have to execute is as simple as: UPDATE [your_joomla_prefix]_hikashop_order SET order_invoice_id=0

Please, Could someone of the hikashop team confirm this?

Thanks.

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 10 months ago [\#84729](#84729) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Progressive invoice number without "holes"](/forum/4-how-to/61837-progressive-invoice-number-without-holes?start=40#84729 "I would like to know if Hikashop can generate invoices like Italian laws requires.  We need progressive invoice number starting at the beginning of every new year from number 1 and must be progressive 1,2,3,4,5,......1347 etc without &quot;holes&quot; in numeration; we cannot have 1,4,6,12, etc we must have 2,3,5,7,8,9,10,11 etc.. in this example.  My doubt is: if I delete an order I also generate an &quot;hole&quot; in the numeration? Example, I had generated invoices 1,2,3,4. Now for some reason the order with ID 5 is deleted or user do not confirm it. What happens to invoice sequence? It will go on with number 6? and what about number 5?  Also, think about that order with ID number 5 is generated but the payment not yet completed. In the meanwhile the order number 6 is placed and payed. What happens this case? I have the order number 5 with a date bigger that order 6??? I cannot have it this way. I should have a pro-forma invoice that will be converted with the subsequential order number when payment is completed so in that case the order with ID 5 will become invoice number 6 after real payment.  Last I would have a number invoice like this:  Fattura numero 1/01 del 14 Maggio 2012 Fattura numero 2/01 del 14 Maggio 2012 Fattura numero 3/01 del 16 Maggio 2012 Fattura numero 4/01 del 19 Maggio 2012 Fattura numero 5/01 del 25 Maggio 2012 and so on...  Is all that possible?  Thanks in advice?")*

Hi,

I confirm that you can do this way.
A new option should be in the next release, which will allow you to set when must the invoice number be reset. (every months or every years)

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

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

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

Less More

- Posts: 4
- Thank you received: 0
-
-

13 years 6 months ago [\#105432](#105432) by [egel](/forum/user/2768-egel "View egel's Profile")  Replied by *[egel](/forum/user/2768-egel "View egel's Profile")* on topic *[Re: Progressive invoice number without "holes"](/forum/4-how-to/61837-progressive-invoice-number-without-holes?start=40#105432 "I would like to know if Hikashop can generate invoices like Italian laws requires.  We need progressive invoice number starting at the beginning of every new year from number 1 and must be progressive 1,2,3,4,5,......1347 etc without &quot;holes&quot; in numeration; we cannot have 1,4,6,12, etc we must have 2,3,5,7,8,9,10,11 etc.. in this example.  My doubt is: if I delete an order I also generate an &quot;hole&quot; in the numeration? Example, I had generated invoices 1,2,3,4. Now for some reason the order with ID 5 is deleted or user do not confirm it. What happens to invoice sequence? It will go on with number 6? and what about number 5?  Also, think about that order with ID number 5 is generated but the payment not yet completed. In the meanwhile the order number 6 is placed and payed. What happens this case? I have the order number 5 with a date bigger that order 6??? I cannot have it this way. I should have a pro-forma invoice that will be converted with the subsequential order number when payment is completed so in that case the order with ID 5 will become invoice number 6 after real payment.  Last I would have a number invoice like this:  Fattura numero 1/01 del 14 Maggio 2012 Fattura numero 2/01 del 14 Maggio 2012 Fattura numero 3/01 del 16 Maggio 2012 Fattura numero 4/01 del 19 Maggio 2012 Fattura numero 5/01 del 25 Maggio 2012 and so on...  Is all that possible?  Thanks in advice?")*

is there any way how to start invoice number from 1 instead of 0 ???

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

13 years 6 months ago [\#105441](#105441) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Re: Progressive invoice number without "holes"](/forum/4-how-to/61837-progressive-invoice-number-without-holes?start=40#105441 "I would like to know if Hikashop can generate invoices like Italian laws requires.  We need progressive invoice number starting at the beginning of every new year from number 1 and must be progressive 1,2,3,4,5,......1347 etc without &quot;holes&quot; in numeration; we cannot have 1,4,6,12, etc we must have 2,3,5,7,8,9,10,11 etc.. in this example.  My doubt is: if I delete an order I also generate an &quot;hole&quot; in the numeration? Example, I had generated invoices 1,2,3,4. Now for some reason the order with ID 5 is deleted or user do not confirm it. What happens to invoice sequence? It will go on with number 6? and what about number 5?  Also, think about that order with ID number 5 is generated but the payment not yet completed. In the meanwhile the order number 6 is placed and payed. What happens this case? I have the order number 5 with a date bigger that order 6??? I cannot have it this way. I should have a pro-forma invoice that will be converted with the subsequential order number when payment is completed so in that case the order with ID 5 will become invoice number 6 after real payment.  Last I would have a number invoice like this:  Fattura numero 1/01 del 14 Maggio 2012 Fattura numero 2/01 del 14 Maggio 2012 Fattura numero 3/01 del 16 Maggio 2012 Fattura numero 4/01 del 19 Maggio 2012 Fattura numero 5/01 del 25 Maggio 2012 and so on...  Is all that possible?  Thanks in advice?")*

Hi,

The problem is, the invoice number does not start from 0, it already starts from 1.
0 is when there is no invoice number.

Regards,

---

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

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

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