From 824a0adb116f4e9c945c6db9d010b80a13e8fbce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Dec 2010 23:22:25 +0000 Subject: [PATCH] New: Add custom code and origin country into invoice --- htdocs/compta/facture.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 56bda154bf9..b4c41864262 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -870,8 +870,17 @@ if (($_POST['action'] == 'addline' || $_POST['action'] == 'addline_predef') && $ } $desc = $prod->description; - $desc.= $prod->description && $_POST['np_desc'] ? "\n" : ""; + $desc.= ($prod->description && $_POST['np_desc']) ? "\n" : ""; $desc.= $_POST['np_desc']; + if (! empty($prod->customcode) || ! empty($prod->country_code)) + { + $tmptxt='('; + if (! empty($prod->customcode)) $tmptxt.=$langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode; + if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt.=' - '; + if (! empty($prod->country_code)) $tmptxt.=$langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code,0,$db,$langs,0); + $tmptxt.=')'; + $desc.="\n".$tmptxt; + } $type = $prod->type; } else