diff --git a/ChangeLog b/ChangeLog
index 605e19be781b19516c44308dc2937c10e5e05e3a..298e37fa13a1c96b606c6dd8c6725d1464ec62d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -21,6 +21,7 @@ FIX: Not showing task extrafields when creating from left menu
 FIX [ bug #3288 ] Tasks box is not properly drawn
 FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts
 FIX [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights
+FIX [ bug #3426 ] Unable to create an invoice from a contract with extrafields
 FIX [ bug #3431 ] Invoice bank account is not respected
 
 NEW: Created new ContratLigne::insert function
diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php
index 930fee833fac8785ba1840886a16242d6e14562c..9a98b389bd01d96c19a3ad3e8d64809844291f96 100644
--- a/htdocs/commande/orderstoinvoice.php
+++ b/htdocs/commande/orderstoinvoice.php
@@ -505,7 +505,7 @@ if ($action == 'create' && !$error)
 
 
 //Mode liste
-if (($action != 'create' && $action != 'add') || !$error)
+if (($action != 'create' && $action != 'add') && !$error)
 {
 	llxHeader();
 	?>
diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php
index 5e893fe7d1e984ee5e84df77a27492c0a6d81ec5..e3f30fc5c0ec8803e66bf8bb28161739c83c4b59 100644
--- a/htdocs/compta/facture/impayees.php
+++ b/htdocs/compta/facture/impayees.php
@@ -129,10 +129,12 @@ if ($action == 'presend' && GETPOST('sendmail'))
 							'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj2->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>',
 							//'__LASTNAME__' => $obj2->lastname,
 							//'__FIRSTNAME__' => $obj2->firstname,
-							'__REF__' => $object->ref,
+							'__FACREF__' => $object->ref,            // For backward compatibility
+						    '__REF__' => $object->ref,
 							'__REFCLIENT__' => $object->thirdparty->name
 						);
 
+						$subject=make_substitutions($subject, $substitutionarray);
 						$message=make_substitutions($message, $substitutionarray);
 
 						$actiontypecode='AC_FAC';
@@ -160,7 +162,7 @@ if ($action == 'presend' && GETPOST('sendmail'))
 						}
 						else
 						{
-							//$result=$mailfile->sendfile();
+							$result=$mailfile->sendfile();
 							if ($result)
 							{
 								$resultmasssend.=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2));		// Must not contain "
@@ -215,7 +217,6 @@ if ($action == 'presend' && GETPOST('sendmail'))
 					$langs->load("other");
 					$resultmasssend.='<div class="error">'.$langs->trans('ErrorCantReadFile',$file).'</div>';
 					dol_syslog('Failed to read file: '.$file);
-					break ;
 				}
 			}
 		}
@@ -469,8 +470,8 @@ if ($resql)
 	else $titre.=' ('.$langs->trans("All").')';
 
 	$link='';
-	if (empty($option)) $link='<a href="'.$_SERVER["PHP_SELF"].'?option=late">'.$langs->trans("ShowUnpaidLateOnly").'</a>';
-	elseif ($option == 'late') $link='<a href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("ShowUnpaidAll").'</a>';
+	if (empty($option)) $link='<a href="'.$_SERVER["PHP_SELF"].'?option=late'.$param.'">'.$langs->trans("ShowUnpaidLateOnly").'</a>';
+	elseif ($option == 'late') $link='<a href="'.$_SERVER["PHP_SELF"].($param?'?'.preg_replace('/&?(amps;)?option=late/','',$param):'').'">'.$langs->trans("ShowUnpaidAll").'</a>';
 	print_fiche_titre($titre,$link);
 	//print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',0);	// We don't want pagination on this page
 
diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index 2359d70d07b16472d053804dffb522cb0889c1bd..e95ddc60eaa92573305cdd0c7a68f055f872b057 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -1,7 +1,8 @@
 <?php
