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

#   Progressive invoice number and no invoice for free

##

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

Less More

- Posts: 89
- Thank you received: 1
-
- [](http://www.insegnalo.it)
-

13 years 10 months ago [\#84084](#84084) by [insegnalo](/forum/user/12331-insegnalo "View insegnalo's Profile")  *[Progressive invoice number and no invoice for free](/forum/4-how-to/77197-progressive-invoice-number-and-no-invoice-for-free#84084 "Hi,  I have two problems in the issuance of invoice.  The first, as Italian user, I need a number for invoices that starts over every beginning of the year and one that does not have holes numbering.  The second. I have many free products. I do not want no &quot;official&quot; invoice is for these products but only orders, is it possible?  thanks Fabio")* was created by *[insegnalo](/forum/user/12331-insegnalo "View insegnalo's Profile")*

Hi,

I have two problems in the issuance of invoice.

The first, as Italian user, I need a number for invoices that starts over every beginning of the year and one that does not have holes numbering.

The second. I have many free products. I do not want no "official" invoice is for these products but only orders, is it possible?

thanks
Fabio

---

Configuration:
Joomla: 2.5.9
Hikashop: 2.1.1
Hikamarket: 1.1.2

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc3MTk3LXByb2dyZXNzaXZlLWludm9pY2UtbnVtYmVyLWFuZC1uby1pbnZvaWNlLWZvci1mcmVlP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) 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 10 months ago [\#84408](#84408) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Progressive invoice number and no invoice for free](/forum/4-how-to/77197-progressive-invoice-number-and-no-invoice-for-free#84408 "Hi,  I have two problems in the issuance of invoice.  The first, as Italian user, I need a number for invoices that starts over every beginning of the year and one that does not have holes numbering.  The second. I have many free products. I do not want no &quot;official&quot; invoice is for these products but only orders, is it possible?  thanks Fabio")*

Hi,

I have started a patch in HikaShop in order to have a reset system for invoices. The patch should be finished for the next release of HikaShop.
It would add a new option for "invoice number reseting frequency" (every month, every year, never).

For the second point, you mean that, if an order does not have a price (that is a free order), you don't want to generate the invoice number ?

Regards,

---

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

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

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

Less More

- Posts: 89
- Thank you received: 1
-
- [](http://www.insegnalo.it)
-

13 years 10 months ago [\#84505](#84505) by [insegnalo](/forum/user/12331-insegnalo "View insegnalo's Profile")  Replied by *[insegnalo](/forum/user/12331-insegnalo "View insegnalo's Profile")* on topic *[Progressive invoice number and no invoice for free](/forum/4-how-to/77197-progressive-invoice-number-and-no-invoice-for-free#84505 "Hi,  I have two problems in the issuance of invoice.  The first, as Italian user, I need a number for invoices that starts over every beginning of the year and one that does not have holes numbering.  The second. I have many free products. I do not want no &quot;official&quot; invoice is for these products but only orders, is it possible?  thanks Fabio")*

Hi Jerome

thanks for the reply,
wait for the patch.

For the second point, exactly, I would like for orders equal to zero, there was no emission of invoice

Is it possible?

Thanks
Fabio

---

Configuration:
Joomla: 2.5.9
Hikashop: 2.1.1
Hikamarket: 1.1.2

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc3MTk3LXByb2dyZXNzaXZlLWludm9pY2UtbnVtYmVyLWFuZC1uby1pbnZvaWNlLWZvci1mcmVlP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) 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 10 months ago [\#84581](#84581) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Progressive invoice number and no invoice for free](/forum/4-how-to/77197-progressive-invoice-number-and-no-invoice-for-free#84581 "Hi,  I have two problems in the issuance of invoice.  The first, as Italian user, I need a number for invoices that starts over every beginning of the year and one that does not have holes numbering.  The second. I have many free products. I do not want no &quot;official&quot; invoice is for these products but only orders, is it possible?  thanks Fabio")*

Hi,

The only way I see for such feature is to include it directly in the HikaShop core. It's not possible to put it in a plugin or to externalize it.

Regards,

---

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

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

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

Less More

- Posts: 89
- Thank you received: 1
-
- [](http://www.insegnalo.it)
-

13 years 10 months ago [\#84796](#84796) by [insegnalo](/forum/user/12331-insegnalo "View insegnalo's Profile")  Replied by *[insegnalo](/forum/user/12331-insegnalo "View insegnalo's Profile")* on topic *[Progressive invoice number and no invoice for free](/forum/4-how-to/77197-progressive-invoice-number-and-no-invoice-for-free#84796 "Hi,  I have two problems in the issuance of invoice.  The first, as Italian user, I need a number for invoices that starts over every beginning of the year and one that does not have holes numbering.  The second. I have many free products. I do not want no &quot;official&quot; invoice is for these products but only orders, is it possible?  thanks Fabio")*

Hi Jerome.

Ok thanks,

Can You do so in the coming features?

Or can I change it in some file? Which one?

Regards
fabio

---

Configuration:
Joomla: 2.5.9
Hikashop: 2.1.1
Hikamarket: 1.1.2

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc3MTk3LXByb2dyZXNzaXZlLWludm9pY2UtbnVtYmVyLWFuZC1uby1pbnZvaWNlLWZvci1mcmVlP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) 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 10 months ago [\#84831](#84831) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Progressive invoice number and no invoice for free](/forum/4-how-to/77197-progressive-invoice-number-and-no-invoice-for-free#84831 "Hi,  I have two problems in the issuance of invoice.  The first, as Italian user, I need a number for invoices that starts over every beginning of the year and one that does not have holes numbering.  The second. I have many free products. I do not want no &quot;official&quot; invoice is for these products but only orders, is it possible?  thanks Fabio")*

Hi,

There is a simpler solution with some view customisation.
It would possible to hide the "invoice" buttons in the front-end directly in views. Just making a little test on the order full price to know if the button should be displayed or not.
After that, I don't know if there are other points that you want to "forbidden" with your free orders.

Regards,

---

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

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

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

Less More

- Posts: 89
- Thank you received: 1
-
- [](http://www.insegnalo.it)
-

13 years 10 months ago [\#84840](#84840) by [insegnalo](/forum/user/12331-insegnalo "View insegnalo's Profile")  Replied by *[insegnalo](/forum/user/12331-insegnalo "View insegnalo's Profile")* on topic *[Progressive invoice number and no invoice for free](/forum/4-how-to/77197-progressive-invoice-number-and-no-invoice-for-free#84840 "Hi,  I have two problems in the issuance of invoice.  The first, as Italian user, I need a number for invoices that starts over every beginning of the year and one that does not have holes numbering.  The second. I have many free products. I do not want no &quot;official&quot; invoice is for these products but only orders, is it possible?  thanks Fabio")*

Hi,

I do not want to hide the "invoice", but not generate an id of invoice for the zero amounts

is it possible?

Thanks
fabio

---

Configuration:
Joomla: 2.5.9
Hikashop: 2.1.1
Hikamarket: 1.1.2

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc3MTk3LXByb2dyZXNzaXZlLWludm9pY2UtbnVtYmVyLWFuZC1uby1pbnZvaWNlLWZvci1mcmVlP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) 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 10 months ago [\#84857](#84857) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Progressive invoice number and no invoice for free](/forum/4-how-to/77197-progressive-invoice-number-and-no-invoice-for-free#84857 "Hi,  I have two problems in the issuance of invoice.  The first, as Italian user, I need a number for invoices that starts over every beginning of the year and one that does not have holes numbering.  The second. I have many free products. I do not want no &quot;official&quot; invoice is for these products but only orders, is it possible?  thanks Fabio")*

Hi,

You can update your class order with this code. Code:

if(!empty($order-&gt;order_status) &amp;&amp; empty($order-&gt;order_invoice_id) &amp;&amp; empty($order-&gt;old-&gt;order_invoice_id) &amp;&amp; $order_type == 'sale') { $config =&amp; hikashop_config(); $valid_statuses = explode(',', $config-&gt;get('invoice_order_statuses','confirmed,shipped')); $excludeFreeOrders = $config-&gt;get('invoice_exclude_free_orders', 0); if(isset($order-&gt;order_full_price)) $total = $order-&gt;order_full_price; else $total = $order-&gt;old-&gt;order_full_price; if(in_array($order-&gt;order_status, $valid_statuses) &amp;&amp; ($total &gt; 0 &#124;&#124; !$excludeFreeOrders)) { $this-&gt;database-&gt;setQuery('SELECT MAX(a.order_invoice_id)+1 FROM '.hikashop_table('order').' AS a WHERE a.order_type = \'sale\''); $order-&gt;order_invoice_id = $this-&gt;database-&gt;loadResult(); $order-&gt;order_invoice_number = hikashop_encode($order, 'invoice'); } }

After that, you have to create an option in the database, named "invoice_exclude_free_orders" and with the value "1".
It would be an advanced option (we have some options which are hidden).

If it's right for you, the patch would be validate and include in the next release of HikaShop.
(And the option would be managed by HikaMarket too).

Regards,

---

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

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

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

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

Less More

- Posts: 89
- Thank you received: 1
-
- [](http://www.insegnalo.it)
-

13 years 10 months ago [\#86808](#86808) by [insegnalo](/forum/user/12331-insegnalo "View insegnalo's Profile")  Replied by *[insegnalo](/forum/user/12331-insegnalo "View insegnalo's Profile")* on topic *[Progressive invoice number and no invoice for free](/forum/4-how-to/77197-progressive-invoice-number-and-no-invoice-for-free#86808 "Hi,  I have two problems in the issuance of invoice.  The first, as Italian user, I need a number for invoices that starts over every beginning of the year and one that does not have holes numbering.  The second. I have many free products. I do not want no &quot;official&quot; invoice is for these products but only orders, is it possible?  thanks Fabio")*

Hi.

What about your last news? Did you finish the patch?

thanks
Fabio

---

Configuration:
Joomla: 2.5.9
Hikashop: 2.1.1
Hikamarket: 1.1.2

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc3MTk3LXByb2dyZXNzaXZlLWludm9pY2UtbnVtYmVyLWFuZC1uby1pbnZvaWNlLWZvci1mcmVlP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) 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 10 months ago [\#86840](#86840) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Progressive invoice number and no invoice for free](/forum/4-how-to/77197-progressive-invoice-number-and-no-invoice-for-free#86840 "Hi,  I have two problems in the issuance of invoice.  The first, as Italian user, I need a number for invoices that starts over every beginning of the year and one that does not have holes numbering.  The second. I have many free products. I do not want no &quot;official&quot; invoice is for these products but only orders, is it possible?  thanks Fabio")*

Hi,

Does the patch right for you ?

Regards,

---

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

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

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

Less More

- Posts: 89
- Thank you received: 1
-
- [](http://www.insegnalo.it)
-

13 years 10 months ago [\#86917](#86917) by [insegnalo](/forum/user/12331-insegnalo "View insegnalo's Profile")  Replied by *[insegnalo](/forum/user/12331-insegnalo "View insegnalo's Profile")* on topic *[Progressive invoice number and no invoice for free](/forum/4-how-to/77197-progressive-invoice-number-and-no-invoice-for-free#86917 "Hi,  I have two problems in the issuance of invoice.  The first, as Italian user, I need a number for invoices that starts over every beginning of the year and one that does not have holes numbering.  The second. I have many free products. I do not want no &quot;official&quot; invoice is for these products but only orders, is it possible?  thanks Fabio")*

Hi Jerome,

as you can see at the beginning of this discussion,

we need the invoice number start from zero with each new year.

At The second question of this discussion (not generate an id of invoice for the zero amounts) you answered me so... "You can update your class order with this code..."

which file should I change?

thanks a lot

Fabio

---

Configuration:
Joomla: 2.5.9
Hikashop: 2.1.1
Hikamarket: 1.1.2

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc3MTk3LXByb2dyZXNzaXZlLWludm9pY2UtbnVtYmVyLWFuZC1uby1pbnZvaWNlLWZvci1mcmVlP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) 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 10 months ago [\#86927](#86927) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Progressive invoice number and no invoice for free](/forum/4-how-to/77197-progressive-invoice-number-and-no-invoice-for-free#86927 "Hi,  I have two problems in the issuance of invoice.  The first, as Italian user, I need a number for invoices that starts over every beginning of the year and one that does not have holes numbering.  The second. I have many free products. I do not want no &quot;official&quot; invoice is for these products but only orders, is it possible?  thanks Fabio")*

Hi,

About your first question, the feature has been implemented in HikaShop and would be include in the next release (2.1.0) which should be publish at the end of the month.

The file is the class order ( administrator/components/com_hikashop/classes/order.php ).
In this file you would find the line Code:

if(!empty($order-&gt;order_status) &amp;&amp; empty($order-&gt;order_invoice_id) &amp;&amp; empty($order-&gt;old-&gt;order_invoice_id) &amp;&amp; $order_type == 'sale') {

And that's this block content which require an update.
But, like I said, if the patch working fine for you, we could include it for the next release, just need your validation before.

Regards,

---

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

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

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

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

Less More

- Posts: 89
- Thank you received: 1
-
- [](http://www.insegnalo.it)
-

13 years 10 months ago [\#87073](#87073) by [insegnalo](/forum/user/12331-insegnalo "View insegnalo's Profile")  Replied by *[insegnalo](/forum/user/12331-insegnalo "View insegnalo's Profile")* on topic *[Progressive invoice number and no invoice for free](/forum/4-how-to/77197-progressive-invoice-number-and-no-invoice-for-free#87073 "Hi,  I have two problems in the issuance of invoice.  The first, as Italian user, I need a number for invoices that starts over every beginning of the year and one that does not have holes numbering.  The second. I have many free products. I do not want no &quot;official&quot; invoice is for these products but only orders, is it possible?  thanks Fabio")*

Hi Jerome

I made ​​the changes that I've written.

As you can see from the attached pictures I changed the order.php file

and I added the entry invoice_exclude_free_orders in the table _hikashop_order

But also the invoice is generated for zero amounts

where went I wrong?

Thanks
Fabio

---

Configuration:
Joomla: 2.5.9
Hikashop: 2.1.1
Hikamarket: 1.1.2

- [ ![Schermata&#95;2013-01-25&#95;alle&#95;09&#95;14&#95;18.jpg](/forum/attachment/8176) ](/forum/attachment/8176 "...e&#95;09&#95;14&#95;18.jpg") [ ](/forum/attachment/8176?download=1 "...e&#95;09&#95;14&#95;18.jpg")
- [ ![Schermata&#95;2013-01-25&#95;alle&#95;09&#95;15&#95;03.jpg](/forum/attachment/8177) ](/forum/attachment/8177 "...e&#95;09&#95;15&#95;03.jpg") [ ](/forum/attachment/8177?download=1 "...e&#95;09&#95;15&#95;03.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc3MTk3LXByb2dyZXNzaXZlLWludm9pY2UtbnVtYmVyLWFuZC1uby1pbnZvaWNlLWZvci1mcmVlP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) 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 10 months ago [\#87079](#87079) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Progressive invoice number and no invoice for free](/forum/4-how-to/77197-progressive-invoice-number-and-no-invoice-for-free#87079 "Hi,  I have two problems in the issuance of invoice.  The first, as Italian user, I need a number for invoices that starts over every beginning of the year and one that does not have holes numbering.  The second. I have many free products. I do not want no &quot;official&quot; invoice is for these products but only orders, is it possible?  thanks Fabio")*

Hi,

You need to add a line in the database. You have create a new column.
[ ![database.png](/forum/attachment/8178) ](/forum/attachment/8178 "database.png")

In the database, make an "insert" and set:
config_namekey: invoice_exclude_free_orders
config_value: 1
config_default: 0

Regards,

---

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

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

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

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

Less More

- Posts: 89
- Thank you received: 1
-
- [](http://www.insegnalo.it)
-

13 years 10 months ago [\#87092](#87092) by [insegnalo](/forum/user/12331-insegnalo "View insegnalo's Profile")  Replied by *[insegnalo](/forum/user/12331-insegnalo "View insegnalo's Profile")* on topic *[Progressive invoice number and no invoice for free](/forum/4-how-to/77197-progressive-invoice-number-and-no-invoice-for-free#87092 "Hi,  I have two problems in the issuance of invoice.  The first, as Italian user, I need a number for invoices that starts over every beginning of the year and one that does not have holes numbering.  The second. I have many free products. I do not want no &quot;official&quot; invoice is for these products but only orders, is it possible?  thanks Fabio")*

Ok it works! ![:-)](/media/kunena/emoticons/3.png ":-)")

on the table _hikashop_order not entered any invoice number for free orders.

Although, however, in order always appears Invoice button with the order number.

A doubt, the PDF plugin what invoice send to the buyer ?

Thanks
Fabio

---

Configuration:
Joomla: 2.5.9
Hikashop: 2.1.1
Hikamarket: 1.1.2

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc3MTk3LXByb2dyZXNzaXZlLWludm9pY2UtbnVtYmVyLWFuZC1uby1pbnZvaWNlLWZvci1mcmVlP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) 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 10 months ago [\#87224](#87224) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Progressive invoice number and no invoice for free](/forum/4-how-to/77197-progressive-invoice-number-and-no-invoice-for-free#87224 "Hi,  I have two problems in the issuance of invoice.  The first, as Italian user, I need a number for invoices that starts over every beginning of the year and one that does not have holes numbering.  The second. I have many free products. I do not want no &quot;official&quot; invoice is for these products but only orders, is it possible?  thanks Fabio")*

Hi,

I have to check about the "invoice" button. It is mainly a translation of the word "order/invoice" and it could be modified with view overrides.
The PDF plugin use a view too, so you can override his content too.

Regards,

---

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

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

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

Less More

- Posts: 89
- Thank you received: 1
-
- [](http://www.insegnalo.it)
-

13 years 9 months ago [\#87605](#87605) by [insegnalo](/forum/user/12331-insegnalo "View insegnalo's Profile")  Replied by *[insegnalo](/forum/user/12331-insegnalo "View insegnalo's Profile")* on topic *[Progressive invoice number and no invoice for free](/forum/4-how-to/77197-progressive-invoice-number-and-no-invoice-for-free#87605 "Hi,  I have two problems in the issuance of invoice.  The first, as Italian user, I need a number for invoices that starts over every beginning of the year and one that does not have holes numbering.  The second. I have many free products. I do not want no &quot;official&quot; invoice is for these products but only orders, is it possible?  thanks Fabio")*

Hi Jerome

I would like the PDF plugin not send any file if it is not generated invoice,

with the changes you told me now is no longer generated invoice for orders equal to zero, however, the pdf file is sent

What should I do in order not to send this file?

Thanks
Fabio

---

Configuration:
Joomla: 2.5.9
Hikashop: 2.1.1
Hikamarket: 1.1.2

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc3MTk3LXByb2dyZXNzaXZlLWludm9pY2UtbnVtYmVyLWFuZC1uby1pbnZvaWNlLWZvci1mcmVlP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) 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 9 months ago [\#87787](#87787) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Progressive invoice number and no invoice for free](/forum/4-how-to/77197-progressive-invoice-number-and-no-invoice-for-free#87787 "Hi,  I have two problems in the issuance of invoice.  The first, as Italian user, I need a number for invoices that starts over every beginning of the year and one that does not have holes numbering.  The second. I have many free products. I do not want no &quot;official&quot; invoice is for these products but only orders, is it possible?  thanks Fabio")*

Hi,

You can update the "attachinvoice" plugin in order to do not generate the invoice if the invoice number is not generated.
In the function "onBeforeMailSend" you would found the lines: Code:

if(!class_exists('HTML2PDF')) include(dirname(__FILE__).DS.'attachinvoice'.DS.'html2pdf.class.php'); $orderId = $data-&gt;data-&gt;order_id; // Add this text block if(empty($data-&gt;data-&gt;order_invoice_id)) { return; }

Regards,

---

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

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

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

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

Less More

- Posts: 104
- Thank you received: 0
-
-

13 years 6 months ago [\#103012](#103012) by [dyvymtvar](/forum/user/7407-dyvymtvar "View dyvymtvar's Profile")  Replied by *[dyvymtvar](/forum/user/7407-dyvymtvar "View dyvymtvar's Profile")* on topic *[Progressive invoice number and no invoice for free](/forum/4-how-to/77197-progressive-invoice-number-and-no-invoice-for-free#103012 "Hi,  I have two problems in the issuance of invoice.  The first, as Italian user, I need a number for invoices that starts over every beginning of the year and one that does not have holes numbering.  The second. I have many free products. I do not want no &quot;official&quot; invoice is for these products but only orders, is it possible?  thanks Fabio")*

Hi Jerome,

I have a question. In administrator/components/com_hikashop/classes/order.php I can see the code Code:

if(!empty($order-&gt;order_status) &amp;&amp; empty($order-&gt;order_invoice_id) &amp;&amp; empty($order-&gt;old-&gt;order_invoice_id) &amp;&amp; $order_type == 'sale') { $config =&amp; hikashop_config(); $valid_statuses = explode(',', $config-&gt;get('invoice_order_statuses','confirmed,shipped')); $excludeFreeOrders = $config-&gt;get('invoice_exclude_free_orders', 0); if(isset($order-&gt;order_full_price)) $total = $order-&gt;order_full_price; else $total = $order-&gt;old-&gt;order_full_price; if(in_array($order-&gt;order_status, $valid_statuses) &amp;&amp; ($total &gt; 0 &#124;&#124; !$excludeFreeOrders)) { $query = 'SELECT MAX(a.order_invoice_id)+1 FROM '.hikashop_table('order').' AS a WHERE a.order_type = \'sale\''; $resetFrequency = $config-&gt;get('invoice_reset_frequency', ''); if(!empty($resetFrequency)) { $y = (int)date('Y'); $m = 1; $d = 1; if($resetFrequency == 'month') $m = (int)date('m'); if(strpos($resetFrequency, '/') !== false) { list($d,$m) = explode('/', $resetFrequency, 2); if($d == '*') $d = (int)date('d'); else $d = (int)$d; if($m == '*') $m = (int)date('m'); else $m = (int)$m; if($d &lt;= 0) $d = 1; if($m &lt;= 0) $m = 1; }

I should replace it with this one? Code:

if(!empty($order-&gt;order_status) &amp;&amp; empty($order-&gt;order_invoice_id) &amp;&amp; empty($order-&gt;old-&gt;order_invoice_id) &amp;&amp; $order_type == 'sale') { $config =&amp; hikashop_config(); $valid_statuses = explode(',', $config-&gt;get('invoice_order_statuses','confirmed,shipped')); $excludeFreeOrders = $config-&gt;get('invoice_exclude_free_orders', 0); if(isset($order-&gt;order_full_price)) $total = $order-&gt;order_full_price; else $total = $order-&gt;old-&gt;order_full_price; if(in_array($order-&gt;order_status, $valid_statuses) &amp;&amp; ($total &gt; 0 &#124;&#124; !$excludeFreeOrders)) { $this-&gt;database-&gt;setQuery('SELECT MAX(a.order_invoice_id)+1 FROM '.hikashop_table('order').' AS a WHERE a.order_type = \'sale\''); $order-&gt;order_invoice_id = $this-&gt;database-&gt;loadResult(); $order-&gt;order_invoice_number = hikashop_encode($order, 'invoice'); } }

And then create the option in de database.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc3MTk3LXByb2dyZXNzaXZlLWludm9pY2UtbnVtYmVyLWFuZC1uby1pbnZvaWNlLWZvci1mcmVlP3N0YXJ0PTAmdG1wbD1tYXJrZG93bg==) 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 [\#103014](#103014) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Progressive invoice number and no invoice for free](/forum/4-how-to/77197-progressive-invoice-number-and-no-invoice-for-free#103014 "Hi,  I have two problems in the issuance of invoice.  The first, as Italian user, I need a number for invoices that starts over every beginning of the year and one that does not have holes numbering.  The second. I have many free products. I do not want no &quot;official&quot; invoice is for these products but only orders, is it possible?  thanks Fabio")*

Hi,

The latest version of HikaShop already includes the patch which read the option Code:

$excludeFreeOrders = $config-&gt;get('invoice_exclude_free_orders', 0);

So you just need to create the option in the database. No view modification is required.

Regards,

---

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

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

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