Browse Source

Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/compta/bank/class/paymentvarious.class.php
	htdocs/compta/bank/various_payment/card.php
	htdocs/don/card.php
	htdocs/langs/en_US/main.lang
	htdocs/public/payment/newpayment.php
	test/phpunit/DateLibTzFranceTest.php
Laurent Destailleur 4 years ago
parent
commit
222012da37

+ 34 - 30
htdocs/adherents/card.php

@@ -1490,10 +1490,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
 		// Password
 		if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
 			print '<tr><td>'.$langs->trans("Password").'</td><td>'.preg_replace('/./i', '*', $object->pass);
-			if ($object->pass) print preg_replace('/./i', '*', $object->pass);
-			else {
-				if ($user->admin) print $langs->trans("Crypted").': '.$object->pass_indatabase_crypted;
-				else print $langs->trans("Hidden");
+			if ($object->pass) {
+				print preg_replace('/./i', '*', $object->pass);
+			} else {
+				if ($user->admin) {
+					print $langs->trans("Crypted").': '.$object->pass_indatabase_crypted;
+				} else {
+					print $langs->trans("Hidden");
+				}
 			}
 			if ((!empty($object->pass) || !empty($object->pass_crypted)) && empty($object->user_id)) {
 				$langs->load("errors");
@@ -1523,6 +1527,32 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
 		}
 		print '</td></tr>';
 
+		print '</table>';
+
+		print '</div>';
+
+		print '<div class="fichehalfright"><div class="ficheaddleft">';
+		print '<div class="underbanner clearboth"></div>';
+
+		print '<table class="border tableforfield tableforfield" width="100%">';
+
+		// Birth Date
+		print '<tr><td class="titlefield">'.$langs->trans("DateOfBirth").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
+
+		// Public
+		print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
+
+		// Categories
+		if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
+			print '<tr><td>'.$langs->trans("Categories").'</td>';
+			print '<td colspan="2">';
+			print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1);
+			print '</td></tr>';
+		}
+
+		// Other attributes
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
+
 		// Third party Dolibarr
 		if (!empty($conf->societe->enabled)) {
 			print '<tr><td>';
@@ -1571,29 +1601,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
 		}
 		print '</td></tr>';
 
-		print '</table>';
-
-		print '</div>';
-
-		print '<div class="fichehalfright"><div class="ficheaddleft">';
-		print '<div class="underbanner clearboth"></div>';
-
-		print '<table class="border tableforfield tableforfield" width="100%">';
-
-		// Birth Date
-		print '<tr><td class="titlefield">'.$langs->trans("DateOfBirth").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
-
-		// Public
-		print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
-
-		// Categories
-		if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
-			print '<tr><td>'.$langs->trans("Categories").'</td>';
-			print '<td colspan="2">';
-			print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1);
-			print '</td></tr>';
-		}
-
 		//VCard
 		print '<tr><td>';
 		print $langs->trans("VCard").'</td><td colspan="3">';
@@ -1603,9 +1610,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
 		print '</a>';
 		print '</td></tr>';
 
-		// Other attributes
-		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
-
 		print "</table>\n";
 
 		print "</div></div></div>\n";

+ 34 - 19
htdocs/adherents/subscription.php

