diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 80cfce40c3242a2b07f5d5d8530a1bfe1e755dd5..60b3083d0f7b7f4310b058e8fdf505b20e8eded5 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -765,9 +765,9 @@ if ($action == 'create')
 		$events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
 		//For external user force the company to user company
 		if (!empty($user->societe_id)) {
-			print $form->select_thirdparty_list($user->societe_id,'socid','',1,1,0,$events);
+			print $form->select_thirdparty_list($user->societe_id, 'socid', '', 1, 1, 0, $events);
 		} else {
-			print $form->select_thirdparty_list('','socid','',1,1,0,$events);
+			print $form->select_thirdparty_list('', 'socid', '', 'SelectThirdParty', 1, 0, $events);
 		}
 
 	}
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 379cca8c9b8dbb4a7c832e59f8f5c93200101ca5..2d21c0049a1ea09d82ce0ec714af9f32be6bcdc5 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -1691,7 +1691,7 @@ if ($action == 'create')
                 $morehtmlref.='<input type="hidden" name="action" value="classin">';
                 $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
                 $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
-                $morehtmlref.='<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
+                $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
                 $morehtmlref.='</form>';
             } else {
                 $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index bc59eff4079a6cb22787976308ccc318289a1007..30a6d839ba8a36e51f19c24b07b9fde8e5981723 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -1944,7 +1944,7 @@ if ($action == 'create' && $user->rights->commande->creer)
 	                    $morehtmlref.='<input type="hidden" name="action" value="classin">';
 	                    $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 	                    $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
-	                    $morehtmlref.='<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
+	                    $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
 	                    $morehtmlref.='</form>';
 	                } else {
 	                    $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
@@ -2022,7 +2022,7 @@ if ($action == 'create' && $user->rights->commande->creer)
 		if ($soc->outstanding_limit)
 		{
 		    // Outstanding Bill
-		    print '<tr><td>';
+		    print '<tr><td class="titlefield">';
 		    print $langs->trans('OutstandingBill');
 		    print '</td><td>';
 		    print price($soc->get_OutstandingBill()) . ' / ';
@@ -2045,7 +2045,7 @@ if ($action == 'create' && $user->rights->commande->creer)
 		$addabsolutediscount = '<a href="' . DOL_URL_ROOT . '/comm/remx.php?id=' . $soc->id . '&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("EditGlobalDiscounts") . '</a>';
 		$addcreditnote = '<a href="' . DOL_URL_ROOT . '/compta/facture.php?action=create&socid=' . $soc->id . '&type=2&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("AddCreditNote") . '</a>';
 
-		print '<tr><td>' . $langs->trans('Discounts') . '</td><td>';
+		print '<tr><td class="titlefield">' . $langs->trans('Discounts') . '</td><td>';
 		if ($soc->remise_percent)
 			print $langs->trans("CompanyHasRelativeDiscount", $soc->remise_percent);
 		else
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 961d133e88e432d232f55055e812b64dc5a098fe..9aaadcea3f25e952f1dc051dc4a799f00325694b 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -2908,7 +2908,7 @@ else if ($id > 0 || ! empty($ref))
 	                $morehtmlref.='<input type="hidden" name="action" value="classin">';
 	                $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 	                $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
-	                $morehtmlref.='<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
+	                $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
 	                $morehtmlref.='</form>';
 	            } else {
 	                $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
@@ -2927,7 +2927,7 @@ else if ($id > 0 || ! empty($ref))
 	}
 	$morehtmlref.='</div>';
 	
-	$object->totalpaye = $totalpaye;   // To give a change to dol_banner_tab to use already paid amount to show correct status
+	$object->totalpaye = $totalpaye;   // To give a chance to dol_banner_tab to use already paid amount to show correct status
 	
 	dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
 	
@@ -3739,7 +3739,7 @@ else if ($id > 0 || ! empty($ref))
         else
             print $langs->trans('ExcessReceived');
         print ' :</td>';
-        print '<td align="right" class="amountremaintopay">' . price($resteapayeraffiche) . '</td>';
+        print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopay"':'').'>' . price($resteapayeraffiche) . '</td>';
         print '<td class="nowrap">&nbsp;</td></tr>';
     } 
     else // Credit note
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index cc51df1f90fb86774c55ff7a33d78c49627ef201..f50803fa45174f986e122b849ffd558b33d73c52 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -737,7 +737,7 @@ class Form
 
 			if (!empty($page))
 			{
-	            $out .= '<input type="submit" class="button" value="'.$langs->trans("Modify").'"></form>';
+	            $out .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'"></form>';
 			}
         }
         else
@@ -1570,7 +1570,7 @@ class Form
 			$out.='<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">';
 			$out.='<script type="text/javascript" language="javascript">jQuery(document).ready(function () {    jQuery(".removedassigned").click(function() {        jQuery(".removedassignedhidden").val(jQuery(this).val());    });})</script>';
 			$out.=$this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
-			$out.=' <input type="submit" class="button" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
+			$out.=' <input type="submit" class="button valignmiddle" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
 		}
 		$assignedtouser=array();
 		if (!empty($_SESSION['assignedtouser']))
@@ -1580,6 +1580,7 @@ class Form
 		$nbassignetouser=count($assignedtouser);
 
 		if ($nbassignetouser && $action != 'view') $out.='<br>';
+		if ($nbassignetouser) $out.='<div class="myavailability">';
 		$i=0; $ownerid=0;
 		foreach($assignedtouser as $key => $value)
 		{
@@ -1593,7 +1594,8 @@ class Form
 			$out.='<br>';
 			$i++;
 		}
