VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: rage76 on July 08, 2017, 09:49:49 AM

Title: Is there a way to print item "GTIN number" on the invoice?
Post by: rage76 on July 08, 2017, 09:49:49 AM
The implementation of GST in India has brought in a lot of statutory changes. We are now required to print the HSN Code (harmonized code) of each item on the invoice. So I was thinking I can create a language override for GTIN and use it for storing HSN code of item.

But the question is how to print it in the invoice? Any ideas or better suggestion?

J 3.7.3 / VM 3.0.18
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: rage76 on July 19, 2017, 18:58:08 PM
Any has a solution / suggestion?
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: rage76 on July 28, 2017, 19:00:05 PM
Somebody please help me on this !!
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: rage76 on August 03, 2017, 08:26:31 AM
I desperately need a solution for this. Anyone out here?
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: Ghost on August 03, 2017, 08:35:50 AM
Create a template override for invoice and modify it to your liking. If GTIN is not available in data, use product model or DB query to get it.
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: loppan on August 03, 2017, 08:44:17 AM
I would totally recommend ARTIO VM invoice if you're
not comfortable with coding, their extension makes it extremely simple
to customize the invoices to your liking and add any info you need on them : https://www.artio.net/virtuemart-tools/vm-invoice-generator
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: rage76 on August 03, 2017, 10:00:51 AM
Thanks dear Loppan

I am using Artio VM Invoice. Guess I need to ask their support on how I can accomplish this !!

Dear Ghost, thanks for your response, but I do not have the expertise to do what you are suggesting.
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: loppan on August 03, 2017, 12:28:14 PM
Quote from: rage76 on August 03, 2017, 10:00:51 AM
Thanks dear Loppan

I am using Artio VM Invoice. Guess I need to ask their support on how I can accomplish this !!


Hmm, I had a closer look and with Artio's VM Invoice you're not able to add the GTIN on the invoice by default - strange, I thought they had everything :). I would definitely explain the situation to the developer and request this feature, though. Perhaps it will be mandatory in more countries eventually....
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: AH on August 03, 2017, 13:15:24 PM
It is a shame that you are using Artio invoices - it is simple to add this to VM core invoices
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: Milbo on August 03, 2017, 20:31:15 PM
the gtin is just $product->gtin
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: rage76 on August 04, 2017, 07:55:38 AM
Quote from: AH on August 03, 2017, 13:15:24 PM
It is a shame that you are using Artio invoices - it is simple to add this to VM core invoices

Dear AH, I am not using Artio Invoices for just this purpose. I am using because it gives me a lot of flexibility and ease in designing the invoices that I was unable to do via the core VM invoices. Although I agree it is quite do-able in Core VM too !!
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: rage76 on August 04, 2017, 07:59:34 AM
In case there are others like me who would like to add "HSN Codes" to each of the product, the easiest easy way to do it is through VM custom fields. But I am facing an issue with this method;

The custom field shows on the product page. I donot want it to be visible on the product page and would only like to show/print it on the invoice. If someone has a solution to this, kindly guide me suitably.

Thanks in anticipation.
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: Ghost on August 04, 2017, 09:08:02 AM
Add something to 'Position' field in your custom field.
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: rage76 on August 04, 2017, 13:17:25 PM
Quote from: Ghost on August 04, 2017, 09:08:02 AM
Add something to 'Position' field in your custom field.

You mean anything random? Strangely, it does work. seems like a good hack. Hope it wont interfere with anything else !!
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: AH on August 05, 2017, 20:03:54 PM
The model has been adjusted to allow product fields to be included in the order view - when the next release is available you will be able to display the GTIN

$item->product_gtin
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: Milbo on August 05, 2017, 20:36:23 PM
You forgot to mention, it works on some php versions. The reason that it worked for some and for others not.
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: rage76 on August 07, 2017, 09:46:54 AM
Quote from: AH on August 05, 2017, 20:03:54 PM
The model has been adjusted to allow product fields to be included in the order view - when the next release is available you will be able to display the GTIN

$item->product_gtin

Dear AH, that is good news. This means I can wait for the next release. Am sure it is not too far now !!
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: rage76 on August 13, 2017, 18:42:29 PM
Has this been implemented in 3.2.3.9614? How to print this in the invoice? BTW, when can we expect the next stable release?
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: rage76 on August 23, 2017, 19:29:18 PM
My compliments to the VM team on releasing the stable VM 3.2.4

And I am happy to announce that I have updated it on my live site. I am trying to figure out how to print "GTIN Number" on the invoice.

Please guide !!

Thanks...
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: Milbo on August 23, 2017, 19:38:47 PM
Should now work in the loop with

echo $item->product_gtin;
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: rage76 on August 23, 2017, 19:42:03 PM
Quote from: Milbo on August 23, 2017, 19:38:47 PM
Should now work in the loop with

echo $item->product_gtin;


You mean I have to add this to a file to make it work? In that case please tell me the filename too !!
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: rage76 on August 27, 2017, 16:56:33 PM
Dear Milbo

Please help me on this.
Title: Re: Is there a way to print item "GTIN number" on the invoice?
Post by: AH on August 28, 2017, 10:19:43 AM
Invoice items are handled by:

\components\com_virtuemart\views\invoice\tmpl\invoice_items.php

Create your own override to the invoice_items.php and include the display of the GTIN.

Put the new invoice items override in:-

\templates\yourtemplate\html\com_virtuemart\invoice\invoice_items.php