@@ -471,6 +471,12 @@ if ($rowid > 0) {
 	print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
 	print '</tr>';
 
+	// Gender
+	print '<tr><td>'.$langs->trans("Gender").'</td>';
+	print '<td>';
+	if ($object->gender) print $langs->trans("Gender".$object->gender);
+	print '</td></tr>';
+
 	// Company
 	print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->company.'</td></tr>';
 
@@ -481,6 +487,15 @@ if ($rowid > 0) {
 	// Password
 	if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
 		print '<tr><td>'.$langs->trans("Password").'</td><td>'.preg_replace('/./i', '*', $object->pass);
+		if ($object->pass) {
+			print preg_replace('/./i', '*', $object->pass);
+		} else {
+			if ($user->admin) {
+				print $langs->trans("Crypted").': '.$object->pass_indatabase_crypted;
+			} else {
+				print $langs->trans("Hidden");
+			}
+		}
 		if ((!empty($object->pass) || !empty($object->pass_crypted)) && empty($object->user_id)) {
 			$langs->load("errors");
 			$htmltext = $langs->trans("WarningPasswordSetWithNoAccount");
@@ -489,6 +504,24 @@ if ($rowid > 0) {
 		print '</td></tr>';
 	}
 
+	// Date end subscription
+	print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">';
+	if ($object->datefin) {
+		print dol_print_date($object->datefin, 'day');
+		if ($object->hasDelay()) {
+			print " ".img_warning($langs->trans("Late"));
+		}
+	} else {
+		if (!$adht->subscription) {
+			print $langs->trans("SubscriptionNotRecorded");
+			if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
+		} else {
+			print $langs->trans("SubscriptionNotReceived");
+			if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
+		}
+	}
+	print '</td></tr>';
+
 	print '</table>';
 
 	print '</div>';
@@ -498,7 +531,7 @@ if ($rowid > 0) {
 	print '<table class="border tableforfield" width="100%">';
 
 	// Birthday
-	print '<tr><td class="titlefield">'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
+	print '<tr><td class="titlefield">'.$langs->trans("DateOfBirth").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
 
 	// Public
 	print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
@@ -515,24 +548,6 @@ if ($rowid > 0) {
 	$cols = 2;
 	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
 
-	// Date end subscription
-	print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">';
-	if ($object->datefin) {
-		print dol_print_date($object->datefin, 'day');
-		if ($object->hasDelay()) {
-			print " ".img_warning($langs->trans("Late"));
-		}
-	} else {
-		if (!$adht->subscription) {
-			print $langs->trans("SubscriptionNotRecorded");
-			if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
-		} else {
-			print $langs->trans("SubscriptionNotReceived");
-			if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
-		}
-	}
-	print '</td></tr>';
-
 	// Third party Dolibarr
 	if (!empty($conf->societe->enabled)) {
 		print '<tr><td>';

+ 1 - 1
htdocs/adherents/subscription/list.php

@@ -419,7 +419,7 @@ while ($i < min($num, $limit)) {
 
 	// Ref
 	if (!empty($arrayfields['d.ref']['checked'])) {
-		print '<td>'.$subscription->getNomUrl(1).'</td>';
+		print '<td class="nowraponall">'.$subscription->getNomUrl(1).'</td>';
 		if (!$i) $totalarray['nbfield']++;
 	}
 	// Type

+ 5 - 3
htdocs/compta/bank/class/paymentvarious.class.php

@@ -1,5 +1,5 @@
 <?php
-/* Copyright (C) 2017-2019  Alexandre Spangaro      <aspangaro@open-dsi.fr>
+/* Copyright (C) 2017-2021  Alexandre Spangaro      <aspangaro@open-dsi.fr>
  * Copyright (C) 2018-2020  Frédéric France         <frederic.france@netlogic.fr>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -70,6 +70,8 @@ class PaymentVarious extends CommonObject
 	public $amount;
 	public $type_payment;
 	public $num_payment;
+	public $chqemetteur;
+	public $chqbank;
 	public $category_transaction;
 
 	/**
@@ -504,8 +506,8 @@ class PaymentVarious extends CommonObject
 						$this->num_payment,
 						($this->category_transaction > 0 ? $this->category_transaction : 0),
 						$user,
-						'',
-						'',
+						$this->chqemetteur,
+						$this->chqbank,
 						'',
 						$this->datev
 					);

+ 57 - 7
htdocs/compta/bank/various_payment/card.php

@@ -49,7 +49,7 @@ $accountid = GETPOST("accountid") > 0 ? GETPOST("accountid", "int") : 0;
 $label = GETPOST("label", "alpha");
 $sens = GETPOST("sens", "int");
 $amount = price2num(GETPOST("amount", "alpha"));
-$paymenttype = GETPOST("paymenttype", "int");
+$paymenttype = GETPOST("paymenttype", "aZ09");
 $accountancy_code = GETPOST("accountancy_code", "alpha");
 $projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : GETPOST('fk_project', 'int'));
 if (!empty($conf->accounting->enabled) && !empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
@@ -116,8 +116,10 @@ if (empty($reshook)) {
 		$object->amount = price2num(GETPOST("amount", 'alpha'));
 		$object->label = GETPOST("label", 'restricthtml');
 		$object->note = GETPOST("note", 'restricthtml');
-		$object->type_payment = GETPOST("paymenttype", 'int') > 0 ? GETPOST("paymenttype", "int") : 0;
+		$object->type_payment = dol_getIdFromCode($db, GETPOST('paymenttype'), 'c_paiement', 'code', 'id', 1);
 		$object->num_payment = GETPOST("num_payment", 'alpha');
+		$object->chqemetteur = GETPOST("chqemetteur", 'alpha');
+		$object->chqbank = GETPOST("chqbank", 'alpha');
 		$object->fk_user_author = $user->id;
 		$object->category_transaction = GETPOST("category_transaction", 'alpha');
 
@@ -338,6 +340,43 @@ foreach ($bankcateg->fetchAll() as $bankcategory) {
 /*                                                                            */
 /* ************************************************************************** */
 if ($action == 'create') {
+	// Update fields properties in realtime
+	if (!empty($conf->use_javascript_ajax))
+	{
+		print "\n".'<script type="text/javascript" language="javascript">';
+		print '$(document).ready(function () {
+            			setPaymentType();
+            			$("#selectpaymenttype").change(function() {
+            				setPaymentType();
+            			});
+            			function setPaymentType()
+            			{
+            				var code = $("#selectpaymenttype option:selected").val();
+                            if (code == \'CHQ\' || code == \'VIR\')
+            				{
+            					if (code == \'CHQ\')
+			                    {
+			                        $(\'.fieldrequireddyn\').addClass(\'fieldrequired\');
+			                    }
+            					if ($(\'#fieldchqemetteur\').val() == \'\')
+            					{
+            						var emetteur = jQuery(\'#thirdpartylabel\').val();
+            						$(\'#fieldchqemetteur\').val(emetteur);
+            					}
+            				}
+            				else
+            				{
+            					$(\'.fieldrequireddyn\').removeClass(\'fieldrequired\');
+            					$(\'#fieldchqemetteur\').val(\'\');
+            				}
+            			}
+			';
+
+		print '	});'."\n";
+
+		print '	</script>'."\n";
+	}
+
 	print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 	print '<input type="hidden" name="token" value="'.newToken().'">';
 	print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
@@ -382,18 +421,29 @@ if ($action == 'create') {
 	}
 
 	// Type payment
-	print '<tr><td>';
-	print $form->editfieldkey('PaymentMode', 'selectpaymenttype', '', $object, 0, 'string', '', 1).'</td><td>';
-	$form->select_types_paiements($paymenttype, "paymenttype");
-	print '</td></tr>';
+	print '<tr><td><span class="fieldrequired">'.$langs->trans('PaymentMode').'</span></td><td>';
+	$form->select_types_paiements($paymenttype, 'paymenttype', '', 2);
+	print "</td>\n";
+	print '</tr>';
 
 	// Number
 	if (!empty($conf->banque->enabled)) {
-		// Number
 		print '<tr><td><label for="num_payment">'.$langs->trans('Numero');
 		print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
 		print '</label></td>';
 		print '<td><input name="num_payment" class="maxwidth150onsmartphone" id="num_payment" type="text" value="'.GETPOST("num_payment").'"></td></tr>'."\n";
+
+		// Check transmitter
+		print '<tr><td class="'.(GETPOST('paymenttype') == 'CHQ' ? 'fieldrequired ' : '').'fieldrequireddyn"><label for="fieldchqemetteur">'.$langs->trans('CheckTransmitter');
+		print ' <em>('.$langs->trans("ChequeMaker").')</em>';
+		print '</label></td>';
+		print '<td><input id="fieldchqemetteur" name="chqemetteur" size="30" type="text" value="'.GETPOST('chqemetteur', 'alphanohtml').'"></td></tr>';
+
+		// Bank name
+		print '<tr><td><label for="chqbank">'.$langs->trans('Bank');
+		print ' <em>('.$langs->trans("ChequeBank").')</em>';
+		print '</label></td>';
+		print '<td><input id="chqbank" name="chqbank" size="30" type="text" value="'.GETPOST('chqbank', 'alphanohtml').'"></td></tr>';
 	}
 
 	// Accountancy account

+ 7 - 2
htdocs/core/class/html.form.class.php

@@ -7634,7 +7634,7 @@ class Form
 				'invoice'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('invoice').')'),
 				'invoice_template'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToTemplateInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('invoice').')'),
 				'contrat'=>array('enabled'=>$conf->contrat->enabled, 'perms'=>1, 'label'=>'LinkToContract',
-								'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, '' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('contract').')'),
+								'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t, ".MAIN_DB_PREFIX."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('contract').')'),
 				'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('intervention').')'),
 				'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled, 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('supplier_proposal').')'),
 				'order_supplier'=>array('enabled'=>$conf->supplier_order->enabled, 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('commande_fournisseur').')'),
@@ -7700,7 +7700,12 @@ class Form
 						print '</td>';
 						print '<td class="center">'.$objp->ref.'</td>';
 						print '<td>'.$objp->ref_client.'</td>';
-						print '<td class="right">'.price($objp->total_ht).'</td>';
+						print '<td class="right">';
+						if ($possiblelink[label] == 'LinkToContract') {
+							$form = new Form($db);
+							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' ';
+						}
+						print price($objp->total_ht).'</td>';
 						print '<td>'.$objp->name.'</td>';
 						print '</tr>';
 						$i++;

+ 16 - 14
htdocs/don/admin/donation.php

@@ -307,24 +307,26 @@ print '<td width="60" class="center">'.$langs->trans("Value")."</td>\n";
 print '<td></td>';
 print "</tr>\n";
 
+if (!empty($conf->societe->enabled)) {
+	print '<tr class="oddeven">';
+	print '<td colspan="2">';
+	print $langs->trans("DonationUseThirdparties");
+	print '</td>';
+	print '<td class="center">';
+	if ($conf->use_javascript_ajax) {
+		print ajax_constantonoff('DONATION_USE_THIRDPARTIES');
+	} else {
+		$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
+		print $form->selectarray("DONATION_USE_THIRDPARTIES", $arrval, $conf->global->DONATION_USE_THIRDPARTIES);
+	}
+	print "</td>\n";
+	print "</tr>\n";
+}
+
 print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 print '<input type="hidden" name="token" value="'.newToken().'" />';
 print '<input type="hidden" name="action" value="set_DONATION_ACCOUNTINGACCOUNT" />';
 
-print '<tr class="oddeven">';
-print '<td colspan="2">';
-print $form->textwithpicto($langs->trans("DonationUserThirdparties"), $langs->trans("DonationUserThirdpartiesDesc"));
-print '</td>';
-print '<td class="center">';
-if ($conf->use_javascript_ajax) {
-	print ajax_constantonoff('DONATION_USE_THIRDPARTIES');
-} else {
-	$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
-	print $form->selectarray("DONATION_USE_THIRDPARTIES", $arrval, $conf->global->DONATION_USE_THIRDPARTIES);
-}
-print "</td>\n";
-print "</tr>\n";
-
 print '<tr class="oddeven">';
 print '<td>';
 $label = $langs->trans("AccountAccounting");

+ 28 - 13
htdocs/don/card.php

@@ -44,7 +44,7 @@ if (!empty($conf->projet->enabled)) {
 }
 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
 
-$langs->loadLangs(array("bills", "companies", "donations"));
+$langs->loadLangs(array("bills", "companies", "donations", "users"));
 
 $id = GETPOST('rowid') ?GETPOST('rowid', 'int') : GETPOST('id', 'int');
 $action = GETPOST('action', 'aZ09');
@@ -178,6 +178,11 @@ if ($action == 'add') {
 
 	$error = 0;
 
+	if (!empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES) && !(GETPOST("socid", 'int') > 0)) {
+		setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdParty")), null, 'errors');
+		$action = "create";
+		$error++;
+	}
 	if (empty($donation_date)) {
 		setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
 		$action = "create";
@@ -346,14 +351,15 @@ if ($action == 'create') {
 	print '<tbody>';
 
 	// Ref
-	print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$langs->trans('Draft').'</td></tr>';
+	print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans('Ref').'</td><td>'.$langs->trans('Draft').'</td></tr>';
 
 	// Company
 	if (!empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES)) {
 		// Thirdparty
-		print '<td>'.$langs->trans('Customer').'</td>';
-		if ($soc->id > 0 && !GETPOST('fac_rec', 'alpha')) {
-			print '<td colspan="2">';
+		if ($soc->id > 0)
+		{
+			print '<td class="fieldrequired">'.$langs->trans('ThirdParty').'</td>';
+			print '<td>';
 			print $soc->getNomUrl(1);
 			print '<input type="hidden" name="socid" value="'.$soc->id.'">';
 			// Outstanding Bill
@@ -370,7 +376,8 @@ if ($action == 'create') {
 			print ')';
 			print '</td>';
 		} else {
-			print '<td colspan="2">';
+			print '<td class="fieldrequired">'.$langs->trans('ThirdParty').'</td>';
+			print '<td>';
 			print $form->select_company($soc->id, 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
 			// Option to reload page to retrieve customer informations. Note, this clear other input
 			if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED)) {
@@ -386,7 +393,7 @@ if ($action == 'create') {
 				});
 				</script>';
 			}
-			print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddThirdParty").'</span><span class="fa fa-plus-circle valignmiddle paddingleft"></span></a>';
+			print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddThirdParty").'"></span></a>';
 			print '</td>';
 		}
 		print '</tr>'."\n";
@@ -540,11 +547,15 @@ if (!empty($id) && $action == 'edit') {
 	print "</td>";
 	print "</tr>\n";
 
-	if ($object->socid && !empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES)) {
+	if (!empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES)) {
 		$company = new Societe($db);
-		$result = $company->fetch($object->socid);
 
-		print '<tr><td>'.$langs->trans("LinkedToDolibarrThirdParty").'</td><td colspan="2">'.$company->getNomUrl(1).'</td></tr>';
+		print '<tr><td>'.$langs->trans("ThirdParty").'</td><td colspan="2">';
+		if ($object->socid > 0) {
+			$result = $company->fetch($object->socid);
+			print $company->getNomUrl(1);
+		}
+		print '</td></tr>';
 	} else {
 		$langs->load("companies");
 		print '<tr><td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="maxwidth200" value="'.dol_escape_htmltag($object->societe).'"></td></tr>';
@@ -700,11 +711,15 @@ if (!empty($id) && $action != 'edit') {
 	print yn($object->public);
 	print '</td></tr>';
 
-	if ($object->socid) {
+	if (!empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES)) {
 		$company = new Societe($db);
-		$result = $company->fetch($object->socid);
 
-		print '<tr><td>'.$langs->trans("LinkedToDolibarrThirdParty").'</td><td colspan="2">'.$company->getNomUrl(1).'</td></tr>';
+		print '<tr><td>'.$langs->trans("ThirdParty").'</td><td colspan="2">';
+		if ($object->socid > 0) {
+			$result = $company->fetch($object->socid);
+			print $company->getNomUrl(1);
+		}
+		print '</td></tr>';
 	} else {
 		print '<tr><td>'.$langs->trans("Company").'</td><td colspan="2">'.$object->societe.'</td></tr>';
 		print '<tr><td>'.$langs->trans("Lastname").'</td><td colspan="2">'.$object->lastname.'</td></tr>';

+ 1 - 1
htdocs/langs/en_US/dict.lang

@@ -21,7 +21,7 @@ CountryNL=Netherlands
 CountryHU=Hungary
 CountryRU=Russia
 CountrySE=Sweden
-CountryCI=Ivoiry Coast
+CountryCI=Ivory Coast
 CountrySN=Senegal
 CountryAR=Argentina
 CountryCM=Cameroon

+ 1 - 0
htdocs/langs/en_US/donations.lang

@@ -32,3 +32,4 @@ DONATION_ART238=Show article 238 from CGI if you are concerned
 DONATION_ART885=Show article 885 from CGI if you are concerned
 DonationPayment=Donation payment
 DonationValidated=Donation %s validated
+DonationUseThirdparties=Use an existing thirdparty as coordinates of donators

+ 1 - 0
htdocs/langs/en_US/main.lang

@@ -1125,3 +1125,4 @@ ConfirmAffectTag=Bulk Tag Affect
 ConfirmAffectTagQuestion=Are you sure you want to affect tags to the %s selected record(s)?
 CategTypeNotFound=No tag type found for type of records
 CopiedToClipboard=Copied to clipboard
+InformationOnLinkToContract=This amount is only the total of all the lines of the contract. No notion of time is taken into consideration.

+ 118 - 1
htdocs/public/payment/newpayment.php

@@ -871,7 +871,7 @@ if (!$source) {
 	}
 	print '</td><td class="CTableRow'.($var ? '1' : '2').'">';
 	if (empty($amount) || !is_numeric($amount)) {
-		print '<input type="hidden" name="amount" value="'.GETPOST("amount", 'int').'">';
+		print '<input type="hidden" name="amount" value="'.price2num(GETPOST("amount", 'alpha'), 'MT').'">';
 		print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount", "alpha"), 'MT').'">';
 	} else {
 		print '<b>'.price($amount).'</b>';
@@ -914,9 +914,13 @@ if ($source == 'order') {
 
 	if ($action != 'dopayment') { // Do not change amount if we just click on first dopayment
 		$amount = $order->total_ttc;
+<<<<<<< HEAD
 		if (GETPOST("amount", 'int')) {
 			$amount = GETPOST("amount", 'int');
 		}
+=======
+		if (GETPOST("amount", 'alpha')) $amount = GETPOST("amount", 'alpha');
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
 		$amount = price2num($amount);
 	}
 
@@ -965,8 +969,14 @@ if ($source == 'order') {
 		print ' ('.$langs->trans("ToComplete").')';
 	}
 	print '</td><td class="CTableRow'.($var ? '1' : '2').'">';
+<<<<<<< HEAD
 	if (empty($amount) || !is_numeric($amount)) {
 		print '<input type="hidden" name="amount" value="'.GETPOST("amount", 'int').'">';
+=======
+	if (empty($amount) || !is_numeric($amount))
+	{
+		print '<input type="hidden" name="amount" value="'.price2num(GETPOST("amount", 'alpha'), 'MT').'">';
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
 		print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount", "alpha"), 'MT').'">';
 	} else {
 		print '<b>'.price($amount).'</b>';
@@ -1038,9 +1048,13 @@ if ($source == 'invoice') {
 
 	if ($action != 'dopayment') { // Do not change amount if we just click on first dopayment
 		$amount = price2num($invoice->total_ttc - ($invoice->getSommePaiement() + $invoice->getSumCreditNotesUsed() + $invoice->getSumDepositsUsed()));
+<<<<<<< HEAD
 		if (GETPOST("amount", 'int')) {
 			$amount = GETPOST("amount", 'int');
 		}
+=======
+		if (GETPOST("amount", 'int')) $amount = GETPOST("amount", 'alpha');
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
 		$amount = price2num($amount);
 	}
 
@@ -1092,8 +1106,14 @@ if ($source == 'invoice') {
 	if ($object->type == $object::TYPE_CREDIT_NOTE) {
 		print '<b>'.$langs->trans("CreditNote").'</b>';
 	} elseif (empty($object->paye)) {
+<<<<<<< HEAD
 		if (empty($amount) || !is_numeric($amount)) {
 			print '<input type="hidden" name="amount" value="'.GETPOST("amount", 'int').'">';
+=======
+		if (empty($amount) || !is_numeric($amount))
+		{
+			print '<input type="hidden" name="amount" value="'.price2num(GETPOST("amount", 'alpha'), 'MT').'">';
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
 			print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount", "alpha"), 'MT').'">';
 		} else {
 			print '<b>'.price($amount).'</b>';
@@ -1204,9 +1224,13 @@ if ($source == 'contractline') {
 			}
 		}
 
+<<<<<<< HEAD
 		if (GETPOST("amount", 'int')) {
 			$amount = GETPOST("amount", 'int');
 		}
+=======
+		if (GETPOST("amount", 'alpha')) $amount = GETPOST("amount", 'alpha');
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
 		$amount = price2num($amount);
 	}
 
@@ -1296,8 +1320,14 @@ if ($source == 'contractline') {
 		print ' ('.$langs->trans("ToComplete").')';
 	}
 	print '</td><td class="CTableRow'.($var ? '1' : '2').'">';
+<<<<<<< HEAD
 	if (empty($amount) || !is_numeric($amount)) {
 		print '<input type="hidden" name="amount" value="'.GETPOST("amount", 'int').'">';
+=======
+	if (empty($amount) || !is_numeric($amount))
+	{
+		print '<input type="hidden" name="amount" value="'.price2num(GETPOST("amount", 'alpha'), 'MT').'">';
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
 		print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount", "alpha"), 'MT').'">';
 	} else {
 		print '<b>'.price($amount).'</b>';
@@ -1370,10 +1400,15 @@ if ($source == 'membersubscription') {
 
 	if ($action != 'dopayment') { // Do not change amount if we just click on first dopayment
 		$amount = $subscription->total_ttc;
+<<<<<<< HEAD
 		if (GETPOST("amount", 'int')) {
 			$amount = GETPOST("amount", 'int');
 		}
 		$amount = price2num($amount);
+=======
+		if (GETPOST("amount", 'alpha')) $amount = GETPOST("amount", 'alpha');
+		$amount = price2num($amount, 'MT');
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
 	}
 
 	if (GETPOST('fulltag', 'alpha')) {
@@ -1470,15 +1505,30 @@ if ($source == 'membersubscription') {
 	}
 	if (empty($amount) || !is_numeric($amount)) {
 		//$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
+<<<<<<< HEAD
 		if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) {
 			$valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
 		}
 		print '<input type="hidden" name="amount" value="'.GETPOST("amount", 'int').'">';
 		print '<input class="flat maxwidth75" type="text" name="newamount" value="'.$valtoshow.'">';
+=======
+		if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
+		print '<input type="hidden" name="amount" value="'.price2num(GETPOST("amount", 'alpha'), 'MT').'">';
+		if (empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) {
+			print '<input class="flat maxwidth75" type="text" name="newamountbis" value="'.$valtoshow.'" disabled>';
+			print '<input type="hidden" name="newamount" value="'.$valtoshow.'">';
+		} else {
+			print '<input class="flat maxwidth75" type="text" name="newamount" value="'.$valtoshow.'">';
+		}
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
 	} else {
 		$valtoshow = $amount;
 		if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) {
 			$valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
+<<<<<<< HEAD
+=======
+			$amount = $valtoshow;
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
 		}
 		print '<b>'.price($valtoshow).'</b>';
 		print '<input type="hidden" name="amount" value="'.$valtoshow.'">';
@@ -1548,9 +1598,13 @@ if ($source == 'donation') {
 
 	if ($action != 'dopayment') { // Do not change amount if we just click on first dopayment
 		$amount = $subscription->total_ttc;
+<<<<<<< HEAD
 		if (GETPOST("amount", 'int')) {
 			$amount = GETPOST("amount", 'int');
 		}
+=======
+		if (GETPOST("amount", 'alpha')) $amount = GETPOST("amount", 'alpha');
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
 		$amount = price2num($amount);
 	}
 
@@ -1624,15 +1678,24 @@ if ($source == 'donation') {
 	}
 	if (empty($amount) || !is_numeric($amount)) {
 		//$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
+<<<<<<< HEAD
 		if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) {
 			$valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
 		}
 		print '<input type="hidden" name="amount" value="'.GETPOST("amount", 'int').'">';
+=======
+		if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
+		print '<input type="hidden" name="amount" value="'.price2num(GETPOST("amount", 'alpha'), 'MT').'">';
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
 		print '<input class="flat maxwidth75" type="text" name="newamount" value="'.$valtoshow.'">';
 	} else {
 		$valtoshow = $amount;
 		if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) {
 			$valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
+<<<<<<< HEAD
+=======
+			$amount = $valtoshow;
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
 		}
 		print '<b>'.price($valtoshow).'</b>';
 		print '<input type="hidden" name="amount" value="'.$valtoshow.'">';
@@ -2118,6 +2181,7 @@ if (preg_match('/^dopayment/', $action)) {			// If we choosed/click on the payme
 				console.log("We click on buttontopay");
 				event.preventDefault();
 
+<<<<<<< HEAD
 				if (cardholderName.value == '')
 				{
 					console.log("Field Card holder is empty");
@@ -2176,6 +2240,59 @@ if (preg_match('/^dopayment/', $action)) {			// If we choosed/click on the payme
 				  });
 				}
 			});
+=======
+            	if (cardholderName.value == '')
+            	{
+    				console.log("Field Card holder is empty");
+    				var displayError = document.getElementById('card-errors');
+    				displayError.textContent = '<?php print dol_escape_js($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CardOwner"))); ?>';
+            	}
+            	else
+            	{
+            	  /* Disable button to pay and show hourglass cursor */
+    	      	  jQuery('#hourglasstopay').show();
+            	  jQuery('#buttontopay').hide();
+
+                  stripe.handleCardPayment(
+                    clientSecret, cardElement, {
+                    	payment_method_data: {
+        			        billing_details: {
+        			        	name: cardholderName.value
+        			        	<?php if (GETPOST('email', 'alpha') || (is_object($object) && is_object($object->thirdparty) && !empty($object->thirdparty->email))) { ?>, email: '<?php echo dol_escape_js(GETPOST('email', 'alpha') ? GETPOST('email', 'alpha') : $object->thirdparty->email); ?>'<?php } ?>
+        			        	<?php if (is_object($object) && is_object($object->thirdparty) && !empty($object->thirdparty->phone)) { ?>, phone: '<?php echo dol_escape_js($object->thirdparty->phone); ?>'<?php } ?>
+        			        	<?php if (is_object($object) && is_object($object->thirdparty)) { ?>, address: {
+        			        	    city: '<?php echo dol_escape_js($object->thirdparty->town); ?>',
+        			        	    <?php if ($object->thirdparty->country_code) { ?>country: '<?php echo dol_escape_js($object->thirdparty->country_code); ?>',<?php } ?>
+        			        	    line1: '<?php echo dol_escape_js(preg_replace('/\s\s+/', ' ', $object->thirdparty->address)); ?>',
+        			        	    postal_code: '<?php echo dol_escape_js($object->thirdparty->zip); ?>'
+        			        	    }
+        			        	<?php } ?>
+        			        }
+              			},
+              			save_payment_method: <?php if ($stripecu) { print 'true'; } else { print 'false'; } ?>	/* true when a customer was provided when creating payment intent. true ask to save the card */
+                    }
+                  ).then(function(result) {
+                  	  console.log(result);
+        	          if (result.error) {
+        	    	      console.log("Error on result of handleCardPayment");
+                	      jQuery('#buttontopay').show();
+                	      jQuery('#hourglasstopay').hide();
+        		          // Inform the user if there was an error
+        		          var errorElement = document.getElementById('card-errors');
+        		          errorElement.textContent = result.error.message;
+        		      } else {
+        		      	  // The payment has succeeded. Display a success message.
+        	    	      console.log("No error on result of handleCardPayment, so we submit the form");
+            			  // Submit the form
+            		      jQuery('#buttontopay').hide();
+            		      jQuery('#hourglasstopay').show();
+            		      // Send form (action=charge that will do nothing)
+            		      jQuery('#payment-form').submit();
+        		      }
+                  });
+                }
+            });
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
 
 				<?php
 			} else // Old method (not SCA ready)

+ 2 - 2
htdocs/societe/canvas/company/tpl/card_create.tpl.php

@@ -74,7 +74,7 @@ if (empty($conf) || !is_object($conf))
     <td width="25%">
 		<table class="nobordernopadding">
 			<tr>
-				<td><input type="text" name="code_client" size="16" value="<?php echo $this->control->tpl['customercode']; ?>" maxlength="15"></td>
+				<td><input type="text" name="code_client" size="16" value="<?php echo $this->control->tpl['customercode']; ?>" maxlength="24"></td>
 				<td><?php echo $this->control->tpl['help_customercode']; ?></td>
 			</tr>
 		</table>
@@ -89,7 +89,7 @@ if (empty($conf) || !is_object($conf))
     <td>
     	<table class="nobordernopadding">
     		<tr>
-    			<td><input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="15"></td>
+    			<td><input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="24"></td>
     			<td><?php echo $this->control->tpl['help_suppliercode']; ?></td>
     		</tr>
     	</table>

+ 2 - 2
htdocs/societe/canvas/company/tpl/card_edit.tpl.php

@@ -75,7 +75,7 @@ $contact = $GLOBALS['objcanvas']->control->object;
 			<tr>
 				<td>
 				<?php if ($this->control->tpl['ismodifiable_customercode']) { ?>
-				<input type="text" name="code_client" size="16" value="<?php echo $this->control->tpl['customercode']; ?>" maxlength="15">
+				<input type="text" name="code_client" size="16" value="<?php echo $this->control->tpl['customercode']; ?>" maxlength="24">
 				<?php } else { ?>
 					<?php echo $this->control->tpl['customercode']; ?>
 				<input type="hidden" name="code_client" value="<?php echo $this->control->tpl['customercode']; ?>">
@@ -96,7 +96,7 @@ $contact = $GLOBALS['objcanvas']->control->object;
 			<tr>
 				<td>
 				<?php if ($this->control->tpl['ismodifiable_suppliercode']) { ?>
-				<input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="15">
+				<input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="24">
 				<?php } else { ?>
 					<?php echo $this->control->tpl['suppliercode']; ?>
 				<input type="hidden" name="code_fournisseur" value="<?php echo $this->control->tpl['suppliercode']; ?>">

+ 2 - 2
htdocs/societe/canvas/individual/tpl/card_create.tpl.php

@@ -84,7 +84,7 @@ if (empty($conf) || !is_object($conf))
     <td width="25%">
 		<table class="nobordernopadding">
 			<tr>
-				<td><input type="text" name="code_client" size="16" value="<?php echo $this->control->tpl['customercode']; ?>" maxlength="15"></td>
+				<td><input type="text" name="code_client" size="16" value="<?php echo $this->control->tpl['customercode']; ?>" maxlength="24"></td>
 				<td><?php echo $this->control->tpl['help_customercode']; ?></td>
 			</tr>
 		</table>
@@ -99,7 +99,7 @@ if (empty($conf) || !is_object($conf))
     <td>
     	<table class="nobordernopadding">
     		<tr>
-    			<td><input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="15"></td>
+    			<td><input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="24"></td>
     			<td><?php echo $this->control->tpl['help_suppliercode']; ?></td>
     		</tr>
     	</table>

+ 2 - 2
htdocs/societe/canvas/individual/tpl/card_edit.tpl.php

@@ -73,7 +73,7 @@ if (empty($conf) || !is_object($conf))
 			<tr>
 				<td>
 				<?php if ($this->control->tpl['ismodifiable_customercode']) { ?>
-				<input type="text" name="code_client" size="16" value="<?php echo $this->control->tpl['customercode']; ?>" maxlength="15">
+				<input type="text" name="code_client" size="16" value="<?php echo $this->control->tpl['customercode']; ?>" maxlength="24">
 				<?php } else { ?>
 					<?php echo $this->control->tpl['customercode']; ?>
 				<input type="hidden" name="code_client" value="<?php echo $this->control->tpl['customercode']; ?>">
@@ -94,7 +94,7 @@ if (empty($conf) || !is_object($conf))
 			<tr>
 				<td>
 				<?php if ($this->control->tpl['ismodifiable_suppliercode']) { ?>
-				<input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="15">
+				<input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="24">
 				<?php } else { ?>
 					<?php echo $this->control->tpl['suppliercode']; ?>
 				<input type="hidden" name="code_fournisseur" value="<?php echo $this->control->tpl['suppliercode']; ?>">

+ 6 - 6
htdocs/societe/card.php

@@ -1289,7 +1289,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
 		print '<table class="nobordernopadding"><tr><td>';
 		$tmpcode = $object->code_client;
 		if (empty($tmpcode) && !empty($modCodeClient->code_auto)) $tmpcode = $modCodeClient->getNextValue($object, 0);
-		print '<input type="text" name="customer_code" id="customer_code" class="maxwidthonsmartphone" value="'.dol_escape_htmltag($tmpcode).'" maxlength="15">';
+		print '<input type="text" name="customer_code" id="customer_code" class="maxwidthonsmartphone" value="'.dol_escape_htmltag($tmpcode).'" maxlength="24">';
 		print '</td><td>';
 		$s = $modCodeClient->getToolTip($langs, $object, 0);
 		print $form->textwithpicto('', $s, 1);
@@ -1321,7 +1321,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
 				print '<table class="nobordernopadding"><tr><td>';
 				$tmpcode = $object->code_fournisseur;
 				if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) $tmpcode = $modCodeFournisseur->getNextValue($object, 1);
-				print '<input type="text" name="supplier_code" id="supplier_code" class="maxwidthonsmartphone" value="'.dol_escape_htmltag($tmpcode).'" maxlength="15">';
+				print '<input type="text" name="supplier_code" id="supplier_code" class="maxwidthonsmartphone" value="'.dol_escape_htmltag($tmpcode).'" maxlength="24">';
 				print '</td><td>';
 				$s = $modCodeFournisseur->getToolTip($langs, $object, 1);
 				print $form->textwithpicto('', $s, 1);
@@ -1942,10 +1942,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
 				$tmpcode = $object->code_client;
 				if (empty($tmpcode) && !empty($object->oldcopy->code_client)) $tmpcode = $object->oldcopy->code_client; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value.
 				if (empty($tmpcode) && !empty($modCodeClient->code_auto)) $tmpcode = $modCodeClient->getNextValue($object, 0);
-				print '<input type="text" name="customer_code" id="customer_code" size="16" value="'.dol_escape_htmltag($tmpcode).'" maxlength="15">';
+				print '<input type="text" name="customer_code" id="customer_code" size="16" value="'.dol_escape_htmltag($tmpcode).'" maxlength="24">';
 			} elseif ($object->codeclient_modifiable())
 			{
-				print '<input type="text" name="customer_code" id="customer_code" size="16" value="'.dol_escape_htmltag($object->code_client).'" maxlength="15">';
+				print '<input type="text" name="customer_code" id="customer_code" size="16" value="'.dol_escape_htmltag($object->code_client).'" maxlength="24">';
 			} else {
 				print $object->code_client;
 				print '<input type="hidden" name="customer_code" value="'.dol_escape_htmltag($object->code_client).'">';
@@ -1980,10 +1980,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
 					$tmpcode = $object->code_fournisseur;
 					if (empty($tmpcode) && !empty($object->oldcopy->code_fournisseur)) $tmpcode = $object->oldcopy->code_fournisseur; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value.
 					if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) $tmpcode = $modCodeFournisseur->getNextValue($object, 1);
-					print '<input type="text" name="supplier_code" id="supplier_code" size="16" value="'.dol_escape_htmltag($tmpcode).'" maxlength="15">';
+					print '<input type="text" name="supplier_code" id="supplier_code" size="16" value="'.dol_escape_htmltag($tmpcode).'" maxlength="24">';
 				} elseif ($object->codefournisseur_modifiable())
 				{
-					print '<input type="text" name="supplier_code" id="supplier_code" size="16" value="'.dol_escape_htmltag($object->code_fournisseur).'" maxlength="15">';
+					print '<input type="text" name="supplier_code" id="supplier_code" size="16" value="'.dol_escape_htmltag($object->code_fournisseur).'" maxlength="24">';
 				} else {
 					print $object->code_fournisseur;
 					print '<input type="hidden" name="supplier_code" value="'.$object->code_fournisseur.'">';

+ 0 - 1
test/phpunit/DateLibTest.php

@@ -334,7 +334,6 @@ class DateLibTest extends PHPUnit\Framework\TestCase
 		print __METHOD__." result=".$result."\n";
 		$this->assertSame('1 '.strtolower(dol_substr($langs->trans("Day"), 0, 1).'.'), $result);
 
-
 		return $result;
 	}
 

+ 3 - 3
test/phpunit/DateLibTzFranceTest.php

@@ -82,9 +82,9 @@ class DateLibTzFranceTest extends PHPUnit\Framework\TestCase
 	{
 		global $conf,$user,$langs,$db;
 
-		if (getServerTimeZoneString() != 'Europe/Paris') {
-			print "\n".__METHOD__." This PHPUnit test can be launched manually only onto a server with PHP timezone set to TZ+1 Europe/Paris, not a TZ=".getServerTimeZoneString().".\n"; die();
-		}
+    	if (getServerTimeZoneString() != 'Europe/Paris' && getServerTimeZoneString() != 'Europe/Berlin') {
+    		print "\n".__METHOD__." This PHPUnit test can be launched manually only onto a server with PHP timezone set to TZ=Europe/Paris, not a TZ=".getServerTimeZoneString().".\n"; die();
+    	}
 
 		$db->begin();	// This is to have all actions inside a transaction even if test launched without suite.