diff --git a/htdocs/core/ajax/vatrates.php b/htdocs/core/ajax/vatrates.php
new file mode 100644
index 00000000000..d987b074bc6
--- /dev/null
+++ b/htdocs/core/ajax/vatrates.php
@@ -0,0 +1,55 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/**
+ * \file htdocs/core/ajax/vatrates.php
+ * \brief File to load vat rates combobox
+ */
+
+if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal
+if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1');
+//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
+if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
+//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
+//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
+
+require('../../main.inc.php');
+
+$id = GETPOST('id','int');
+$action = GETPOST('action','alpha');
+$htmlname = GETPOST('htmlname','alpha');
+
+/*
+ * View
+ */
+
+top_httphead();
+
+//print ''."\n";
+
+// Load original field value
+if (! empty($id) && ! empty($action) && ! empty($htmlname))
+{
+ $form = new Form($db);
+ $soc = new Societe($db);
+
+ $soc->fetch($id);
+
+ echo $form->load_tva('tva_tx','',$soc,$mysoc,0,0,'',true);
+}
+
+?>
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index c0eeea480b6..5b9d2db15d8 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -640,9 +640,10 @@ class Form
* @param int $showempty Add an empty field
* @param int $showtype Show third party type in combolist (customer, prospect or supplier)
* @param int $forcecombo Force to use combo box
+ @param array $event Event options
* @return string HTML string with
*/
- function select_company($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0)
+ function select_company($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $event=array())
{
global $conf,$user,$langs;
@@ -665,7 +666,7 @@ class Form
{
//$minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2);
- $out.= ajax_combobox($htmlname);
+ $out.= ajax_combobox($htmlname, $event);
}
$out.= '