-/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
- * Copyright (C) 2004-2013 Laurent Destailleur  <eldy@users.sourceforge.net>
- * Copyright (C) 2005-2012 Regis Houssin        <regis.houssin@capnetworks.com>
+/* Copyright (C) 2001-2005  Rodolphe Quiedeville    <rodolphe@quiedeville.org>
+ * Copyright (C) 2004-2013  Laurent Destailleur     <eldy@users.sourceforge.net>
+ * Copyright (C) 2005-2012  Regis Houssin           <regis.houssin@capnetworks.com>
+ * Copyright (C) 2015       Raphaƫl Doursenaud      <rdoursenaud@gpcsolutions.fr>
  *
  * 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
@@ -574,7 +575,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
 					$chargestatic->lib=$obj->libelle;
 					$chargestatic->paye=$obj->paye;
 					print '<td>'.$chargestatic->getNomUrl(1).'</td>';
-					print '<td align="center">'.dol_print_date($obj->date_ech,'day').'</td>';
+					print '<td align="center">'.dol_print_date($db->jdate($obj->date_ech),'day').'</td>';
 					print '<td align="right">'.price($obj->amount).'</td>';
 					print '<td align="right">'.price($obj->sumpaid).'</td>';
 					print '<td align="center">'.$chargestatic->getLibStatut(3).'</td>';
@@ -915,8 +916,8 @@ if ($resql)
 		$obj = $db->fetch_object($resql);
 		$var=!$var;
 
-		print "<tr ".$bc[$var]."><td>".dol_print_date($obj->da,"day")."</td>";
-		print "<td><a href=\"action/card.php\">$obj->libelle $obj->label</a></td></tr>";
+		print "<tr ".$bc[$var]."><td>".dol_print_date($db->jdate($obj->da),"day")."</td>";
+		print "<td><a href=\"action/card.php\">".$obj->libelle." ".$obj->label."</a></td></tr>";
 		$i++;
 	}
 	$db->free($resql);
diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php
index f389b380b99734700355450f62b920b6fa32b2f7..b5aab7090d6d55ced541370536c64960d82b5d21 100644
--- a/htdocs/compta/resultat/clientfourn.php
+++ b/htdocs/compta/resultat/clientfourn.php
@@ -304,7 +304,7 @@ if ($modecompta == 'CREANCES-DETTES')
 }
 else
 {
-    $sql = "SELECT s.nom, s.rowid as socid, sum(pf.amount) as amount_ttc";
+    $sql = "SELECT s.nom as name, s.rowid as socid, sum(pf.amount) as amount_ttc";
     $sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn as p";
     $sql.= ", ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf";
     $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as f";
diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/index.php
index 678b3bfaa2e754f0be9f85bb38c66f7261fe1b2b..008a0ef3e2cf3f120f76cef5531c04ce6b3c215f 100644
--- a/htdocs/compta/salaries/index.php
+++ b/htdocs/compta/salaries/index.php
@@ -168,7 +168,7 @@ if ($result)
         // Type
         print '<td>'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.'</td>';
 		// Amount
-        print "<td align=\"right\">".price($obj->amount,0,$outputlangs,1,-1,-1,$conf->currency)."</td>";
+        print "<td align=\"right\">".price($obj->amount)."</td>";
         print "<td>&nbsp;</td>";
         print "</tr>\n";
 
@@ -177,7 +177,7 @@ if ($result)
         $i++;
     }
     print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").'</td>';
-    print '<td  class="liste_total" align="right">'.price($total,0,$outputlangs,1,-1,-1,$conf->currency)."</td>";
+    print '<td  class="liste_total" align="right">'.price($total)."</td>";
 	print "<td>&nbsp;</td></tr>";
 
     print "</table>";
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index ba12d039e103b73eb86c56ab43d105e7c00fc086..3e1e3fd1720c17a8924b824d87bda0ed0154eac8 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -499,9 +499,10 @@ class Contact extends CommonObject
 	 */
 	function fetch($id, $user=0, $ref_ext='')
 	{
-		dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR);
 		global $langs;
 
+		dol_syslog(get_class($this)."::fetch id=".$id, LOG_DEBUG);
+
 		$langs->load("companies");
 
 		$sql = "SELECT c.rowid, c.fk_soc, c.ref_ext, c.civility as civility_id, c.lastname, c.firstname,";