-
+		if ($nbassignetouser) $out.='</div>';
+		
 		//$out.='</form>';
         return $out;
     }
@@ -2967,12 +2969,9 @@ class Form
             print '<form method="POST" action="'.$page.'">';
             print '<input type="hidden" name="action" value="setshippingmethod">';
             print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
-            print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
-            print '<tr><td>';
             $this->selectShippingMethod($selected, $htmlname, '', $addempty);
-            print '</td>';
-            print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
-            print '</tr></table></form>';
+            print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
+            print '</form>';
         } else {
             if ($selected) {
                 $code=$langs->getLabelFromKey($db, $selected, 'c_shipment_mode', 'rowid', 'code');
@@ -3159,12 +3158,9 @@ class Form
             print '<form method="POST" action="'.$page.'">';
             print '<input type="hidden" name="action" value="setbankaccount">';
             print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
-            print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
-            print '<tr><td>';
             $this->select_comptes($selected, $htmlname, 0, '', $addempty);
-            print '</td>';
-            print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
-            print '</tr></table></form>';
+            print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
+            print '</form>';
         } else {
             if ($selected) {
                 require_once DOL_DOCUMENT_ROOT .'/compta/bank/class/account.class.php';
@@ -3521,7 +3517,7 @@ class Form
             $formconfirm.= '<td class="valid">';
             $formconfirm.= $this->selectyesno("confirm",$newselectedchoice);
             $formconfirm.= '</td>';
-            $formconfirm.= '<td class="valid" align="center"><input class="button" type="submit" value="'.$langs->trans("Validate").'"></td>';
+            $formconfirm.= '<td class="valid" align="center"><input class="button valignmiddle" type="submit" value="'.$langs->trans("Validate").'"></td>';
             $formconfirm.= '</tr>'."\n";
 
             $formconfirm.= '</table>'."\n";
@@ -3567,12 +3563,9 @@ class Form
             $out.='<form method="post" action="'.$page.'">';
             $out.='<input type="hidden" name="action" value="classin">';
             $out.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
-            $out.='<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
-            $out.='<tr><td>';
             $out.=$formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1);
-            $out.='</td>';
-            $out.='<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
-            $out.='</tr></table></form>';
+            $out.='<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
+            $out.='</form>';
         }
         else
         {
@@ -3614,12 +3607,9 @@ class Form
             print '<form method="post" action="'.$page.'">';
             print '<input type="hidden" name="action" value="setconditions">';
             print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
-            print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
-            print '<tr><td>';
             $this->select_conditions_paiements($selected,$htmlname,-1,$addempty);
-            print '</td>';
-            print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
-            print '</tr></table></form>';
+            print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
+            print '</form>';
         }
         else
         {
@@ -3650,12 +3640,9 @@ class Form
             print '<form method="post" action="'.$page.'">';
             print '<input type="hidden" name="action" value="setavailability">';
             print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
-            print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
-            print '<tr><td>';
             $this->selectAvailabilityDelay($selected,$htmlname,-1,$addempty);
-            print '</td>';
-            print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
-            print '</tr></table></form>';
+            print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
+            print '</form>';
         }
         else
         {
@@ -3687,12 +3674,9 @@ class Form
             print '<form method="post" action="'.$page.'">';
             print '<input type="hidden" name="action" value="setdemandreason">';
             print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
-            print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
-            print '<tr><td>';
             $this->selectInputReason($selected,$htmlname,-1,$addempty);
-            print '</td>';
-            print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
-            print '</tr></table></form>';
+            print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
+            print '</form>';
         }
         else
         {
@@ -3773,12 +3757,9 @@ class Form
             print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
             print '<input type="hidden" name="action" value="set'.$htmlname.'">';
             print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
-            print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
-            print '<tr><td>';
             print $this->select_dolusers($selected,$htmlname,1,$exclude,0,$include);
-            print '</td>';
-            print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
-            print '</tr></table></form>';
+            print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
+            print '</form>';
         }
         else
 		{
@@ -3813,12 +3794,9 @@ class Form
             print '<form method="POST" action="'.$page.'">';
             print '<input type="hidden" name="action" value="setmode">';
             print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
-            print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
-            print '<tr><td>';
             $this->select_types_paiements($selected,$htmlname,$filtertype,0,0,0,0,$active);
-            print '</td>';
-            print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
-            print '</tr></table></form>';
+            print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
+            print '</form>';
         }
         else
         {
@@ -3848,12 +3826,9 @@ class Form
             print '<form method="POST" action="'.$page.'">';
             print '<input type="hidden" name="action" value="setmulticurrencycode">';
             print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
-            print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
-            print '<tr><td>';
             print $this->selectMultiCurrency($selected, $htmlname, 0);
-            print '</td>';
-            print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
-            print '</tr></table></form>';
+            print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
+            print '</form>';
         }
         else
         {
@@ -3880,12 +3855,9 @@ class Form
             print '<form method="POST" action="'.$page.'">';
             print '<input type="hidden" name="action" value="setmulticurrencyrate">';
             print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
-            print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
-            print '<tr><td>';
             print '<input type="text" name="'.$htmlname.'" value="'.(!empty($rate) ? price($rate) : 1).'" size="10" />';
-            print '</td>';
-            print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
-            print '</tr></table></form>';
+            print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
+            print '</form>';
         }
         else
         {
@@ -3988,7 +3960,6 @@ class Form
             if ($num==0)
             {
             	$addcontact = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
-                print '<font class="error">Cette societe n\'a pas de contact, veuillez en cr�er un avant de faire votre proposition commerciale</font><br>';
                 print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&amp;action=create&amp;backtoreferer=1">'.$addcontact.'</a>';
             }
             print '</td>';
@@ -4031,12 +4002,9 @@ class Form
             print '<form method="post" action="'.$page.'">';
             print '<input type="hidden" name="action" value="set_thirdparty">';
             print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
-            print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
-            print '<tr><td>';
             print $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events);
-            print '</td>';
-            print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
-            print '</tr></table></form>';
+            print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
+            print '</form>';
         }
         else
         {
@@ -5362,7 +5330,7 @@ class Form
 						$i++;
 					}
 					print '</table>';
