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

#   Exclude invoice generation for private customer

##

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

Less More

- Posts: 59
- Thank you received: 0
-
-

8 years 9 months ago [\#285312](#285312) by [simonev](/forum/user/30589-simonev "View simonev's Profile")  *[Exclude invoice generation for private customer](/forum/35-orders-management/893341-exclude-invoice-generation-for-private-customer#285312 "Hi! I'm looking a way to exclude the invoice generation for orders made by private customers, people which don't have any vat. In fact in Italy private customers don't need to receive the invoice if they don't require it. They just need to receive the receipt in the shipped pack.  So I was looking a way to exclude invoice generation. I thought to create a new custom field, a radio button which says: &quot;do you need an invoice?&quot; if user click on yes then are displayed invoice fields to fill and users will receive the invoice via email with your plugin (as it normally working). If user say no the system doesn't generate the invoice.  Is it possibile to achieve this result? Could you help me to find the code to edit in order to make this check before to generate an invoice?  Thanks for your support. Regards, Simone")* was created by *[simonev](/forum/user/30589-simonev "View simonev's Profile")*

Hi! I'm looking a way to exclude the invoice generation for orders made by private customers, people which don't have any vat.
In fact in Italy private customers don't need to receive the invoice if they don't require it. They just need to receive the receipt in the shipped pack.

So I was looking a way to exclude invoice generation. I thought to create a new custom field, a radio button which says:
"do you need an invoice?" if user click on yes then are displayed invoice fields to fill and users will receive the invoice via email with your plugin (as it normally working). If user say no the system doesn't generate the invoice.

Is it possibile to achieve this result?
Could you help me to find the code to edit in order to make this check before to generate an invoice?

Thanks for your support.
Regards,
Simone

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

8 years 9 months ago [\#285317](#285317) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Exclude invoice generation for private customer](/forum/35-orders-management/893341-exclude-invoice-generation-for-private-customer#285317 "Hi! I'm looking a way to exclude the invoice generation for orders made by private customers, people which don't have any vat. In fact in Italy private customers don't need to receive the invoice if they don't require it. They just need to receive the receipt in the shipped pack.  So I was looking a way to exclude invoice generation. I thought to create a new custom field, a radio button which says: &quot;do you need an invoice?&quot; if user click on yes then are displayed invoice fields to fill and users will receive the invoice via email with your plugin (as it normally working). If user say no the system doesn't generate the invoice.  Is it possibile to achieve this result? Could you help me to find the code to edit in order to make this check before to generate an invoice?  Thanks for your support. Regards, Simone")*

Hi,

How do your users get the invoice ?
A PDF in the confirmation email with the "PDF invoice plugin" ?
The "invoice" button when they edit their order ?
And for which version of HikaShop are you trying to do that ?
Based on that we might be able to provide a solution.

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

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

Less More

- Posts: 59
- Thank you received: 0
-
-

8 years 9 months ago [\#285365](#285365) by [simonev](/forum/user/30589-simonev "View simonev's Profile")  Replied by *[simonev](/forum/user/30589-simonev "View simonev's Profile")* on topic *[Exclude invoice generation for private customer](/forum/35-orders-management/893341-exclude-invoice-generation-for-private-customer#285365 "Hi! I'm looking a way to exclude the invoice generation for orders made by private customers, people which don't have any vat. In fact in Italy private customers don't need to receive the invoice if they don't require it. They just need to receive the receipt in the shipped pack.  So I was looking a way to exclude invoice generation. I thought to create a new custom field, a radio button which says: &quot;do you need an invoice?&quot; if user click on yes then are displayed invoice fields to fill and users will receive the invoice via email with your plugin (as it normally working). If user say no the system doesn't generate the invoice.  Is it possibile to achieve this result? Could you help me to find the code to edit in order to make this check before to generate an invoice?  Thanks for your support. Regards, Simone")*

User get the invoice only via email when order is confirmed through PDF invoice plugin.
For users is not allowed to print invoice on frontend, if is that what you mean saying:
The "invoice" button when they edit their order ?
I'm using Hikashop Business 2.6.2 at the moment but I'll upgrade if needed to do this job.

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

8 years 9 months ago [\#285367](#285367) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Exclude invoice generation for private customer](/forum/35-orders-management/893341-exclude-invoice-generation-for-private-customer#285367 "Hi! I'm looking a way to exclude the invoice generation for orders made by private customers, people which don't have any vat. In fact in Italy private customers don't need to receive the invoice if they don't require it. They just need to receive the receipt in the shipped pack.  So I was looking a way to exclude invoice generation. I thought to create a new custom field, a radio button which says: &quot;do you need an invoice?&quot; if user click on yes then are displayed invoice fields to fill and users will receive the invoice via email with your plugin (as it normally working). If user say no the system doesn't generate the invoice.  Is it possibile to achieve this result? Could you help me to find the code to edit in order to make this check before to generate an invoice?  Thanks for your support. Regards, Simone")*

Hi,

In that case, you can add the code: Code:

if(empty($order-&gt;billing_address-&gt;address_vat)) return;

after the code: Code:

$order = $class-&gt;loadFullOrder($orderId,true,false);

in the file plugins/hikashop/attachinvoice/attachinvoice.php

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

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

Less More

- Posts: 59
- Thank you received: 0
-
-

8 years 9 months ago [\#285439](#285439) by [simonev](/forum/user/30589-simonev "View simonev's Profile")  Replied by *[simonev](/forum/user/30589-simonev "View simonev's Profile")* on topic *[Exclude invoice generation for private customer](/forum/35-orders-management/893341-exclude-invoice-generation-for-private-customer#285439 "Hi! I'm looking a way to exclude the invoice generation for orders made by private customers, people which don't have any vat. In fact in Italy private customers don't need to receive the invoice if they don't require it. They just need to receive the receipt in the shipped pack.  So I was looking a way to exclude invoice generation. I thought to create a new custom field, a radio button which says: &quot;do you need an invoice?&quot; if user click on yes then are displayed invoice fields to fill and users will receive the invoice via email with your plugin (as it normally working). If user say no the system doesn't generate the invoice.  Is it possibile to achieve this result? Could you help me to find the code to edit in order to make this check before to generate an invoice?  Thanks for your support. Regards, Simone")*

Hi thanks for your support, code works.
I've been not so clear while explaining because seems that with your code no invoice is sent to the user but in website backend order panel the invoice has been created and numeration increased.
What i need is that no invoice is generated by hikashop if user is private user (so empty vat) in the entire website.
Hope that it's more clear now.

Thank you again, superb support!

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

8 years 9 months ago [\#285440](#285440) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Exclude invoice generation for private customer](/forum/35-orders-management/893341-exclude-invoice-generation-for-private-customer#285440 "Hi! I'm looking a way to exclude the invoice generation for orders made by private customers, people which don't have any vat. In fact in Italy private customers don't need to receive the invoice if they don't require it. They just need to receive the receipt in the shipped pack.  So I was looking a way to exclude invoice generation. I thought to create a new custom field, a radio button which says: &quot;do you need an invoice?&quot; if user click on yes then are displayed invoice fields to fill and users will receive the invoice via email with your plugin (as it normally working). If user say no the system doesn't generate the invoice.  Is it possibile to achieve this result? Could you help me to find the code to edit in order to make this check before to generate an invoice?  Thanks for your support. Regards, Simone")*

Hi,

In that case, you also want to change the line:
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' &amp;&amp; !$already_invoice_number) {
to:
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' &amp;&amp; !$already_invoice_number &amp;&amp; !empty($order-&gt;cart-&gt;billing_address-&gt;address_vat)) {
in the file administrator/components/com_hikashop/classes/order.php

PS: Please note that we're not supposed to answer such code customization requests, even more so when you don't even have an active subscription for your HikaShop.

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

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

Less More

- Posts: 59
- Thank you received: 0
-
-

8 years 9 months ago [\#285475](#285475) by [simonev](/forum/user/30589-simonev "View simonev's Profile")  Replied by *[simonev](/forum/user/30589-simonev "View simonev's Profile")* on topic *[Exclude invoice generation for private customer](/forum/35-orders-management/893341-exclude-invoice-generation-for-private-customer#285475 "Hi! I'm looking a way to exclude the invoice generation for orders made by private customers, people which don't have any vat. In fact in Italy private customers don't need to receive the invoice if they don't require it. They just need to receive the receipt in the shipped pack.  So I was looking a way to exclude invoice generation. I thought to create a new custom field, a radio button which says: &quot;do you need an invoice?&quot; if user click on yes then are displayed invoice fields to fill and users will receive the invoice via email with your plugin (as it normally working). If user say no the system doesn't generate the invoice.  Is it possibile to achieve this result? Could you help me to find the code to edit in order to make this check before to generate an invoice?  Thanks for your support. Regards, Simone")*

Really thanks for your support, I'll try to perform with your suggestion.
If we'll update this stuff about invoice we also will update checkout system and workflow using ajax so I'll renew my subscription.

Best regards,
Simone

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

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

[](#top)