@@ -524,7 +525,6 @@ class Contact extends CommonObject
 		if ($id) $sql.= " WHERE c.rowid = ". $id;
 		elseif ($ref_ext) $sql .= " WHERE c.ref_ext = '".$this->db->escape($ref_ext)."'";
 
-		dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -565,7 +565,7 @@ class Contact extends CommonObject
 
 				$this->email			= $obj->email;
 				$this->jabberid			= $obj->jabberid;
-        $this->skype			= $obj->skype;
+                $this->skype			= $obj->skype;
 				$this->priv				= $obj->priv;
 				$this->mail				= $obj->email;
 
diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php
index 3020f12f0c4ab748ce9b6f634af6c6e360a19070..c2011c87d4cf4e86d9a91843ed814f92b5f28945 100644
--- a/htdocs/core/boxes/box_prospect.php
+++ b/htdocs/core/boxes/box_prospect.php
@@ -136,7 +136,6 @@ class box_prospect extends ModeleBoxes
 			}
 		}
 		else {
-			dol_syslog("box_prospect::loadBox not allowed de read this box content",LOG_ERR);
 			$this->info_box_contents[0][0] = array('td' => 'align="left"',
         'text' => $langs->trans("ReadPermissionNotAllowed"));
 		}
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 4bbe7b3aa9823669ba31d41188ea950ea106da3f..f9eeffbb0184f032d97d08f21da5c29a2bc15680 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -1837,7 +1837,7 @@ abstract class CommonObject
      *	@return	void
      *  @see	add_object_linked, updateObjectLinked, deleteObjectLinked
      */
