From ea0687f613cfe94d3b1ae34ff6837954af071252 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Sat, 1 Oct 2016 18:22:30 +0200
Subject: [PATCH] FIX Vat not visible in dictionnary

---
 .../class/html.formventilation.class.php      | 19 +++++++++----------
 htdocs/admin/dict.php                         | 13 ++++++-------
 2 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/htdocs/accountancy/class/html.formventilation.class.php b/htdocs/accountancy/class/html.formventilation.class.php
index 738a98bb57e..f4e255f6dba 100644
--- a/htdocs/accountancy/class/html.formventilation.class.php
+++ b/htdocs/accountancy/class/html.formventilation.class.php
@@ -62,17 +62,16 @@ class FormVentilation extends Form
 	/**
 	 * Return list of accounts with label by chart of accounts
 	 *
-	 * @param string $selectid Preselected chart of accounts
-	 * @param string $htmlname Name of field in html form
-	 * @param int $showempty Add an empty field
-	 * @param array $event Event options
-	 * @param int $select_in $selectid value is a aa.rowid (0 default) or aa.account_number (1)
-	 * @param int $select_out set value returned by select 0=rowid (default), 1=account_number
-	 * @param int $aabase set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by this number
-	 *
+	 * @param string   $selectid           Preselected chart of accounts
+	 * @param string   $htmlname           Name of field in html form
+	 * @param int      $showempty          Add an empty field
+	 * @param array    $event              Event options
+	 * @param int      $select_in          selectid value is a aa.rowid (0 default) or aa.account_number (1)
+	 * @param int      $select_out         set value returned by select 0=rowid (default), 1=account_number
+	 * @param string   $morecss            More css non HTML object
 	 * @return string String with HTML select
 	 */
-	function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '') {
+	function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $morecss='maxwidth300 maxwidthonsmartphone') {
 		global $conf;
 
 		require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
@@ -123,7 +122,7 @@ class FormVentilation extends Form
 			$options[$select_value_out] = $label;
 		}
 
-		$out .= Form::selectarray($htmlname, $options, $selected, $showempty, 0, 0, '', 0, 0, 0, '', 'maxwidth300');
+		$out .= Form::selectarray($htmlname, $options, $selected, $showempty, 0, 0, '', 0, 0, 0, '', $morecss);
 		$this->db->free($resql);
 		return $out;
 	}
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index 3705aecf558..5379a3afd83 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -1238,6 +1238,7 @@ if ($id)
                     {
                         foreach ($fieldlist as $field => $value)
                         {
+                            
                             $showfield=1;
                         	$align="left";
                             $valuetoshow=$obj->{$fieldlist[$field]};
@@ -1374,20 +1375,18 @@ if ($id)
 							    $valuetoshow=$localtax_typeList[$valuetoshow];
 							  else
 							    $valuetoshow = '';
-							  $align="center";
+							  $align="right";
 							}
 							else if ($fieldlist[$field]=='localtax2_type') {
 							 if ($obj->localtax2 != 0)
 							    $valuetoshow=$localtax_typeList[$valuetoshow];
 							  else
 							    $valuetoshow = '';
-							  $align="center";
+							  $align="right";
 							}
 							else if ($fieldlist[$field]=='taux') {
                                 $valuetoshow = price($valuetoshow, 0, $langs, 0, 0);
-							  if ($obj->localtax1 == 0)
-							    $valuetoshow = '';
-							  $align="right";
+							    $align="right";
 							}
 							else if (in_array($fieldlist[$field],array('recuperableonly')))
 							{
@@ -1567,7 +1566,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
 			}	// For state page, we do not show the country input (we link to region, not country)
 			print '<td>';
 			$fieldname='country';
-			print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:'')), $fieldname, '', 28, 'maxwidth300');
+			print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:'')), $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone');
 			print '</td>';
 		}
 		elseif ($fieldlist[$field] == 'country_id')
@@ -1689,7 +1688,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
 			if (! empty($conf->accounting->enabled))
 			{
 				$accountancy_account = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0);
-				print $formaccountancy->select_account($accountancy_account, $fieldlist[$field], 1, '', 1, 1);
+				print $formaccountancy->select_account($accountancy_account, $fieldlist[$field], 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone');
 			}
 			else
 			{
-- 
GitLab