commit
c6927404ef
@ -1829,7 +1829,7 @@ class Form
|
|||||||
* @param string $htmlname Name of HTML field
|
* @param string $htmlname Name of HTML field
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function select_product_fourn_price($productid,$htmlname='productfournpriceid', $showempty=0)
|
function select_product_fourn_price($productid,$htmlname='productfournpriceid')
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
|
||||||
@ -1862,7 +1862,7 @@ class Form
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if($showempty && $num > 1) $form.= '<option value="0"> </option>';
|
$form.= '<option value="0"> </option>';
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
@ -1870,6 +1870,10 @@ class Form
|
|||||||
$objp = $this->db->fetch_object($result);
|
$objp = $this->db->fetch_object($result);
|
||||||
|
|
||||||
$opt = '<option value="'.$objp->idprodfournprice.'"';
|
$opt = '<option value="'.$objp->idprodfournprice.'"';
|
||||||
|
//if there is only one supplier, preselect it
|
||||||
|
if($num == 1) {
|
||||||
|
$opt .= ' selected="selected"';
|
||||||
|
}
|
||||||
$opt.= '>'.$objp->nom.' - '.$objp->ref_fourn.' - ';
|
$opt.= '>'.$objp->nom.' - '.$objp->ref_fourn.' - ';
|
||||||
|
|
||||||
if ($objp->quantity == 1)
|
if ($objp->quantity == 1)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user