-	function fetchObjectLinked($sourceid='',$sourcetype='',$targetid='',$targettype='',$clause='OR')
+	function fetchObjectLinked($sourceid=null,$sourcetype='',$targetid=null,$targettype='',$clause='OR')
     {
         global $conf;
 
@@ -1865,11 +1865,11 @@ abstract class CommonObject
         $sourcetype = (! empty($sourcetype) ? $sourcetype : $this->element);
         $targettype = (! empty($targettype) ? $targettype : $this->element);
 
-        if (empty($sourceid) && empty($targetid))
+        /*if (empty($sourceid) && empty($targetid))
         {
         	dol_syslog('Bad usage of function. No source nor target id defined (nor as parameter nor as object id)', LOG_ERROR);
         	return -1;
-        }
+        }*/
 
         // Links beetween objects are stored in this table
         $sql = 'SELECT fk_source, sourcetype, fk_target, targettype';
@@ -3375,6 +3375,11 @@ abstract class CommonObject
     {
     	if (empty($rowid)) $rowid=$this->id;
 
+        //To avoid SQL errors. Probably not the better solution though
+        if (!$this->table_element) {
+            return 0;
+        }
+
         if (! is_array($optionsArray))
         {
             // optionsArray not already loaded, so we load it
diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php
index 8f6847bcb9a6ec7860334d0aac5dea0b516f7dc9..3b62556f48291e2fafd7d0c486fd665873ce4890 100644
--- a/htdocs/core/lib/geturl.lib.php
+++ b/htdocs/core/lib/geturl.lib.php
@@ -24,12 +24,12 @@
 /**
  * Function get content from an URL (use proxy if proxy defined)
  *
- * @param	string	$url 				URL to call.
- * @param	string	$postorget			'POST', 'GET', 'HEAD'
- * @param	string	$param				Parameters of URL (x=value1&y=value2)
- * @param	string	$followlocation		1=Follow location, 0=Do not follow
- * @param	array	$addheaders			Array of string to add into header. Example: ('Accept: application/xrds+xml', ....)
- * @return	array						Returns an associative array containing the response from the server array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...)
+ * @param	string	  $url 				    URL to call.
+ * @param	string    $postorget		    'POST', 'GET', 'HEAD', 'PUTALREADYFORMATED'
+ * @param	string    $param			    Parameters of URL (x=value1&y=value2) or may be a formated content with PUTALREADYFORMATED
+ * @param	string    $followlocation		1=Follow location, 0=Do not follow
+ * @param	array     $addheaders			Array of string to add into header. Example: ('Accept: application/xrds+xml', ....)
+ * @return	array						    Returns an associative array containing the response from the server array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...)
  */
 function getURLContent($url,$postorget='GET',$param='',$followlocation=1,$addheaders=array())
 {
@@ -74,10 +74,19 @@ function getURLContent($url,$postorget='GET',$param='',$followlocation=1,$addhea
     else if ($postorget == 'PUT')
     {
     	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // HTTP request is 'PUT'
-    	if ( ! is_array($param) )
-		parse_str($param, $array_param);
+    	if (! is_array($param)) parse_str($param, $array_param);
+    	else 
+    	{
+    	    dol_syslog("parameter param must be a string", LOG_WARNING);
+    	    $array_param=$param;
+    	}
     	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($array_param));	// Setting param x=a&y=z as PUT fields	
     }
+    else if ($postorget == 'PUTALREADYFORMATED')
+    {
+    	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // HTTP request is 'PUT'
+    	curl_setopt($ch, CURLOPT_POSTFIELDS, $param);	// param = content of post, like a xml string
+    }
     else if ($postorget == 'HEAD')
     {
     	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'HEAD'); // HTTP request is 'HEAD'
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index 794ba7ac2afcf2163f934fcee19dc5b7bc479ec1..0350bce7a4b5cdea23ea7ec510f35faf2534b729 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -1585,55 +1585,52 @@ function pdf_getLinkedObjects($object,$outputlangs)
 		if ($objecttype == 'propal')
 		{
 			$outputlangs->load('propal');
-			$num=count($objects);
-			for ($i=0;$i<$num;$i++)
+			
+			foreach($objects as $elementobject)
 			{
 				$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefProposal");
-				$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($objects[$i]->ref);
+				$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref);
 				$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DatePropal");
-				$linkedobjects[$objecttype]['date_value'] = dol_print_date($objects[$i]->date,'day','',$outputlangs);
+				$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date,'day','',$outputlangs);
 			}
 		}
 		else if ($objecttype == 'commande')
 		{
 			$outputlangs->load('orders');
-			$num=count($objects);
-			for ($i=0;$i<$num;$i++)
+			foreach($objects as $elementobject)
 			{
 				$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder");
-				$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($objects[$i]->ref) . ($objects[$i]->ref_client ? ' ('.$objects[$i]->ref_client.')' : '');
+				$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref) . ($elementobject->ref_client ? ' ('.$elementobject->ref_client.')' : '');
 				$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate");
-				$linkedobjects[$objecttype]['date_value'] = dol_print_date($objects[$i]->date,'day','',$outputlangs);
+				$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date,'day','',$outputlangs);
 			}
 		}
 		else if ($objecttype == 'contrat')
 		{
 			$outputlangs->load('contracts');
-			$num=count($objects);
-			for ($i=0;$i<$num;$i++)
+			foreach($objects as $elementobject)
 			{
 				$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefContract");
-				$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($objects[$i]->ref);
+				$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref);
 				$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DateContract");
-				$linkedobjects[$objecttype]['date_value'] = dol_print_date($objects[$i]->date_contrat,'day','',$outputlangs);
+				$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date_contrat,'day','',$outputlangs);
 			}
 		}
 		else if ($objecttype == 'shipping')
 		{
 			$outputlangs->load('orders');
 			$outputlangs->load('sendings');
-			$num=count($objects);
-			for ($i=0;$i<$num;$i++)
+			foreach($objects as $elementobject)
 			{
-				$objects[$i]->fetchObjectLinked();
-				$order = $objects[$i]->linkedObjects['commande'][0];
+				$elementobject->fetchObjectLinked();
+				$order = $elementobject->linkedObjects['commande'][0];
 
 				$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder") . ' / ' . $outputlangs->transnoentities("RefSending");
 				$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($order->ref) . ($order->ref_client ? ' ('.$order->ref_client.')' : '');
-				$linkedobjects[$objecttype]['ref_value'].= ' / ' . $outputlangs->transnoentities($objects[$i]->ref);
+				$linkedobjects[$objecttype]['ref_value'].= ' / ' . $outputlangs->transnoentities($elementobject->ref);
 				$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate") . ' / ' . $outputlangs->transnoentities("DateSending");
 				$linkedobjects[$objecttype]['date_value'] = dol_print_date($order->date,'day','',$outputlangs);
-				$linkedobjects[$objecttype]['date_value'].= ' / ' . dol_print_date($objects[$i]->date_delivery,'day','',$outputlangs);
+				$linkedobjects[$objecttype]['date_value'].= ' / ' . dol_print_date($elementobject->date_delivery,'day','',$outputlangs);
 			}
 		}
 	}