-					print '<div class="center"><input type="submit" class="button" value="' . $langs->trans('ToLink') . '">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" class="button" name="cancel" value="' . $langs->trans('Cancel') . '"></div>';
+					print '<div class="center"><input type="submit" class="button valignmiddle" value="' . $langs->trans('ToLink') . '">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" class="button" name="cancel" value="' . $langs->trans('Cancel') . '"></div>';
 
 					print '</form>';
 					$this->db->free($resqllist);
diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php
index 70dc0e253c4f76c5c8b1fba96bf7ec4aba36caf1..ef9141dbc94b7f9ac5c6d0fe0bd77cda1c51953c 100644
--- a/htdocs/core/class/html.formcompany.class.php
+++ b/htdocs/core/class/html.formcompany.class.php
@@ -143,8 +143,6 @@ class FormCompany
 		print '<form method="post" action="'.$page.'">';
 		print '<input type="hidden" name="action" value="setprospectlevel">';
 		print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
-		print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
-		print '<tr><td>';
 
 		dol_syslog(get_class($this).'::form_prospect_level',LOG_DEBUG);
 		$sql = "SELECT code, label";
@@ -174,9 +172,8 @@ class FormCompany
 		}
 		else dol_print_error($this->db);
 
-		print '</td>';
-		print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
-		print '</tr></table></form>';
+		print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
+		print '</form>';
 	}
 
 	/**
diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php
index 80b618b880410b18ae26242d241d094f36953223..ace00b77caa69277e7faba8a6b92d36092661425 100644
--- a/htdocs/core/class/html.formcontract.class.php
+++ b/htdocs/core/class/html.formcontract.class.php
@@ -157,12 +157,9 @@ class FormContract
         print '<form method="post" action="'.$page.'">';
         print '<input type="hidden" name="action" value="setcontract">';
         print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
-        print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
-        print '<tr><td>';
         $this->select_contract($socid, $selected, $htmlname, $maxlength, $showempty);
-        print '</td>';
-        print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
-        print '</tr></table></form>';
+        print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
+        print '</form>';
 	}	
 	
 }
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index c92229cf036dd7690771d92aa7421c4db423ff15..76736bcdd6f62d6c2416d0f860f9618e69812801 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -642,7 +642,7 @@ class FormMail extends Form
 	        			if (!empty($conf->global->FROM_MAIL_USE_INPUT_FILE_MULTIPLE)) $out.= '<input type="file" class="flat" id="addedfile" name="addedfile[]" value="'.$langs->trans("Upload").'" multiple />';
 						else $out.= '<input type="file" class="flat" id="addedfile" name="addedfile" value="'.$langs->trans("Upload").'" />';
 	        			$out.= ' ';
-	        			$out.= '<input type="submit" class="button" id="'.$addfileaction.'" name="'.$addfileaction.'" value="'.$langs->trans("MailingAddFile").'" />';
+	        			$out.= '<input class="button" type="submit" id="'.$addfileaction.'" name="'.$addfileaction.'" value="'.$langs->trans("MailingAddFile").'" />';
 	        		}
         		}
         		else
diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php
index 26ddd33f0a24e3f2a0d79e7e11094e737582e844..7adbe5fad42e546529c4e38340dcb0e5aa5b06be 100644
--- a/htdocs/core/class/html.formother.class.php
+++ b/htdocs/core/class/html.formother.class.php
@@ -948,14 +948,11 @@ class FormOther
             print '<form method="post" action="'.$page.'">';
             print '<input type="hidden" name="action" value="setaddress">';
             print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
-            print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
-            print '<tr><td>';
             $form->select_address($selected, $socid, $htmlname, 1);
-            print '</td>';
-            print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'">';
+            print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
             $langs->load("companies");
             print ' &nbsp; <a href='.DOL_URL_ROOT.'/comm/address.php?socid='.$socid.'&action=create&origin='.$origin.'&originid='.$originid.'>'.$langs->trans("AddAddress").'</a>';
-            print '</td></tr></table></form>';
+            print '</form>';
         }
         else
         {
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 7c4a19d729b58373388cc83bba0a1b9095e99667..abe1a797706545c82609266d89c37c47947c9295 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -923,7 +923,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
 	if ($object->element == 'member')  $modulepart='memberphoto';
 	if ($object->element == 'user')    $modulepart='userphoto';
 	if ($object->element == 'product') $modulepart='product';
-
+	
 	print '<div class="arearef heightref valignmiddle" width="100%">';
 	if ($object->element == 'product')
 	{
@@ -986,7 +986,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
             $morehtmlright.=$object->getLibStatut(5,1);
         }
 	}
-	elseif ($object->element == 'facture')
+	elseif ($object->element == 'facture' || $object->element == 'invoice' || $object->element == 'invoice_supplier')
 	{
 	    $tmptxt=$object->getLibStatut(6, $object->totalpaye);
 	    if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) $tmptxt=$object->getLibStatut(5, $object->totalpaye); 
diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php
index b8b9b4fe6a66e80fd9cc2e0a459311139709bd8d..b2c7a779d329c4fcd1284342efe4aeb60d08faf0 100644
--- a/htdocs/fichinter/card.php
+++ b/htdocs/fichinter/card.php
@@ -1211,7 +1211,7 @@ else if ($id > 0 || ! empty($ref))
 	                $morehtmlref.='<input type="hidden" name="action" value="classin">';
 	                $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 	                $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
-	                $morehtmlref.='<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
+	                $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
 	                $morehtmlref.='</form>';
 	            } else {
 	                $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index 135aaebb7061aa3a1876a243e9eac9946557056f..41df1e4f31185bd7d405701f91ed069b2316f327 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -274,6 +274,8 @@ if (empty($reshook))
 	// Add a product line
 	if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
 	{
+	    $db->begin();
+	    
 	    $langs->load('errors');
 	    $error = 0;
 
@@ -408,7 +410,7 @@ if (empty($reshook))
 	    		setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'errors');
 	    	}
 	    }
-	    else if((GETPOST('price_ht')!=='' || GETPOST('price_ttc')!=='') && empty($error))
+	    else if ((GETPOST('price_ht')!=='' || GETPOST('price_ttc')!=='') && empty($error))
 		{
 			$pu_ht = price2num($price_ht, 'MU');
 			$pu_ttc = price2num(GETPOST('price_ttc'), 'MU');
@@ -445,6 +447,8 @@ if (empty($reshook))
 	    //print "xx".$tva_tx; exit;
 	    if (! $error && $result > 0)
 	    {
+	        $db->commit();
+	        
 	    	$ret=$object->fetch($object->id);    // Reload to get new records
 
 	        // Define output language
@@ -498,8 +502,11 @@ if (empty($reshook))
 	    }
 	    else
 		{
+		    $db->rollback();
             setEventMessages($object->error, $object->errors, 'errors');
 	    }
+	    
+	    $action = '';
 	}
 
 	/*
@@ -1304,8 +1311,6 @@ if (empty($reshook))
 /*
  * View
  */
