diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000000..2c35389d0ab --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +htdocs/takepos @andreubisquerra \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md similarity index 100% rename from CODE_OF_CONDUCT.md rename to .github/CODE_OF_CONDUCT.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 02d21453a3a..578bd592a75 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -38,7 +38,7 @@ We officially support versions N, N − 1 and N − 2 for N the latest version a Choose your base branch accordingly. ### General rules -Please don't edit the ChangeLog file. File will be generated from your commit messages during release process by the project manager. +Please don't edit the ChangeLog file. File will be generated from all commit messages during release process by the project manager. ### Commits Use clear commit messages with the following structure: @@ -56,13 +56,15 @@ You can add it to your git configuration using: git config --local commit.template .gitmessage ``` +where + #### Keyword In uppercase if you want to have the log comment appears into the generated ChangeLog file. The keyword can be ommitted if your commit does not fit in any of the following categories: -- Fix: for a bug fix -- Close: for closing a referenced feature request -- New: for an unreferenced new feature (Opening a feature request and using close is prefered) +- Fix/FIX: for a bug fix +- New/NEW: for an unreferenced new feature (Opening a feature request and using close is prefered) +- Close/CLOSE: for closing a referenced feature request #### Issuenum If your commit fixes a referenced bug or feature request. @@ -85,14 +87,14 @@ This section can span multiple lines. Try to keep lines under 120 characters. -#### Samples +#### Examples
 FIX|Fix #456 Short description (where #456 is number of bug fix, if it exists. In upper case to appear into ChangeLog)
 or
