Paramètre sur select_tva pour proposer valeur "defaut" dans liste.
This commit is contained in:
parent
3d30860b5f
commit
e2381d70ad
@ -446,7 +446,7 @@ class Form
|
|||||||
$sql.= " WHERE p.envente = 1";
|
$sql.= " WHERE p.envente = 1";
|
||||||
if ($filtretype && $filtretype != '') $sql.=" AND p.fk_product_type=".$filtretype;
|
if ($filtretype && $filtretype != '') $sql.=" AND p.fk_product_type=".$filtretype;
|
||||||
$sql.= " ORDER BY p.nbvente DESC";
|
$sql.= " ORDER BY p.nbvente DESC";
|
||||||
$sql.= " LIMIT $limit";
|
if ($limit) $sql.= " LIMIT $limit";
|
||||||
|
|
||||||
$result=$this->db->query($sql);
|
$result=$this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
@ -737,15 +737,13 @@ class Form
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Selection du taux de tva
|
* \brief Selection du taux de tva
|
||||||
*
|
* \param name Nom champ html
|
||||||
|
* \param defaulttx Taux tva présélectionné
|
||||||
|
* \param empy Proposer ligne "Defaut"
|
||||||
*/
|
*/
|
||||||
|
function select_tva($name='tauxtva', $defaulttx='', $default=0)
|
||||||
function select_tva($name='', $defaulttx = '')
|
|
||||||
{
|
{
|
||||||
if (! strlen(trim($name)))
|
global $langs;
|
||||||
{
|
|
||||||
$name = "tauxtva";
|
|
||||||
}
|
|
||||||
|
|
||||||
$file = DOL_DOCUMENT_ROOT . "/conf/tva.local.php";
|
$file = DOL_DOCUMENT_ROOT . "/conf/tva.local.php";
|
||||||
if (is_readable($file))
|
if (is_readable($file))
|
||||||
@ -767,6 +765,7 @@ class Form
|
|||||||
$taille = sizeof($txtva);
|
$taille = sizeof($txtva);
|
||||||
|
|
||||||
print '<select class="flat" name="'.$name.'">';
|
print '<select class="flat" name="'.$name.'">';
|
||||||
|
if ($default) print '<option value="0">'.$langs->trans("Default").'</option>';
|
||||||
|
|
||||||
for ($i = 0 ; $i < $taille ; $i++)
|
for ($i = 0 ; $i < $taille ; $i++)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user