-$help_url='EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores';
-llxHeader('',$langs->trans("Order"),$help_url);
 
 $form =	new	Form($db);
 $formfile = new FormFile($db);
@@ -1313,6 +1318,8 @@ $formorder = new FormOrder($db);
 $productstatic = new Product($db);
 if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); }
 
+$help_url='EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores';
+llxHeader('',$langs->trans("Order"),$help_url);
 
 /* *************************************************************************** */
 /*                                                                             */
@@ -1766,7 +1773,7 @@ elseif (! empty($object->id))
 	                $morehtmlref.='<input type="hidden" name="action" value="classin">';
 	                $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 	                $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
-	                $morehtmlref.='<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
+	                $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
 	                $morehtmlref.='</form>';
 	            } else {
 	                $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index a64d4115186ab98b292e7d5ead1404f4ffde389d..b3fc59950316aa62470fff416d4fce0fb1384d54 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -85,7 +85,9 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
 if ($id > 0 || ! empty($ref))
 {
 	$ret=$object->fetch($id, $ref);
-	$object->fetch_thirdparty();
+	if ($ret < 0) dol_print_error($db,$object->error);
+	$ret=$object->fetch_thirdparty();
+	if ($ret < 0) dol_print_error($db,$object->error);
 }
 
 $permissionnote=$user->rights->fournisseur->facture->creer;	// Used by the include of actions_setnotes.inc.php
@@ -774,7 +776,7 @@ if (empty($reshook))
 		        setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'errors');
 	        }
 	    }
-	    else if( GETPOST('price_ht')!=='' || GETPOST('price_ttc')!=='' )
+	    else if (GETPOST('price_ht')!=='' || GETPOST('price_ttc')!=='')
 		{
 			$pu_ht = price2num($price_ht, 'MU');
 			$pu_ttc = price2num(GETPOST('price_ttc'), 'MU');
@@ -1112,6 +1114,9 @@ $form = new Form($db);
 $formfile = new FormFile($db);
 $bankaccountstatic=new Account($db);
 $paymentstatic=new PaiementFourn($db);
+if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); }
+
+$now = dol_now();
 
 $title = $langs->trans('SupplierInvoice') . " - " . $langs->trans('Card');
 $helpurl = "EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores";
@@ -1240,9 +1245,9 @@ if ($action == 'create')
     print '<tr><td class="fieldrequired">'.$langs->trans('RefSupplier').'</td><td><input name="ref_supplier" value="'.(isset($_POST['ref_supplier'])?$_POST['ref_supplier']:'').'" type="text"></td>';
     print '</tr>';
 
+    // Type
     print '<tr><td valign="top" class="fieldrequired">'.$langs->trans('Type').'</td><td colspan="2">';
     print '<table class="nobordernopadding">'."\n";
-
     // Standard invoice
     print '<tr height="18"><td width="16px" valign="middle">';
     print '<input type="radio" name="type" value="0"'.($_POST['type']==0?' checked':'').'>';
@@ -1250,16 +1255,14 @@ if ($action == 'create')
     $desc=$form->textwithpicto($langs->trans("InvoiceStandardAsk"),$langs->transnoentities("InvoiceStandardDesc"),1);
     print $desc;
     print '</td></tr>'."\n";