-CLOSE|Close #456 Short description (where #456 is number of feature request, if it exists. In upper case to appear into ChangeLog)
-or
 NEW|New Short description (In upper case to appear into ChangeLog, use this if you add a feature not tracked, otherwise use CLOSE #456)
 or
+CLOSE|Close #456 Short description (where #456 is number of feature request, if it exists. In upper case to appear into ChangeLog)
+or
 Short description (when the commit is not introducing feature nor closing a bug)
 
 Long description (Can span accross multiple lines).
@@ -104,13 +106,22 @@ When submitting a pull request, use same rule as [Commits](#commits) for the mes
 If your pull request only contains one commit, GitHub will be smart enough to fill it for you.
 Otherwise, please be a bit verbose about what you're providing.
 
-Your Pull Request must pass the Continuous Integration checks.
+Your Pull Request (PR) must pass the Continuous Integration checks.
 Also, some code changes need a prior approbation:
 
 * if you want to include a new external library (into htdocs/includes directory), please ask before to the project manager (@eldy) to see if such a library can be accepted.
 
 * if you add a new table, you must first create a page on http://wiki.dolibarr.org/index.php/Category:Table_SQL (copy an existing page changing its name to see it into this index page). Than ask the project manager (@eldy) if the new data model you plan to add can be accepted as you suggest.
 
+Once a PR has been submitted, you may need to wait for its integration. It is common that the project leader let the PR open for a long delay to allow 
+every developer discuss about the PR.
+If your PR has errors reported by the Continuous Integration Platform, it means your PR is not valid and nothing will be done with it. It will be kept open to allow developers to fix this, or it may be closed several month later.
+If the PR is valid, and is kept open for a long time, a tag will also be added on the PR to describe the status of your PR.
+By putting your mouse on the tag, you will get a full explanation of the tag/status that explain why your PR has not been integrated yet.
+Around 95% of submitted PR are reviewed and tagged. Even if this is one of the most important ratio in Open Source world, don't expect the core team 
+to reach the 100%. With the increasing popularity of Dolibarr, this ratio will probably decrease in future.
+
+
 ### Resources
 [Developer documentation](http://wiki.dolibarr.org/index.php/Developer_documentation)
 
@@ -120,9 +131,12 @@ The source language (en_US) is maintained in the repository. See the [Code](#cod
 
 All other translations are managed online at [Transifex](https://www.transifex.com/dolibarr-association/dolibarr/).
 
-Join an existing translation team or create your own and translate into the interface.
+Translations done on transifex are available in the next major release.
+
+Note: Sometimes, the source text (english) is modified. In such a case, the translation is reset. Transifex assume that if the original source
+has changed, the translation is surely no more correct so must be done again. But old translation is not lost and you can use the tab "History"
+to retreive all old translation of a source text, and restore the translation in one click with no need to retranslate it if there is no need to. 
 
-Your translations will be available in the next major release.
 
 ### Resources
 [Translator documentation](http://wiki.dolibarr.org/index.php/Translator_documentation)
@@ -131,5 +145,5 @@ Documentation
 -------------
 The project's documentation is maintained on the [Wiki](http://wiki.dolibarr.org/index.php).
 
-*Note*: to help prevent spam, you need to create an account before being able to edit.
+*Note*: to help prevent spam, you need to create an account before being able to edit. Everybody is welcome to contribute to its content.
 
diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl
index 16b4f64a0d2..96ae320e1b5 100755
--- a/build/makepack-dolibarr.pl
+++ b/build/makepack-dolibarr.pl
@@ -361,12 +361,12 @@ if ($nboftargetok) {
 		}
 		if (! $BUILD || $BUILD eq '0-rc')	# For a major version
 		{
-			print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log `git rev-list --boundary '.$MAJOR.'.'.$MINOR.'..origin/develop | grep ^- | cut -c2- | head -n 1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
+			print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log `git rev-list --boundary '.$MAJOR.'.'.$MINOR.'..origin/develop | grep ^- | cut -c2- | head -n 1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\|CLOSE\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/CLOSE/NEW/g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
 		}
 		else			# For a maintenance release
 		{
-			#print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
-			print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. | grep -v "Merge branch" | grep -v "Merge pull" | grep "^ " | sed -e "s/^[0-9a-z]* *//" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
+			#print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/CLOSE/NEW/g\'| sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
+			print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. | grep -v "Merge branch" | grep -v "Merge pull" | grep "^ " | sed -e "s/^[0-9a-z]* *//" | grep -e \'^FIX\|NEW\|CLOSE\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/CLOSE/NEW/g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
 			
 		}
 		print "\n";
diff --git a/dev/tools/github_authors_peryear.sh b/dev/tools/github_authors_peryear.sh
index 1f3a7fea5f6..7184d6c44ae 100755
--- a/dev/tools/github_authors_peryear.sh
+++ b/dev/tools/github_authors_peryear.sh
@@ -9,6 +9,10 @@ fi
 FROM=$1-01-01
 TO=$1-12-31
 
+echo "Number of contributors for the year"
 echo "git log --since $FROM --before $TO | grep ^Author | sort -u -f -i -b | wc -l"
 git log --since $FROM --before $TO | grep ^Author | sort -u -f -i -b | wc -l
 
+
+echo "Number of commit for the year"
+git log --pretty='format:%cd' --date=format:'%Y' | uniq -c | awk '{print "Year: "$2", commits: "$1}' | grep "Year: $1"
diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php
index 43f4a99e6c1..d1ae80378ee 100644
--- a/htdocs/adherents/index.php
+++ b/htdocs/adherents/index.php
@@ -424,10 +424,10 @@ foreach ($AdherentType as $key => $adhtype)
 }
 print '';
 print ''.$langs->trans("Total").'';
-print ''.$SommeA.' '.$staticmember->LibStatut(-1, $adhtype->subscription, 0, 3).'';
-print ''.$SommeB.' '.$staticmember->LibStatut(1, $adhtype->subscription, 0, 3).'';
-print ''.$SommeC.' '.$staticmember->LibStatut(1, $adhtype->subscription, $now, 3).'';
-print ''.$SommeD.' '.$staticmember->LibStatut(0, $adhtype->subscription, 0, 3).'';
+print ''.$SommeA.' '.$staticmember->LibStatut(-1, $adhtype->subscription, 0, 3).'';
+print ''.$SommeB.' '.$staticmember->LibStatut(1, $adhtype->subscription, 0, 3).'';
+print ''.$SommeC.' '.$staticmember->LibStatut(1, $adhtype->subscription, $now, 3).'';
+print ''.$SommeD.' '.$staticmember->LibStatut(0, $adhtype->subscription, 0, 3).'';
 print '';
 
 print "\n";
diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php
index 53a1c2bc7f8..e123669342d 100644
--- a/htdocs/adherents/subscription/list.php
+++ b/htdocs/adherents/subscription/list.php
@@ -87,8 +87,8 @@ $arrayfields=array(
 	'c.dateadh'=>array('label'=>$langs->trans("DateSubscription"), 'checked'=>1, 'position'=>100),
 	'c.datef'=>array('label'=>$langs->trans("EndSubscription"), 'checked'=>1, 'position'=>101),
 	'd.amount'=>array('label'=>$langs->trans("Amount"), 'checked'=>1, 'position'=>102),
-	'd.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
-	'd.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
+	'c.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
+	'c.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
 //	'd.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000)
 );
 
@@ -367,13 +367,13 @@ $parameters=array('arrayfields'=>$arrayfields);
 $reshook=$hookmanager->executeHooks('printFieldListOption', $parameters);    // Note that $action and $object may have been modified by hook
 print $hookmanager->resPrint;
 // Date creation
-if (! empty($arrayfields['d.datec']['checked']))
+if (! empty($arrayfields['c.datec']['checked']))
 {
 	print '';
 	print '';
 }
 // Date modification
-if (! empty($arrayfields['d.tms']['checked']))
+if (! empty($arrayfields['c.tms']['checked']))
 {
 	print '';
 	print '';
@@ -436,9 +436,9 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
 $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
 $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters);    // Note that $action and $object may have been modified by hook
 print $hookmanager->resPrint;
-if (! empty($arrayfields['d.datec']['checked']))     print_liste_field_titre($arrayfields['d.datec']['label'], $_SERVER["PHP_SELF"], "d.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
-if (! empty($arrayfields['d.tms']['checked']))       print_liste_field_titre($arrayfields['d.tms']['label'], $_SERVER["PHP_SELF"], "d.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
-print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
+if (! empty($arrayfields['c.datec']['checked']))     print_liste_field_titre($arrayfields['c.datec']['label'], $_SERVER["PHP_SELF"], "c.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
+if (! empty($arrayfields['c.tms']['checked']))       print_liste_field_titre($arrayfields['c.tms']['label'], $_SERVER["PHP_SELF"], "c.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
+print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
 print "\n";
 
 
@@ -553,7 +553,7 @@ while ($i < min($num, $limit))
 	$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters);    // Note that $action and $object may have been modified by hook
 	print $hookmanager->resPrint;
 	// Date creation
-	if (! empty($arrayfields['d.datec']['checked']))
+	if (! empty($arrayfields['c.datec']['checked']))
 	{
 		print '';
 		print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
@@ -561,7 +561,7 @@ while ($i < min($num, $limit))
 		if (! $i) $totalarray['nbfield']++;
 	}
 	// Date modification
-	if (! empty($arrayfields['d.tms']['checked']))
+	if (! empty($arrayfields['c.tms']['checked']))
 	{
 		print '';
 		print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php
index e93f263bc30..da5b1346fc2 100644
--- a/htdocs/comm/action/pertype.php
+++ b/htdocs/comm/action/pertype.php
@@ -5,7 +5,7 @@
  * Copyright (C) 2005-2012 Regis Houssin        
  * Copyright (C) 2011      Juanjo Menent        
  * Copyright (C) 2014      Cedric GROSS         
- * Copyright (C) 2018       Frédéric France         
+ * Copyright (C) 2018-2019  Frédéric France         
  *
  * 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
@@ -740,7 +740,7 @@ $db->close();
 /**
  * Show event line of a particular day for a user
  *
- * @param	string	$username		Login
+ * @param	User    $username		Login
  * @param   int		$day            Day
  * @param   int		$month          Month
  * @param   int		$year           Year
diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php
index 45134dc707c..33199f2dd6c 100644
--- a/htdocs/comm/action/peruser.php
+++ b/htdocs/comm/action/peruser.php
@@ -5,7 +5,7 @@
  * Copyright (C) 2005-2012 Regis Houssin        
  * Copyright (C) 2011      Juanjo Menent        
  * Copyright (C) 2014      Cedric GROSS         
- * Copyright (C) 2018       Frédéric France         
+ * Copyright (C) 2018-2019  Frédéric France         
  *
  * 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
@@ -888,7 +888,7 @@ $db->close();
 /**
  * Show event line of a particular day for a user
  *
- * @param	string	$username		Login
+ * @param   User    $username		Login
  * @param   int		$day            Day
  * @param   int		$month          Month
  * @param   int		$year           Year
diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index a30bbf5e4b4..9e319d70f91 100644
--- a/htdocs/comm/card.php
+++ b/htdocs/comm/card.php
@@ -7,8 +7,9 @@
  * Copyright (C) 2008      Raphael Bertrand (Resultic) 
  * Copyright (C) 2010-2014 Juanjo Menent               
  * Copyright (C) 2013      Alexandre Spangaro          
- * Copyright (C) 2015      Frederic France             
+ * Copyright (C) 2015-2019  Frédéric France            
  * Copyright (C) 2015      Marcos García               
+ *
  * 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 3 of the License, or
@@ -1327,12 +1328,6 @@ if ($object->id > 0)
 		show_contacts($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?socid='.$object->id);
 	}
 
-	// Addresses list
-	if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) && ! empty($conf->global->MAIN_REPEATADDRESSONEACHTAB))
-	{
-		show_addresses($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?socid='.$object->id);
-	}
-
     if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
     {
         print load_fiche_titre($langs->trans("ActionsOnCompany"), '', '');
diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php
index 37408d02057..0d49e938c54 100644
--- a/htdocs/comm/remx.php
+++ b/htdocs/comm/remx.php
@@ -1,6 +1,6 @@
 
- * Copyright (C) 2004-2012 Laurent Destailleur         
+ * Copyright (C) 2004-2019 Laurent Destailleur         
  * Copyright (C) 2008      Raphael Bertrand (Resultic) 
  *
  * This program is free software; you can redistribute it and/or modify
@@ -411,7 +411,7 @@ if ($socid > 0)
 			print load_fiche_titre($langs->trans("CustomerDiscounts"), '', '');
 		}
 
-		$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
+		$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
 		$sql.= " rc.datec as dc, rc.description,";
 		$sql.= " rc.fk_facture_source,";
 		$sql.= " u.login, u.rowid as user_id,";
@@ -433,11 +433,19 @@ if ($socid > 0)
 			print '';
 			print ''.$langs->trans("Date").'';	// Need 120+ for format with AM/PM
 			print ''.$langs->trans("ReasonDiscount").'';
-			print ''.$langs->trans("ConsumedBy").'';
-			print ''.$langs->trans("AmountHT").'';
-			print ''.$langs->trans("VATRate").'';
-			print ''.$langs->trans("AmountTTC").'';
-			print ''.$langs->trans("DiscountOfferedBy").'';
+			print ''.$langs->trans("ConsumedBy").'';
+			print ''.$langs->trans("AmountHT").'';
+			if (! empty($conf->multicurrency->enabled))
+			{
+                print ''.$langs->trans("MulticurrencyAmountHT").'';
+			}
+			print ''.$langs->trans("VATRate").'';
+			print ''.$langs->trans("AmountTTC").'';
+			if (! empty($conf->multicurrency->enabled))
+			{
+			    print ''.$langs->trans("MulticurrencyAmountTTC").'';
+			}
+			print ''.$langs->trans("DiscountOfferedBy").'';
 			print ' ';
 			print '';
 
@@ -455,7 +463,7 @@ if ($socid > 0)
 	    			print ''.dol_print_date($db->jdate($obj->dc), 'dayhour').'';
 	    			if (preg_match('/\(CREDIT_NOTE\)/', $obj->description))
 	    			{
-	    				print '';
+	    				print '';
 	    				$facturestatic->id=$obj->fk_facture_source;
 	    				$facturestatic->ref=$obj->ref;
 	    				$facturestatic->type=$obj->type;
@@ -464,7 +472,7 @@ if ($socid > 0)
 	    			}
 	    			elseif (preg_match('/\(DEPOSIT\)/', $obj->description))
 	    			{
-	    				print '';
+	    				print '';
 	    				$facturestatic->id=$obj->fk_facture_source;
 	    				$facturestatic->ref=$obj->ref;
 	    				$facturestatic->type=$obj->type;
@@ -473,7 +481,7 @@ if ($socid > 0)
 	    			}
 	    			elseif (preg_match('/\(EXCESS RECEIVED\)/', $obj->description))
 	    			{
-	    				print '';
+	    				print '';
 	    				$facturestatic->id=$obj->fk_facture_source;
 	    				$facturestatic->ref=$obj->ref;
 	    				$facturestatic->type=$obj->type;
@@ -482,14 +490,22 @@ if ($socid > 0)
 	    			}
 	    			else
 	    			{
-	    				print '';
+	    				print '';
 	    				print $obj->description;
 	    				print '';
 	    			}
 	    			print ''.$langs->trans("NotConsumed").'';
 	    			print ''.price($obj->amount_ht).'';
-	    			print ''.price2num($obj->tva_tx, 'MU').'%';
+	    			if (! empty($conf->multicurrency->enabled))
+	    			{
+	    			    print ''.price($obj->multicurrency_amount_ht).'';
+	    			}
+	    			print ''.vatrate($obj->tva_tx, true).'';
 	    			print ''.price($obj->amount_ttc).'';
+	    			if (! empty($conf->multicurrency->enabled))
+	    			{
+	    			    print ''.price($obj->multicurrency_amount_ttc).'';
+	    			}
 	    			print '';
 	    			print ''.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.'';
 	    			print '';
@@ -497,7 +513,7 @@ if ($socid > 0)
 	    			{
 	    				print '';
 	    				print 'rowid.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.img_split($langs->trans("SplitDiscount")).'';
-	    				print '   ';
+	    				//print '   ';
 	    				print 'rowid.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.img_delete($langs->trans("RemoveDiscount")).'';
 	    				print '';
 	    			}
@@ -550,7 +566,7 @@ if ($socid > 0)
 		/*
 		 * Liste remises fixes fournisseur restant en cours (= liees a aucune facture ni ligne de facture)
 		 */
-		$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
+		$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
 		$sql.= " rc.datec as dc, rc.description,";
 		$sql.= " rc.fk_invoice_supplier_source,";
 		$sql.= " u.login, u.rowid as user_id,";
@@ -572,11 +588,19 @@ if ($socid > 0)
 			print '';
 			print ''.$langs->trans("Date").'';	// Need 120+ for format with AM/PM
 			print ''.$langs->trans("ReasonDiscount").'';
-			print ''.$langs->trans("ConsumedBy").'';
-			print ''.$langs->trans("AmountHT").'';
-			print ''.$langs->trans("VATRate").'';
-			print ''.$langs->trans("AmountTTC").'';
-			print ''.$langs->trans("DiscountOfferedBy").'';
+			print ''.$langs->trans("ConsumedBy").'';
+			print ''.$langs->trans("AmountHT").'';
+			if (! empty($conf->multicurrency->enabled))
+			{
+			    print ''.$langs->trans("MulticurrencyAmountHT").'';
+			}
+			print ''.$langs->trans("VATRate").'';
+			print ''.$langs->trans("AmountTTC").'';
+			if (! empty($conf->multicurrency->enabled))
+			{
+			    print ''.$langs->trans("MulticurrencyAmountTTC").'';
+			}
+			print ''.$langs->trans("DiscountOfferedBy").'';
 			print ' ';
 			print '';
 
@@ -594,7 +618,7 @@ if ($socid > 0)
 					print ''.dol_print_date($db->jdate($obj->dc), 'dayhour').'';
 					if (preg_match('/\(CREDIT_NOTE\)/', $obj->description))
 					{
-						print '';
+						print '';
 						$facturefournstatic->id=$obj->fk_invoice_supplier_source;
 						$facturefournstatic->ref=$obj->ref;
 						$facturefournstatic->type=$obj->type;
@@ -603,7 +627,7 @@ if ($socid > 0)
 					}
 					elseif (preg_match('/\(DEPOSIT\)/', $obj->description))
 					{
-						print '';
+						print '';
 						$facturefournstatic->id=$obj->fk_invoice_supplier_source;
 						$facturefournstatic->ref=$obj->ref;
 						$facturefournstatic->type=$obj->type;
@@ -612,7 +636,7 @@ if ($socid > 0)
 					}
 					elseif (preg_match('/\(EXCESS PAID\)/', $obj->description))
 					{
-						print '';
+						print '';
 						$facturefournstatic->id=$obj->fk_invoice_supplier_source;
 						$facturefournstatic->ref=$obj->ref;
 						$facturefournstatic->type=$obj->type;
@@ -621,22 +645,30 @@ if ($socid > 0)
 					}
 					else
 					{
-						print '';
+						print '';
 						print $obj->description;
 						print '';
 					}
 					print ''.$langs->trans("NotConsumed").'';
 					print ''.price($obj->amount_ht).'';
-					print ''.price2num($obj->tva_tx, 'MU').'%';
+					if (! empty($conf->multicurrency->enabled))
+					{
+					    print ''.price($obj->multicurrency_amount_ht).'';
+					}
+					print ''.vatrate($obj->tva_tx, true).'';
 					print ''.price($obj->amount_ttc).'';
-					print '';
+					if (! empty($conf->multicurrency->enabled))
+					{
+					    print ''.price($obj->multicurrency_amount_ttc).'';
+					}
+					print '';
 					print ''.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.'';
 					print '';
 					if ($user->rights->societe->creer || $user->rights->facture->creer)
 					{
-						print '';
+						print '';
 						print 'rowid.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.img_split($langs->trans("SplitDiscount")).'';
-						print '   ';
+						//print '   ';
 						print 'rowid.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.img_delete($langs->trans("RemoveDiscount")).'';
 						print '';
 					}
@@ -700,7 +732,7 @@ if ($socid > 0)
 		}
 
 		// Remises liees a lignes de factures
-		$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
+		$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
 		$sql.= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,";
 		$sql.= " rc.fk_facture_source,";
 		$sql.= " u.login, u.rowid as user_id,";
@@ -745,11 +777,19 @@ if ($socid > 0)
 			print '';
 			print ''.$langs->trans("Date").'';	// Need 120+ for format with AM/PM
 			print ''.$langs->trans("ReasonDiscount").'';
-			print ''.$langs->trans("ConsumedBy").'';
-			print ''.$langs->trans("AmountHT").'';
-			print ''.$langs->trans("VATRate").'';
-			print ''.$langs->trans("AmountTTC").'';
-			print ''.$langs->trans("Author").'';
+			print ''.$langs->trans("ConsumedBy").'';
+			print ''.$langs->trans("AmountHT").'';
+			if (! empty($conf->multicurrency->enabled))
+			{
+			    print ''.$langs->trans("MulticurrencyAmountHT").'';
+			}
+			print ''.$langs->trans("VATRate").'';
+			print ''.$langs->trans("AmountTTC").'';
+			if (! empty($conf->multicurrency->enabled))
+			{
+			    print ''.$langs->trans("MulticurrencyAmountTTC").'';
+			}
+			print ''.$langs->trans("Author").'';
 			print ' ';
 			print '';
 
@@ -788,7 +828,7 @@ if ($socid > 0)
 	    			print ''.dol_print_date($db->jdate($obj->dc), 'dayhour').'';
 	    			if (preg_match('/\(CREDIT_NOTE\)/', $obj->description))
 	    			{
-	    				print '';
+	    				print '';
 	    				$facturestatic->id=$obj->fk_facture_source;
 	    				$facturestatic->ref=$obj->ref;
 	    				$facturestatic->type=$obj->type;
@@ -797,7 +837,7 @@ if ($socid > 0)
 	    			}
 	    			elseif (preg_match('/\(DEPOSIT\)/', $obj->description))
 	    			{
-	    				print '';
+	    				print '';
 	    				$facturestatic->id=$obj->fk_facture_source;
 	    				$facturestatic->ref=$obj->ref;
 	    				$facturestatic->type=$obj->type;
@@ -806,7 +846,7 @@ if ($socid > 0)
 	    			}
 	    			elseif (preg_match('/\(EXCESS RECEIVED\)/', $obj->description))
 	    			{
-	    				print '';
+	    				print '';
 	    				$facturestatic->id=$obj->fk_facture_source;
 	    				$facturestatic->ref=$obj->ref;
 	    				$facturestatic->type=$obj->type;
@@ -815,15 +855,23 @@ if ($socid > 0)
 	    			}
 	    			else
 	    			{
-	    				print '';
+	    				print '';
 	    				print $obj->description;
 	    				print '';
 	    			}
-	    			print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.'';
+	    			print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.'';
 	    			print ''.price($obj->amount_ht).'';
-	    			print ''.price2num($obj->tva_tx, 'MU').'%';
+	    			if (! empty($conf->multicurrency->enabled))
+	    			{
+	    			    print ''.price($obj->multicurrency_amount_ht).'';
+	    			}
+	    			print ''.vatrate($obj->tva_tx, true).'';
 	    			print ''.price($obj->amount_ttc).'';
-	    			print '';
+	    			if (! empty($conf->multicurrency->enabled))
+	    			{
+	    			    print ''.price($obj->multicurrency_amount_ttc).'';
+	    			}
+	    			print '';
 	    			print ''.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.'';
 	    			print '';
 	    			print ' ';
@@ -854,7 +902,7 @@ if ($socid > 0)
 		}
 
 		// Remises liees a lignes de factures
-		$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
+		$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
 		$sql.= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,";
 		$sql.= " rc.fk_invoice_supplier_source,";
 		$sql.= " u.login, u.rowid as user_id,";
@@ -899,11 +947,19 @@ if ($socid > 0)
 			print '';
 			print ''.$langs->trans("Date").'';	// Need 120+ for format with AM/PM
 			print ''.$langs->trans("ReasonDiscount").'';
-			print ''.$langs->trans("ConsumedBy").'';
-			print ''.$langs->trans("AmountHT").'';
-			print ''.$langs->trans("VATRate").'';
-			print ''.$langs->trans("AmountTTC").'';
-			print ''.$langs->trans("Author").'';
+			print ''.$langs->trans("ConsumedBy").'';
+			print ''.$langs->trans("AmountHT").'';
+			if (! empty($conf->multicurrency->enabled))
+			{
+			    print ''.$langs->trans("MulticurrencyAmountHT").'';
+			}
+			print ''.$langs->trans("VATRate").'';
+			print ''.$langs->trans("AmountTTC").'';
+			if (! empty($conf->multicurrency->enabled))
+			{
+			    print ''.$langs->trans("MulticurrencyAmountTTC").'';
+			}
+			print ''.$langs->trans("Author").'';
 			print ' ';
 			print '';
 
@@ -942,7 +998,7 @@ if ($socid > 0)
 					print ''.dol_print_date($db->jdate($obj->dc), 'dayhour').'';
 					if (preg_match('/\(CREDIT_NOTE\)/', $obj->description))
 					{
-						print '';
+						print '';
 						$facturefournstatic->id=$obj->fk_invoice_supplier_source;
 						$facturefournstatic->ref=$obj->ref;
 						$facturefournstatic->type=$obj->type;
@@ -951,7 +1007,7 @@ if ($socid > 0)
 					}
 					elseif (preg_match('/\(DEPOSIT\)/', $obj->description))
 					{
-						print '';
+						print '';
 						$facturefournstatic->id=$obj->fk_invoice_supplier_source;
 						$facturefournstatic->ref=$obj->ref;
 						$facturefournstatic->type=$obj->type;
@@ -960,7 +1016,7 @@ if ($socid > 0)
 					}
 					elseif (preg_match('/\(EXCESS PAID\)/', $obj->description))
 					{
-						print '';
+						print '';
 						$facturefournstatic->id=$obj->fk_invoice_supplier_source;
 						$facturefournstatic->ref=$obj->ref;
 						$facturefournstatic->type=$obj->type;
@@ -969,14 +1025,22 @@ if ($socid > 0)
 					}
 					else
 					{
-						print '';
+						print '';
 						print $obj->description;
 						print '';
 					}
-					print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.'';
+					print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.'';
 					print ''.price($obj->amount_ht).'';
-					print ''.price2num($obj->tva_tx, 'MU').'%';
+					if (! empty($conf->multicurrency->enabled))
+					{
+					    print ''.price($obj->multicurrency_amount_ht).'';
+					}
+					print ''.vatrate($obj->tva_tx, true).'';
 					print ''.price($obj->amount_ttc).'';
+					if (! empty($conf->multicurrency->enabled))
+					{
+					    print ''.price($obj->multicurrency_amount_ttc).'';
+					}
 					print '';
 					print ''.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.'';
 					print '';
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index ff8940854e7..95483513c72 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -727,24 +727,24 @@ if ($resql)
 	if (! empty($arrayfields['s.town']['checked']))           print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder);
 	if (! empty($arrayfields['s.zip']['checked']))            print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder);
 	if (! empty($arrayfields['state.nom']['checked']))        print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder);
-	if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, 'align="center"', $sortfield, $sortorder);
-	if (! empty($arrayfields['typent.code']['checked']))      print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, 'align="center"', $sortfield, $sortorder);
-	if (! empty($arrayfields['c.date_commande']['checked']))  print_liste_field_titre($arrayfields['c.date_commande']['label'], $_SERVER["PHP_SELF"], 'c.date_commande', '', $param, 'align="center"', $sortfield, $sortorder);
-	if (! empty($arrayfields['c.date_delivery']['checked']))  print_liste_field_titre($arrayfields['c.date_delivery']['label'], $_SERVER["PHP_SELF"], 'c.date_livraison', '', $param, 'align="center"', $sortfield, $sortorder);
-	if (! empty($arrayfields['c.total_ht']['checked']))       print_liste_field_titre($arrayfields['c.total_ht']['label'], $_SERVER["PHP_SELF"], 'c.total_ht', '', $param, 'class="right"', $sortfield, $sortorder);
-	if (! empty($arrayfields['c.total_vat']['checked']))      print_liste_field_titre($arrayfields['c.total_vat']['label'], $_SERVER["PHP_SELF"], 'c.tva', '', $param, 'class="right"', $sortfield, $sortorder);
-	if (! empty($arrayfields['c.total_ttc']['checked']))      print_liste_field_titre($arrayfields['c.total_ttc']['label'], $_SERVER["PHP_SELF"], 'c.total_ttc', '', $param, 'class="right"', $sortfield, $sortorder);
+	if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center ');
+	if (! empty($arrayfields['typent.code']['checked']))      print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center ');
+	if (! empty($arrayfields['c.date_commande']['checked']))  print_liste_field_titre($arrayfields['c.date_commande']['label'], $_SERVER["PHP_SELF"], 'c.date_commande', '', $param, '', $sortfield, $sortorder, 'center ');
+	if (! empty($arrayfields['c.date_delivery']['checked']))  print_liste_field_titre($arrayfields['c.date_delivery']['label'], $_SERVER["PHP_SELF"], 'c.date_livraison', '', $param, '', $sortfield, $sortorder, 'center ');
+	if (! empty($arrayfields['c.total_ht']['checked']))       print_liste_field_titre($arrayfields['c.total_ht']['label'], $_SERVER["PHP_SELF"], 'c.total_ht', '', $param, '', $sortfield, $sortorder, 'right ');
+	if (! empty($arrayfields['c.total_vat']['checked']))      print_liste_field_titre($arrayfields['c.total_vat']['label'], $_SERVER["PHP_SELF"], 'c.tva', '', $param, '', $sortfield, $sortorder, 'right ');
+	if (! empty($arrayfields['c.total_ttc']['checked']))      print_liste_field_titre($arrayfields['c.total_ttc']['label'], $_SERVER["PHP_SELF"], 'c.total_ttc', '', $param, '', $sortfield, $sortorder, 'right ');
 	// Extra fields
 	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
 	// Hook fields
 	$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
 	$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters);    // Note that $action and $object may have been modified by hook
 	print $hookmanager->resPrint;
-	if (! empty($arrayfields['c.datec']['checked']))     print_liste_field_titre($arrayfields['c.datec']['label'], $_SERVER["PHP_SELF"], "c.date_creation", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
-	if (! empty($arrayfields['c.tms']['checked']))       print_liste_field_titre($arrayfields['c.tms']['label'], $_SERVER["PHP_SELF"], "c.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
-	if (! empty($arrayfields['c.fk_statut']['checked'])) print_liste_field_titre($arrayfields['c.fk_statut']['label'], $_SERVER["PHP_SELF"], "c.fk_statut", "", $param, 'class="right"', $sortfield, $sortorder);
-	if (! empty($arrayfields['c.facture']['checked']))   print_liste_field_titre($arrayfields['c.facture']['label'], $_SERVER["PHP_SELF"], 'c.facture', '', $param, 'align="center"', $sortfield, $sortorder, '');
-	print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', $param, 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
+	if (! empty($arrayfields['c.datec']['checked']))     print_liste_field_titre($arrayfields['c.datec']['label'], $_SERVER["PHP_SELF"], "c.date_creation", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
+	if (! empty($arrayfields['c.tms']['checked']))       print_liste_field_titre($arrayfields['c.tms']['label'], $_SERVER["PHP_SELF"], "c.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
+	if (! empty($arrayfields['c.fk_statut']['checked'])) print_liste_field_titre($arrayfields['c.fk_statut']['label'], $_SERVER["PHP_SELF"], "c.fk_statut", "", $param, '', $sortfield, $sortorder, 'right ');
+	if (! empty($arrayfields['c.facture']['checked']))   print_liste_field_titre($arrayfields['c.facture']['label'], $_SERVER["PHP_SELF"], 'c.facture', '', $param, '', $sortfield, $sortorder, 'center ');
+	print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'maxwidthsearch center ');
 	print ''."\n";
 
 	$total=0;
diff --git a/htdocs/compta/compta-files.php b/htdocs/compta/compta-files.php
index e91fa1ffac5..1a845d59601 100644
--- a/htdocs/compta/compta-files.php
+++ b/htdocs/compta/compta-files.php
@@ -243,7 +243,7 @@ if ($result && $action == "dl")
     $log='date,type,ref,total,paid,filename,item_id'."\n";
     $zipname = $dirfortmpfile.'/'.dol_print_date($date_start, 'dayrfc')."-".dol_print_date($date_stop, 'dayrfc').'_export.zip';
 
-    dol_delete_file(name);
+    dol_delete_file($zipname);
 
     $zip = new ZipArchive;
     $res = $zip->open($zipname, ZipArchive::OVERWRITE|ZipArchive::CREATE);
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 80951464d7b..6b633f99309 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -696,6 +696,7 @@ if (empty($reshook))
 			$db->begin();
 
 			$amount_ht = $amount_tva = $amount_ttc = array();
+			$multicurrency_amount_ht = $multicurrency_amount_tva = $multicurrency_amount_ttc = array();
 
 			// Loop on each vat rate
 			$i = 0;
@@ -709,7 +710,7 @@ if (empty($reshook))
 					$multicurrency_amount_ht[$line->tva_tx] += $line->multicurrency_total_ht;
 					$multicurrency_amount_tva[$line->tva_tx] += $line->multicurrency_total_tva;
 					$multicurrency_amount_ttc[$line->tva_tx] += $line->multicurrency_total_ttc;
-					$i ++;
+					$i++;
 				}
 			}
 
@@ -4671,6 +4672,13 @@ elseif ($id > 0 || ! empty($ref))
 				}
 			}
 
