From 3611161b67353c96ac0ffbc9491c544deb48b19c Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Thu, 30 Jun 2016 19:35:11 +0200
Subject: [PATCH] Fix custom code should not appears on services

---
 dev/translation/sanity_check_en_langfiles.php | 3 ++-
 htdocs/langs/en_US/products.lang              | 2 ++
 htdocs/product/card.php                       | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dev/translation/sanity_check_en_langfiles.php b/dev/translation/sanity_check_en_langfiles.php
index f64798d72ff..6d63c415981 100755
--- a/dev/translation/sanity_check_en_langfiles.php
+++ b/dev/translation/sanity_check_en_langfiles.php
@@ -324,7 +324,8 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
 	    if (preg_match('/GlobalVariableUpdaterHelp$/', $value)) $qualifiedforclean=0;
 	    if (preg_match('/OppStatus/', $value)) $qualifiedforclean=0;
 	    if (preg_match('/AvailabilityType/', $value)) $qualifiedforclean=0;
-
+	    if (preg_match('/CardProduct/', $value)) $qualifiedforclean=0;
+	    
 	    if (preg_match('/sms/i', $value)) $qualifiedforclean=0;
 	    if (preg_match('/TF_/i', $value)) $qualifiedforclean=0;
 	    if (preg_match('/WithBankUsing/i', $value)) $qualifiedforclean=0;
diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang
index b1b8d601430..e9142d463ff 100644
--- a/htdocs/langs/en_US/products.lang
+++ b/htdocs/langs/en_US/products.lang
@@ -32,6 +32,8 @@ ServicesOnSellAndOnBuy=Services for sale and for purchase
 LastModifiedProductsAndServices=Latest %s modified products/services
 LastRecordedProducts=Latest %s recorded products
 LastRecordedServices=Latest %s recorded services
+CardProduct0=Product card
+CardProduct1=Service card
 Stock=Stock
 Stocks=Stocks
 Movements=Movements
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 330e712cf1b..e524b8f8303 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1314,7 +1314,7 @@ else
 	        }
 
 	        // Custom code
-    	    if (empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO))
+    	    if (! $object->isService() && empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO))
         	{
 	            print '<tr><td>'.$langs->trans("CustomCode").'</td><td><input name="customcode" size="10" value="'.$object->customcode.'"></td>';
 	            // Origin country
-- 
GitLab