-
     /*
-     // Deposit
+    // Deposit
     print '<tr height="18"><td width="16px" valign="middle">';
     print '<input type="radio" name="type" value="3"'.($_POST['type']==3?' checked':'').'>';
     print '</td><td valign="middle">';
     $desc=$form->textwithpicto($langs->trans("InvoiceDeposit"),$langs->transnoentities("InvoiceDepositDesc"),1);
     print $desc;
     print '</td></tr>'."\n";
-
     // Proforma
     if (! empty($conf->global->FACTURE_USE_PROFORMAT))
     {
@@ -1270,7 +1273,6 @@ if ($action == 'create')
     print $desc;
     print '</td></tr>'."\n";
     }
-
     // Replacement
     print '<tr height="18"><td valign="middle">';
     print '<input type="radio" name="type" value="1"'.($_POST['type']==1?' checked':'');
@@ -1294,7 +1296,6 @@ if ($action == 'create')
     $desc=$form->textwithpicto($text,$langs->transnoentities("InvoiceReplacementDesc"),1);
     print $desc;
     print '</td></tr>';
-
     // Credit note
     print '<tr height="18"><td valign="middle">';
     print '<input type="radio" name="type" value="2"'.($_POST['type']==2?' checked':'');
@@ -1514,6 +1515,8 @@ else
         // fetch optionals attributes and labels
 		$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
 
+		$alreadypaid=$object->getSommePaiement();
+		
         /*
          *	View card
          */
@@ -1611,7 +1614,8 @@ else
 			$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
 		}
 
-        if (!$formconfirm) {
+        if (!$formconfirm)
+        {
 			$parameters=array('lineid'=>$lineid);
 			$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
 			if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
@@ -1622,14 +1626,64 @@ else
 		print $formconfirm;
 
 
-        /**
-         * 	Invoice
-         */
-        print '<table class="border" width="100%">';
+        // Supplier invoice card
 
         $linkback = '<a href="'.DOL_URL_ROOT.'/fourn/facture/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
+    		
+    	$morehtmlref='<div class="refidno">';
+    	// Ref supplier
+    	$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1);
+    	$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1);
+    	// Thirdparty
+    	$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
+    	// Project
+    	if (! empty($conf->projet->enabled))
+    	{
+    	    $langs->load("projects");
+    	    $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
+    	    if ($user->rights->fournisseur->commande->creer)
+    	    {
+    	        if ($action != 'classify')
+    	            $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
+    	            if ($action == 'classify') {
+    	                //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
+    	                $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
+    	                $morehtmlref.='<input type="hidden" name="action" value="classin">';
+    	                $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
+    	                $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
+    	                $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
+    	                $morehtmlref.='</form>';
+    	            } else {
+    	                $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
+    	            }
+    	    } else {
+    	        if (! empty($object->fk_project)) {
+    	            $proj = new Project($db);
+    	            $proj->fetch($object->fk_project);
+    	            $morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
+    	            $morehtmlref.=$proj->ref;
+    	            $morehtmlref.='</a>';
+    	        } else {
+    	            $morehtmlref.='';
+    	        }
+    	    }
+    	}
+    	$morehtmlref.='</div>';
+    	
+    	$object->totalpaye = $alreadypaid;   // To give a chance to dol_banner_tab to use already paid amount to show correct status
+    	
+    	dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);	
+    	
+    
+    	print '<div class="fichecenter">';
+    	print '<div class="fichehalfleft">';
+    	print '<div class="underbanner clearboth"></div>';
+    	 	
+    	print '<table class="border" width="100%">';
+    	
 
         // Ref
+        /*
         print '<tr><td class="titlefield nowrap">'.$langs->trans("Ref").'</td><td colspan="4">';
         print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
         print '</td>';
@@ -1644,9 +1698,10 @@ else
         print '<tr><td>'.$langs->trans('Supplier').'</td><td colspan="4">'.$societe->getNomUrl(1,'supplier');
         print ' &nbsp; (<a href="'.DOL_URL_ROOT.'/fourn/facture/list.php?socid='.$object->socid.'">'.$langs->trans('OtherBills').'</a>)</td>';
         print '</tr>';
-
+		*/
+	
         // Type