+			// POS Ticket
+			if (! empty($conf->takepos->enabled) && $object->module_source != '')
+			{
+                $receipt_url=DOL_URL_ROOT."/takepos/receipt.php";
+                print '';
+			}
+
 			// Classify paid
 			if ($object->statut == 1 && $object->paye == 0 && $usercanissuepayment && (($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && $resteapayer <= 0) || ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0))
 				|| ($object->type == Facture::TYPE_DEPOSIT && $object->paye == 0 && $object->total_ttc > 0 && $resteapayer == 0 && $usercanissuepayment && empty($discount->id))
diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php
index af3626942de..3056fc1c7f4 100644
--- a/htdocs/compta/facture/class/api_invoices.class.php
+++ b/htdocs/compta/facture/class/api_invoices.class.php
@@ -338,7 +338,7 @@ class Invoices extends DolibarrApi
     		throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
     	}
     	$request_data = (object) $request_data;
-    $updateRes = $this->invoice->updateline(
+        $updateRes = $this->invoice->updateline(
     		$lineid,
     		$request_data->desc,
     		$request_data->subprice,
@@ -362,7 +362,7 @@ class Invoices extends DolibarrApi
     		$request_data->situation_percent,
     		$request_data->fk_unit,
     		$request_data->multicurrency_subprice
-    		);
+    	);
 
     	if ($updateRes > 0) {
     		$result = $this->get($id);
@@ -392,7 +392,7 @@ class Invoices extends DolibarrApi
             throw new RestException(401);
         }
 
