From dac97e2115284f3ce086e52d64133b52ef4a1624 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Nov 2012 11:39:48 +0100 Subject: [PATCH] Fix: Do not try to show supplie ref if not defined. --- htdocs/core/class/html.form.class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 2eab0a5fe38..1b0033f5d3f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1480,8 +1480,12 @@ class Form $label = $objp->label; if ($filterkey && $filterkey != '') $label=preg_replace('/('.preg_quote($filterkey).')/i','$1',$label,1); - $opt.=$objp->ref.' ('.$objp->ref_fourn.') - '; - $outval.=$objRef.' ('.$objRefFourn.') - '; + $opt.=$objp->ref; + if (! empty($objp->idprodfournprice)) $opt.=' ('.$objp->ref_fourn.')'; + $opt.=' - '; + $outval.=$objRef; + if (! empty($objp->idprodfournprice)) $outval.=' ('.$objRefFourn.')'; + $outval.=' - '; $opt.=dol_trunc($objp->label,18).' - '; $outval.=dol_trunc($label,18).' - '; @@ -1532,7 +1536,7 @@ class Form } } else - { + { $opt.= $langs->trans("NoPriceDefinedForThisSupplier"); $outval.=$langs->transnoentities("NoPriceDefinedForThisSupplier"); }