diff --git a/htdocs/core/modules/syslog/mod_syslog_chromephp.php b/htdocs/core/modules/syslog/mod_syslog_chromephp.php
index cd2ea51285048a248b1d5f243e7849c608584b83..ea93d63532222a6ad421a0421c7568747cecac2f 100644
--- a/htdocs/core/modules/syslog/mod_syslog_chromephp.php
+++ b/htdocs/core/modules/syslog/mod_syslog_chromephp.php
@@ -51,7 +51,9 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
 		global $conf;
 		try
 		{
-			if (empty($conf->global->SYSLOG_CHROMEPHP_INCLUDEPATH)) $conf->global->SYSLOG_CHROMEPHP_INCLUDEPATH='/usr/share/php';
+			if (empty($conf->global->SYSLOG_CHROMEPHP_INCLUDEPATH)) {
+				$conf->global->SYSLOG_CHROMEPHP_INCLUDEPATH=DOL_DOCUMENT_ROOT . '/includes/chromephp/';
+			}
 			set_include_path($conf->global->SYSLOG_CHROMEPHP_INCLUDEPATH);
 
 			//print 'rrrrr'.get_include_path();
@@ -86,9 +88,9 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
 			array(
 				'name' => $langs->trans('IncludePath','SYSLOG_CHROMEPHP_INCLUDEPATH'),
 				'constant' => 'SYSLOG_CHROMEPHP_INCLUDEPATH',
-				'default' => '/usr/share/php',
+				'default' => DOL_DOCUMENT_ROOT . '/includes/chromephp/',
 				'attr' => 'size="60"',
-			    'example' => DOL_DOCUMENT_ROOT.'/includes/chromephp'
+			    'example' =>'/usr/share/php'
 			)
 		);
 	}
