From e2381d70adccaafd257807cf50d21b6fbb047ed1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Jul 2005 13:11:23 +0000 Subject: [PATCH] =?UTF-8?q?Param=E8tre=20sur=20select=5Ftva=20pour=20propo?= =?UTF-8?q?ser=20valeur=20"defaut"=20dans=20liste.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/html.form.class.php | 97 +++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 02906c64920..23c9e5ecfc2 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -446,14 +446,14 @@ class Form $sql.= " WHERE p.envente = 1"; if ($filtretype && $filtretype != '') $sql.=" AND p.fk_product_type=".$filtretype; $sql.= " ORDER BY p.nbvente DESC"; - $sql.= " LIMIT $limit"; + if ($limit) $sql.= " LIMIT $limit"; $result=$this->db->query($sql); if ($result) { print ''; - - for ($i = 0 ; $i < $taille ; $i++) - { - print ''; - } - else - { - print '>'.$txtva[$i].' %'; - } - } - print ''; - } + /** + * \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) + { + global $langs; + + $file = DOL_DOCUMENT_ROOT . "/conf/tva.local.php"; + if (is_readable($file)) + { + include $file; + } + else + { + $txtva[0] = '19.6'; + $txtva[1] = '5.5'; + $txtva[2] = '0'; + } + + if ($defaulttx == '') + { + $defaulttx = $txtva[0]; + } + + $taille = sizeof($txtva); + + print ''; + } /**