-        $result = $this->facture->fetch($id);
+        $result = $this->invoice->fetch($id);
 
 		if(!$result) {
 			throw new RestException(404, 'Invoice not found');
@@ -402,17 +402,17 @@ class Invoices extends DolibarrApi
             throw new RestException(500, 'Availables types: BILLING, SHIPPING OR CUSTOMER');
         }
 
-        if(!DolibarrApi::_checkAccessToResource('invoice', $this->facture->id)) {
+        if(!DolibarrApi::_checkAccessToResource('invoice', $this->invoice->id)) {
 			throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
 		}
 
-        $result = $this->facture->add_contact($contactid, $type, 'external');
+        $result = $this->invoice->add_contact($contactid, $type, 'external');
 
         if (!$result) {
             throw new RestException(500, 'Error when added the contact');
         }
 
-        return $this->facture;
+        return $this->_cleanObjectDatas($this->invoice);
     }
 
    /**
@@ -434,23 +434,23 @@ class Invoices extends DolibarrApi
             throw new RestException(401);
         }
 
-        $result = $this->facture->fetch($id);
+        $result = $this->invoice->fetch($id);
 
-		if(!$result) {
+		if (!$result) {
 			throw new RestException(404, 'Invoice not found');
 		}
 
-        if(!DolibarrApi::_checkAccessToResource('invoice', $this->facture->id)) {
+        if (!DolibarrApi::_checkAccessToResource('invoice', $this->invoice->id)) {
 			throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
 		}
 
-        $result = $this->facture->delete_contact($rowid);
+        $result = $this->invoice->delete_contact($rowid);
 
         if (!$result) {
             throw new RestException(500, 'Error when deleted the contact');
         }
 
-        return $this->facture;
+        return $this->_cleanObjectDatas($this->invoice);
     }
 
     /**
diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php
index 5fd3e7ddd63..336b306fff1 100644
--- a/htdocs/compta/paiement.php
+++ b/htdocs/compta/paiement.php
@@ -253,11 +253,13 @@ if (empty($reshook))
 	    $paiement->amounts      = $amounts;   // Array with all payments dispatching with invoice id
 	    $paiement->multicurrency_amounts = $multicurrency_amounts;   // Array with all payments dispatching
 	    $paiement->paiementid   = dol_getIdFromCode($db, GETPOST('paiementcode'), 'c_paiement', 'code', 'id', 1);
-	    $paiement->num_paiement = GETPOST('num_paiement');
-	    $paiement->note         = GETPOST('comment');
+	    $paiement->num_paiement = GETPOST('num_paiement', 'alpha');
+	    $paiement->note         = GETPOST('comment', 'alpha');
 
 	    if (! $error)
 	    {
+	        // Create payment and update this->multicurrency_amounts if this->amounts filled or
+	        // this->amounts if this->multicurrency_amounts filled.
 	        $paiement_id = $paiement->create($user, (GETPOST('closepaidinvoices')=='on'?1:0), $thirdparty);    // This include closing invoices and regenerating documents
 	    	if ($paiement_id < 0)
 	        {
@@ -635,7 +637,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
                     // Date
                    	print ''.dol_print_date($db->jdate($objp->df), 'day')."\n";
 
-                    // Date Max Payment
+                    // Due date
                     if ($objp->dlr > 0 )
                     {
                         print '';
@@ -650,7 +652,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
                     }
                     else
                     {
-                        print '--';
+                        print '';
                     }
 
                     // Currency
@@ -673,12 +675,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
 						}
 		                print '';
 
-    					// Multicurrency Price
+    					// Multicurrency remain to pay
     				    print '';
     				    if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) print price($sign * $multicurrency_remaintopay);
     				    print '';
 
-    				    print '';
+    				    print '';
 
     				    // Add remind multicurrency amount
     				    $namef = 'multicurrency_amount_'.$objp->facid;
@@ -690,12 +692,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
     				    	{
     				    		if (!empty($conf->use_javascript_ajax))
     				    			print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'");
-    				    			print '';
-    				    			print '';
+   				    			print '';
+   				    			print '';
     				    	}
     				    	else
     				    	{
-    				    		print '';
+    				    		print '';
     				    		print '';
     				    	}
     				    }
@@ -716,7 +718,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
                     //$test= price(price2num($objp->total_ttc - $paiement - $creditnotes - $deposits));
 
                     // Amount
-                    print '';
+                    print '';
 
                     // Add remind amount
                     $namef = 'amount_'.$objp->facid;
@@ -726,12 +728,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
                     {
                         if (!empty($conf->use_javascript_ajax))
 							print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $remaintopay)."'");
+                        print '';
                         print '';
-                        print '';
                     }
                     else
                     {
-                        print '';
+                        print '';
                         print '';
                     }
                     print "";
diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php
index 71e7ef7194e..7307b3e1601 100644
--- a/htdocs/compta/paiement/class/paiement.class.php
+++ b/htdocs/compta/paiement/class/paiement.class.php
@@ -366,6 +366,7 @@ class Paiement extends CommonObject
                                 if ($invoice->type == Facture::TYPE_DEPOSIT)
                                 {
 			                        $amount_ht = $amount_tva = $amount_ttc = array();
+			                        $multicurrency_amount_ht = $multicurrency_amount_tva = $multicurrency_amount_ttc = array();
 
 									// Insert one discount by VAT rate category
 									$discount = new DiscountAbsolute($this->db);
@@ -384,6 +385,9 @@ class Paiement extends CommonObject
 												$amount_ht[$line->tva_tx] += $line->total_ht;
 												$amount_tva[$line->tva_tx] += $line->total_tva;
 												$amount_ttc[$line->tva_tx] += $line->total_ttc;
+												$multicurrency_amount_ht[$line->tva_tx] += $line->multicurrency_total_ht;
+												$multicurrency_amount_tva[$line->tva_tx] += $line->multicurrency_total_tva;
+												$multicurrency_amount_ttc[$line->tva_tx] += $line->multicurrency_total_ttc;
 												$i++;
 											}
 										}
@@ -392,6 +396,9 @@ class Paiement extends CommonObject
 											$discount->amount_ht = abs($amount_ht[$tva_tx]);
 											$discount->amount_tva = abs($amount_tva[$tva_tx]);
 											$discount->amount_ttc = abs($amount_ttc[$tva_tx]);
+											$discount->multicurrency_amount_ht = abs($multicurrency_amount_ht[$tva_tx]);
+											$discount->multicurrency_amount_tva = abs($multicurrency_amount_tva[$tva_tx]);
+											$discount->multicurrency_amount_ttc = abs($multicurrency_amount_ttc[$tva_tx]);
 											$discount->tva_tx = abs($tva_tx);
 
 											$result = $discount->create($user);
@@ -1110,7 +1117,7 @@ class Paiement extends CommonObject
 	/**
 	 * 	get the right way of payment
 	 *
-	 * 	@return 	string 	'dolibarr' if standard comportment or paid in dolibarr currency, 'customer' if payment received from multicurrency inputs
+	 * 	@return 	string 	'dolibarr' if standard comportment or paid in main currency, 'customer' if payment received from multicurrency inputs
 	 */
 	function getWay()
 	{
diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index 4f3817401b4..697e1038504 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -1225,7 +1225,7 @@ else
 
     	// Other attributes
     	$cols = 3;
-    	$parameyers=array('socid'=>$socid);
+    	$parameters=array('socid'=>$socid);
     	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
 
         $object->load_ref_elements();
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index cd25107d744..71d86016fe6 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -9,6 +9,7 @@
  * Copyright (C) 2015       Jean-François Ferry     
  * Copyright (C) 2018       Nicolas ZABOURI         
  * Copyright (C) 2018       Juanjo Menent			
+ * Copyright (C) 2019       Frédéric France         
  *
  * 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
@@ -81,7 +82,7 @@ $search_town=GETPOST('search_town', 'alpha');
 $search_import_key=GETPOST("search_import_key", "alpha");
 $search_country=GETPOST("search_country", 'intcomma');
 
-if ($search_status=='') $search_status=1; // always display activ customer first
+if ($search_status=='') $search_status=1; // always display active customer first
 
 $optioncss = GETPOST('optioncss', 'alpha');
 
@@ -400,15 +401,15 @@ $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas';
 llxHeader('', $title, $help_url);
 
 $param='';
-if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
-if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
-$param.='&begin='.urlencode($begin).'&view='.urlencode($view).'&userid='.urlencode($userid).'&contactname='.urlencode($sall);
-$param.='&type='.urlencode($type).'&view='.urlencode($view);
-if (!empty($search_categ)) $param.='&search_categ='.urlencode($search_categ);
-if (!empty($search_categ_thirdparty)) $param.='&search_categ_thirdparty='.urlencode($search_categ_thirdparty);
-if (!empty($search_categ_supplier)) $param.='&search_categ_supplier='.urlencode($search_categ_supplier);
+if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
+if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
+$param.='&begin='.urlencode($begin).'&userid='.urlencode($userid).'&contactname='.urlencode($sall);
+$param.='&type='.urlencode($type).'&view='.urlencode($view);
+if (!empty($search_categ)) $param.='&search_categ='.urlencode($search_categ);
+if (!empty($search_categ_thirdparty)) $param.='&search_categ_thirdparty='.urlencode($search_categ_thirdparty);
+if (!empty($search_categ_supplier)) $param.='&search_categ_supplier='.urlencode($search_categ_supplier);
 if ($sall != '') $param.='&sall='.urlencode($sall);
-if ($search_id > 0) $param.= "&search_id=".urlencode($search_id);
+if ($search_id > 0) $param.= "&search_id=".urlencode($search_id);
 if ($search_lastname != '') $param.='&search_lastname='.urlencode($search_lastname);
 if ($search_firstname != '') $param.='&search_firstname='.urlencode($search_firstname);
 if ($search_societe != '') $param.='&search_societe='.urlencode($search_societe);
@@ -422,9 +423,9 @@ if ($search_phone_mobile != '') $param.='&search_phone_mobile='.urlencode($s
 if ($search_fax != '') $param.='&search_fax='.urlencode($search_fax);
 if ($search_email != '') $param.='&search_email='.urlencode($search_email);
 if ($search_status != '') $param.='&search_status='.urlencode($search_status);
-if ($search_priv == '0' || $search_priv == '1') $param.="&search_priv=".urlencode($search_priv);
-if ($search_import_key != '') $param.='&search_import_key='.urlencode($search_import_key);
-if ($optioncss != '') $param.='&optioncss='.$optioncss;
+if ($search_priv == '0' || $search_priv == '1') $param.="&search_priv=".urlencode($search_priv);
+if ($search_import_key != '') $param.='&search_import_key='.urlencode($search_import_key);
+if ($optioncss != '') $param.='&optioncss='.$optioncss;
 
 // Add $param from extra fields
 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
@@ -572,7 +573,7 @@ if (! empty($arrayfields['p.town']['checked']))
 // Country
 if (! empty($arrayfields['country.code_iso']['checked']))
 {
-	print '';
+	print '';
 	print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth100');
 	print '';
 }
@@ -632,7 +633,7 @@ if (! empty($arrayfields['p.thirdparty']['checked']))
 }
 if (! empty($arrayfields['p.priv']['checked']))
 {
-	print '';
+	print '';
    $selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate"));
    print $form->selectarray('search_priv', $selectarray, $search_priv, 1);
    print '';
@@ -697,17 +698,17 @@ if (! empty($arrayfields['p.skype']['checked']))               print_liste_field
 if (! empty($arrayfields['p.twitter']['checked']))             print_liste_field_titre($arrayfields['p.twitter']['label'], $_SERVER["PHP_SELF"], "p.twitter", $begin, $param, '', $sortfield, $sortorder);
 if (! empty($arrayfields['p.facebook']['checked']))            print_liste_field_titre($arrayfields['p.facebook']['label'], $_SERVER["PHP_SELF"], "p.facebook", $begin, $param, '', $sortfield, $sortorder);
 if (! empty($arrayfields['p.thirdparty']['checked']))          print_liste_field_titre($arrayfields['p.thirdparty']['label'], $_SERVER["PHP_SELF"], "s.nom", $begin, $param, '', $sortfield, $sortorder);
-if (! empty($arrayfields['p.priv']['checked']))                print_liste_field_titre($arrayfields['p.priv']['label'], $_SERVER["PHP_SELF"], "p.priv", $begin, $param, 'align="center"', $sortfield, $sortorder);
+if (! empty($arrayfields['p.priv']['checked']))                print_liste_field_titre($arrayfields['p.priv']['label'], $_SERVER["PHP_SELF"], "p.priv", $begin, $param, '', $sortfield, $sortorder, 'center ');
 // Extra fields
 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
 // Hook fields
 $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
 $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters);    // Note that $action and $object may have been modified by hook
 print $hookmanager->resPrint;
-if (! empty($arrayfields['p.datec']['checked']))      print_liste_field_titre($arrayfields['p.datec']['label'], $_SERVER["PHP_SELF"], "p.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
-if (! empty($arrayfields['p.tms']['checked']))        print_liste_field_titre($arrayfields['p.tms']['label'], $_SERVER["PHP_SELF"], "p.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
-if (! empty($arrayfields['p.statut']['checked']))     print_liste_field_titre($arrayfields['p.statut']['label'], $_SERVER["PHP_SELF"], "p.statut", "", $param, 'align="center"', $sortfield, $sortorder);
-if (! empty($arrayfields['p.import_key']['checked'])) print_liste_field_titre($arrayfields['p.import_key']['label'], $_SERVER["PHP_SELF"], "p.import_key", "", $param, 'align="center"', $sortfield, $sortorder);
+if (! empty($arrayfields['p.datec']['checked']))      print_liste_field_titre($arrayfields['p.datec']['label'], $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
+if (! empty($arrayfields['p.tms']['checked']))        print_liste_field_titre($arrayfields['p.tms']['label'], $_SERVER["PHP_SELF"], "p.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
+if (! empty($arrayfields['p.statut']['checked']))     print_liste_field_titre($arrayfields['p.statut']['label'], $_SERVER["PHP_SELF"], "p.statut", "", $param, '', $sortfield, $sortorder, 'center ');
+if (! empty($arrayfields['p.import_key']['checked'])) print_liste_field_titre($arrayfields['p.import_key']['label'], $_SERVER["PHP_SELF"], "p.import_key", "", $param, '', $sortfield, $sortorder, 'center ');
 print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
 print "\n";
 
@@ -787,7 +788,7 @@ while ($i < min($num, $limit))
 	// Country
 	if (! empty($arrayfields['country.code_iso']['checked']))
 	{
-		print '';
+		print '';
 		$tmparray=getCountry($obj->fk_pays, 'all');
 		print $tmparray['label'];
 		print '';
@@ -867,7 +868,7 @@ while ($i < min($num, $limit))
 	// Private/Public
 	if (! empty($arrayfields['p.priv']['checked']))
 	{
-		print ''.$contactstatic->LibPubPriv($obj->priv).'';
+		print ''.$contactstatic->LibPubPriv($obj->priv).'';
 		if (! $i) $totalarray['nbfield']++;
 	}
 
@@ -880,7 +881,7 @@ while ($i < min($num, $limit))
 	// Date creation
 	if (! empty($arrayfields['p.datec']['checked']))
 	{
-		print '';
+		print '';
 		print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
 		print '';
 		if (! $i) $totalarray['nbfield']++;
@@ -888,7 +889,7 @@ while ($i < min($num, $limit))
 	// Date modification
 	if (! empty($arrayfields['p.tms']['checked']))
 	{
-		print '';
+		print '';
 		print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
 		print '';
 		if (! $i) $totalarray['nbfield']++;
@@ -896,7 +897,7 @@ while ($i < min($num, $limit))
 	// Status
 	if (! empty($arrayfields['p.statut']['checked']))
 	{
-		print ''.$contactstatic->getLibStatut(3).'';
+		print ''.$contactstatic->getLibStatut(3).'';
 		if (! $i) $totalarray['nbfield']++;
 	}
 	if (! empty($arrayfields['p.import_key']['checked']))
@@ -908,7 +909,7 @@ while ($i < min($num, $limit))
 	}
 
 	// Action column
-	print '';
+	print '';
 	if ($massactionbutton || $massaction)   // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
 	{
 		$selected=0;
diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php
index eb44fac13ea..9615c040eb0 100644
--- a/htdocs/core/class/discount.class.php
+++ b/htdocs/core/class/discount.class.php
@@ -53,10 +53,13 @@ class DiscountAbsolute
 	 */
     public $fk_soc;
 
-    public $discount_type;			// 0 => customer discount, 1 => supplier discount
-    public $amount_ht;				//
+    public $discount_type;		// 0 => customer discount, 1 => supplier discount
+    public $amount_ht;			//
     public $amount_tva;			//
     public $amount_ttc;			//
+    public $multicurrency_amount_ht;
+    public $multicurrency_amount_tva;
+    public $multicurrency_amount_ttc;
     public $tva_tx;				// Vat rate
 
     /**
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 1eb83393652..647460e049c 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -669,7 +669,7 @@ class Form
 	 *
 	 *  @param	string	$selected       	Id or Code or Label of preselected country
 	 *  @param  string	$htmlname       	Name of html select object
-	 *  @param  string	$htmloption     	Options html on select object
+	 *  @param  string	$htmloption     	More html options on select object
 	 *  @param	integer	$maxlength			Max length for labels (0=no limit)
 	 *  @param	string	$morecss			More css class
 	 *  @param	string	$usecodeaskey		''=Use id as key (default), 'code3'=Use code on 3 alpha as key, 'code2"=Use code on 2 alpha as key
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 89933fcd499..1be84ddcd4f 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -2636,7 +2636,7 @@ function dol_print_ip($ip, $mode = 0)
  * Return the IP of remote user.
  * Take HTTP_X_FORWARDED_FOR (defined when using proxy)
  * Then HTTP_CLIENT_IP if defined (rare)
- * Then REMOTE_ADDR (not way to be modified by user but may be wrong if using proxy)
+ * Then REMOTE_ADDR (no way to be modified by user but may be wrong if user is using a proxy)
  *
  * @return	string		Ip of remote user.
  */
@@ -2979,7 +2979,9 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
 				'jabber','skype','twitter','facebook'
 			)
 		)) {
-			$fakey = $pictowithoutext;
+		    $fa='fa';
+		    if (! empty($conf->global->MAIN_USE_FONT_AWESOME_5)) $fa='fas';
+		    $fakey = $pictowithoutext;
 			$facolor = ''; $fasize = '';
 			$marginleftonlyshort = 2;
 			if ($pictowithoutext == 'switch_off') {
@@ -3074,6 +3076,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
 			elseif ($pictowithoutext == 'jabber') {
 				$fakey = 'fa-comment-o';
 			}
+			elseif ($pictowithoutext == 'skype') {
+			    $fakey = 'fa-'.$pictowithoutext;
+			    if (! empty($conf->global->MAIN_USE_FONT_AWESOME_5)) $fa = 'fab';
+			}
 			elseif ($pictowithoutext == 'split') {
 			    $fakey = 'fa-code-fork';
 			}
@@ -3095,8 +3101,6 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
             }
             $moreatt=trim($moreatt);
 
-			$fa='fa';
-			if (! empty($conf->global->MAIN_USE_FONT_AWESOME_5)) $fa='fas';
             $enabledisablehtml = '';
 			if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php
index 478c69d4fe5..162bee68128 100644
--- a/htdocs/core/lib/product.lib.php
+++ b/htdocs/core/lib/product.lib.php
@@ -472,8 +472,8 @@ function show_stats_for_company($product, $socid)
 function measuring_units_string($unit, $measuring_style = '')
 {
 	global $langs, $db;
-	require_once DOL_DOCUMENT_ROOT.'/core/class/cmeasuringunits.class.php';
-	$measuringUnits= new CMeasuringUnits($db);
+	require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php';
+	$measuringUnits= new CUnits($db);
 	$result = $measuringUnits->fetchAll('', '', 0, 0, array(
 			't.code' => $unit,
 			't.unit_type' => $measuring_style,
diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php
index 9c0da6c5b8d..4c6c420aa50 100644
--- a/htdocs/core/modules/modProduct.class.php
+++ b/htdocs/core/modules/modProduct.class.php
@@ -351,48 +351,48 @@ class modProduct extends DolibarrModules
         $this->import_convertvalue_array[$r] = array(
 				'p.weight_units' => array(
 						'rule' => 'fetchidfromcodeunits',
-						'classfile' => '/core/class/cmeasuringunits.class.php',
-						'class' => 'CMeasuringUnits',
+						'classfile' => '/core/class/cunits.class.php',
+						'class' => 'CUnits',
 						'method' => 'fetch',
 						'units' => 'weight',
 						'dict' => 'DictionaryMeasuringUnits'
 				),
 				'p.length_units' => array(
 						'rule' => 'fetchidfromcodeunits',
-						'classfile' => '/core/class/cmeasuringunits.class.php',
-						'class' => 'CMeasuringUnits',
+						'classfile' => '/core/class/cunits.class.php',
+						'class' => 'CUnits',
 						'method' => 'fetch',
 						'units' => 'size',
 						'dict' => 'DictionaryMeasuringUnits'
 				),
 				'p.width_units' => array(
 						'rule' => 'fetchidfromcodeunits',
-						'classfile' => '/core/class/cmeasuringunits.class.php',
-						'class' => 'CMeasuringUnits',
+						'classfile' => '/core/class/cunits.class.php',
+						'class' => 'CUnits',
 						'method' => 'fetch',
 						'units' => 'size',
 						'dict' => 'DictionaryMeasuringUnits'
 				),
 				'p.height_units' => array(
 						'rule' => 'fetchidfromcodeunits',
-						'classfile' => '/core/class/cmeasuringunits.class.php',
-						'class' => 'CMeasuringUnits',
+						'classfile' => '/core/class/cunits.class.php',
+						'class' => 'CUnits',
 						'method' => 'fetch',
 						'units' => 'size',
 						'dict' => 'DictionaryMeasuringUnits'
 				),
 				'p.surface_units' => array(
 						'rule' => 'fetchidfromcodeunits',
-						'classfile' => '/core/class/cmeasuringunits.class.php',
-						'class' => 'CMeasuringUnits',
+						'classfile' => '/core/class/cunits.class.php',
+						'class' => 'CUnits',
 						'method' => 'fetch',
 						'units' => 'surface',
 						'dict' => 'DictionaryMeasuringUnits'
 				),
 				'p.volume_units' => array(
 						'rule' => 'fetchidfromcodeunits',
-						'classfile' => '/core/class/cmeasuringunits.class.php',
-						'class' => 'CMeasuringUnits',
+						'classfile' => '/core/class/cunits.class.php',
+						'class' => 'CUnits',
 						'method' => 'fetch',
 						'units' => 'volume',
 						'dict' => 'DictionaryMeasuringUnits'
diff --git a/htdocs/core/modules/modTakePos.class.php b/htdocs/core/modules/modTakePos.class.php
index 286c34bf61c..ecbd3b9c8c4 100644
--- a/htdocs/core/modules/modTakePos.class.php
+++ b/htdocs/core/modules/modTakePos.class.php
@@ -86,7 +86,7 @@ class modTakePos extends DolibarrModules
 		                        	'tpl' => 0,                                      	// Set this to 1 if module overwrite template dir (core/tpl)
 									'barcode' => 0,                                  	// Set this to 1 if module has its own barcode directory (core/modules/barcode)
 									'models' => 0,                                   	// Set this to 1 if module has its own models directory (core/modules/xxx)
-									'hooks' => array('data'=>array('invoicecard'), 'entity'=>'0') 	// Set here all hooks context managed by module. To find available hook context, make a "grep -r '>initHooks(' *" on source code. You can also set hook context 'all'
+									'hooks' => array() 	                                // Set here all hooks context managed by module. To find available hook context, make a "grep -r '>initHooks(' *" on source code. You can also set hook context 'all'
 		                        );
 
 		// Data directories to create when module is enabled.
diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php
index f6f3bcd82b6..45c620db456 100644
--- a/htdocs/core/tpl/admin_extrafields_add.tpl.php
+++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php
@@ -203,7 +203,7 @@ $langs->load("modulebuilder");
 
 
 
-
">      +
">      ">
diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 6191a4f92b7..1ba83bc393f 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -266,7 +266,7 @@ else -
">      +
">      ">
diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index 7e05580f77d..ac7ee20139a 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -58,15 +58,15 @@ print ''.$langs->trans("LabelOrTranslationKey").''; print ''.$langs->trans("TranslationString").''; print ''.$langs->trans("AttributeCode").''; print ''.$langs->trans("Type").''; -print ''.$langs->trans("Size").''; +print ''.$langs->trans("Size").''; print ''.$langs->trans("ComputedFormula").''; -print ''.$langs->trans("Unique").''; -print ''.$langs->trans("Required").''; -print ''.$langs->trans("AlwaysEditable").''; -print ''.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).''; -print ''.$form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")).''; +print ''.$langs->trans("Unique").''; +print ''.$langs->trans("Required").''; +print ''.$langs->trans("AlwaysEditable").''; +print ''.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).''; +print ''.$form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")).''; if ($conf->multicompany->enabled) { - print ''.$langs->trans("Entities").''; + print ''.$langs->trans("Entities").''; } print ' '; print "\n"; @@ -86,15 +86,15 @@ if (is_array($extrafields->attributes[$elementtype]['type']) && count($extrafiel print "".$langs->trans($extrafields->attributes[$elementtype]['label'][$key])."\n"; print "".$key."\n"; print "".$type2label[$extrafields->attributes[$elementtype]['type'][$key]]."\n"; - print ''.$extrafields->attributes[$elementtype]['size'][$key]."\n"; + print ''.$extrafields->attributes[$elementtype]['size'][$key]."\n"; print ''.dol_trunc($extrafields->attributes[$elementtype]['computed'][$key], 20)."\n"; - print ''.yn($extrafields->attributes[$elementtype]['unique'][$key])."\n"; - print ''.yn($extrafields->attributes[$elementtype]['required'][$key])."\n"; - print ''.yn($extrafields->attributes[$elementtype]['alwayseditable'][$key])."\n"; - print ''.$extrafields->attributes[$elementtype]['list'][$key]."\n"; - print ''.yn($extrafields->attributes[$elementtype]['totalizable'][$key])."\n"; + print ''.yn($extrafields->attributes[$elementtype]['unique'][$key])."\n"; + print ''.yn($extrafields->attributes[$elementtype]['required'][$key])."\n"; + print ''.yn($extrafields->attributes[$elementtype]['alwayseditable'][$key])."\n"; + print ''.$extrafields->attributes[$elementtype]['list'][$key]."\n"; + print ''.yn($extrafields->attributes[$elementtype]['totalizable'][$key])."\n"; if (! empty($conf->multicompany->enabled)) { - print ''.($extrafields->attributes[$elementtype]['entityid'][$key]==0?$langs->trans("All"):$extrafields->attributes[$elementtype]['entitylabel'][$key]).''; + print ''.($extrafields->attributes[$elementtype]['entityid'][$key]==0?$langs->trans("All"):$extrafields->attributes[$elementtype]['entitylabel'][$key]).''; } print ''.img_edit().''; print "  ".img_delete()."\n"; diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index ea5b6e06e4d..dadfff3e62e 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -53,10 +53,10 @@ print '