diff --git a/htdocs/includes/tcpdf/fonts/dejavusanscondensed.ctg.z b/htdocs/includes/tcpdf/fonts/dejavusanscondensed.ctg.z
new file mode 100755
index 0000000000000000000000000000000000000000..df25b6497f084274a55feb158bb478f237137568
Binary files /dev/null and b/htdocs/includes/tcpdf/fonts/dejavusanscondensed.ctg.z differ
diff --git a/htdocs/includes/tcpdf/fonts/dejavusanscondensed.z b/htdocs/includes/tcpdf/fonts/dejavusanscondensed.z
new file mode 100755
index 0000000000000000000000000000000000000000..2053dd16f031128023f839d0344a97a754285a19
Binary files /dev/null and b/htdocs/includes/tcpdf/fonts/dejavusanscondensed.z differ
diff --git a/htdocs/includes/tcpdf/fonts/dejavusanscondensedb.ctg.z b/htdocs/includes/tcpdf/fonts/dejavusanscondensedb.ctg.z
new file mode 100755
index 0000000000000000000000000000000000000000..71cef637e83311b26f0d4325c39b137930335918
Binary files /dev/null and b/htdocs/includes/tcpdf/fonts/dejavusanscondensedb.ctg.z differ
diff --git a/htdocs/includes/tcpdf/fonts/dejavusanscondensedb.z b/htdocs/includes/tcpdf/fonts/dejavusanscondensedb.z
new file mode 100755
index 0000000000000000000000000000000000000000..af54a16a09a5a4fb7fd7f4e4d44fb0f4e3f8e722
Binary files /dev/null and b/htdocs/includes/tcpdf/fonts/dejavusanscondensedb.z differ
diff --git a/htdocs/includes/tcpdf/fonts/dejavusanscondensedbi.ctg.z b/htdocs/includes/tcpdf/fonts/dejavusanscondensedbi.ctg.z
new file mode 100755
index 0000000000000000000000000000000000000000..23445ef2f4ba7cbb6b067515a98d6500f62a23f5
Binary files /dev/null and b/htdocs/includes/tcpdf/fonts/dejavusanscondensedbi.ctg.z differ
diff --git a/htdocs/includes/tcpdf/fonts/dejavusanscondensedbi.z b/htdocs/includes/tcpdf/fonts/dejavusanscondensedbi.z
new file mode 100755
index 0000000000000000000000000000000000000000..37da24ac6a9f8ff661e9aa0e3625674c3aed51ab
Binary files /dev/null and b/htdocs/includes/tcpdf/fonts/dejavusanscondensedbi.z differ
diff --git a/htdocs/includes/tcpdf/fonts/dejavusanscondensedi.ctg.z b/htdocs/includes/tcpdf/fonts/dejavusanscondensedi.ctg.z
new file mode 100755
index 0000000000000000000000000000000000000000..1b98d135f6843177fd449faf94308ad8f33326d4
Binary files /dev/null and b/htdocs/includes/tcpdf/fonts/dejavusanscondensedi.ctg.z differ
diff --git a/htdocs/includes/tcpdf/fonts/dejavusanscondensedi.z b/htdocs/includes/tcpdf/fonts/dejavusanscondensedi.z
new file mode 100755
index 0000000000000000000000000000000000000000..aa35d093a84707bad6b4314828d80cf21c62e77a
Binary files /dev/null and b/htdocs/includes/tcpdf/fonts/dejavusanscondensedi.z differ
diff --git a/htdocs/includes/tcpdf/fonts/dejavusansextralight.ctg.z b/htdocs/includes/tcpdf/fonts/dejavusansextralight.ctg.z
new file mode 100755
index 0000000000000000000000000000000000000000..d5fff04b70447a9468fac81266618fbb3b08d4c5
Binary files /dev/null and b/htdocs/includes/tcpdf/fonts/dejavusansextralight.ctg.z differ
diff --git a/htdocs/includes/tcpdf/fonts/dejavusansextralight.z b/htdocs/includes/tcpdf/fonts/dejavusansextralight.z
new file mode 100755
index 0000000000000000000000000000000000000000..a966f6de5c41357b3cae9cf88610eb77711f28db
Binary files /dev/null and b/htdocs/includes/tcpdf/fonts/dejavusansextralight.z differ
diff --git a/htdocs/includes/tcpdf/fonts/dejavusansmono.ctg.z b/htdocs/includes/tcpdf/fonts/dejavusansmono.ctg.z
new file mode 100755
index 0000000000000000000000000000000000000000..209e2d50b7425f6576effe463780bc5d4a5e44ea
Binary files /dev/null and b/htdocs/includes/tcpdf/fonts/dejavusansmono.ctg.z differ
diff --git a/htdocs/includes/tcpdf/fonts/dejavusansmono.z b/htdocs/includes/tcpdf/fonts/dejavusansmono.z
new file mode 100755
index 0000000000000000000000000000000000000000..126cc9228fe34a68006c69b7b997e79256ae46e2
Binary files /dev/null and b/htdocs/includes/tcpdf/fonts/dejavusansmono.z differ
diff --git a/htdocs/includes/tcpdf/fonts/dejavusansmonob.ctg.z b/htdocs/includes/tcpdf/fonts/dejavusansmonob.ctg.z
new file mode 100755
index 0000000000000000000000000000000000000000..76b78bc8f8b3c9e0a41a83366385e280a50ca0ca
Binary files /dev/null and b/htdocs/includes/tcpdf/fonts/dejavusansmonob.ctg.z differ
diff --git a/htdocs/includes/tcpdf/fonts/dejavusansmonob.z b/htdocs/includes/tcpdf/fonts/dejavusansmonob.z
new file mode 100755
index 0000000000000000000000000000000000000000..ef5638e2510ab23891b82dfe8fc359f7578bef53
Binary files /dev/null and b/htdocs/includes/tcpdf/fonts/dejavusansmonob.z differ
diff --git a/htdocs/includes/tcpdf/fonts/dejavusansmonobi.ctg.z b/htdocs/includes/tcpdf/fonts/dejavusansmonobi.ctg.z
new file mode 100755
index 0000000000000000000000000000000000000000..aa6da4149775e834c28adb6d6fdd1439b9ec4c5c
Binary files /dev/null and b/htdocs/includes/tcpdf/fonts/dejavusansmonobi.ctg.z differ
diff --git a/htdocs/includes/tcpdf/fonts/dejavusansmonobi.z b/htdocs/includes/tcpdf/fonts/dejavusansmonobi.z
new file mode 100755
index 0000000000000000000000000000000000000000..a866f79821ada258d10471c704595eaa9d7bcf0e
Binary files /dev/null and b/htdocs/includes/tcpdf/fonts/dejavusansmonobi.z differ
diff --git a/htdocs/includes/tcpdf/fonts/dejavusansmonoi.ctg.z b/htdocs/includes/tcpdf/fonts/dejavusansmonoi.ctg.z
new file mode 100755
index 0000000000000000000000000000000000000000..0fa53ab2eff7b9fa20dfe3b891351d23f21a5b81
Binary files /dev/null and b/htdocs/includes/tcpdf/fonts/dejavusansmonoi.ctg.z differ
diff --git a/htdocs/includes/tcpdf/fonts/dejavusansmonoi.z b/htdocs/includes/tcpdf/fonts/dejavusansmonoi.z
new file mode 100755
index 0000000000000000000000000000000000000000..14be5c14e57e019eb6d5f7bd2e15c33f969a5a2d
Binary files /dev/null and b/htdocs/includes/tcpdf/fonts/dejavusansmonoi.z differ
diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php
index 3cd39d4101fcf30127dc6e6ef876ba6e4442a10f..79c241a9d7ecb9fa1b862d01299623bfeda676e8 100644
--- a/htdocs/margin/customerMargins.php
+++ b/htdocs/margin/customerMargins.php
@@ -50,9 +50,9 @@ $pagenext = $page + 1;
 $startdate=$enddate='';
 
 if (!empty($_POST['startdatemonth']))
