Fix: Do not try to show supplie ref if not defined.

This commit is contained in:
Laurent Destailleur 2012-11-03 11:39:48 +01:00
parent 118733c600
commit dac97e2115

View File

@ -1480,8 +1480,12 @@ class Form
$label = $objp->label; $label = $objp->label;
if ($filterkey && $filterkey != '') $label=preg_replace('/('.preg_quote($filterkey).')/i','<strong>$1</strong>',$label,1); if ($filterkey && $filterkey != '') $label=preg_replace('/('.preg_quote($filterkey).')/i','<strong>$1</strong>',$label,1);
$opt.=$objp->ref.' ('.$objp->ref_fourn.') - '; $opt.=$objp->ref;
$outval.=$objRef.' ('.$objRefFourn.') - '; if (! empty($objp->idprodfournprice)) $opt.=' ('.$objp->ref_fourn.')';
$opt.=' - ';
$outval.=$objRef;
if (! empty($objp->idprodfournprice)) $outval.=' ('.$objRefFourn.')';
$outval.=' - ';
$opt.=dol_trunc($objp->label,18).' - '; $opt.=dol_trunc($objp->label,18).' - ';
$outval.=dol_trunc($label,18).' - '; $outval.=dol_trunc($label,18).' - ';
@ -1532,7 +1536,7 @@ class Form
} }
} }
else else
{ {
$opt.= $langs->trans("NoPriceDefinedForThisSupplier"); $opt.= $langs->trans("NoPriceDefinedForThisSupplier");
$outval.=$langs->transnoentities("NoPriceDefinedForThisSupplier"); $outval.=$langs->transnoentities("NoPriceDefinedForThisSupplier");
} }