-        print '<tr><td>'.$langs->trans('Type').'</td><td colspan="4">';
+        print '<tr><td class="titlefield">'.$langs->trans('Type').'</td><td>';
         print $object->getLibType();
         if ($object->type == FactureFournisseur::TYPE_REPLACEMENT)
         {
@@ -1686,115 +1741,7 @@ else
 
         // Label
         print '<tr><td>'.$form->editfieldkey("Label",'label',$object->label,$object,($user->rights->fournisseur->facture->creer)).'</td>';
-        print '<td colspan="3">'.$form->editfieldval("Label",'label',$object->label,$object,($user->rights->fournisseur->facture->creer)).'</td>';
-
-        /*
-         * List of payments
-         */
-        $nbrows=9; $nbcols=3;
-        if (! empty($conf->projet->enabled)) $nbrows++;
-        if (! empty($conf->banque->enabled)) { $nbrows++; $nbcols++; }
-        if (! empty($conf->incoterm->enabled)) $nbrows++;
-
-        // Local taxes
-        if ($societe->localtax1_assuj=="1") $nbrows++;
-        if ($societe->localtax2_assuj=="1") $nbrows++;
-
-        print '<td rowspan="'.$nbrows.'" valign="top">';
-
-        $sql = 'SELECT p.datep as dp, p.ref, p.num_paiement, p.rowid, p.fk_bank,';
-        $sql.= ' c.id as paiement_type,';
-        $sql.= ' pf.amount,';
-        $sql.= ' ba.rowid as baid, ba.ref as baref, ba.label';
-        $sql.= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p';
-        $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid';
-        $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid';
-        $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id';
-        $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_paiementfourn = p.rowid';
-        $sql.= ' WHERE pf.fk_facturefourn = '.$object->id;
-        $sql.= ' ORDER BY p.datep, p.tms';
-
-        $result = $db->query($sql);
-        if ($result)
-        {
-            $num = $db->num_rows($result);
-            $i = 0; $totalpaye = 0;
-            print '<table class="nobordernopadding paymenttable" width="100%">';
-            print '<tr class="liste_titre">';
-            print '<td>'.$langs->trans('Payments').'</td>';
-			print '<td>'.$langs->trans('Date').'</td>';
-            print '<td>'.$langs->trans('Type').'</td>';
-            if (! empty($conf->banque->enabled)) print '<td align="right">'.$langs->trans('BankAccount').'</td>';
-            print '<td align="right">'.$langs->trans('Amount').'</td>';
-            print '<td width="18">&nbsp;</td>';
-            print '</tr>';
-
-            $var=true;
-            if ($num > 0)
-            {
-                while ($i < $num)
-                {
-                    $objp = $db->fetch_object($result);
-                    $var=!$var;
-                    print '<tr '.$bc[$var].'><td>';
-					$paymentstatic->id=$objp->rowid;
-					$paymentstatic->datepaye=$db->jdate($objp->dp);
-					$paymentstatic->ref=$objp->ref;
-					$paymentstatic->num_paiement=$objp->num_paiement;
-					$paymentstatic->payment_code=$objp->payment_code;
-					print $paymentstatic->getNomUrl(1);
-					print '</td>';
-					print '<td>'.dol_print_date($db->jdate($objp->dp), 'day') . '</td>';
-                    print '<td>';
-                    print $form->form_modes_reglement(null, $objp->paiement_type,'none').' '.$objp->num_paiement;
-                    print '</td>';
-                    if (! empty($conf->banque->enabled))
-                    {
-                        $bankaccountstatic->id=$objp->baid;
-                        $bankaccountstatic->ref=$objp->baref;
-                        $bankaccountstatic->label=$objp->baref;
-                        print '<td align="right">';
-                        if ($objp->baid > 0) print $bankaccountstatic->getNomUrl(1,'transactions');
-                        print '</td>';
-                    }
-                    print '<td align="right">'.price($objp->amount).'</td>';
-                    print '<td align="center">';
-                    if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0)
-                    {
-                        print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deletepaiement&paiement_id='.$objp->rowid.'">';
-                        print img_delete();
-                        print '</a>';
-                    }
-                    print '</td>';
-                    print '</tr>';
-                    $totalpaye += $objp->amount;
-                    $i++;
-                }
-            }
-            else
-            {
-                 print '<tr '.$bc[$var].'><td colspan="'.$nbcols.'" class="opacitymedium">'.$langs->trans("None").'</td><td></td><td></td></tr>';
-            }
-
-            if ($object->paye == 0)
-            {
-                print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('AlreadyPaid').' :</td><td align="right"><b>'.price($totalpaye).'</b></td><td></td></tr>';
-                print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans("Billed").' :</td><td align="right" style="border: 1px solid;">'.price($object->total_ttc).'</td><td></td></tr>';
-
-                $resteapayer = $object->total_ttc - $totalpaye;
-
-                print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('RemainderToPay').' :</td>';
-                print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price($resteapayer).'</b></td><td></td></tr>';
-            }
-            print '</table>';
-            $db->free($result);
-        }
-        else
-        {
-            dol_print_error($db);
-        }
-        print '</td>';
-
+        print '<td>'.$form->editfieldval("Label",'label',$object->label,$object,($user->rights->fournisseur->facture->creer)).'</td>';
         print '</tr>';
 
 	    $form_permission = $object->statut<FactureFournisseur::STATUS_CLOSED && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() <= 0;
@@ -1907,58 +1854,10 @@ else
         print '</tr>';
 
         // Status
-        $alreadypaid=$object->getSommePaiement();
-        print '<tr><td>'.$langs->trans('Status').'</td><td colspan="3">'.$object->getLibStatut(4,$alreadypaid).'</td></tr>';
-
-        // Amount
-        print '<tr><td>'.$langs->trans('AmountHT').'</td><td colspan="3">'.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).'</td></tr>';
-        print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).'</td><td colspan="2" align="left">';
-        if (GETPOST('calculationrule')) $calculationrule=GETPOST('calculationrule','alpha');
-        else $calculationrule=(empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)?'totalofround':'roundoftotal');
-        if ($calculationrule == 'totalofround') $calculationrulenum=1;
-        else  $calculationrulenum=2;
-        $s=$langs->trans("ReCalculate").' ';
-        $s.='<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=totalofround">'.$langs->trans("Mode1").'</a>';
-        $s.=' / ';
-        $s.='<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=roundoftotal">'.$langs->trans("Mode2").'</a>';
-        print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc",$calculationrulenum).'<br>'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('','help'));
-        print '</td></tr>';
-
-        // Amount Local Taxes
-        //TODO: Place into a function to control showing by country or study better option
-        if ($societe->localtax1_assuj=="1") //Localtax1
-        {
-            print '<tr><td>'.$langs->transcountry("AmountLT1",$societe->country_code).'</td>';
-            print '<td colspan="3">'.price($object->total_localtax1,1,$langs,0,-1,-1,$conf->currency).'</td>';
-            print '</tr>';
-        }
-        if ($societe->localtax2_assuj=="1") //Localtax2
-        {
-            print '<tr><td>'.$langs->transcountry("AmountLT2",$societe->country_code).'</td>';
-            print '<td colspan="3">'.price($object->total_localtax2,1,$langs,0,-1,-1,$conf->currency).'</td>';
-            print '</tr>';
-        }
-        print '<tr><td>'.$langs->trans('AmountTTC').'</td><td colspan="3">'.price($object->total_ttc,1,$langs,0,-1,-1,$conf->currency).'</td></tr>';
-
-		if (!empty($conf->multicurrency->enabled))
-		{
-			// Multicurrency Amount HT
-			print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>';
-			print '<td class="nowrap" colspan="2">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
-			print '</tr>';
-
-			// Multicurrency Amount VAT
-			print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>';
-			print '<td class="nowrap" colspan="2">' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
-			print '</tr>';
-
-			// Multicurrency Amount TTC
-			print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>';
-			print '<td class="nowrap" colspan="2">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
-			print '</tr>';
-		}
+        //print '<tr><td>'.$langs->trans('Status').'</td><td colspan="3">'.$object->getLibStatut(4,$alreadypaid).'</td></tr>';
 
         // Project