-  $startdate  = dol_mktime(12, 0, 0, $_POST['startdatemonth'],  $_POST['startdateday'],  $_POST['startdateyear']);
+  $startdate  = dol_mktime(0, 0, 0, $_POST['startdatemonth'],  $_POST['startdateday'],  $_POST['startdateyear']);
 if (!empty($_POST['enddatemonth']))
-  $enddate  = dol_mktime(12, 0, 0, $_POST['enddatemonth'],  $_POST['enddateday'],  $_POST['enddateyear']);
+  $enddate  = dol_mktime(23, 59, 59, $_POST['enddatemonth'],  $_POST['enddateday'],  $_POST['enddateyear']);
 
 /*
  * View
diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php
index b359287d24fd0261340e72f91de00846193a72c2..94b24e459f8ac883bad75c7bc18d4a3d696b1143 100644
--- a/htdocs/margin/productMargins.php
+++ b/htdocs/margin/productMargins.php
@@ -72,9 +72,9 @@ $pagenext = $page + 1;
 $startdate=$enddate='';
 
 if (!empty($_POST['startdatemonth']))
-  $startdate  = dol_mktime(12, 0, 0, $_POST['startdatemonth'], $_POST['startdateday'], $_POST['startdateyear']);
+  $startdate  = dol_mktime(0, 0, 0, $_POST['startdatemonth'], $_POST['startdateday'], $_POST['startdateyear']);
 if (!empty($_POST['enddatemonth']))
-  $enddate  = dol_mktime(12, 0, 0, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']);
+  $enddate  = dol_mktime(23, 59, 59, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']);
 
 
 /*