+        /*
         if (! empty($conf->projet->enabled))
         {
             $langs->load('projects');
@@ -1988,7 +1887,8 @@ else
             print '</td>';
             print '</tr>';
         }
-
+		*/
+		
 		// Incoterms
 		if (!empty($conf->incoterm->enabled))
 		{
@@ -2012,12 +1912,180 @@ else
 	        print '</td></tr>';
 		}
 
-        // Other attributes
-        $cols = 4;
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
-
-        print '</table><br>';
-
+    	// Other attributes
+    	$cols = 2;
+    	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
+    
+    	print '</table>';
+    	
+    	print '</div>';
+    	print '<div class="fichehalfright">';
+    	print '<div class="ficheaddleft">';
+    	print '<div class="underbanner clearboth"></div>';
+    	
+    	print '<table class="border centpercent">';
+    		
+    	// Amount
+    	print '<tr><td>'.$langs->trans('AmountHT').'</td><td>'.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).'</td></tr>';
+    	print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).'<div class="inline-block"> &nbsp; &nbsp; &nbsp; &nbsp; ';
+    	if (GETPOST('calculationrule')) $calculationrule=GETPOST('calculationrule','alpha');
+    	else $calculationrule=(empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)?'totalofround':'roundoftotal');
+    	if ($calculationrule == 'totalofround') $calculationrulenum=1;
+    	else  $calculationrulenum=2;
+    	$s=$langs->trans("ReCalculate").' ';
+    	$s.='<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=totalofround">'.$langs->trans("Mode1").'</a>';
+    	$s.=' / ';
+    	$s.='<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=roundoftotal">'.$langs->trans("Mode2").'</a>';
+    	print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc",$calculationrulenum).'<br>'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('','help'));
+    	print '</div></td></tr>';
+    	
+    	// Amount Local Taxes
+    	//TODO: Place into a function to control showing by country or study better option
+    	if ($societe->localtax1_assuj=="1") //Localtax1
+    	{
+    	    print '<tr><td>'.$langs->transcountry("AmountLT1",$societe->country_code).'</td>';
+    	    print '<td>'.price($object->total_localtax1,1,$langs,0,-1,-1,$conf->currency).'</td>';
+    	    print '</tr>';
+    	}
+    	if ($societe->localtax2_assuj=="1") //Localtax2
+    	{
+    	    print '<tr><td>'.$langs->transcountry("AmountLT2",$societe->country_code).'</td>';
+    	    print '<td>'.price($object->total_localtax2,1,$langs,0,-1,-1,$conf->currency).'</td>';
+    	    print '</tr>';
+    	}
+    	print '<tr><td>'.$langs->trans('AmountTTC').'</td><td colspan="3">'.price($object->total_ttc,1,$langs,0,-1,-1,$conf->currency).'</td></tr>';
+    	
+    	if (!empty($conf->multicurrency->enabled))
+    	{
+    	    // Multicurrency Amount HT
+    	    print '<tr><td>' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>';
+    	    print '<td class="nowrap">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
+    	    print '</tr>';
+    	
+    	    // Multicurrency Amount VAT
+    	    print '<tr><td>' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>';
+    	    print '<td class="nowrap" colspan="2">' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
+    	    print '</tr>';
+    	
+    	    // Multicurrency Amount TTC
+    	    print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>';
+    	    print '<td class="nowrap" colspan="2">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
+    	    print '</tr>';
+    	}	
+    	
+    	print '</table>';
+    	 
+    	/*
+    	 * List of payments
+    	 */
+    	$nbrows=9; $nbcols=3;
+    	if (! empty($conf->projet->enabled)) $nbrows++;
+    	if (! empty($conf->banque->enabled)) { $nbrows++; $nbcols++; }
+    	if (! empty($conf->incoterm->enabled)) $nbrows++;
+    	
+    	// Local taxes
+    	if ($societe->localtax1_assuj=="1") $nbrows++;
+    	if ($societe->localtax2_assuj=="1") $nbrows++;
+    	
+    	$sql = 'SELECT p.datep as dp, p.ref, p.num_paiement, p.rowid, p.fk_bank,';
+    	$sql.= ' c.id as paiement_type,';
+    	$sql.= ' pf.amount,';
+    	$sql.= ' ba.rowid as baid, ba.ref as baref, ba.label';
+    	$sql.= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p';
+    	$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid';
+    	$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid';
+    	$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id';
+    	$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_paiementfourn = p.rowid';
+    	$sql.= ' WHERE pf.fk_facturefourn = '.$object->id;
+    	$sql.= ' ORDER BY p.datep, p.tms';
+    	
+    	$result = $db->query($sql);
+    	if ($result)
+    	{
+    	    $num = $db->num_rows($result);
+    	    $i = 0; $totalpaye = 0;
+    	    print '<table class="noborder paymenttable" width="100%">';
+    	    print '<tr class="liste_titre">';
+    	    print '<td>'.$langs->trans('Payments').'</td>';
+    	    print '<td>'.$langs->trans('Date').'</td>';
+    	    print '<td>'.$langs->trans('Type').'</td>';
+    	    if (! empty($conf->banque->enabled)) print '<td align="right">'.$langs->trans('BankAccount').'</td>';
+    	    print '<td align="right">'.$langs->trans('Amount').'</td>';
+    	    print '<td width="18">&nbsp;</td>';
+    	    print '</tr>';
+    	
+    	    $var=false;
+    	    if ($num > 0)
+    	    {
+    	        while ($i < $num)
+    	        {
+    	            $objp = $db->fetch_object($result);
+    	            $var=!$var;
+    	            print '<tr '.$bc[$var].'><td>';
+    	            $paymentstatic->id=$objp->rowid;
+    	            $paymentstatic->datepaye=$db->jdate($objp->dp);
+    	            $paymentstatic->ref=$objp->ref;
+    	            $paymentstatic->num_paiement=$objp->num_paiement;
+    	            $paymentstatic->payment_code=$objp->payment_code;
+    	            print $paymentstatic->getNomUrl(1);
+    	            print '</td>';
+    	            print '<td>'.dol_print_date($db->jdate($objp->dp), 'day') . '</td>';
+    	            print '<td>';
+    	            print $form->form_modes_reglement(null, $objp->paiement_type,'none').' '.$objp->num_paiement;
+    	            print '</td>';
+    	            if (! empty($conf->banque->enabled))
+    	            {
+    	                $bankaccountstatic->id=$objp->baid;
+    	                $bankaccountstatic->ref=$objp->baref;
+    	                $bankaccountstatic->label=$objp->baref;
+    	                print '<td align="right">';
+    	                if ($objp->baid > 0) print $bankaccountstatic->getNomUrl(1,'transactions');
+    	                print '</td>';
+    	            }
+    	            print '<td align="right">'.price($objp->amount).'</td>';
+    	            print '<td align="center">';
+    	            if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0)
+    	            {
+    	                print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deletepaiement&paiement_id='.$objp->rowid.'">';
+    	                print img_delete();
+    	                print '</a>';
+    	            }
+    	            print '</td>';
+    	            print '</tr>';
+    	            $totalpaye += $objp->amount;
+    	            $i++;
+    	        }
+    	    }
+    	    else
+    	    {
+    	        print '<tr '.$bc[$var].'><td colspan="'.$nbcols.'" class="opacitymedium">'.$langs->trans("None").'</td><td></td><td></td></tr>';
+    	    }
+    	
+    	    if ($object->paye == 0)
+    	    {
+    	        print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('AlreadyPaid').' :</td><td align="right">'.price($totalpaye).'</td><td></td></tr>';
+    	        print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans("Billed").' :</td><td align="right">'.price($object->total_ttc).'</td><td></td></tr>';
+    	
+    	        $resteapayer = $object->total_ttc - $totalpaye;
+    	
+    	        print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('RemainderToPay').' :</td>';
+    	        print '<td align="right"'.($resteapayer?' class="amountremaintopay"':'').'>'.price($resteapayer).'</td><td></td></tr>';
+    	    }
+    	    print '</table>';
+    	    $db->free($result);
+    	}
+    	else
+    	{
+    	    dol_print_error($db);
+    	}
+    	
+
+        print '</div>';
+        print '</div>';
+        print '</div>';
+        
+        print '<div class="clearboth"></div><br>';
+        
         if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
         {
         	$blocname = 'contacts';
diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php
index 1c5fd795d1584641f65d36edf5ef1ec391ab7e37..4edcbd8728d2be4044766c560794720d10678113 100644
--- a/htdocs/product/stock/card.php
+++ b/htdocs/product/stock/card.php
@@ -308,7 +308,7 @@ else
         	                $morehtmlref.='<input type="hidden" name="action" value="classin">';
         	                $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
         	                $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
-        	                $morehtmlref.='<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
+        	                $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
         	                $morehtmlref.='</form>';
         	            } else {
         	                $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index 91a4ca818557ee882fe3c63ec56400d765735a60..2f3d7e7201c36615a58bf71e3d3dab03b8b87cc4 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -1380,7 +1380,7 @@ if ($action == 'create')
 	                $morehtmlref.='<input type="hidden" name="action" value="classin">';
 	                $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 	                $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
-	                $morehtmlref.='<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
+	                $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
 	                $morehtmlref.='</form>';
 	            } else {
 	                $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 8eb7e277a00d12381bed3943526cdaec2a49408b..c6968bebdd160fd6cc6a989c4ab7377643187146 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -3973,6 +3973,9 @@ div.dataTables_length select {
 /*  Select2                                                                       */
 /* ============================================================================== */
 
+.select2-container .select2-choice .select2-arrow {
+	border-radius: 0;
+}
 .select2-container-multi .select2-choices {
 	background-image: none;
 }
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index a08f2475436401bf2fcac3d1cd23e80c994db332..4ba92966498ca8c7b1bb9c4d704a8b876b56f54c 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -3840,6 +3840,9 @@ div.dataTables_length select {
 /*  Select2                                                                       */
 /* ============================================================================== */
 
+.select2-container .select2-choice .select2-arrow {
+	border-radius: 0;
+}
 .select2-container .select2-choice {
 	color: #000;
 }