
########## accountancy/admin/index.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/accountancy/admin/index.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/accountancy/admin/index.php	2025-06-27 11:43:38.979398000 +0000
@@ -433,7 +433,7 @@
 
 // Case of the parameter ACCOUNTING_MODE
 
-if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1) {
+if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
 	print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
 	print '<input type="hidden" name="token" value="'.newToken().'">';
 	print '<input type="hidden" name="action" value="updatemode">';
@@ -446,7 +446,7 @@
 	print '<tr class="oddeven"><td class="nowraponall"><input type="radio" id="accounting_mode_1" name="accounting_mode" value="CREANCES-DETTES"'.($accounting_mode != 'RECETTES-DEPENSES' ? ' checked' : '').'><label for="accounting_mode_1"> '.$langs->trans('OptionModeVirtual').'</label> ('.$langs->trans('Default').')</td>';
 	print '<td><span class="opacitymedium">'.nl2br($langs->trans('ACCOUNTING_USE_NON_TREASURY_Desc')).'</span>';
 	print "</td></tr>\n";
-	print '<tr class="oddeven"><td class="nowraponall"><input type="radio" id="accounting_mode_2" name="accounting_mode" value="RECETTES-DEPENSES"'.($accounting_mode == 'RECETTES-DEPENSES' ? ' checked' : '').'><label for="accounting_mode_2"> '.$langs->trans('OptionModeTrue').'</label></td>';
+	print '<tr class="oddeven"><td class="nowraponall"><input type="radio" id="accounting_mode_2" name="accounting_mode" value="RECETTES-DEPENSES"'.($accounting_mode != 'CREANCES-DETTES' ? ' checked' : '').'><label for="accounting_mode_2"> '.$langs->trans('OptionModeTrue').'</label></td>';
 	print '<td><span class="opacitymedium">'.nl2br($langs->trans('ACCOUNTING_USE_TREASURY_Desc'))."</span>";
 	print "</td></tr>\n";
 
@@ -579,16 +579,18 @@
 
 print '<div class="center"><input type="submit" class="button reposition" value="'.dol_escape_htmltag($langs->trans('Save')).'" name="button"></div>';
 
-// Show numbering options
-print '<br><br>';
+print '<br>';
 
 // Accountancy Numbering model
 $dirmodels = array_merge(array('/'), $conf->modules_parts['models']);
 
+print load_fiche_titre($langs->trans("BookkeepingNumberingModules"), '', '');
+
 print '<div class="div-table-responsive-no-min">';
 print '<table class="noborder centpercent">';
 print '<tr class="liste_titre">';
-print '<td colspan="2">'.$langs->trans("BookkeepingNumberingModules").'</td>';
+print '<td>'.$langs->trans("Name").'</td>';
+print '<td></td>';
 print '<td class="nowrap">'.$langs->trans("Example").'</td>';
 print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
 print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';

########## accountancy/bookkeeping/balance.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/accountancy/bookkeeping/balance.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/accountancy/bookkeeping/balance.php	2025-06-27 11:43:38.909903000 +0000
@@ -344,15 +344,7 @@
 	$newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint;
 
 	if (empty($reshook)) {
-		if ($type == 'sub') {
-			$newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly'));
-			$newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?type=sub' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
-		} else {
-			$newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
-			$newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?type=sub' . $url_param, '', 1, array('morecss' => 'marginleftonly'));
-		}
-
-		$newcardbutton .= dolGetButtonTitle($langs->trans('ExportToCsv'), '', 'fa fa-file-csv paddingleft', $_SERVER['PHP_SELF'], 'exportcsvbutton', 1, array('morecss' => 'marginleftonly'));
+		$newcardbutton = '<input type="button" id="exportcsvbutton" name="exportcsvbutton" class="butAction" value="'.$langs->trans("Export").' (' . getDolGlobalString('ACCOUNTING_EXPORT_FORMAT').')" />';
 
 		print '<script type="text/javascript">
 		jQuery(document).ready(function() {
@@ -368,6 +360,14 @@
 		});
 		</script>';
 
+		if ($type == 'sub') {
+			$newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly'));
+			$newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?type=sub' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
+		} else {
+			$newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
+			$newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?type=sub' . $url_param, '', 1, array('morecss' => 'marginleftonly'));
+		}
+
 		$newcardbutton .= dolGetButtonTitle($langs->trans('ExportToPdf'), '', 'fa fa-file-pdf paddingleft', $_SERVER['PHP_SELF'], 'exportpdfbutton', 1, array('morecss' => 'marginleftonly'));
 
 		$newcardbutton .= dolGetButtonTitleSeparator();

########## accountancy/class/bookkeeping.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/accountancy/class/bookkeeping.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/accountancy/class/bookkeeping.class.php	2025-06-27 11:43:38.940175000 +0000
@@ -243,7 +243,6 @@
 		}
 		if (isset($this->doc_ref)) {
 			$this->doc_ref = trim($this->doc_ref);
-			$this->doc_ref = dol_trunc($this->doc_ref, 300); // We limit to 300 chars to avoid problems with too long ref in DB
 		}
 		if (isset($this->fk_doc)) {
 			$this->fk_doc = (int) $this->fk_doc;
@@ -1193,7 +1192,7 @@
 
 		// Manage filter
 		if (is_array($filter)) {	// deprecated, use $filter = USF syntax
-			dol_syslog("You are using a deprecated use of fetchAll. filter parameter must be an USF string now.", LOG_WARNING);
+			dol_syslog("You are using a deprecated use of fetchAll. filter parameter mus be an USF string now.", LOG_WARNING);
 			$sqlwhere = array();
 			if (count($filter) > 0) {
 				foreach ($filter as $key => $value) {
@@ -3178,7 +3177,7 @@
 								$error++;
 							}
 							$objtmp = $this->db->fetch_object($result);
-							$bookkeeping->subledger_label = $objtmp->subledger_label ?? null; // latest subledger label used
+							$bookkeeping->subledger_label = $objtmp->subledger_label; // latest subledger label used
 						} else {
 							$bookkeeping->subledger_account = null;
 							$bookkeeping->subledger_label = null;
@@ -3904,9 +3903,4 @@
 	 * @var int|string
 	 */
 	public $date_lim_reglement;
-
-	/**
-	 * @var string
-	 */
-	public $code_tiers;
 }

########## accountancy/journal/bankjournal.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/accountancy/journal/bankjournal.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/accountancy/journal/bankjournal.php	2025-06-27 11:43:38.996125000 +0000
@@ -5,7 +5,7 @@
  * Copyright (C) 2012		Regis Houssin				<regis.houssin@inodbox.com>
  * Copyright (C) 2013		Christophe Battarel			<christophe.battarel@altairis.fr>
  * Copyright (C) 2013-2022	Open-DSI					<support@open-dsi.fr>
- * Copyright (C) 2013-2025	Alexandre Spangaro			<alexandre@inovea-conseil.com>
+ * Copyright (C) 2013-2024	Alexandre Spangaro			<alexandre@inovea-conseil.com>
  * Copyright (C) 2013-2014	Florian Henry				<florian.henry@open-concept.pro>
  * Copyright (C) 2013-2014	Olivier Geffroy				<jeff@jeffinfo.com>
  * Copyright (C) 2017-2025  Frédéric France				<frederic.france@free.fr>
@@ -673,7 +673,7 @@
 	$accountingaccountpayment->fetch(0, getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT'), true);
 
 	$accountingaccountexpensereport = new AccountingAccount($db);
-	$accountingaccountexpensereport->fetch(0, getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT'), true);
+	$accountingaccountexpensereport->fetch(0, $conf->global->ACCOUNTING_ACCOUNT_EXPENSEREPORT, true);
 
 	$accountingaccountsuspense = new AccountingAccount($db);
 	$accountingaccountsuspense->fetch(0, getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE'), true);

########## accountancy/journal/treasuryjournal.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/accountancy/journal/treasuryjournal.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/accountancy/journal/treasuryjournal.php	2025-06-27 11:43:38.993875000 +0000
@@ -1402,7 +1402,7 @@
 		print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
 	}
 
-	print '<br><div class="tabsAction tabsActionNoBottom centerimp">';
+	print '<div class="tabsAction tabsActionNoBottom">';
 
 	if (getDolGlobalString('ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL')) {
 		print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
@@ -1441,6 +1441,7 @@
 	print '<div class="div-table-responsive">';
 	print '<table class="noborder centpercent">';
 	print '<tr class="liste_titre">';
+	print "<td></td>";
 	print "<td>".$langs->trans("Date")."</td>";
 	print "<td>".$langs->trans("Piece").' ('.$langs->trans("ObjectsRef").')</td>';
 	print "<td>".$langs->trans("AccountAccounting")."</td>";

########## adherents/class/adherent.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/adherents/class/adherent.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/adherents/class/adherent.class.php	2025-06-27 11:43:39.120796000 +0000
@@ -70,12 +70,12 @@
 	public $mesgs;
 
 	/**
-	 * @var ?string login of member
+	 * @var string login of member
 	 */
 	public $login;
 
 	/**
-	 * @var ?string Clear password in memory
+	 * @var string Clear password in memory
 	 */
 	public $pass;
 
@@ -186,7 +186,7 @@
 	public $default_lang;
 
 	/**
-	 * @var ?string photo of member
+	 * @var string photo of member
 	 */
 	public $photo;
 
@@ -225,7 +225,7 @@
 	public $typeid;
 
 	/**
-	 * @var ?string label type member
+	 * @var string label type member
 	 */
 	public $type;
 
@@ -536,10 +536,6 @@
 		global $langs;
 
 		$birthday = dol_print_date($this->birth, 'day');
-		$photo = isset($this->photo) ? $this->photo : '';
-		$login = isset($this->login) ? $this->login : '';
-		$type = isset($this->type) ? $this->type : '';
-		$pass = isset($this->pass) ? $this->pass : '';
 
 		$msgishtml = 0;
 		if (dol_textishtml($text, 1)) {
@@ -564,11 +560,11 @@
 		$infos .= $langs->transnoentities("PhonePerso").": ".$this->phone_perso."\n";
 		$infos .= $langs->transnoentities("PhoneMobile").": ".$this->phone_mobile."\n";
 		if (!getDolGlobalString('ADHERENT_LOGIN_NOT_REQUIRED')) {
-			$infos .= $langs->transnoentities("Login").": ".$login."\n";
-			$infos .= $langs->transnoentities("Password").": ".$pass."\n";
+			$infos .= $langs->transnoentities("Login").": ".$this->login."\n";
+			$infos .= $langs->transnoentities("Password").": ".$this->pass."\n";
 		}
 		$infos .= $langs->transnoentities("Birthday").": ".$birthday."\n";
-		$infos .= $langs->transnoentities("Photo").": ".$photo."\n";
+		$infos .= $langs->transnoentities("Photo").": ".$this->photo."\n";
 		$infos .= $langs->transnoentities("Public").": ".yn($this->public);
 
 		// Substitutions
@@ -587,13 +583,13 @@
 			'__COUNTRY__' => $msgishtml ? dol_htmlentitiesbr($this->country) : ($this->country ? $this->country : ''),
 			'__EMAIL__' => $msgishtml ? dol_htmlentitiesbr((string) $this->email) : ($this->email ? $this->email : ''),
 			'__BIRTH__' => $msgishtml ? dol_htmlentitiesbr($birthday) : ($birthday ? $birthday : ''),
-			'__PHOTO__' => $msgishtml ? dol_htmlentitiesbr($photo) : $photo,
-			'__LOGIN__' => $msgishtml ? dol_htmlentitiesbr($login) : $login,
-			'__PASSWORD__' => $msgishtml ? dol_htmlentitiesbr($pass) : $pass,
+			'__PHOTO__' => $msgishtml ? dol_htmlentitiesbr($this->photo) : ($this->photo ? $this->photo : ''),
+			'__LOGIN__' => $msgishtml ? dol_htmlentitiesbr($this->login) : ($this->login ? $this->login : ''),
+			'__PASSWORD__' => $msgishtml ? dol_htmlentitiesbr($this->pass) : ($this->pass ? $this->pass : ''),
 			'__PHONE__' => $msgishtml ? dol_htmlentitiesbr($this->phone) : ($this->phone ? $this->phone : ''),
 			'__PHONEPRO__' => $msgishtml ? dol_htmlentitiesbr($this->phone_perso) : ($this->phone_perso ? $this->phone_perso : ''),
 			'__PHONEMOBILE__' => $msgishtml ? dol_htmlentitiesbr($this->phone_mobile) : ($this->phone_mobile ? $this->phone_mobile : ''),
-			'__TYPE__' => $msgishtml ? dol_htmlentitiesbr($type) : $type,
+			'__TYPE__' => $msgishtml ? dol_htmlentitiesbr($this->type) : ($this->type ? $this->type : '')
 		);
 
 		complete_substitutions_array($substitutionarray, $langs, $this);
@@ -960,6 +956,9 @@
 					$result = $luser->fetch($this->user_id);
 
 					if ($result >= 0) {
+						//var_dump($this->user_login);exit;
+						//var_dump($this->login);exit;
+
 						// If option ADHERENT_LOGIN_NOT_REQUIRED is on, there is no login of member, so we do not overwrite user login to keep existing one.
 						if (!getDolGlobalString('ADHERENT_LOGIN_NOT_REQUIRED')) {
 							$luser->login = $this->login;
@@ -970,7 +969,7 @@
 						$luser->firstname = $this->firstname;
 						$luser->lastname = $this->lastname;
 						$luser->gender = $this->gender;
-						$luser->pass = isset($this->pass) ? $this->pass : '';
+						$luser->pass = $this->pass;
 						//$luser->socid=$this->fk_soc;		// We do not enable this. This may transform a user into an external user.
 
 						$luser->birth = $this->birth;
@@ -1777,7 +1776,7 @@
 	 *	@param	string		$emetteur_banque		Name of bank of cheque
 	 *  @param	int			$autocreatethirdparty	Auto create new thirdparty if member not yet linked to a thirdparty and we request an option that generate invoice.
 	 *  @param  string      $ext_payment_id         External id of payment (for example Stripe charge id)
-	 *  @param  string      $ext_payment_site       Name of external paymentmode (for example 'StripeLive', 'StripeTest', 'paypal', ...)
+	 *  @param  string      $ext_payment_site       Name of external paymentmode (for example 'stripe')
 	 *	@return int									Return integer <0 if KO, >0 if OK
 	 */
 	public function subscriptionComplementaryActions($subscriptionid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom = '', $emetteur_banque = '', $autocreatethirdparty = 0, $ext_payment_id = '', $ext_payment_site = '')
@@ -2464,7 +2463,7 @@
 				($morecss ? ' usertext'.$morecss : '').'">';
 			}
 			if ($mode == 'login') {
-				$result .= dol_trunc(isset($this->login) ? $this->login : '', $maxlen);
+				$result .= dol_trunc($this->login, $maxlen);
 			} elseif ($mode == 'ref') {
 				$result .= $this->ref;
 			} else {
@@ -2507,7 +2506,7 @@
 	 */
 	public function getLibStatut($mode = 0)
 	{
-		return $this->LibStatut($this->status, $this->need_subscription, $this->datefin, $mode);
+		return $this->LibStatut($this->statut, $this->need_subscription, $this->datefin, $mode);
 	}
 
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps

########## adherents/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/adherents/list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/adherents/list.php	2025-06-27 11:43:39.129841000 +0000
@@ -1292,14 +1292,14 @@
 		}
 		// Technical ID
 		if (!empty($arrayfields['d.rowid']['checked'])) {
-			print '<td class="center" data-key="id">'.dolPrintHTML($obj->rowid).'</td>';
+			print '<td class="center" data-key="id">'.$obj->rowid.'</td>';
 			if (!$i) {
 				$totalarray['nbfield']++;
 			}
 		}
 		// Ref
 		if (!empty($arrayfields['d.ref']['checked'])) {
-			print '<td class="tdoverflowmax150">';
+			print "<td>";
 			print $memberstatic->getNomUrl(-1, 0, 'card', 'ref', '', -1, 0, 1);
 			print "</td>\n";
 			if (!$i) {
@@ -1309,7 +1309,7 @@
 		// Title/Civility
 		if (!empty($arrayfields['d.civility']['checked'])) {
 			print "<td>";
-			print dolPrintHTML($obj->civility);
+			print dol_escape_htmltag($obj->civility);
 			print "</td>\n";
 			if (!$i) {
 				$totalarray['nbfield']++;
@@ -1348,13 +1348,13 @@
 		}
 		// Company
 		if (!empty($arrayfields['d.company']['checked'])) {
-			print '<td class="tdoverflowmax125" title="'.dolPrintHTMLForAttribute((string) $companyname).'">';
+			print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag((string) $companyname).'">';
 			print $companynametoshow;
 			print "</td>\n";
 		}
 		// Login
 		if (!empty($arrayfields['d.login']['checked'])) {
-			print '<td class="tdoverflowmax125" title="'.dolPrintHTMLForAttribute($obj->login).'">'.dolPrintHTML($obj->login)."</td>\n";
+			print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->login).'">'.$obj->login."</td>\n";
 			if (!$i) {
 				$totalarray['nbfield']++;
 			}
@@ -1382,7 +1382,7 @@
 		// Address
 		if (!empty($arrayfields['d.address']['checked'])) {
 			print '<td class="nocellnopadd tdoverflowmax200" title="'.dol_escape_htmltag($obj->address).'">';
-			print dolPrintHTML($obj->address);
+			print dol_escape_htmltag($obj->address);
 			print '</td>';
 			if (!$i) {
 				$totalarray['nbfield']++;
@@ -1391,7 +1391,7 @@
 		// Zip
 		if (!empty($arrayfields['d.zip']['checked'])) {
 			print '<td class="nocellnopadd">';
-			print dolPrintHTML($obj->zip);
+			print dol_escape_htmltag($obj->zip);
 			print '</td>';
 			if (!$i) {
 				$totalarray['nbfield']++;
@@ -1400,7 +1400,7 @@
 		// Town
 		if (!empty($arrayfields['d.town']['checked'])) {
 			print '<td class="nocellnopadd">';
-			print dolPrintHTML($obj->town);
+			print dol_escape_htmltag($obj->town);
 			print '</td>';
 			if (!$i) {
 				$totalarray['nbfield']++;
@@ -1409,7 +1409,7 @@
 		// State / County / Departement
 		if (!empty($arrayfields['state.nom']['checked'])) {
 			print "<td>";
-			print dolPrintHTML($obj->state_name);
+			print dol_escape_htmltag($obj->state_name);
 			print "</td>\n";
 			if (!$i) {
 				$totalarray['nbfield']++;
@@ -1418,8 +1418,8 @@
 		// Country
 		if (!empty($arrayfields['country.code_iso']['checked'])) {
 			$tmparray = getCountry($obj->country, 'all');
-			print '<td class="center tdoverflowmax100" title="'.dolPrintHTMLForAttribute($tmparray['label']).'">';
-			print dolPrintHTML($tmparray['label']);
+			print '<td class="center tdoverflowmax100" title="'.dol_escape_htmltag($tmparray['label']).'">';
+			print dol_escape_htmltag($tmparray['label']);
 			print '</td>';
 			if (!$i) {
 				$totalarray['nbfield']++;
@@ -1523,8 +1523,8 @@
 		}
 		// Import key
 		if (!empty($arrayfields['d.import_key']['checked'])) {
-			print '<td class="tdoverflowmax100 center" title="'.dolPrintHTMLForAttribute($obj->import_key).'">';
-			print dolPrintHTML($obj->import_key);
+			print '<td class="tdoverflowmax100 center" title="'.dol_escape_htmltag($obj->import_key).'">';
+			print dol_escape_htmltag($obj->import_key);
 			print "</td>\n";
 			if (!$i) {
 				$totalarray['nbfield']++;

########## admin/agenda_extsites.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/agenda_extsites.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/agenda_extsites.php	2025-06-27 11:43:39.332503000 +0000
@@ -292,7 +292,7 @@
 	print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ' . $key . '" value="' . (GETPOST('AGENDA_EXT_OFFSETTZ' . $key) ? GETPOST('AGENDA_EXT_OFFSETTZ' . $key) : getDolGlobalString($offsettz)) . '" size="2"></td>';
 	// Color (Possible colors are limited by Google)
 	print '<td class="nowraponall right">';
-	print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR" . $key) ? GETPOST("AGENDA_EXT_COLOR" . $key) : getDolGlobalString($color)), "AGENDA_EXT_COLOR" . $key, '', 1, array(), 'hideifnotset');
+	print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR" . $key) ? GETPOST("AGENDA_EXT_COLOR" . $key) : getDolGlobalString($color)), "AGENDA_EXT_COLOR" . $key, 'extsitesconfig', 1, array(), 'hideifnotset');
 	print '</td>';
 	// Calendar active by default
 	print '<td class="nowrap right">';

########## admin/agenda_other.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/agenda_other.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/agenda_other.php	2025-06-27 11:43:39.333710000 +0000
@@ -101,7 +101,7 @@
 	dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
 
 	$defaultValues = new DefaultValues($db);
-	$result = $defaultValues->fetchAll('', '', 0, 0, "(t.page:=:'comm/action/card.php') AND (t.param:=:'complete') AND (t.user_id:=:0) AND (t.type:=:'createform') AND (t.entity:=:".((int) $conf->entity).")");
+	$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page' => 'comm/action/card.php', 't.param' => 'complete', 't.user_id' => '0', 't.type' => 'createform', 't.entity' => (string) $conf->entity));
 	if (!is_array($result) && $result < 0) {
 		setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
 	} elseif (count($result) > 0) {
@@ -391,7 +391,7 @@
 print '<td class="right nowrap">'."\n";
 $defval = 'na';
 $defaultValues = new DefaultValues($db);
-$result = $defaultValues->fetchAll('', '', 0, 0, "(t.page:=:'comm/action/card.php') AND (t.param:=:'complete') AND (t.user_id:=:0) AND (t.type:=:'createform') AND (t.entity:=:".((int) $conf->entity).")");
+$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page' => 'comm/action/card.php', 't.param' => 'complete', 't.user_id' => '0', 't.type' => 'createform', 't.entity' => (string) $conf->entity));
 if (!is_array($result) && $result < 0) {
 	setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
 } elseif (count($result) > 0) {

########## admin/bank.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/bank.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/bank.php	2025-06-27 11:43:39.337367000 +0000
@@ -478,7 +478,7 @@
 		print '<td colspan="4" width="180" class="nowrap">'.$langs->trans("BankColorizeMovementName".$key)."</td>";
 		// Color
 		print '<td class="nowrap right">';
-		print $formother->selectColor((GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key) ? GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key) : getDolGlobalString($color)), "BANK_COLORIZE_MOVEMENT_COLOR".$key, '', 1, array(), 'right hideifnotset');
+		print $formother->selectColor((GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key) ? GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key) : getDolGlobalString($color)), "BANK_COLORIZE_MOVEMENT_COLOR".$key, 'bankmovementcolorconfig', 1, array(), 'right hideifnotset');
 		print '</td>';
 		print "</tr>";
 		$i++;

########## admin/barcode.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/barcode.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/barcode.php	2025-06-27 11:43:39.184809000 +0000
@@ -206,7 +206,7 @@
 
 // Select barcode numbering module
 if (isModEnabled('product')) {
-	print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")", '', 'product');
+	print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")", '', '');
 
 	print '<div class="div-table-responsive-no-min">';
 	print '<table class="noborder centpercent">';
@@ -264,16 +264,12 @@
 		}
 	}
 	print "</table>\n";
-
-	print dolButtonToOpenUrlInDialogPopup('barcodeinitproduct', $langs->trans("MassBarcodeInit"), $langs->trans("GoOnThisPageToInitBarCode").' '.img_picto('', 'url'), '/barcode/codeinit.php', '', 'small');
-	print '<br><br><br>';
-
 	print '</div>';
 }
 
 // Select barcode numbering module
 if (isModEnabled('societe')) {
-	print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("ThirdParty").")", '', 'company');
+	print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("ThirdParty").")", '', '');
 
 	print '<div class="div-table-responsive-no-min">';
 	print '<table class="noborder centpercent">';
@@ -312,7 +308,7 @@
 					print '</td>';
 					print '<td class="nowrap">'.$modBarCode->getExample($langs)."</td>\n";
 
-					if (getDolGlobalString('BARCODE_THIRDPARTY_ADDON_NUM') && getDolGlobalString('BARCODE_THIRDPARTY_ADDON_NUM') == "$file") {
+					if (getDolGlobalString('BARCODE_THIRDPARTY_ADDON_NUM') && $conf->global->BARCODE_THIRDPARTY_ADDON_NUM == "$file") {
 						print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodethirdpartyoff&token='.newToken().'&amp;value='.urlencode($file).'">';
 						print img_picto($langs->trans("Activated"), 'switch_on');
 						print '</a></td>';
@@ -332,17 +328,14 @@
 		}
 	}
 	print "</table>\n";
-
-	print dolButtonToOpenUrlInDialogPopup('barcodeinitthirdparty', $langs->trans("MassBarcodeInit"), $langs->trans("GoOnThisPageToInitBarCode").' '.img_picto('', 'url'), '/barcode/codeinit.php', '', 'small');
-	print '<br><br><br>';
-
 	print '</div>';
 }
 
 /*
- *  CHOOSE ENCODING
+ *  CHOIX ENCODAGE
  */
 
+print '<br>';
 print load_fiche_titre($langs->trans("BarcodeEncodeModule"), '', '');
 
 if (empty($conf->use_javascript_ajax)) {
@@ -479,7 +472,7 @@
 // Module products
 if (isModEnabled('product')) {
 	print '<tr class="oddeven">';
-	print '<td>'.img_picto('', 'product', 'class="pictofixedwidth"').$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
+	print '<td>'.$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
 	print '<td width="60" class="right">';
 	print $formbarcode->selectBarcodeType(getDolGlobalInt('PRODUIT_DEFAULT_BARCODE_TYPE'), "PRODUIT_DEFAULT_BARCODE_TYPE", 1);
 	print '</td>';
@@ -490,7 +483,7 @@
 // Module thirdparty
 if (isModEnabled('societe')) {
 	print '<tr class="oddeven">';
-	print '<td>'.img_picto('', 'company', 'class="pictofixedwidth"').$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>';
+	print '<td>'.$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>';
 	print '<td width="60" class="right">';
 	print $formbarcode->selectBarcodeType(getDolGlobalInt('GENBARCODE_BARCODETYPE_THIRDPARTY'), "GENBARCODE_BARCODETYPE_THIRDPARTY", 1);
 	print '</td>';

########## admin/company.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/company.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/company.php	2025-06-27 11:43:39.342361000 +0000
@@ -74,8 +74,6 @@
 // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
 $hookmanager->initHooks(array('admincompany', 'globaladmin'));
 
-$object = new Societe($db);
-
 
 /*
  * Actions
@@ -453,11 +451,11 @@
 print '<input type="hidden" name="page_y" value="">';
 
 print '<table class="noborder centpercent editmode">';
-print '<tr class="liste_titre"><th class="titlefieldcreate wordbreak" colspan="2">'.$langs->trans("CompanyInfo").'</th></tr>'."\n";
+print '<tr class="liste_titre"><th class="titlefieldcreate wordbreak">'.$langs->trans("CompanyInfo").'</th><th></th></tr>'."\n";
 
 // Company name
 print '<tr class="oddeven"><td class="fieldrequired wordbreak"><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
-print '<input name="name" id="name" maxlength="'.$mysoc->fields['nom']['length'].'" class="minwidth250" value="'.dolPrintHTMLForAttribute((GETPOSTISSET('name') ? GETPOST('name', 'alphanohtml') : getDolGlobalString('MAIN_INFO_SOCIETE_NOM'))).'"'.(getDolGlobalString('MAIN_INFO_SOCIETE_NOM') ? '' : ' autofocus="autofocus"').'></td></tr>'."\n";
+print '<input name="name" id="name" maxlength="'.$mysoc->fields['nom']['length'].'" class="minwidth250" value="'.dol_escape_htmltag((GETPOSTISSET('name') ? GETPOST('name', 'alphanohtml') : (getDolGlobalString('MAIN_INFO_SOCIETE_NOM')))).'"'.(!getDolGlobalString('MAIN_INFO_SOCIETE_NOM') ? ' autofocus="autofocus"' : '').'></td></tr>'."\n";
 
 // Main currency
 print '<tr class="oddeven"><td class="fieldrequired"><label for="currency">'.$langs->trans("CompanyCurrency").'</label></td><td>';
@@ -474,14 +472,14 @@
 
 // Address
 print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ADDRESS">'.$langs->trans("CompanyAddress").'</label></td><td>';
-print '<textarea name="MAIN_INFO_SOCIETE_ADDRESS" id="MAIN_INFO_SOCIETE_ADDRESS" class="quatrevingtpercent" rows="'.ROWS_3.'">'.(GETPOSTISSET('MAIN_INFO_SOCIETE_ADDRESS') ? GETPOST('MAIN_INFO_SOCIETE_ADDRESS', 'alphanohtml') : getDolGlobalString('MAIN_INFO_SOCIETE_ADDRESS')).'</textarea></td></tr>'."\n";
+print '<textarea name="MAIN_INFO_SOCIETE_ADDRESS" id="MAIN_INFO_SOCIETE_ADDRESS" class="quatrevingtpercent" rows="'.ROWS_3.'">'.(GETPOSTISSET('MAIN_INFO_SOCIETE_ADDRESS') ? GETPOST('MAIN_INFO_SOCIETE_ADDRESS', 'alphanohtml') : (getDolGlobalString('MAIN_INFO_SOCIETE_ADDRESS'))).'</textarea></td></tr>'."\n";
 
 // Zip
 print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ZIP">'.$langs->trans("CompanyZip").'</label></td><td>';
-print '<input class="width100" name="MAIN_INFO_SOCIETE_ZIP" id="MAIN_INFO_SOCIETE_ZIP" value="'.dolPrintHTMLForAttribute((GETPOSTISSET('MAIN_INFO_SOCIETE_ZIP') ? GETPOST('MAIN_INFO_SOCIETE_ZIP', 'alphanohtml') : getDolGlobalString('MAIN_INFO_SOCIETE_ZIP'))).'"></td></tr>'."\n";
+print '<input class="width100" name="MAIN_INFO_SOCIETE_ZIP" id="MAIN_INFO_SOCIETE_ZIP" value="'.dol_escape_htmltag((GETPOSTISSET('MAIN_INFO_SOCIETE_ZIP') ? GETPOST('MAIN_INFO_SOCIETE_ZIP', 'alphanohtml') : (getDolGlobalString('MAIN_INFO_SOCIETE_ZIP')))).'"></td></tr>'."\n";
 
 print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_TOWN">'.$langs->trans("CompanyTown").'</label></td><td>';
-print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth200" id="MAIN_INFO_SOCIETE_TOWN" value="'.dolPrintHTMLForAttribute((GETPOSTISSET('MAIN_INFO_SOCIETE_TOWN') ? GETPOST('MAIN_INFO_SOCIETE_TOWN', 'alphanohtml') : getDolGlobalString('MAIN_INFO_SOCIETE_TOWN'))).'"></td></tr>'."\n";
+print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth200" id="MAIN_INFO_SOCIETE_TOWN" value="'.dol_escape_htmltag((GETPOSTISSET('MAIN_INFO_SOCIETE_TOWN') ? GETPOST('MAIN_INFO_SOCIETE_TOWN', 'alphanohtml') : (getDolGlobalString('MAIN_INFO_SOCIETE_TOWN')))).'"></td></tr>'."\n";
 
 // State
 print '<tr class="oddeven"><td class="wordbreak"><label for="state_id">'.$langs->trans("State").'</label></td><td>';
@@ -497,31 +495,31 @@
 // Phone
 print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
 print img_picto('', 'object_phoning', '', 0, 0, 0, '', 'pictofixedwidth');
-print '<input class="maxwidth150 widthcentpercentminusx" name="phone" id="phone" value="'.dolPrintHTMLForAttribute((GETPOSTISSET('phone') ? GETPOST('phone', 'alphanohtml') : getDolGlobalString('MAIN_INFO_SOCIETE_TEL'))).'"></td></tr>';
+print '<input class="maxwidth150 widthcentpercentminusx" name="phone" id="phone" value="'.dol_escape_htmltag((GETPOSTISSET('phone') ? GETPOST('phone', 'alphanohtml') : (getDolGlobalString('MAIN_INFO_SOCIETE_TEL')))).'"></td></tr>';
 print '</td></tr>'."\n";
 
 // Phone mobile
 print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("PhoneMobile").'</label></td><td>';
 print img_picto('', 'object_phoning_mobile', '', 0, 0, 0, '', 'pictofixedwidth');
-print '<input class="maxwidth150 widthcentpercentminusx" name="phone_mobile" id="phone_mobile" value="'.dolPrintHTMLForAttribute((GETPOSTISSET('phone_mobile') ? GETPOST('phone_mobile', 'alphanohtml') : getDolGlobalString('MAIN_INFO_SOCIETE_MOBILE'))).'"></td></tr>';
+print '<input class="maxwidth150 widthcentpercentminusx" name="phone_mobile" id="phone_mobile" value="'.dol_escape_htmltag((GETPOSTISSET('phone_mobile') ? GETPOST('phone_mobile', 'alphanohtml') : (getDolGlobalString('MAIN_INFO_SOCIETE_MOBILE')))).'"></td></tr>';
 print '</td></tr>'."\n";
 
 // Fax
 print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
 print img_picto('', 'object_phoning_fax', '', 0, 0, 0, '', 'pictofixedwidth');
-print '<input class="maxwidth150" name="fax" id="fax" value="'.dolPrintHTMLForAttribute((GETPOSTISSET('fax') ? GETPOST('fax', 'alphanohtml') : getDolGlobalString('MAIN_INFO_SOCIETE_FAX'))).'"></td></tr>';
+print '<input class="maxwidth150" name="fax" id="fax" value="'.dol_escape_htmltag((GETPOSTISSET('fax') ? GETPOST('fax', 'alphanohtml') : (getDolGlobalString('MAIN_INFO_SOCIETE_FAX')))).'"></td></tr>';
 print '</td></tr>'."\n";
 
 // Email
 print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
 print img_picto('', 'object_email', '', 0, 0, 0, '', 'pictofixedwidth');
-print '<input class="minwidth300 maxwidth500 widthcentpercentminusx" name="mail" id="email" value="'.dolPrintHTMLForAttribute((GETPOSTISSET('mail') ? GETPOST('mail', 'alphanohtml') : getDolGlobalString('MAIN_INFO_SOCIETE_MAIL'))).'"></td></tr>';
+print '<input class="minwidth300 maxwidth500 widthcentpercentminusx" name="mail" id="email" value="'.dol_escape_htmltag((GETPOSTISSET('mail') ? GETPOST('mail', 'alphanohtml') : (getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') ? $conf->global->MAIN_INFO_SOCIETE_MAIL : ''))).'"></td></tr>';
 print '</td></tr>'."\n";
 
 // Web
 print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
 print img_picto('', 'globe', '', 0, 0, 0, '', 'pictofixedwidth');
-print '<input class="maxwidth300 widthcentpercentminusx" name="web" id="web" value="'.dol_escape_htmltag((GETPOSTISSET('web') ? GETPOST('web', 'alphanohtml') : getDolGlobalString('MAIN_INFO_SOCIETE_WEB'))).'"></td></tr>';
+print '<input class="maxwidth300 widthcentpercentminusx" name="web" id="web" value="'.dol_escape_htmltag((GETPOSTISSET('web') ? GETPOST('web', 'alphanohtml') : (getDolGlobalString('MAIN_INFO_SOCIETE_WEB') ? $conf->global->MAIN_INFO_SOCIETE_WEB : ''))).'"></td></tr>';
 print '</td></tr>'."\n";
 
 // Barcode
@@ -529,7 +527,7 @@
 	print '<tr class="oddeven"><td>';
 	print '<label for="barcode">'.$langs->trans("Gencod").'</label></td><td>';
 	print '<span class="fa fa-barcode pictofixedwidth"></span>';
-	print '<input name="barcode" id="barcode" class="minwidth150 widthcentpercentminusx maxwidth300" value="'.dolPrintHTMLForAttribute(GETPOSTISSET('barcode') ? GETPOST('barcode', 'alphanohtml') : getDolGlobalString('MAIN_INFO_SOCIETE_GENCOD')).'"></td></tr>';
+	print '<input name="barcode" id="barcode" class="minwidth150 widthcentpercentminusx maxwidth300" value="'.dol_escape_htmltag(GETPOSTISSET('barcode') ? GETPOST('barcode', 'alphanohtml') : getDolGlobalString('MAIN_INFO_SOCIETE_GENCOD', '')).'"></td></tr>';
 	print '</td></tr>';
 }
 
@@ -565,7 +563,7 @@
 
 // Note
 print '<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>';
-print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : getDolGlobalString('MAIN_INFO_SOCIETE_NOTE')).'</textarea></td></tr>';
+print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : (getDolGlobalString('MAIN_INFO_SOCIETE_NOTE') ? $conf->global->MAIN_INFO_SOCIETE_NOTE : '')).'</textarea></td></tr>';
 print '</td></tr>';
 
 print '</table>';
@@ -578,23 +576,23 @@
 // IDs of the company (country-specific)
 print '<div class="div-table-responsive-no-min">';
 print '<table class="noborder centpercent editmode">';
-print '<tr class="liste_titre"><td class="titlefieldcreate wordbreak" colspan="2">'.$langs->trans("CompanyIds").'</td></tr>';
+print '<tr class="liste_titre"><td class="titlefieldcreate wordbreak">'.$langs->trans("CompanyIds").'</td><td></td></tr>';
 
 $langs->load("companies");
 
 // Managing Director(s)
 print '<tr class="oddeven"><td><label for="director">'.$langs->trans("ManagingDirectors").'</label></td><td>';
-print '<input name="MAIN_INFO_SOCIETE_MANAGERS" id="directors" class="minwidth300" value="'.dolPrintHTMLForAttribute((GETPOSTISSET('MAIN_INFO_SOCIETE_MANAGERS') ? GETPOST('MAIN_INFO_SOCIETE_MANAGERS', 'alphanohtml') : getDolGlobalString('MAIN_INFO_SOCIETE_MANAGERS'))).'"></td></tr>';
+print '<input name="MAIN_INFO_SOCIETE_MANAGERS" id="directors" class="minwidth300" value="'.dol_escape_htmltag((GETPOSTISSET('MAIN_INFO_SOCIETE_MANAGERS') ? GETPOST('MAIN_INFO_SOCIETE_MANAGERS', 'alphanohtml') : (getDolGlobalString('MAIN_INFO_SOCIETE_MANAGERS') ? $conf->global->MAIN_INFO_SOCIETE_MANAGERS : ''))).'"></td></tr>';
 
 // GDPR contact
 print '<tr class="oddeven"><td>';
 print $form->textwithpicto($langs->trans("GDPRContact"), $langs->trans("GDPRContactDesc"));
 print '</td><td>';
-print '<input name="MAIN_INFO_GDPR" id="infodirector" class="minwidth300" value="'.dolPrintHTMLForAttribute((GETPOSTISSET("MAIN_INFO_GDPR") ? GETPOST("MAIN_INFO_GDPR", 'alphanohtml') : getDolGlobalString('MAIN_INFO_GDPR'))).'"></td></tr>';
+print '<input name="MAIN_INFO_GDPR" id="infodirector" class="minwidth300" value="'.dol_escape_htmltag((GETPOSTISSET("MAIN_INFO_GDPR") ? GETPOST("MAIN_INFO_GDPR", 'alphanohtml') : (getDolGlobalString('MAIN_INFO_GDPR') ? $conf->global->MAIN_INFO_GDPR : ''))).'"></td></tr>';
 
 // Capital
 print '<tr class="oddeven"><td><label for="capital">'.$langs->trans("Capital").'</label></td><td>';
-print '<input name="capital" id="capital" class="maxwidth100" value="'.dolPrintHTMLForAttribute((GETPOSTISSET('capital') ? GETPOST('capital', 'alphanohtml') : getDolGlobalString('MAIN_INFO_CAPITAL'))).'"></td></tr>';
+print '<input name="capital" id="capital" class="maxwidth100" value="'.dol_escape_htmltag((GETPOSTISSET('capital') ? GETPOST('capital', 'alphanohtml') : (getDolGlobalString('MAIN_INFO_CAPITAL') ? $conf->global->MAIN_INFO_CAPITAL : ''))).'"></td></tr>';
 
 // Juridical Status
 print '<tr class="oddeven"><td><label for="forme_juridique_code">'.$langs->trans("JuridicalStatus").'</label></td><td>';
@@ -607,19 +605,19 @@
 
 // Object of the company
 print '<tr class="oddeven"><td><label for="socialobject">'.$langs->trans("CompanyObject").'</label></td><td>';
-print '<textarea class="flat quatrevingtpercent" name="socialobject" id="socialobject" rows="'.ROWS_3.'">'.getDolGlobalString('MAIN_INFO_SOCIETE_OBJECT').'</textarea></td></tr>';
+print '<textarea class="flat quatrevingtpercent" name="socialobject" id="socialobject" rows="'.ROWS_3.'">'.(getDolGlobalString('MAIN_INFO_SOCIETE_OBJECT')).'</textarea></td></tr>';
 print '</td></tr>';
 
 // Tax ID Intra-community VAT number
 print '<tr class="oddeven"><td><label for="intra_vat">'.$langs->trans("VATIntra").'</label></td><td>';
-print '<input name="tva" id="intra_vat" class="minwidth200" value="'.dolPrintHTMLForAttribute(getDolGlobalString('MAIN_INFO_TVAINTRA')).'">';
+print '<input name="tva" id="intra_vat" class="minwidth200" value="'.dol_escape_htmltag(getDolGlobalString('MAIN_INFO_TVAINTRA')).'">';
 print '</td></tr>';
 
 // ProfId1
 if ($langs->transcountry("ProfId1", $mysoc->country_code) != '-') {
 	print '<tr class="oddeven"><td><label for="profid1">'.$langs->transcountry("ProfId1", $mysoc->country_code).'</label></td><td>';
 	if (!empty($mysoc->country_code)) {
-		print '<input name="siren" id="profid1" class="minwidth200" value="'.dolPrintHTMLForAttribute(getDolGlobalString('MAIN_INFO_SIREN')).'">';
+		print '<input name="siren" id="profid1" class="minwidth200" value="'.dol_escape_htmltag(getDolGlobalString('MAIN_INFO_SIREN')).'">';
 	} else {
 		print $countrynotdefined;
 	}
@@ -630,7 +628,7 @@
 if ($langs->transcountry("ProfId2", $mysoc->country_code) != '-') {
 	print '<tr class="oddeven"><td><label for="profid2">'.$langs->transcountry("ProfId2", $mysoc->country_code).'</label></td><td>';
 	if (!empty($mysoc->country_code)) {
-		print '<input name="siret" id="profid2" class="minwidth200" value="'.dolPrintHTMLForAttribute(getDolGlobalString('MAIN_INFO_SIRET')).'">';
+		print '<input name="siret" id="profid2" class="minwidth200" value="'.dol_escape_htmltag(getDolGlobalString('MAIN_INFO_SIRET')).'">';
 	} else {
 		print $countrynotdefined;
 	}
@@ -641,7 +639,7 @@
 if ($langs->transcountry("ProfId3", $mysoc->country_code) != '-') {
 	print '<tr class="oddeven"><td><label for="profid3">'.$langs->transcountry("ProfId3", $mysoc->country_code).'</label></td><td>';
 	if (!empty($mysoc->country_code)) {
-		print '<input name="ape" id="profid3" class="minwidth200" value="'.dolPrintHTMLForAttribute(getDolGlobalString('MAIN_INFO_APE')).'">';
+		print '<input name="ape" id="profid3" class="minwidth200" value="'.dol_escape_htmltag(getDolGlobalString('MAIN_INFO_APE')).'">';
 	} else {
 		print $countrynotdefined;
 	}
@@ -652,7 +650,7 @@
 if ($langs->transcountry("ProfId4", $mysoc->country_code) != '-') {
 	print '<tr class="oddeven"><td><label for="profid4">'.$langs->transcountry("ProfId4", $mysoc->country_code).'</label></td><td>';
 	if (!empty($mysoc->country_code)) {
-		print '<input name="rcs" id="profid4" class="minwidth200" value="'.dolPrintHTMLForAttribute(getDolGlobalString('MAIN_INFO_RCS')).'">';
+		print '<input name="rcs" id="profid4" class="minwidth200" value="'.dol_escape_htmltag(getDolGlobalString('MAIN_INFO_RCS')).'">';
 	} else {
 		print $countrynotdefined;
 	}
@@ -663,7 +661,7 @@
 if ($langs->transcountry("ProfId5", $mysoc->country_code) != '-') {
 	print '<tr class="oddeven"><td><label for="profid5">'.$langs->transcountry("ProfId5", $mysoc->country_code).'</label></td><td>';
 	if (!empty($mysoc->country_code)) {
-		print '<input name="MAIN_INFO_PROFID5" id="profid5" class="minwidth200" value="'.dolPrintHTMLForAttribute(getDolGlobalString('MAIN_INFO_PROFID5')).'">';
+		print '<input name="MAIN_INFO_PROFID5" id="profid5" class="minwidth200" value="'.dol_escape_htmltag(getDolGlobalString('MAIN_INFO_PROFID5')).'">';
 	} else {
 		print $countrynotdefined;
 	}
@@ -674,7 +672,7 @@
 if ($langs->transcountry("ProfId6", $mysoc->country_code) != '-') {
 	print '<tr class="oddeven"><td><label for="profid6">'.$langs->transcountry("ProfId6", $mysoc->country_code).'</label></td><td>';
 	if (!empty($mysoc->country_code)) {
-		print '<input name="MAIN_INFO_PROFID6" id="profid6" class="minwidth200" value="'.dolPrintHTMLForAttribute(getDolGlobalString('MAIN_INFO_PROFID6')).'">';
+		print '<input name="MAIN_INFO_PROFID6" id="profid6" class="minwidth200" value="'.dol_escape_htmltag(getDolGlobalString('MAIN_INFO_PROFID6')).'">';
 	} else {
 		print $countrynotdefined;
 	}
@@ -685,7 +683,7 @@
 if ($langs->transcountry("ProfId7", $mysoc->country_code) != '-') {
 	print '<tr class="oddeven"><td><label for="profid7">'.$langs->transcountry("ProfId7", $mysoc->country_code).'</label></td><td>';
 	if (!empty($mysoc->country_code)) {
-		print '<input name="MAIN_INFO_PROFID7" id="profid7" class="minwidth200" value="'.dolPrintHTMLForAttribute(getDolGlobalString('MAIN_INFO_PROFID7')).'">';
+		print '<input name="MAIN_INFO_PROFID7" id="profid7" class="minwidth200" value="'.dol_escape_htmltag(getDolGlobalString('MAIN_INFO_PROFID7')).'">';
 	} else {
 		print $countrynotdefined;
 	}
@@ -696,7 +694,7 @@
 if ($langs->transcountry("ProfId8", $mysoc->country_code) != '-') {
 	print '<tr class="oddeven"><td><label for="profid8">'.$langs->transcountry("ProfId8", $mysoc->country_code).'</label></td><td>';
 	if (!empty($mysoc->country_code)) {
-		print '<input name="MAIN_INFO_PROFID8" id="profid8" class="minwidth200" value="'.dolPrintHTMLForAttribute(getDolGlobalString('MAIN_INFO_PROFID8')).'">';
+		print '<input name="MAIN_INFO_PROFID8" id="profid8" class="minwidth200" value="'.dol_escape_htmltag(getDolGlobalString('MAIN_INFO_PROFID8')).'">';
 	} else {
 		print $countrynotdefined;
 	}
@@ -707,7 +705,7 @@
 if ($langs->transcountry("ProfId9", $mysoc->country_code) != '-') {
 	print '<tr class="oddeven"><td><label for="profid9">'.$langs->transcountry("ProfId9", $mysoc->country_code).'</label></td><td>';
 	if (!empty($mysoc->country_code)) {
-		print '<input name="MAIN_INFO_PROFID9" id="profid9" class="minwidth200" value="'.dolPrintHTMLForAttribute(getDolGlobalString('MAIN_INFO_PROFID9')).'">';
+		print '<input name="MAIN_INFO_PROFID9" id="profid9" class="minwidth200" value="'.dol_escape_htmltag(getDolGlobalString('MAIN_INFO_PROFID9')).'">';
 	} else {
 		print $countrynotdefined;
 	}
@@ -718,7 +716,7 @@
 if ($langs->transcountry("ProfId10", $mysoc->country_code) != '-') {
 	print '<tr class="oddeven"><td><label for="profid10">'.$langs->transcountry("ProfId10", $mysoc->country_code).'</label></td><td>';
 	if (!empty($mysoc->country_code)) {
-		print '<input name="MAIN_INFO_PROFID10" id="profid10" class="minwidth200" value="'.dolPrintHTMLForAttribute(getDolGlobalString('MAIN_INFO_PROFID10')).'">';
+		print '<input name="MAIN_INFO_PROFID10" id="profid10" class="minwidth200" value="'.dol_escape_htmltag(getDolGlobalString('MAIN_INFO_PROFID10')).'">';
 	} else {
 		print $countrynotdefined;
 	}
@@ -737,7 +735,7 @@
 print "</tr>\n";
 
 print '<tr class="oddeven"><td><label for="SOCIETE_FISCAL_MONTH_START">'.$langs->trans("FiscalMonthStart").'</label></td><td>';
-print $formother->select_month(getDolGlobalString('SOCIETE_FISCAL_MONTH_START'), 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100').'</td></tr>';
+print $formother->select_month(getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') ? $conf->global->SOCIETE_FISCAL_MONTH_START : '', 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100').'</td></tr>';
 
 print "</table>";
 

########## admin/compta.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/compta.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/compta.php	2025-06-27 11:43:39.240631000 +0000
@@ -134,7 +134,6 @@
 	}
 }
 
-
 /*
  * View
  */
@@ -159,11 +158,11 @@
 print '<tr class="liste_titre">';
 print '<td colspan="2">'.$langs->trans('OptionMode').'</td>';
 print "</tr>\n";
-print '<tr class="oddeven"><td class="nowraponall"><input type="radio" id="accounting_mode_2" name="accounting_mode" value="CREANCES-DETTES"'.($accounting_mode != 'RECETTES-DEPENSES' ? ' checked' : '').'><label for="accounting_mode_2"> '.$langs->trans('OptionModeVirtual').'</label></td>';
-print '<td class="opacitymedium">'.nl2br($langs->trans('OptionModeVirtualDesc'))."</td></tr>\n";
-print '<tr class="oddeven"><td class="nowraponall"><input type="radio" id="accounting_mode_1" name="accounting_mode" value="RECETTES-DEPENSES"'.($accounting_mode == 'RECETTES-DEPENSES' ? ' checked' : '').'><label for="accounting_mode_1"> '.$langs->trans('OptionModeTrue').'</label></td>';
+print '<tr class="oddeven"><td class="nowraponall"><input type="radio" id="accounting_mode_1" name="accounting_mode" value="RECETTES-DEPENSES"'.($accounting_mode != 'CREANCES-DETTES' ? ' checked' : '').'><label for="accounting_mode_1"> '.$langs->trans('OptionModeTrue').'</label></td>';
 print '<td class="opacitymedium">'.nl2br($langs->trans('OptionModeTrueDesc'));
 print "</td></tr>\n";
+print '<tr class="oddeven"><td class="nowraponall"><input type="radio" id="accounting_mode_2" name="accounting_mode" value="CREANCES-DETTES"'.($accounting_mode == 'CREANCES-DETTES' ? ' checked' : '').'><label for="accounting_mode_2"> '.$langs->trans('OptionModeVirtual').'</label></td>';
+print '<td class="opacitymedium">'.nl2br($langs->trans('OptionModeVirtualDesc'))."</td></tr>\n";
 
 print "</table>\n";
 

########## admin/defaultvalues.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/defaultvalues.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/defaultvalues.php	2025-06-27 11:43:39.420448000 +0000
@@ -368,8 +368,8 @@
 print '<input type="submit" class="button"'.$disabled.' value="'.$langs->trans("Add").'" name="add">';
 print '</td>'."\n";
 print '</tr>'."\n";
-//"(t.type:=:".$mode.") AND (t.entity:in:("((int)$user->entity).", ".((int)$conf->entity)."))"
-$result = $object->fetchAll($sortorder, $sortfield, 0, 0, "(t.type:=:'".$mode."') AND (t.entity:in:".((int) $user->entity).", ".((int) $conf->entity).")");
+
+$result = $object->fetchAll($sortorder, $sortfield, 0, 0, array('t.type' => $mode, 't.entity' => array($user->entity,$conf->entity)));
 
 if (!is_array($result) && $result < 0) {
 	setEventMessages($object->error, $object->errors, 'errors');

########## admin/dict.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/dict.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/dict.php	2025-06-27 11:43:39.246789000 +0000
@@ -273,7 +273,7 @@
 $tabsql[DICT_CIVILITY] = "SELECT c.rowid as rowid, c.code as code, c.label, c.active FROM ".MAIN_DB_PREFIX."c_civility AS c";
 $tabsql[DICT_ACTIONCOMM] = "SELECT a.id    as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.color, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a";
 $tabsql[DICT_CHARGESOCIALES] = "SELECT a.id    as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_pays = c.rowid and c.active = 1";
-$tabsql[DICT_TYPENT] = "SELECT t.id	 as rowid, t.code as code, t.libelle, t.fk_country as country_id, c.code as country_code, c.label as country, t.position, t.module, t.active FROM ".MAIN_DB_PREFIX."c_typent as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON t.fk_country=c.rowid";
+$tabsql[DICT_TYPENT] = "SELECT t.id	 as rowid, t.code as code, t.libelle, t.fk_country as country_id, c.code as country_code, c.label as country, t.position, t.active FROM ".MAIN_DB_PREFIX."c_typent as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON t.fk_country=c.rowid";
 $tabsql[DICT_CURRENCIES] = "SELECT c.code_iso as code, c.label, c.unicode, c.active FROM ".MAIN_DB_PREFIX."c_currencies AS c";
 $tabsql[DICT_TVA] = "SELECT t.rowid, t.entity, t.code, t.type_vat, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.fk_department_buyer as department_buyer_id, db.nom as department_buyer, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy, t.use_default FROM ".MAIN_DB_PREFIX."c_tva as t INNER JOIN ".MAIN_DB_PREFIX."c_country as c ON t.fk_pays = c.rowid LEFT JOIN ".MAIN_DB_PREFIX."c_departements as db ON t.fk_department_buyer = db.rowid WHERE t.entity IN (".getEntity($tabname[DICT_TVA]).")";
 $tabsql[DICT_TYPE_CONTACT] = "SELECT t.rowid as rowid, t.element, t.source, t.code, t.libelle, t.position, t.active FROM ".MAIN_DB_PREFIX."c_type_contact AS t";
@@ -367,7 +367,7 @@
 $tabfield[DICT_CIVILITY] = "code,label";
 $tabfield[DICT_ACTIONCOMM] = "code,libelle,type,color,position";
 $tabfield[DICT_CHARGESOCIALES] = "code,libelle,country,accountancy_code";
-$tabfield[DICT_TYPENT] = "code,libelle,module,country_id,country".(getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? ',position' : '');
+$tabfield[DICT_TYPENT] = "code,libelle,country_id,country".(getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? ',position' : '');
 $tabfield[DICT_CURRENCIES] = "code,label,unicode";
 $tabfield[DICT_TVA] = "country_id,country,department_buyer_id,department_buyer,code,type_vat,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,use_default,note";
 $tabfield[DICT_TYPE_CONTACT] = "element,source,code,libelle,position";
@@ -2317,7 +2317,7 @@
 						$canbedisabled = 0;
 					}
 				}
-				if ($id == DICT_TYPE_CONTAINER && $obj->module == 'system') {
+				if ($id == DICT_TYPE_CONTAINER && in_array($obj->code, array('banner', 'blogpost', 'menu', 'page', 'other', 'service', 'library'))) {
 					$iserasable = 0;
 					$canbedisabled = 0;
 					if (in_array($obj->code, array('banner'))) {

########## admin/modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/modules.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/modules.php	2025-06-27 11:43:39.290847000 +0000
@@ -72,10 +72,8 @@
 }
 
 $action = GETPOST('action', 'aZ09');
-$page_y = GETPOSTINT('page_y');
-$optioncss = GETPOST('optioncss', 'aZ09');
-
 $value = GETPOST('value', 'alpha');
+$page_y = GETPOSTINT('page_y');
 $search_keyword = GETPOST('search_keyword', 'alpha');
 $search_status = GETPOST('search_status', 'alpha');
 $search_nature = GETPOST('search_nature', 'alpha');
@@ -85,14 +83,10 @@
 // For remotestore search
 $options              		= array();
 $options['per_page']  		= 11;
-$options['no_page']   		= (GETPOSTINT('no_page') ? GETPOSTINT('no_page') : 1);
-$options['categorie'] 		= (GETPOSTINT('categorie') ? GETPOSTINT('categorie') : 0);
+$options['no_page']   		= ((int) GETPOSTINT('no_page') ? GETPOSTINT('no_page') : 1);
+$options['categorie'] 		= ((int) (GETPOSTINT('categorie') ? GETPOSTINT('categorie') : 0));
 $options['search']    		= GETPOST('search_keyword', 'alpha');
 
-// If it is a new search, we reset page to 1
-if (GETPOST('buttonsubmit', 'alphanohtml', 2)) {
-	$options['no_page'] = 1;
-}
 
 // MAIN_ENABLE_EXTERNALMODULES_DOLISTORE is 1 if we enabled the dolistore modules
 $options['search_source_dolistore']	= getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_DOLISTORE');
@@ -458,6 +452,7 @@
 }
 
 
+
 /*
  * View
  */
@@ -773,10 +768,10 @@
 	$moreforfilter .= '</div>';
 	$moreforfilter .= ' ';
 	$moreforfilter .= '<div class="divsearchfield valignmiddle inline-block">';
-	$moreforfilter .= '<input type="submit" name="buttonsubmit" class="button small nomarginleft" value="'.dolPrintHTMLForAttribute($langs->trans("Refresh")).'">';
+	$moreforfilter .= '<input type="submit" name="buttonsubmit" class="button small nomarginleft" value="'.dol_escape_htmltag($langs->trans("Refresh")).'">';
 	if ($search_keyword || ($search_nature && $search_nature != '-1') || ($search_version && $search_version != '-1') || ($search_status && $search_status != '-1')) {
 		$moreforfilter .= ' ';
-		$moreforfilter .= '<input type="submit" name="buttonreset" class="buttonreset noborderbottom" value="'.dolPrintHTMLForAttribute($langs->trans("Reset")).'">';
+		$moreforfilter .= '<input type="submit" name="buttonreset" class="buttonreset noborderbottom" value="'.dol_escape_htmltag($langs->trans("Reset")).'">';
 	}
 	$moreforfilter .= '</div>';
 	$moreforfilter .= '</div>';
@@ -1336,15 +1331,12 @@
 					<input type="hidden" name="mode" value="marketplace">
 					<input type="hidden" name="page_y" value="">
 					<div class="divsearchfield">
-						<input name="search_keyword" placeholder="<?php echo $langs->trans('Keyword') ?>" id="search_keyword" type="text" class="minwidth200" value="<?php echo dolPrintHTMLForAttribute($options['search']) ?>">
+						<input name="search_keyword" placeholder="<?php echo $langs->trans('Keyword') ?>" id="search_keyword" type="text" class="minwidth200" value="<?php echo dol_escape_htmltag($options['search']) ?>">
 					</div>
 					<div class="divsearchfield">
-						<input name="buttonsubmit" class="button buttongen reposition" value="<?php echo $langs->trans('Search') ?>" type="submit">
-		<?php
-		if ($search_keyword !== '') {
-			print '<a class="buttonreset reposition" href="'.$_SERVER["PHP_SELF"].'?mode=marketplace">'.$langs->trans('Reset').'</a>';
-		}
-		?>
+						<input class="button buttongen reposition" value="<?php echo $langs->trans('Search') ?>" type="submit">
+						<a class="buttonreset reposition" href="<?php echo $_SERVER["PHP_SELF"].'?mode=marketplace'; ?>"><?php echo $langs->trans('Reset') ?></a>
+
 						&nbsp;
 					</div>
 		<?php

########## admin/multicurrency.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/multicurrency.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/multicurrency.php	2025-06-27 11:43:39.422747000 +0000
@@ -334,7 +334,7 @@
 	print '<input type="hidden" name="action" value="update_currency">';
 	print '<input type="hidden" name="fk_multicurrency" value="'.$currency->id.'">';
 	print '1 '.$conf->currency.' = ';
-	print '<input type="text" name="rate" class="width125 right" value="'.($currency->rate->rate ? $currency->rate->rate : '').'">&nbsp;'.$currency->code.'&nbsp;';
+	print '<input type="text" name="rate" class="width75 right" value="'.($currency->rate->rate ? $currency->rate->rate : '').'" size="13">&nbsp;'.$currency->code.'&nbsp;';
 	print '<input type="submit" name="updatecurrency" class="button button-edit smallpaddingimp" value="'.$langs->trans("Modify").'">&nbsp;';
 	print '<input type="submit" name="deletecurrency" class="button smallpaddingimp" value="'.$langs->trans("Delete").'">';
 	print '</form>';

########## admin/pdf_other.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/pdf_other.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/pdf_other.php	2025-06-27 11:43:39.172469000 +0000
@@ -483,6 +483,7 @@
 	}
 	print '</td></tr>';
 
+	/* too late to have it enabled by default in v21
 	print '<tr class="oddeven"><td>';
 	print $form->textwithpicto($langs->trans("PDF_INVOICE_SHOW_VAT_ANALYSIS"), '');
 	print '</td><td>';
@@ -493,7 +494,7 @@
 		print $form->selectarray("PDF_INVOICE_SHOW_VAT_ANALYSIS", $arrval, $conf->global->PDF_INVOICE_SHOW_VAT_ANALYSIS);
 	}
 	print '</td></tr>';
-
+	*/
 
 	/* Keep this option hidden for the moment to avoid options inflation. We'll see later if it is used enough...
 	print '<tr class="oddeven"><td>';

########## admin/propal_pdf.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/propal_pdf.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/propal_pdf.php	2025-06-27 11:43:39.176056000 +0000
@@ -143,7 +143,7 @@
 print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_PROPAL"), $langs->trans("PdfAddTermOfSaleHelp"));
 print '</td><td>';
 if ($conf->use_javascript_ajax) {
-	print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_PROPAL', array(), null, 0, 0, 1);
+	print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_PROPAL');
 } else {
 	$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
 	print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_PROPAL", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_PROPAL);
@@ -164,48 +164,40 @@
 print '</table>';
 print '</div>';
 
-if (empty($conf->use_javascript_ajax)) {
-	print '<center><input type="submit" class="button button-edit reposition" value="'.$langs->trans("Save").'"></center>';
-}
-
+print load_fiche_titre($langs->trans("FileToConcatToGeneratedPDF"), '', 'file');
 
-if (getDolGlobalString('MAIN_PDF_ADD_TERMSOFSALE_PROPAL')) {
-	print '<br>';
-	print load_fiche_titre($langs->trans("FileToConcatToGeneratedPDF"), '', 'file');
-
-	print '<div class="div-table-responsive-no-min">';
-	print '<table summary="more" class="noborder centpercent">';
-	print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px"></td></tr>';
-
-	// Terms of sale
-	$tooltiptermsofsale = $langs->trans('AvailableFormats').' : pdf';
-	$maxfilesizearray = getMaxFileSizeArray();
-	$tooltiptermsofsale .= ($maxfilesizearray['maxmin'] > 0) ? '<br>'.$langs->trans('MaxSize').' : '.$maxfilesizearray['maxmin'].' '.$langs->trans('Kb') : '';
-	$documenturl = DOL_URL_ROOT.'/document.php';
-	if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) {
-		$documenturl = $conf->global->DOL_URL_ROOT_DOCUMENT_PHP;
-	}
-	$modulepart = 'propal';
+print '<div class="div-table-responsive-no-min">';
+print '<table summary="more" class="noborder centpercent">';
+print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px"></td></tr>';
+
+// Terms of sale
+$tooltiptermsofsale = $langs->trans('AvailableFormats').' : pdf';
+$maxfilesizearray = getMaxFileSizeArray();
+$tooltiptermsofsale .= ($maxfilesizearray['maxmin'] > 0) ? '<br>'.$langs->trans('MaxSize').' : '.$maxfilesizearray['maxmin'].' '.$langs->trans('Kb') : '';
+$documenturl = DOL_URL_ROOT.'/document.php';
+if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) {
+	$documenturl = $conf->global->DOL_URL_ROOT_DOCUMENT_PHP;
+}
+$modulepart = 'propal';
 
-	print '<tr class="oddeven"><td><label for="logo">'.$form->textwithpicto($langs->trans("FileToConcatToGeneratedPDF"), $tooltiptermsofsale).'</label></td><td>';
-	print '<div class="centpercent nobordernopadding valignmiddle "><div class="inline-block marginrightonly">';
-	print '<input type="file" class="flat minwidth100 maxwidthinputfileonsmartphone" name="termsofsale" id="termsofsale" accept="application/pdf">';
-	if (getDolGlobalString("MAIN_INFO_PROPAL_TERMSOFSALE")) {
-		$termofsale = getDolGlobalString("MAIN_INFO_PROPAL_TERMSOFSALE");
-		if (file_exists($conf->propal->dir_output.'/'.$termofsale)) {
-			$file = dol_dir_list($conf->propal->dir_output, 'files', 0, $termofsale);
-			print '<div class="inline-block valignmiddle marginrightonly"><a href="'.$documenturl.'?modulepart='.$modulepart.'&amp;file='.urlencode($termofsale).'">'.$termofsale.'</a>'.$formfile->showPreview($file[0], $modulepart, $termofsale, 0, '');
-			print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removetermsofsale&token='.newToken().'">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
-		}
+print '<tr class="oddeven"><td><label for="logo">'.$form->textwithpicto($langs->trans("FileToConcatToGeneratedPDF"), $tooltiptermsofsale).'</label></td><td>';
+print '<div class="centpercent nobordernopadding valignmiddle "><div class="inline-block marginrightonly">';
+print '<input type="file" class="flat minwidth100 maxwidthinputfileonsmartphone" name="termsofsale" id="termsofsale" accept="application/pdf">';
+if (getDolGlobalString("MAIN_INFO_PROPAL_TERMSOFSALE")) {
+	$termofsale = getDolGlobalString("MAIN_INFO_PROPAL_TERMSOFSALE");
+	if (file_exists($conf->propal->dir_output.'/'.$termofsale)) {
+		$file = dol_dir_list($conf->propal->dir_output, 'files', 0, $termofsale);
+		print '<div class="inline-block valignmiddle marginrightonly"><a href="'.$documenturl.'?modulepart='.$modulepart.'&amp;file='.urlencode($termofsale).'">'.$termofsale.'</a>'.$formfile->showPreview($file[0], $modulepart, $termofsale, 0, '');
+		print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removetermsofsale&token='.newToken().'">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
 	}
-	print '</div>';
-	print '</td></tr>';
-	print '</table>';
-	print '</div>';
-
-	print '<center><input type="submit" class="button button-edit reposition" value="'.$langs->trans("Save").'"></center>';
 }
+print '</div>';
+print '</td></tr>';
+print '</table>';
+print '</div>';
+
 
+print '<center><input type="submit" class="button button-edit reposition" value="'.$langs->trans("Save").'"></center>';
 
 print '</form>';
 

########## admin/remotestore/class/externalModules.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/remotestore/class/externalModules.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/remotestore/class/externalModules.class.php	2025-06-27 11:43:39.303148000 +0000
@@ -460,8 +460,8 @@
 
 			// Set and check version
 			$version = '';
-			if ($this->versionCompare($product["dolibarr_min"], $dolibarrversiontouse) <= 0) {
-				if (!empty($product["dolibarr_max"]) && $product["dolibarr_max"] != 'auto' && $product["dolibarr_max"] != 'unknown' && $this->versionCompare($product["dolibarr_max"], $dolibarrversiontouse) >= 0) {
+			if ($this->version_compare($product["dolibarr_min"], $dolibarrversiontouse) <= 0) {
+				if (!empty($product["dolibarr_max"]) && $product["dolibarr_max"] != 'auto' && $product["dolibarr_max"] != 'unknown' && $this->version_compare($product["dolibarr_max"], $dolibarrversiontouse) >= 0) {
 					//compatible
 					$version = '<span class="compatible">'.$langs->trans(
 						'CompatibleUpTo',
@@ -508,7 +508,7 @@
 			$html .= $newapp.$images;	// No dol_escape_htmltag, it is already escape html
 			$html .= '</div></td>';
 			$html .= '<td class="margeCote"><h2 class="appTitle">';
-			$html .= dolPrintHTML(dol_string_nohtmltag($product["label"]));
+			$html .= dol_escape_htmltag(dol_string_nohtmltag($product["label"]));
 			$html .= '<br><small>';
 			$html .= $version;			// No dol_escape_htmltag, it is already escape html
 			$html .= '</small></h2>';
@@ -518,11 +518,11 @@
 			} else {
 				$html .= '<span class="opacitymedium">'.dol_print_date(dol_stringtotime($product['tms']), 'day').'</span>';
 			}
-			$html .= ' - '.$langs->trans('Ref').' '.dolPrintHTML($product["ref"]);
+			$html .= ' - '.$langs->trans('Ref').' '.dol_escape_htmltag($product["ref"]);
 			//$html .= ' - '.dol_escape_htmltag($langs->trans('Id')).': '.((int) $product["id"]);
 			$html .= '</small><br>';
 			$html .= '<small>'.$langs->trans('Source').': '.$product["source"].'</small><br>';
-			$html .= '<br>'.dolPrintHTML(dol_string_nohtmltag($product["description"]));
+			$html .= '<br>'.dol_escape_htmltag(dol_string_nohtmltag($product["description"]));
 			$html .= '</td>';
 			// do not load if display none
 			$html .= '<td class="margeCote center amount">';
@@ -568,6 +568,7 @@
 		};
 	}
 
+	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
 	/**
 	 * version compare
 	 *
@@ -575,12 +576,9 @@
 	 * @param   string  $v2     version 2
 	 * @return int              result of compare
 	 */
-	public function versionCompare($v1, $v2)
+	public function version_compare($v1, $v2)
 	{
-		// Clean v1 and v2
-		$v1 = str_replace(array('v', 'V'), '', $v1);
-		$v2 = str_replace(array('v', 'V'), '', $v2);
-
+		// phpcs:enable
 		$v1       = explode('.', $v1);
 		$v2       = explode('.', $v2);
 		$ret      = 0;
@@ -780,8 +778,8 @@
 			}
 		}
 
-		if (!empty($request['curl_error_msg'])) {
-			$error_message .= ' - ' . $request['curl_error_msg'];
+		if (!empty($request['response']['curl_error_msg'])) {
+			$error_message .= ' - ' . $request['response']['curl_error_msg'];
 		}
 
 		// Return the formatted error message

########## admin/security.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/security.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/security.php	2025-06-27 11:43:39.309673000 +0000
@@ -444,7 +444,7 @@
 print '<tr class="oddeven">';
 print '<td colspan="3">'.$langs->trans("MainDbPasswordFileConfEncrypted").'</td>';
 print '<td align="center" width="60">';
-if (preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) {
+if (preg_match('/crypted:/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) {
 	print img_picto($langs->trans("Active"), 'tick');
 }
 
@@ -483,7 +483,7 @@
 	print "</td>";
 }
 if (getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK')) {
-	print '<td class="center" width="100">';
+	print '<td center="center" width="100">';
 	print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=disable_MAIN_SECURITY_DISABLEFORGETPASSLINK&token='.newToken().'">'.$langs->trans("Disable").'</a>';
 	print "</td>";
 }

########## admin/security_other.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/security_other.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/security_other.php	2025-06-27 11:43:39.349396000 +0000
@@ -214,6 +214,19 @@
 print '</td>';
 print '</tr>';
 
+/*
+if (empty($conf->global->MAIN_APPLICATION_TITLE)) {
+	$conf->global->MAIN_APPLICATION_TITLE = "";
+}
+print '<tr class="oddeven">';
+print '<td>'.$langs->trans("MAIN_APPLICATION_TITLE").'</td><td class="right">';
+print '</td>';
+print '<td class="nowrap">';
+print '<input class="flat" name="MAIN_APPLICATION_TITLE" type="text" size="20" value="'.dol_escape_htmltag($conf->global->MAIN_APPLICATION_TITLE).'"> ';
+print '</td>';
+print '</tr>';
+*/
+
 print '</table>';
 
 print $form->buttonsSaveCancel("Modify", '');

########## admin/system/perf.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/system/perf.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/system/perf.php	2025-06-27 11:43:39.218262000 +0000
@@ -480,7 +480,7 @@
 print img_picto('', 'folder', 'class="pictofixedwidth"');
 print '<strong>'.$langs->trans("HTTPCacheStaticResources").' - '.$langs->trans("CacheByClient").'</strong><br>';
 print '<div class="divsection">';
-print '<div id="httpcachebybrowser"><span class="opacitymedium">'.img_picto('', 'question.png', 'class="pictofixedwidth"').' '.$langs->trans("TestNotPossibleWithCurrentBrowsers").'</span></div>';
+print '<div id="httpcachebybrowser">'.img_picto('', 'question.png', 'class="pictofixedwidth"').' '.$langs->trans("TestNotPossibleWithCurrentBrowsers").'</div>';
 print '</div>';
 
 
@@ -704,8 +704,7 @@
 	print img_picto('', 'minus', 'class="pictofixedwidth"');
 }
 print $form->textwithpicto($langs->trans("EnableFileCache").' ('.$langs->trans("Widgets").')', $langs->trans("Option").' MAIN_ACTIVATE_FILECACHE');
-print ': ';
-print yn(getDolGlobalInt('MAIN_ACTIVATE_FILECACHE'));
+print ': '.yn(getDolGlobalInt('MAIN_ACTIVATE_FILECACHE'));
 print '<br>';
 
 if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
@@ -713,8 +712,7 @@
 } else {
 	print img_picto('', 'minus', 'class="pictofixedwidth"');
 }
-print $form->textwithpicto($langs->trans('MAIN_ENABLE_AJAX_TOOLTIP'), $langs->trans("Option").' MAIN_ENABLE_AJAX_TOOLTIP');
-print ': ';
+print 'MAIN_ENABLE_AJAX_TOOLTIP : ';
 print yn(getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP'));
 print '<br>';
 
@@ -724,8 +722,7 @@
 } else {
 	print img_picto('', 'minus', 'class="pictofixedwidth"');
 }
-print $form->textwithpicto($langs->trans('MAIN_CACHE_COUNT'), $langs->trans("Option").' MAIN_CACHE_COUNT');
-print ': ';
+print 'MAIN_CACHE_COUNT : ';
 print yn(getDolGlobalInt('MAIN_CACHE_COUNT'));
 //.' '.img_picto('', 'warning.png');
 print '<br>';
@@ -744,8 +741,7 @@
 } else {
 	print img_picto('', 'minus', 'class="pictofixedwidth"');
 }
-print $form->textwithpicto($langs->trans('MAIN_DO_FETCH_IN_ONE_SQL_REQUEST'), $langs->trans("Option").' MAIN_DO_FETCH_IN_ONE_SQL_REQUEST');
-print ' = '.getDolGlobalString('MAIN_DO_FETCH_IN_ONE_SQL_REQUEST', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>');
+print 'MAIN_DO_FETCH_IN_ONE_SQL_REQUEST = '.getDolGlobalString('MAIN_DO_FETCH_IN_ONE_SQL_REQUEST', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>');
 //print ' &nbsp; ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)</span>')."<br>";
 print '<br>';
 print '</div>';

########## admin/system/security.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/system/security.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/system/security.php	2025-06-27 11:43:39.219809000 +0000
@@ -527,7 +527,7 @@
 /*
 $usepassinconfencrypted = 0;
 global $dolibarr_main_db_pass, $dolibarr_main_db_encrypted_pass;
-if (preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) {
+if (preg_match('/crypted:/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) {
 	$usepassinconfencrypted = 1;
 }
 print '<strong>'.$langs->trans("MainDbPasswordFileConfEncrypted").'</strong>: ';

########## admin/ticket.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/ticket.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/ticket.php	2025-06-27 11:43:39.192241000 +0000
@@ -198,7 +198,7 @@
 	include_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
 
 	$notification_email = GETPOST('TICKET_NOTIFICATION_EMAIL_FROM', 'alpha');
-	$notification_email_description = "Email of user allowed to send ticket replies from Dolibarr";
+	$notification_email_description = "Sender of ticket replies sent from Dolibarr";
 	if (!empty($notification_email)) {
 		$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_FROM', $notification_email, 'chaine', 0, $notification_email_description, $conf->entity);
 	} else { // If an empty e-mail address is providen, use the global "FROM" since an empty field will cause other issues
@@ -208,17 +208,6 @@
 		$error++;
 	}
 
-	$notification_email_replyto = GETPOST('TICKET_NOTIFICATION_EMAIL_REPLYTO', 'alpha');
-	$notification_email_replyto_description = "Email that must appears as the sender of ticket replies sent from Dolibarr";
-	if (!empty($notification_email)) {
-		$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_REPLYTO', $notification_email_replyto, 'chaine', 0, $notification_email_replyto_description, $conf->entity);
-	} else {
-		$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_REPLYTO', getDolGlobalString('MAIN_MAIL_EMAIL_FROM'), 'chaine', 0, $notification_email_replyto_description, $conf->entity);
-	}
-	if (!($res > 0)) {
-		$error++;
-	}
-
 	// altairis : differentiate notification email FROM and TO
 	$notification_email_to = GETPOST('TICKET_NOTIFICATION_EMAIL_TO', 'alpha');
 	$notification_email_to_description = "Notified e-mail for ticket replies sent from Dolibarr";
@@ -656,7 +645,7 @@
 	print "</tr>\n";
 }
 
-// Email of sender allowed to send technical notifications
+// Email to send notifications
 print '<tr class="oddeven"><td><label for="TICKET_NOTIFICATION_EMAIL_FROM" class="block">'.$langs->trans("TicketEmailNotificationFrom").'</label></td>';
 print '<td class="left">';
 print img_picto('', 'email', 'class="pictofixedwidth"');
@@ -666,16 +655,6 @@
 print '</td>';
 print '</tr>';
 
-// Email that must appears as the sender of email notifications
-print '<tr class="oddeven"><td><label for="TICKET_NOTIFICATION_EMAIL_REPLYTO" class="block">'.$langs->trans("TicketEmailNotificationReplyTo").'</label></td>';
-print '<td class="left">';
-print img_picto('', 'email', 'class="pictofixedwidth"');
-print '<input type="text" class="minwidth200" id="TICKET_NOTIFICATION_EMAIL_REPLYTO" name="TICKET_NOTIFICATION_EMAIL_REPLYTO" value="' . getDolGlobalString('TICKET_NOTIFICATION_EMAIL_REPLYTO').'"></td>';
-print '<td class="center">';
-print $formcategory->textwithpicto('', $langs->trans("TicketEmailNotificationReplyToHelp"), 1, 'help');
-print '</td>';
-print '</tr>';
-
 print '<tr class="oddeven"><td class="titlefieldmiddle"><label for="TICKET_SEND_INTERNAL_CC" class="block">';
 print $form->textwithpicto($langs->trans("TicketSendToInternalCC"), $langs->trans("TicketSendToInternalCCHelp")).'</label></td>';
 print '<td>';

########## admin/tools/listevents.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/tools/listevents.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/tools/listevents.php	2025-06-27 11:43:39.368989000 +0000
@@ -72,7 +72,7 @@
 $search_desc = GETPOST("search_desc", "alpha");
 $search_ua   = GETPOST("search_ua", "restricthtml");
 $search_prefix_session = GETPOST("search_prefix_session", "restricthtml");
-$search_entity = ($user->entity > 0 ? $user->entity : GETPOSTINT('search_entity'));		// TODO Replace with $search_entity = GETPOSTINT('search_entity') when the filter is available on screen for this page
+$search_entity = ($user->entity > 0 ? $user->entity : GETPOSTINT('search_entity'));
 
 $now = dol_now();
 $nowarray = dol_getdate($now);

########## admin/tools/ui/class/documentation.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/tools/ui/class/documentation.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/tools/ui/class/documentation.class.php	2025-06-27 11:43:39.409575000 +0000
@@ -259,15 +259,14 @@
 	}
 
 	/**
-	 * Output header + body
+	 *    Output header + body
 	 *
 	 * @param string $title Title of page
-	 * @param 	string[]	$arrayofjs		Array of complementary js files
-	 * @param 	string[]	$arrayofcss		Array of complementary css files
-	 * @param	string		$hidenavmenu	Hide nav menu
+	 * @param 	string[]	$arrayofjs		 Array of complementary js files
+	 * @param 	string[]	$arrayofcss		 Array of complementary css files
 	 * @return void
 	 */
-	public function docHeader($title = '', $arrayofjs = [], $arrayofcss = [], $hidenavmenu = '')
+	public function docHeader($title = '', $arrayofjs = [], $arrayofcss = [])
 	{
 		global $langs;
 		$title = (!empty($title)) ? dol_escape_htmltag($title) : $langs->trans('Documentation');
@@ -276,7 +275,7 @@
 
 		top_htmlhead('',  $title, 0, 0, $arrayofjs, $arrayofcss);
 
-		print '<body class="dolibarr-doc'.($hidenavmenu ? "-bis" : "").'">';
+		print '<body class="dolibarr-doc">';
 	}
 
 	/**

########## admin/tools/ui/components/icons.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/tools/ui/components/icons.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/tools/ui/components/icons.php	2025-06-27 11:43:39.381047000 +0000
@@ -42,7 +42,7 @@
 $documentation = new Documentation($db);
 
 // Output html head + body - Param is Title
-$documentation->docHeader('Icons', [], ['admin/tools/ui/css/doc-icons.css'], GETPOST('hidenavmenu'));
+$documentation->docHeader('Icons', [], ['admin/tools/ui/css/doc-icons.css']);
 
 // Set view for menu and breadcrumb
 // Menu must be set in constructor of documentation class

########## admin/tools/ui/css/documentation.css
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/tools/ui/css/documentation.css	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/tools/ui/css/documentation.css	2025-06-27 11:43:39.391538000 +0000
@@ -109,7 +109,6 @@
 
 /* Documentation summary */
 .doc-wrapper .doc-content-wrapper .summary-wrapper {margin-bottom: 32px;}
-.doc-wrapper-bis .doc-content-wrapper .summary-wrapper {margin-bottom: 32px;}
 .doc-wrapper .doc-content-wrapper ul.documentation-summary {margin: 0;padding: 0;color: rgba(0, 0, 0, .25);}
 .doc-wrapper .doc-content-wrapper ul.documentation-summary li {list-style: disc;margin-left: 16px;}
 .doc-wrapper .doc-content-wrapper ul.documentation-summary li ul {margin: 0;padding: 0 ;color: rgba(0, 0, 0, .25);}

########## admin/translation.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/translation.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/translation.php	2025-06-27 11:43:39.304818000 +0000
@@ -363,22 +363,15 @@
 		$disablededit = ' disabled';
 	}
 
-	$text = $langs->trans("SomeTranslationAreUncomplete");
+	$infoOnTransProcess = '<div class="justify"><span class="opacitymedium">';
+	$infoOnTransProcess .= img_info().' '.$langs->trans("SomeTranslationAreUncomplete");
 	$urlwikitranslatordoc = 'https://wiki.dolibarr.org/index.php/Translator_documentation';
-	$text .= ' - <a href="'.$urlwikitranslatordoc.'" target="_blank" rel="noopener noreferrer external">'.$langs->trans("SeeAlso", $langs->transnoentitiesnoconv("Here")).' '.img_picto('', 'url').'</a>.<br>';
-	$infoOnTransProcess = info_admin($text);
-
-	$infoOnTransProcess .= '<div class="justify">';
-	$infoOnTransProcess .= '<span class="opacitymedium">';
+	$infoOnTransProcess .= ' ('.str_replace('{s1}', '<a href="'.$urlwikitranslatordoc.'" target="_blank" rel="noopener noreferrer external">'.$langs->trans("Here").'</a>', $langs->trans("SeeAlso", '{s1}')).')<br>';
+	$infoOnTransProcess .= '<br>';
 	$infoOnTransProcess .= $langs->trans("TranslationOverwriteDesc", $langs->transnoentitiesnoconv("Language"), $langs->transnoentitiesnoconv("TranslationKey"), $langs->transnoentitiesnoconv("NewTranslationStringToShow"))."\n";
 	$infoOnTransProcess .= ' ('.$langs->trans("TranslationOverwriteDesc2").').'."<br>\n";
 	$infoOnTransProcess .= '</span></div>';
 
-	// If a cache for translation is on, show a warning.
-	if (isModEnabled('memcached') || getDolGlobalInt('MAIN_USE_CACHE_FOR_TRANSLATION')) {
-		$infoOnTransProcess .= info_admin($langs->trans("CacheForTranslationIsUsed"), 0, 0, '1', 'warning');
-	}
-
 	print $infoOnTransProcess;
 
 	print '<br>';
@@ -650,8 +643,8 @@
 		}
 		print '<span title="'.dolPrintHTMLForAttribute($titleforvalue).'" class="classfortooltip">';
 		print dolPrintHTML($val);
-		if (substr_count($langsenfileonly->tab_translate[$key], '%s') > 5) {
-			print '<br><div class="warning">Error, more than 5 %s in the source</div>';
+		if (substr_count($langsenfileonly->tab_translate[$key], '%s') > 4) {
+			print '<br><div class="warning">Error, more than 4 %s in the source</div>';
 		}
 		print '</span>';
 		print '</td>';

########## ai/class/ai.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/ai/class/ai.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/ai/class/ai.class.php	2025-06-27 11:43:39.064354000 +0000
@@ -138,7 +138,7 @@
 			}
 		}
 
-		dol_syslog("Call API for apiKey=".substr($this->apiKey, 0, 5).'***********, apiEndpoint='.$this->apiEndpoint.", model=".$model);
+		dol_syslog("Call API for apiKey=".substr($this->apiKey, 0, 3).'***********, apiEndpoint='.$this->apiEndpoint.", model=".$model);
 
 		try {
 			if (empty($this->apiEndpoint)) {
@@ -256,7 +256,7 @@
 				throw new Exception('API request failed. No http received');
 			}
 			if (!empty($response['http_code']) && $response['http_code'] != 200) {
-				if (in_array($response['http_code'], array(400, 401, 403, 429)) && !empty($response['content'])) {
+				if ($response['http_code'] == 400 && !empty($response['content'])) {
 					$tmp = json_decode($response['content'], true);
 					if (!empty($tmp['message'])) {
 						return array(

########## api/class/api_access.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/api/class/api_access.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/api/class/api_access.class.php	2025-06-27 11:43:39.081657000 +0000
@@ -124,7 +124,7 @@
 			$api_key = preg_replace('/^Bearer\s+/i', '', empty($headers['Authorization']) ? '' : $headers['Authorization']);
 		};
 
-		$api_key = dol_string_nounprintableascii($api_key, 1);
+		$api_key = dol_string_nounprintableascii($api_key);
 
 		if (preg_match('/^dolcrypt:/i', $api_key)) {
 			throw new RestException(503, 'Bad value for the API key. An API key should not start with dolcrypt:');
@@ -182,7 +182,7 @@
 			}
 
 			// Check if user status is enabled
-			if ($fuser->status != $fuser::STATUS_ENABLED) {
+			if ($fuser->statut != $fuser::STATUS_ENABLED) {
 				// Status is disabled
 				dol_syslog("functions_isallowed::check_user_api_key Authentication KO for '".$login."': The user has been disabled", LOG_NOTICE);
 				sleep(1); // Anti brute force protection. Must be same delay when user and password are not valid.
@@ -205,14 +205,6 @@
 				throw new RestException(401, $genericmessageerroruser);
 			}
 
-			// TODO
-			// Increase counter of API access
-			if (getDolGlobalString('API_COUNTER_ENABLED')) {
-				include DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
-				dolibarr_set_const($this->db, 'API_COUNTER_COUNT', getDolGlobalInt('API_COUNTER_COUNT') + 1);
-				//var_dump('eeee');exit;
-			}
-
 			// User seems valid
 			$fuser->loadRights();
 

########## api/class/api_documents.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/api/class/api_documents.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/api/class/api_documents.class.php	2025-06-27 11:43:39.083669000 +0000
@@ -548,7 +548,7 @@
 		} elseif ($modulepart == 'knowledgemanagement') {
 			require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/class/knowledgerecord.class.php';
 
-			if (!DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) {
+			if (!DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read') && !DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) {
 				throw new RestException(403);
 			}
 

########## barcode/codeinit.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/barcode/codeinit.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/barcode/codeinit.php	2025-06-27 11:43:39.454734000 +0000
@@ -294,16 +294,19 @@
 
 llxHeader('', $langs->trans("MassBarcodeInit"), '', '', 0, 0, '', '', '', 'mod-barcode page-codeinit');
 
-if (!GETPOST('dol_openinpopup', 'aZ')) {
-	print load_fiche_titre($langs->trans("MassBarcodeInit"), '', 'title_setup.png');
-	print '<br>';
-}
+print load_fiche_titre($langs->trans("MassBarcodeInit"), '', 'title_setup.png');
+print '<br>';
 
 print '<span class="opacitymedium">'.$langs->trans("MassBarcodeInitDesc").'</span><br>';
 print '<br>';
+
+//print img_picto('','puce').' '.$langs->trans("PrintsheetForOneBarCode").'<br>';
+//print '<br>';
+
 print '<br>';
 
 
+
 // Example 1 : Adding jquery code
 print '<script type="text/javascript">
 function confirm_erase() {
@@ -312,79 +315,64 @@
 </script>';
 
 
-// For products
-if (isModEnabled('product') || isModEnabled('service')) {
+// For thirdparty
+if (isModEnabled('societe')) {
 	print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 	print '<input type="hidden" name="mode" value="label">';
-	print '<input type="hidden" name="action" value="initbarcodeproducts">';
+	print '<input type="hidden" name="action" value="initbarcodethirdparties">';
 	print '<input type="hidden" name="token" value="'.newToken().'">';
-	print '<input type="hidden" name="dol_openinpopup" value="'.GETPOST('dol_openinpopup', 'aZ').'">';
-
-	$nbproductno = $nbproducttotal = 0;
+	$nbthirdpartyno = $nbthirdpartytotal = 0;
 
 	print '<div class="divsection">';
 
-	print load_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"), '', 'product');
+	print load_fiche_titre($langs->trans("BarcodeInitForThirdparties"), '', 'company');
 
-	$sql = "SELECT count(rowid) as nb, fk_product_type, datec";
-	$sql .= " FROM ".MAIN_DB_PREFIX."product";
-	$sql .= " WHERE barcode IS NULL OR barcode = ''";
-	$sql .= " AND entity IN (".getEntity('product').")";
-	$sql .= " GROUP BY fk_product_type, datec";
-	$sql .= " ORDER BY datec";
+	$sql = "SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."societe where barcode IS NULL or barcode = ''";
 	$resql = $db->query($sql);
 	if ($resql) {
-		$num = $db->num_rows($resql);
-
-		$i = 0;
-		while ($i < $num) {
-			$obj = $db->fetch_object($resql);
-			$nbproductno += $obj->nb;
-
-			$i++;
-		}
+		$obj = $db->fetch_object($resql);
+		$nbthirdpartyno = $obj->nb;
 	} else {
 		dol_print_error($db);
 	}
 
-	$sql = "SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."product";
-	$sql .= " WHERE entity IN (".getEntity('product').")";
+	$sql = "SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."societe";
+	$sql .= " WHERE entity IN (".getEntity('societe').")";
 	$resql = $db->query($sql);
 	if ($resql) {
 		$obj = $db->fetch_object($resql);
-		$nbproducttotal = $obj->nb;
+		$nbthirdpartytotal = $obj->nb;
 	} else {
 		dol_print_error($db);
 	}
 
-	print $langs->trans("CurrentlyNWithoutBarCode", $nbproductno, $nbproducttotal, $langs->transnoentitiesnoconv("ProductsOrServices"))."\n";
-
-	$disabledproduct = $disabledproduct1 = 0;
+	print $langs->trans("CurrentlyNWithoutBarCode", $nbthirdpartyno, $nbthirdpartytotal, $langs->transnoentitiesnoconv("ThirdParties"))."\n";
 
+	$disabledthirdparty = $disabledthirdparty1 = 0;
 	$titleno = '';
-	if (is_object($modBarCodeProduct)) {
+
+	if (is_object($modBarCodeThirdparty)) {
 		print '<br>'.$langs->trans("BarCodeNumberManager").": ";
-		$objproduct = new Product($db);
-		print '<b>'.(isset($modBarCodeProduct->name) ? $modBarCodeProduct->name : $modBarCodeProduct->nom).'</b> - '.$langs->trans("NextValue").': <b>'.$modBarCodeProduct->getNextValue($objproduct).'</b><br>';
-		$disabledproduct = 0;
+		$objthirdparty = new Societe($db);
+		print '<b>'.(isset($modBarCodeThirdparty->name) ? $modBarCodeThirdparty->name : $modBarCodeThirdparty->nom).'</b> - '.$langs->trans("NextValue").': <b>'.$modBarCodeThirdparty->getNextValue($objthirdparty).'</b><br>';
+		$disabledthirdparty = 0;
 		print '<br>';
 	} else {
-		$disabledproduct = 1;
+		$disabledthirdparty = 1;
 		$titleno = $langs->trans("NoBarcodeNumberingTemplateDefined");
-		print '<br><div class="warning">'.$langs->trans("NoBarcodeNumberingTemplateDefined");
+		print '<div class="warning">'.$langs->trans("NoBarcodeNumberingTemplateDefined");
 		print '<br><a href="'.DOL_URL_ROOT.'/admin/barcode.php">'.$langs->trans("ToGenerateCodeDefineAutomaticRuleFirst").'</a>';
 		print '</div>';
 	}
-	if (empty($nbproductno)) {
-		$disabledproduct1 = 1;
+	if (empty($nbthirdpartyno)) {
+		$disabledthirdparty1 = 1;
 	}
 
-	//print '<input type="checkbox" id="erasealreadyset" name="erasealreadyset"> '.$langs->trans("ResetBarcodeForAllRecords").'<br>';
-	$moretagsproduct1 = (($disabledproduct || $disabledproduct1) ? ' disabled title="'.dol_escape_htmltag($titleno).'"' : '');
-	print '<input type="submit" class="button" name="submitformbarcodeproductgen" id="submitformbarcodeproductgen" value="'.$langs->trans("InitEmptyBarCode", min($maxperinit, $nbproductno)).'"'.$moretagsproduct1.'>';
-	$moretagsproduct2 = (($nbproductno == $nbproducttotal) ? ' disabled' : '');
+	$moretagsthirdparty1 = (($disabledthirdparty || $disabledthirdparty1) ? ' disabled title="'.dol_escape_htmltag($titleno).'"' : '');
+	print '<input class="button button-add" type="submit" id="submitformbarcodethirdpartygen" value="'.$langs->trans("InitEmptyBarCode", $nbthirdpartyno).'"'.$moretagsthirdparty1.'>';
+	$moretagsthirdparty2 = (($nbthirdpartyno == $nbthirdpartytotal) ? ' disabled' : '');
 	print ' &nbsp; ';
-	print '<input type="submit" class="button butActionDelete" name="eraseallproductbarcode" id="eraseallproductbarcode" value="'.$langs->trans("EraseAllCurrentBarCode").'"'.$moretagsproduct2.' onClick="return confirm_erase();">';
+	print '<input type="submit" class="button butActionDelete" name="eraseallthirdpartybarcode" id="eraseallthirdpartybarcode" value="'.$langs->trans("EraseAllCurrentBarCode").'"'.$moretagsthirdparty2.' onClick="return confirm_erase();">';
 	print '<br><br>';
 	print '</div>';
 	print '<br>';
@@ -392,67 +380,78 @@
 }
 
 
-
-// For thirdparty
-if (isModEnabled('societe')) {
+// For products
+if (isModEnabled('product') || isModEnabled('service')) {
 	print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 	print '<input type="hidden" name="mode" value="label">';
-	print '<input type="hidden" name="action" value="initbarcodethirdparties">';
+	print '<input type="hidden" name="action" value="initbarcodeproducts">';
 	print '<input type="hidden" name="token" value="'.newToken().'">';
-	print '<input type="hidden" name="dol_openinpopup" value="'.GETPOST('dol_openinpopup', 'aZ').'">';
 
-	$nbthirdpartyno = $nbthirdpartytotal = 0;
+	$nbproductno = $nbproducttotal = 0;
 
 	print '<div class="divsection">';
 
-	print load_fiche_titre($langs->trans("BarcodeInitForThirdparties"), '', 'company');
+	print load_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"), '', 'product');
 
-	$sql = "SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."societe where barcode IS NULL or barcode = ''";
+	$sql = "SELECT count(rowid) as nb, fk_product_type, datec";
+	$sql .= " FROM ".MAIN_DB_PREFIX."product";
+	$sql .= " WHERE barcode IS NULL OR barcode = ''";
+	$sql .= " AND entity IN (".getEntity('product').")";
+	$sql .= " GROUP BY fk_product_type, datec";
+	$sql .= " ORDER BY datec";
 	$resql = $db->query($sql);
 	if ($resql) {
-		$obj = $db->fetch_object($resql);
-		$nbthirdpartyno = $obj->nb;
+		$num = $db->num_rows($resql);
+
+		$i = 0;
+		while ($i < $num) {
+			$obj = $db->fetch_object($resql);
+			$nbproductno += $obj->nb;
+
+			$i++;
+		}
 	} else {
 		dol_print_error($db);
 	}
 
-	$sql = "SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."societe";
-	$sql .= " WHERE entity IN (".getEntity('societe').")";
+	$sql = "SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."product";
+	$sql .= " WHERE entity IN (".getEntity('product').")";
 	$resql = $db->query($sql);
 	if ($resql) {
 		$obj = $db->fetch_object($resql);
-		$nbthirdpartytotal = $obj->nb;
+		$nbproducttotal = $obj->nb;
 	} else {
 		dol_print_error($db);
 	}
 
-	print $langs->trans("CurrentlyNWithoutBarCode", $nbthirdpartyno, $nbthirdpartytotal, $langs->transnoentitiesnoconv("ThirdParties"))."\n";
+	print $langs->trans("CurrentlyNWithoutBarCode", $nbproductno, $nbproducttotal, $langs->transnoentitiesnoconv("ProductsOrServices"))."\n";
 
-	$disabledthirdparty = $disabledthirdparty1 = 0;
-	$titleno = '';
+	$disabledproduct = $disabledproduct1 = 0;
 
-	if (is_object($modBarCodeThirdparty)) {
+	$titleno = '';
+	if (is_object($modBarCodeProduct)) {
 		print '<br>'.$langs->trans("BarCodeNumberManager").": ";
-		$objthirdparty = new Societe($db);
-		print '<b>'.(isset($modBarCodeThirdparty->name) ? $modBarCodeThirdparty->name : $modBarCodeThirdparty->nom).'</b> - '.$langs->trans("NextValue").': <b>'.$modBarCodeThirdparty->getNextValue($objthirdparty).'</b><br>';
-		$disabledthirdparty = 0;
+		$objproduct = new Product($db);
+		print '<b>'.(isset($modBarCodeProduct->name) ? $modBarCodeProduct->name : $modBarCodeProduct->nom).'</b> - '.$langs->trans("NextValue").': <b>'.$modBarCodeProduct->getNextValue($objproduct).'</b><br>';
+		$disabledproduct = 0;
 		print '<br>';
 	} else {
-		$disabledthirdparty = 1;
+		$disabledproduct = 1;
 		$titleno = $langs->trans("NoBarcodeNumberingTemplateDefined");
-		print '<div class="warning">'.$langs->trans("NoBarcodeNumberingTemplateDefined");
+		print '<br><div class="warning">'.$langs->trans("NoBarcodeNumberingTemplateDefined");
 		print '<br><a href="'.DOL_URL_ROOT.'/admin/barcode.php">'.$langs->trans("ToGenerateCodeDefineAutomaticRuleFirst").'</a>';
 		print '</div>';
 	}
-	if (empty($nbthirdpartyno)) {
-		$disabledthirdparty1 = 1;
+	if (empty($nbproductno)) {
+		$disabledproduct1 = 1;
 	}
 
-	$moretagsthirdparty1 = (($disabledthirdparty || $disabledthirdparty1) ? ' disabled title="'.dol_escape_htmltag($titleno).'"' : '');
-	print '<input class="button button-add" type="submit" id="submitformbarcodethirdpartygen" value="'.$langs->trans("InitEmptyBarCode", $nbthirdpartyno).'"'.$moretagsthirdparty1.'>';
-	$moretagsthirdparty2 = (($nbthirdpartyno == $nbthirdpartytotal) ? ' disabled' : '');
+	//print '<input type="checkbox" id="erasealreadyset" name="erasealreadyset"> '.$langs->trans("ResetBarcodeForAllRecords").'<br>';
+	$moretagsproduct1 = (($disabledproduct || $disabledproduct1) ? ' disabled title="'.dol_escape_htmltag($titleno).'"' : '');
+	print '<input type="submit" class="button" name="submitformbarcodeproductgen" id="submitformbarcodeproductgen" value="'.$langs->trans("InitEmptyBarCode", min($maxperinit, $nbproductno)).'"'.$moretagsproduct1.'>';
+	$moretagsproduct2 = (($nbproductno == $nbproducttotal) ? ' disabled' : '');
 	print ' &nbsp; ';
-	print '<input type="submit" class="button butActionDelete" name="eraseallthirdpartybarcode" id="eraseallthirdpartybarcode" value="'.$langs->trans("EraseAllCurrentBarCode").'"'.$moretagsthirdparty2.' onClick="return confirm_erase();">';
+	print '<input type="submit" class="button butActionDelete" name="eraseallproductbarcode" id="eraseallproductbarcode" value="'.$langs->trans("EraseAllCurrentBarCode").'"'.$moretagsproduct2.' onClick="return confirm_erase();">';
 	print '<br><br>';
 	print '</div>';
 	print '<br>';

########## blockedlog/class/blockedlog.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/blockedlog/class/blockedlog.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/blockedlog/class/blockedlog.class.php	2025-06-27 11:43:39.019647000 +0000
@@ -400,7 +400,7 @@
 	}
 
 	/**
-	 *	Populate properties of an unalterable log entry from object data
+	 *	Populate properties of log from object data
 	 *
 	 *	@param	CommonObject|stdClass	$object		object to store
 	 *	@param	string					$action		action
@@ -955,18 +955,18 @@
 
 		$previoushash = $this->getPreviousHash(1, 0); // This get last record and lock database until insert is done and transaction closed
 
-		$concatenatedata = $this->buildKeyForSignature();	// All the information for the hash (meta data + data saved)
+		$keyforsignature = $this->buildKeyForSignature();	// All the information for the hash (meta data + data saved)
 
 		$this->debuginfo = $this->buildFirstPartOfKeyForSignature();
 
 		include_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
 
-		$this->signature_line = dol_hash($concatenatedata, '5'); // Not really useful
-		$this->signature = dol_hash($previoushash.$concatenatedata, '5');
+		$this->signature_line = dol_hash($keyforsignature, '5'); // Not really useful
+		$this->signature = dol_hash($previoushash.$keyforsignature, '5');
 		if ($forcesignature) {
 			$this->signature = $forcesignature;
 		}
-		//var_dump($concatenatedata);var_dump($previoushash);var_dump($this->signature_line);var_dump($this->signature);
+		//var_dump($keyforsignature);var_dump($previoushash);var_dump($this->signature_line);var_dump($this->signature);
 
 		$sql = "INSERT INTO ".MAIN_DB_PREFIX."blockedlog (";
 		$sql .= " date_creation,";
@@ -1049,11 +1049,11 @@
 		}
 
 		// Build the string for the signature
-		$concatenatedata = $this->buildKeyForSignature();
+		$keyforsignature = $this->buildKeyForSignature();
 
-		//$signature_line = dol_hash($concatenatedata, '5'); // Not really useful
-		$signature = dol_hash($previoushash.$concatenatedata, 'sha256');
-		//var_dump($previoushash); var_dump($concatenatedata); var_dump($signature_line); var_dump($signature);
+		//$signature_line = dol_hash($keyforsignature, '5'); // Not really useful
+		$signature = dol_hash($previoushash.$keyforsignature, 'sha256');
+		//var_dump($previoushash); var_dump($keyforsignature); var_dump($signature_line); var_dump($signature);
 
 		$res = ($signature === $this->signature);
 
@@ -1063,13 +1063,13 @@
 
 		if ($returnarray) {
 			if ($returnarray == 1) {
-				unset($concatenatedata);
+				unset($keyforsignature);
 				return array('checkresult' => $res, 'calculatedsignature' => $signature, 'previoushash' => $previoushash);
-			} else {	// Consume much memory ($concatenatedata is a large var)
-				return array('checkresult' => $res, 'calculatedsignature' => $signature, 'previoushash' => $previoushash, 'keyforsignature' => $concatenatedata);
+			} else {	// Consume much memory ($keyforsignature is a large var)
+				return array('checkresult' => $res, 'calculatedsignature' => $signature, 'previoushash' => $previoushash, 'keyforsignature' => $keyforsignature);
 			}
 		} else {
-			unset($concatenatedata);
+			unset($keyforsignature);
 			return $res;
 		}
 	}
@@ -1312,7 +1312,7 @@
 		$result = false;
 
 		$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog";
-		$sql .= " WHERE entity = ".((int) $conf->entity);
+		$sql .= " WHERE entity = ".$conf->entity;
 		if ($ignoresystem) {
 			$sql .= " AND action not in ('MODULE_SET','MODULE_RESET')";
 		}

########## bom/bom_list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/bom/bom_list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/bom/bom_list.php	2025-06-27 11:43:39.528409000 +0000
@@ -42,7 +42,8 @@
 // Load translation files required by the page
 $langs->loadLangs(array('mrp', 'other'));
 
-// Get parameters
+// Get Parameters
+$id         = GETPOSTINT('id');
 $action     = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
 $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
 $show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ?
@@ -54,7 +55,6 @@
 $optioncss   = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
 $mode        = GETPOST('mode', 'aZ');  // mode view (kanban or common)
 
-$id         = GETPOSTINT('id');
 
 // Load variable for pagination
 $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
@@ -104,8 +104,8 @@
 	}
 }
 
-// List of fields to search into when doing a "search in all"
 $fieldstosearchall = array();
+// List of fields to search into when doing a "search in all"
 foreach ($object->fields as $key => $val) {
 	if (!empty($val['searchall'])) {
 		$fieldstosearchall['t.'.$key] = $val['label'];
@@ -139,6 +139,7 @@
 
 // Security check
 if ($user->socid > 0) {
+	// Protection if external user
 	accessforbidden();
 }
 $result = restrictedArea($user, 'bom');
@@ -171,15 +172,11 @@
 	if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
 		foreach ($object->fields as $key => $val) {
 			$search[$key] = '';
-			if ($key == 'status') {
-				$search[$key] = -1;
-			}
 			if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
 				$search[$key.'_dtstart'] = '';
 				$search[$key.'_dtend'] = '';
 			}
 		}
-		$search_all = '';
 		$toselect = array();
 		$search_array_options = array();
 	}
@@ -191,6 +188,8 @@
 	// Mass actions
 	$objectclass = 'BOM';
 	$objectlabel = 'BillOfMaterials';
+	$permissiontoread = $user->hasRight('bom', 'read');
+	$permissiontodelete = $user->hasRight('bom', 'delete');
 	$uploaddir = $conf->bom->dir_output;
 	include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
 
@@ -374,7 +373,7 @@
 /* If a group by is required
 $sql.= " GROUP BY ";
 foreach($object->fields as $key => $val) {
-	$sql .= "t.".$db->sanitize($key).", ";
+	$sql .= "t.".$db->escape($key).", ";
 }
 // Add fields from extrafields
 if (!empty($extrafields->attributes[$object->table_element]['label'])) {
@@ -552,7 +551,7 @@
 $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
 
-print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
+print '<div class="div-table-responsive">';
 print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
 
 
@@ -741,7 +740,6 @@
 				$totalarray['nbfield']++;
 			}
 		}
-		// Fields
 		foreach ($object->fields as $key => $val) {
 			$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
 			if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
@@ -763,7 +761,7 @@
 			if (!empty($arrayfields['t.'.$key]['checked'])) {
 				print '<td'.($cssforfield ? ' class="'.$cssforfield.(preg_match('/tdoverflow/', $cssforfield) ? ' classfortooltip' : '').'"' : '');
 				if (preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) {
-					print ' title="'.dolPrintHTMLForAttribute((string) $object->$key).'"';
+					print ' title="'.dol_escape_htmltag((string) $object->$key).'"';
 				}
 				print '>';
 				if ($key == 'status') {
@@ -771,13 +769,7 @@
 				} elseif ($key == 'rowid') {
 					print $object->showOutputField($val, $key, (string) $object->id, '');
 				} else {
-					if ($val['type'] == 'html') {
-						print '<div class="small lineheightsmall twolinesmax-normallineheight">';
-					}
-					print $object->showOutputField($val, $key, (string) $object->$key, '');
-					if ($val['type'] == 'html') {
-						print '</div>';
-					}
+					print $object->showOutputField($val, $key, $object->$key, '');
 				}
 				print '</td>';
 				if (!$i) {

########## bom/class/api_boms.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/bom/class/api_boms.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/bom/class/api_boms.class.php	2025-06-27 11:43:39.504783000 +0000
@@ -116,7 +116,7 @@
 		$obj_ret = array();
 		$tmpobject = new BOM($this->db);
 
-		$socid = DolibarrApiAccess::$user->socid ?: '';
+		$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : '';
 
 		$restrictonsocid = 0; // Set to 1 if there is a field socid in table of object
 

########## bom/class/bom.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/bom/class/bom.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/bom/class/bom.class.php	2025-06-27 11:43:39.506711000 +0000
@@ -1442,20 +1442,16 @@
 							$this->error = $tmpproduct->error;
 							return -1;
 						}
-
-						$unit_cost = (float) (is_null($tmpproduct->cost_price) ? $tmpproduct->pmp : $tmpproduct->cost_price);
-						if (empty($unit_cost)) {	// @phpstan-ignore-line phpstan thinks this is always false. No,if unit_cost is 0, it is not.
+						$unit_cost = (!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp;
+						$line->unit_cost = (float) price2num($unit_cost);
+						if (empty($line->unit_cost)) {
 							if ($productFournisseur->find_min_price_product_fournisseur($line->fk_product) > 0) {
 								if ($productFournisseur->fourn_remise_percent != "0") {
 									$line->unit_cost = $productFournisseur->fourn_unitprice_with_discount;
 								} else {
 									$line->unit_cost = $productFournisseur->fourn_unitprice;
 								}
-							} else {
-								$line->unit_cost = 0;
 							}
-						} else {
-							$line->unit_cost = (float) price2num($unit_cost);
 						}
 
 						$line->total_cost = (float) price2num($line->qty * $line->unit_cost, 'MT');

########## categories/categorie_list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/categories/categorie_list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/categories/categorie_list.php	2025-06-27 11:43:39.551551000 +0000
@@ -483,10 +483,7 @@
 	$newcardbutton .= dolGetButtonTitleSeparator();
 	$newcardbutton .= dolGetButtonTitle($langs->trans('NewCategory'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/categories/card.php?action=create&type='.$type.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$param).$param, '', $permissiontoadd);
 
-	$morehtmlrightbeforebutton = '';
-	if (!GETPOST('dol_openinpopup', 'aZ')) {
-		$morehtmlrightbeforebutton = '<a class="small paddingright marginrightonly" href="'.DOL_URL_ROOT.'/categories/index.php">'.$langs->trans("BackToCategoryTypes").'</a> &nbsp; ';
-	}
+	$morehtmlrightbeforebutton = '<a class="small paddingright marginrightonly" href="'.DOL_URL_ROOT.'/categories/index.php">'.$langs->trans("BackToCategoryTypes").'</a> &nbsp; ';
 
 	print_barre_liste($title, 0, $_SERVER["PHP_SELF"], $param, '', '', '', 0, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', 0, 0, 0, 1, $morehtmlrightbeforebutton);
 
@@ -613,10 +610,7 @@
 	$newcardbutton .= dolGetButtonTitleSeparator();
 	$newcardbutton .= dolGetButtonTitle($langs->trans('NewCategory'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/categories/card.php?action=create&type='.$type.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$param).$param, '', $permissiontoadd);
 
-	$morehtmlrightbeforebutton = '';
-	if (!GETPOST('dol_openinpopup', 'aZ')) {
-		$morehtmlrightbeforebutton = '<a class="small paddingright marginrightonly" href="'.DOL_URL_ROOT.'/categories/index.php">'.$langs->trans("BackToCategoryTypes").'</a> &nbsp; ';
-	}
+	$morehtmlrightbeforebutton = '<a class="small paddingright marginrightonly" href="'.DOL_URL_ROOT.'/categories/index.php">'.$langs->trans("BackToCategoryTypes").'</a> &nbsp; ';
 
 	print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1, $morehtmlrightbeforebutton);
 

########## comm/action/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/action/card.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/action/card.php	2025-06-27 11:43:39.622159000 +0000
@@ -1744,7 +1744,7 @@
 		print '$(document).ready(function () {
 	               $("#projectid").change(function () {
                         var url = "'.DOL_URL_ROOT.'/projet/ajax/projects.php?mode=gettasks&socid="+$("#search_socid").val()+"&projectid="+$("#projectid").val();
-						console.log("Call url to get the new list of tasks: "+url);
+						console.log("Call url to get new list of tasks: "+url);
                         $.get(url, function(data) {
                             console.log(data);
                             if (data) $("#taskid").html(data).select2();
@@ -1765,15 +1765,7 @@
 
 		$tid = GETPOSTISSET("projecttaskid") ? GETPOSTINT("projecttaskid") : (GETPOSTISSET("taskid") ? GETPOSTINT("taskid") : '');
 
-		if (empty($projectsListId)) {
-			print '<select class="valignmiddle flat maxwidth500 widthcentpercentminusxx minwidth150imp" id="taskid" name="taskid">';
-			print '<option class="opacitymedium">&nbsp;</option>';
-			print '<option class="opacitymedium" disabled data-html="'.dolPrintHTMLForAttribute($langs->trans("SelectAProjectFirst")).'">'.$langs->trans("SelectAProjectFirst").'</option>';
-			print '</select>';
-			print ajax_combobox('taskid');
-		} else {
-			print $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 32, 0, '1', 1, 0, 0, 'maxwidth500 widthcentpercentminusxx', (string) $projectsListId, 'all', null, 1);
-		}
+		$formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500 widthcentpercentminusxx', (string) $projectsListId);
 		print '</td></tr>';
 	}
 
@@ -2326,7 +2318,7 @@
                 })';
 				print '</script>'."\n";
 
-				print $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $object->fk_element, 'fk_element', 24, 0, '', 1, 0, 0, 'maxwidth500', (string) $object->fk_project, 'all', null, 1);
+				$formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $object->fk_element, 'fk_element', 24, 0, '', 1, 0, 0, 'maxwidth500', (string) $object->fk_project);
 				print '<input type="hidden" name="elementtype" value="'.$object->elementtype.'">';
 
 				print '</td>';
@@ -2357,7 +2349,7 @@
 						$tid = GETPOSTINT("taskid");
 					}
 
-					print $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500 widthcentpercentminusxx', (string) $projectsListId, 'all', null, 1);
+					$formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500 widthcentpercentminusxx', (string) $projectsListId);
 
 					print '</td>';
 				} else {

########## comm/action/class/actioncomm.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/action/class/actioncomm.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/action/class/actioncomm.class.php	2025-06-27 11:43:39.629146000 +0000
@@ -327,11 +327,6 @@
 	public $email_from;
 
 	/**
-	 * @var string Email reply to
-	 */
-	public $email_reply_to;
-
-	/**
 	 * @var string Email sender
 	 */
 	public $email_sender;

########## comm/action/class/api_agendaevents.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/action/class/api_agendaevents.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/action/class/api_agendaevents.class.php	2025-06-27 11:43:39.625850000 +0000
@@ -130,7 +130,7 @@
 		}
 
 		// case of external user
-		$socid = DolibarrApiAccess::$user->socid ?: 0;
+		$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : 0;
 
 		// If the internal user must only see his customers, force searching by him
 		$search_sale = 0;

########## comm/action/index.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/action/index.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/action/index.php	2025-06-27 11:43:39.614643000 +0000
@@ -52,13 +52,6 @@
 $MAXAGENDA = getDolGlobalString('AGENDA_EXT_NB', 5);
 $DELAYFORCACHE = 300;	// 300 seconds
 
-$action = GETPOST('action', 'aZ09');
-$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
-$mode = GETPOST('mode', 'aZ09');
-if (empty($mode) && preg_match('/show_/', $action)) {
-	$mode = $action;	// For backward compatibility
-}
-
 $disabledefaultvalues = GETPOSTINT('disabledefaultvalues');
 
 $check_holiday = GETPOSTINT('check_holiday');
@@ -75,15 +68,13 @@
 
 $newparam = '';
 
-// Pagination parameters
-$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
 $sortfield = GETPOST('sortfield', 'aZ09comma');
 $sortorder = GETPOST('sortorder', 'aZ09comma');
 $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
-if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
-	// If $page is not defined, or '' or -1 or if we click on clear filters
+if (empty($page) || $page == -1) {
 	$page = 0;
-}
+}     // If $page is not defined, or '' or -1
+$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
 $offset = $limit * $page;
 if (!$sortorder) {
 	$sortorder = "ASC";
@@ -112,6 +103,12 @@
 	$filtert = (string) $user->id;
 }
 
+$action = GETPOST('action', 'aZ09');
+
+$mode = GETPOST('mode', 'aZ09');
+if (empty($mode) && preg_match('/show_/', $action)) {
+	$mode = $action;	// For backward compatibility
+}
 $resourceid = GETPOSTINT("search_resourceid");
 $year = GETPOSTINT("year") ? GETPOSTINT("year") : date("Y");
 $month = GETPOSTINT("month") ? GETPOSTINT("month") : date("m");
@@ -121,6 +118,7 @@
 $status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo', 'na' or -1
 $type = GETPOSTISSET("search_type") ? GETPOST("search_type", 'aZ09') : GETPOST("type", 'aZ09');
 $maxprint = GETPOSTISSET("maxprint") ? GETPOSTINT("maxprint") : getDolGlobalInt('AGENDA_MAX_EVENTS_DAY_VIEW', 3);
+$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
 
 $dateselect = dol_mktime(0, 0, 0, GETPOSTINT('dateselectmonth'), GETPOSTINT('dateselectday'), GETPOSTINT('dateselectyear'));
 if ($dateselect > 0) {
@@ -193,7 +191,7 @@
 			if ($key == 'token') {
 				continue;
 			}
-			$param .= '&'.urlencode($key).'='.urlencode($val);
+			$param .= '&'.$key.'='.urlencode($val);
 		}
 	}
 	if (!preg_match('/action=/', $param)) {
@@ -211,7 +209,7 @@
 			if ($key == 'token') {
 				continue;
 			}
-			$param .= '&'.urlencode($key).'='.urlencode($val);
+			$param .= '&'.$key.'='.urlencode($val);
 		}
 	}
 	//print $param;
@@ -757,41 +755,29 @@
 $sql .= ' a.fk_element, a.elementtype,';
 $sql .= ' ca.code as type_code, ca.libelle as type_label, ca.color as type_color, ca.type as type_type, ca.picto as type_picto';
 
-// Add fields from hooks
 $parameters = array();
-$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
 $sql .= $hookmanager->resPrint;
 
-$sqlfields = $sql; // $sql fields to remove for count total
-
-$sql .= " FROM ".MAIN_DB_PREFIX."c_actioncomm as ca, ".MAIN_DB_PREFIX."actioncomm as a";
+$sql .= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a";
 
 // We must filter on assignment table
-if (($filtert != '-1' && $filtert != '-2') || $usergroup > 0) {
-	// TODO Replace with a AND EXISTS
-	$sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as ar ON ar.fk_actioncomm = a.id AND ar.element_type = 'user'";
-	if ($filtert != '-1' && $filtert != '-2'  && $filtert != '-3') {
-		$sql .= " AND (ar.fk_element IN (".$db->sanitize($filtert).") OR (ar.fk_element IS NULL AND a.fk_user_action = ".((int) $filtert)."))"; // The OR is for backward compatibility
-	} elseif ($filtert == '-3') {
-		$sql .= " AND ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds(1))).")";
+if ($filtert > 0 || $usergroup > 0) {
+	$sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as ar";
+	$sql .= " ON ar.fk_actioncomm = a.id AND ar.element_type='user'";
+	if ($filtert > 0) {
+		$sql .= " AND ar.fk_element = ".((int) $filtert);
 	}
 	if ($usergroup > 0) {
 		$sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element AND ugu.fk_usergroup = ".((int) $usergroup);
 	}
 }
-
 // We must filter on resource table
 if ($resourceid > 0) {
 	$sql .= ", ".MAIN_DB_PREFIX."element_resources as r";
 }
-
-// Add table from hooks
-$parameters = array();
-$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
-$sql .= $hookmanager->resPrint;
-
-$sql .= " WHERE a.fk_action = ca.id";
-$sql .= " AND a.entity IN (".getEntity('agenda').")";	// bookcal is a "virtual view" of agenda
+$sql .= ' WHERE a.fk_action = ca.id';
+$sql .= ' AND a.entity IN ('.getEntity('agenda').')';	// bookcal is a "virtual view" of agenda
 // Condition on actioncode
 if (!empty($actioncode)) {
 	if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE')) {
@@ -808,27 +794,14 @@
 			}
 		}
 	} else {
-		if ($actioncode === 'AC_NON_AUTO') {
+		if ($actioncode == 'AC_NON_AUTO') {
 			$sql .= " AND ca.type != 'systemauto'";
-		} elseif ($actioncode === 'AC_ALL_AUTO') {
+		} elseif ($actioncode == 'AC_ALL_AUTO') {
 			$sql .= " AND ca.type = 'systemauto'";
-		} else {
+		} elseif (/* !empty($actioncode) && */ $actioncode !== '-1') {
 			if (is_array($actioncode)) {
-				// Remove all -1 values
-				$actioncode = array_filter(
-					$actioncode,
-					/**
-					 * @param string $value
-					 * @return	bool
-					 */
-					function ($value) {
-						return ((string) $value !== '-1');
-					}
-				);
-				if (count($actioncode)) {
-					$sql .= " AND ca.code IN (".$db->sanitize("'".implode("','", $actioncode)."'", 1).")";
-				}
-			} elseif ($actioncode !== '-1') {
+				$sql .= " AND ca.code IN (".$db->sanitize("'".implode("','", $actioncode)."'", 1).")";
+			} else {
 				$sql .= " AND ca.code IN (".$db->sanitize("'".implode("','", explode(',', $actioncode))."'", 1).")";
 			}
 		}
@@ -854,7 +827,7 @@
 	}
 }
 // Search on socid
-if ($socid > 0) {
+if ($socid) {
 	$sql .= " AND a.fk_soc = ".((int) $socid);
 }
 //var_dump($day.' '.$month.' '.$year);
@@ -903,6 +876,17 @@
 if ($status == 'todo') {
 	$sql .= " AND (a.percent >= 0 AND a.percent < 100)";
 }
+// We must filter on assignment table
+if ($filtert > 0 || $usergroup > 0) {
+	$sql .= " AND (";
+	if ($filtert > 0) {
+		$sql .= "ar.fk_element = ".((int) $filtert);
+	}
+	if ($usergroup > 0) {
+		$sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".((int) $usergroup);
+	}
+	$sql .= ")";
+}
 
 // Search in categories, -1 is all and -2 is no categories
 if ($search_categ_cus != -1) {
@@ -2253,7 +2237,7 @@
 								$listofusertoshow .= $cacheusers[$tmpid]->getNomUrl(-3, '', 0, 0, 0, 0, '', 'valignmiddle inline-block');
 							}
 
-							if ($event->type_code != 'BIRTHDAY' && $event->type_code != 'HOLIDAY') {
+							if ($event->type_code != 'BIRTHDAY') {
 								print $titletoshow;
 								print $listofusertoshow.' &nbsp;';
 							}
@@ -2313,7 +2297,7 @@
 						// It's holiday calendar
 						$tmpholiday->fetch($event->id);
 
-						print $tmpholiday->getNomUrl(1, -1, 0, 'valignmiddle inline-block');
+						//print $tmpholiday->getNomUrl(1, -1, 0, 'valignmiddle inline-block');
 
 						$tmpid = $tmpholiday->fk_user;
 						if (empty($cacheusers[$tmpid])) {
@@ -2359,7 +2343,7 @@
 					print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode='.$mode.'&maxprint=0&month='.((int) $monthshown).'&year='.((int) $year);
 					print($status ? '&status='.$status : '').($filter ? '&filter='.urlencode($filter) : '');
 					print($filtert ? '&search_filtert='.urlencode((string) $filtert) : '');
-					print($usergroup ? '&search_usergroup='.urlencode((string) $usergroup) : '');
+					print($usergroup ? '&search_usergroup='.urlencode($usergroup) : '');
 					print($actioncode != '' ? '&search_actioncode='.urlencode($actioncode) : '');
 					print '">'.img_picto("all", "1downarrow_selected.png").' ...';
 					print ' +'.(count($eventarray[$daykey]) - $maxprint);

########## comm/action/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/action/list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/action/list.php	2025-06-27 11:43:39.617813000 +0000
@@ -58,13 +58,14 @@
 $toselect 	= GETPOST('toselect', 'array');
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'actioncommlist'; // To manage different context of search
 $optioncss 	= GETPOST('optioncss', 'alpha');
+
+
+$disabledefaultvalues = GETPOSTINT('disabledefaultvalues');
+
 $mode = GETPOST('mode', 'aZ09');
 if (empty($mode) && preg_match('/show_/', $action)) {
 	$mode = $action;	// For backward compatibility
 }
-
-$disabledefaultvalues = GETPOSTINT('disabledefaultvalues');
-
 $resourceid = GETPOSTINT("search_resourceid") ? GETPOSTINT("search_resourceid") : GETPOSTINT("resourceid");
 $pid = GETPOSTINT("search_projectid", 3) ? GETPOSTINT("search_projectid", 3) : GETPOSTINT("projectid", 3);
 $search_status = (GETPOST("search_status", 'aZ09') != '') ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09');
@@ -119,7 +120,7 @@
 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
 // If not choice done on calendar owner, we filter on user.
 if (empty($filtert) && !getDolGlobalString('AGENDA_ALL_CALENDARS')) {
-	$filtert = (string) $user->id;
+	$filtert = $user->id;
 }
 
 // Pagination parameters
@@ -162,7 +163,7 @@
 	$canedit = 0;
 }
 if (!$user->hasRight('agenda', 'allactions', 'read') || $filter == 'mine') {	// If no permission to see all, we show only affected to me
-	$filtert = (string) $user->id;
+	$filtert = $user->id;
 }
 
 $arrayfields = array(
@@ -205,7 +206,7 @@
 	$param = '';
 	if (is_array($_POST)) {
 		foreach ($_POST as $key => $val) {
-			$param .= '&'.urlencode($key).'='.urlencode($val);
+			$param .= '&'.$key.'='.urlencode($val);
 		}
 	}
 	//print $param;
@@ -331,10 +332,10 @@
 	$param .= "&search_status=".urlencode($search_status);
 }
 if ($filter) {
-	$param .= "&search_filter=".urlencode((string) $filter);
+	$param .= "&search_filter=".urlencode($filter);
 }
 if ($filtert) {
-	$param .= "&search_filtert=".urlencode((string) $filtert);
+	$param .= "&search_filtert=".urlencode($filtert);
 }
 if ($usergroup > 0) {
 	$param .= "&search_usergroup=".urlencode((string) ($usergroup));
@@ -462,17 +463,11 @@
 	$sql .= " INNER JOIN ".MAIN_DB_PREFIX."element_resources as r ON r.element_type = 'action' AND r.element_id = a.id";
 }
 // We must filter on assignment table
-if (($filtert != '-1' && $filtert != '-2') || $usergroup > 0) {
-	// TODO Replace with a AND EXISTS
-	$sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as ar ON ar.fk_actioncomm = a.id AND ar.element_type = 'user'";
-	if ($filtert != '' && $filtert != '-1' && $filtert != '-2'  && $filtert != '-3') {
-		$sql .= " AND (ar.fk_element IN (".$db->sanitize($filtert).") OR (ar.fk_element IS NULL AND a.fk_user_action = ".((int) $filtert)."))"; // The OR is for backward compatibility
-	} elseif ($filtert == '-3') {
-		$sql .= " AND ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds(1))).")";
-	}
-	if ($usergroup > 0) {
-		$sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element AND ugu.fk_usergroup = ".((int) $usergroup);
-	}
+if ($filtert > 0 || $usergroup > 0) {
+	$sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as ar ON ar.fk_actioncomm = a.id AND ar.element_type='user'";
+}
+if ($usergroup > 0) {
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
 }
 
 // Add table from hooks
@@ -480,7 +475,7 @@
 $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
 $sql .= $hookmanager->resPrint;
 
-$sql .= " WHERE a.entity IN (".getEntity('agenda').")";	// bookcal is a "virtual view" of agenda
+$sql .= " WHERE a.entity IN (".getEntity('agenda').")";
 // Condition on actioncode
 if (!empty($actioncode)) {
 	if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE')) {
@@ -551,18 +546,18 @@
 	$sql .= " AND c.id = ".((int) $type);
 }
 if ($search_status == '0') {
-	// To do (not started)
 	$sql .= " AND a.percent = 0";
 }
 if ($search_status == 'na') {
-	// Not applicable
 	$sql .= " AND a.percent = -1";
-}
+}	// Not applicable
 if ($search_status == '50') {
-	// Running already started
 	$sql .= " AND (a.percent > 0 AND a.percent < 100)";
+}	// Running already started
+if ($search_status == '100') {
+	$sql .= " AND a.percent = 100";
 }
-if ($search_status == 'done' || $search_status == '100') {
+if ($search_status == 'done') {
 	$sql .= " AND (a.percent = 100)";
 }
 if ($search_status == 'todo') {
@@ -577,6 +572,17 @@
 if ($search_note) {
 	$sql .= natural_search('a.note', $search_note);
 }
+// We must filter on assignment table
+if ($filtert > 0 || $usergroup > 0) {
+	$sql .= " AND (";
+	if ($filtert > 0) {
+		$sql .= "(ar.fk_element = ".((int) $filtert)." OR (ar.fk_element IS NULL AND a.fk_user_action = ".((int) $filtert)."))"; // The OR is for backward compatibility
+	}
+	if ($usergroup > 0) {
+		$sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".((int) $usergroup);
+	}
+	$sql .= ")";
+}
 
 // The second or of next test is to take event with no end date (we suppose duration is 1 hour in such case)
 if ($dateselect > 0) {

########## comm/action/pertype.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/action/pertype.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/action/pertype.php	2025-06-27 11:43:39.619739000 +0000
@@ -57,7 +57,7 @@
 $disabledefaultvalues = GETPOSTINT('disabledefaultvalues');
 
 $filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3);
-$filtert = GETPOST("search_filtert", "intcomma", 3) ? GETPOST("search_filtert", "intcomma", 3) : GETPOST("filtert", "intcomma", 3);
+$filtert = GETPOSTINT("search_filtert", 3) ? GETPOSTINT("search_filtert", 3) : GETPOSTINT("filtert", 3);
 $usergroup = GETPOSTINT("search_usergroup", 3) ? GETPOSTINT("search_usergroup", 3) : GETPOSTINT("usergroup", 3);
 //if (! ($usergroup > 0) && ! ($filtert > 0)) $filtert = $user->id;
 
@@ -95,7 +95,8 @@
 	$socid = '';
 }
 
-$canedit = 1;	// can read events of others
+// Permissions
+$canedit = 1;
 if (!$user->hasRight('agenda', 'myactions', 'read')) {
 	accessforbidden();
 }
@@ -103,7 +104,7 @@
 	$canedit = 0;
 }
 if (!$user->hasRight('agenda', 'allactions', 'read') || $filter == 'mine') {  // If no permission to see all, we show only affected to me
-	$filtert = (string) $user->id;
+	$filtert = $user->id;
 }
 
 $mode = 'show_pertype';
@@ -136,11 +137,11 @@
 }
 
 // working hours
-$tmp = getDolGlobalString('MAIN_DEFAULT_WORKING_HOURS', '9-18');
+$tmp = !getDolGlobalString('MAIN_DEFAULT_WORKING_HOURS') ? '9-18' : $conf->global->MAIN_DEFAULT_WORKING_HOURS;
 $tmp = str_replace(' ', '', $tmp); // FIX 7533
 $tmparray = explode('-', $tmp);
-$begin_h = GETPOSTISSET('begin_h') ? GETPOSTINT('begin_h') : ($tmparray[0] != '' ? $tmparray[0] : 9);
-$end_h   = GETPOSTISSET('end_h') ? GETPOSTINT('end_h') : ($tmparray[1] != '' ? $tmparray[1] : 18);
+$begin_h = GETPOSTINT('begin_h') != '' ? GETPOSTINT('begin_h') : ($tmparray[0] != '' ? $tmparray[0] : 9);
+$end_h   = GETPOSTINT('end_h') ? GETPOSTINT('end_h') : ($tmparray[1] != '' ? $tmparray[1] : 18);
 if ($begin_h < 0 || $begin_h > 23) {
 	$begin_h = 9;
 }
@@ -195,7 +196,7 @@
 // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
 $hookmanager->initHooks(array('agenda'));
 
-$result = restrictedArea($user, 'agenda', 0, 'actioncomm&societe', 'myactions');
+$result = restrictedArea($user, 'agenda', 0, '', 'myactions');
 if ($user->socid && $socid) {
 	$result = restrictedArea($user, 'societe', $socid);
 }
@@ -282,12 +283,10 @@
 }
 
 $param = '';
-if (($actioncode && $actioncode !== '-1') || GETPOSTISSET('search_actioncode')) {
+if ($actioncode || GETPOSTISSET('search_actioncode')) {
 	if (is_array($actioncode)) {
 		foreach ($actioncode as $str_action) {
-			if ($str_action != '-1') {
-				$param .= "&search_actioncode[]=".urlencode($str_action);
-			}
+			$param .= "&search_actioncode[]=".urlencode($str_action);
 		}
 	} else {
 		$param .= "&search_actioncode=".urlencode($actioncode);
@@ -300,7 +299,7 @@
 	$param .= "&search_status=".urlencode($status);
 }
 if ($filter) {
-	$param .= "&search_filter=".urlencode((string) $filter);
+	$param .= "&search_filter=".urlencode($filter);
 }
 if ($filtert) {
 	$param .= "&search_filtert=".urlencode((string) $filtert);
@@ -311,7 +310,7 @@
 if ($socid > 0) {
 	$param .= "&search_socid=".urlencode((string) ($socid));
 }
-if ($showbirthday) {  // Always false @phpstan-suppress-current-line
+if ($showbirthday) {
 	$param .= "&search_showbirthday=1";
 }
 if ($pid) {
@@ -324,16 +323,16 @@
 	$param .= '&mode='.urlencode((string) $mode);
 }
 if ($begin_h != '') {
-	$param .= '&begin_h='.((int) $begin_h);
+	$param .= '&begin_h='.urlencode($begin_h);
 }
 if ($end_h != '') {
-	$param .= '&end_h='.((int) $end_h);
+	$param .= '&end_h='.urlencode($end_h);
 }
 if ($begin_d != '') {
-	$param .= '&begin_d='.((int) $begin_d);
+	$param .= '&begin_d='.urlencode((string) ($begin_d));
 }
 if ($end_d != '') {
-	$param .= '&end_d='.((int) $end_d);
+	$param .= '&end_d='.urlencode((string) ($end_d));
 }
 $param .= "&maxprint=".urlencode((string) ($maxprint));
 
@@ -490,7 +489,7 @@
 if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) {
 	$tmpforcreatebutton = dol_getdate(dol_now('tzuserrel'), true);
 
-	$newparam .= '&month='.str_pad((string) $month, 2, "0", STR_PAD_LEFT).'&year='.((int) $tmpforcreatebutton['year']);
+	$newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year'];
 
 	$urltocreateaction = DOL_URL_ROOT.'/comm/action/card.php?action=create';
 	$urltocreateaction .= '&apyear='.$tmpforcreatebutton['year'].'&apmonth='.$tmpforcreatebutton['mon'].'&apday='.$tmpforcreatebutton['mday'].'&aphour='.$tmpforcreatebutton['hours'].'&apmin='.$tmpforcreatebutton['minutes'];
@@ -525,7 +524,7 @@
 
 
 // DEFAULT CALENDAR + AUTOEVENT CALENDAR + CONFERENCEBOOTH CALENDAR
-$sql = "SELECT";
+$sql = 'SELECT';
 if ($usergroup > 0) {
 	$sql .= " DISTINCT";
 }
@@ -537,34 +536,20 @@
 $sql .= ' a.transparency, a.priority, a.fulldayevent, a.location,';
 $sql .= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype, a.fk_project,';
 $sql .= ' ca.code, ca.libelle as type_label, ca.color, ca.type as type_type, ca.picto as type_picto';
-
-$parameters = array();
-$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
-$sql .= $hookmanager->resPrint;
-
 $sql .= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a";
 // We must filter on resource table
 if ($resourceid > 0) {
 	$sql .= ", ".MAIN_DB_PREFIX."element_resources as r";
 }
 // We must filter on assignment table
-if (($filtert != '-1' && $filtert != '-2') || $usergroup > 0) {
-	// TODO Replace with a AND EXISTS
-	$sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as ar";
-	$sql .= " ON ar.fk_actioncomm = a.id AND ar.element_type = 'user'";
-	if ($filtert != '-1' && $filtert != '-2'  && $filtert != '-3') {
-		$sql .= " AND ar.fk_element IN (".$db->sanitize($filtert).")";
-	} elseif ($filtert == -3) {
-		$sql .= " AND ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds(1))).")";
-	}
-	if ($usergroup > 0) {
-		$sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element AND ugu.fk_usergroup = ".((int) $usergroup);
-	}
+if ($filtert > 0 || $usergroup > 0) {
+	$sql .= ", ".MAIN_DB_PREFIX."actioncomm_resources as ar";
 }
-
-$sql .= " WHERE a.fk_action = ca.id";
-$sql .= " AND a.entity IN (".getEntity('agenda').")";	// bookcal is a "virtual view" of agenda
-
+if ($usergroup > 0) {
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
+}
+$sql .= ' WHERE a.fk_action = ca.id';
+$sql .= ' AND a.entity IN ('.getEntity('agenda').')';
 // Condition on actioncode
 if (!empty($actioncode)) {
 	if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE')) {
@@ -585,16 +570,9 @@
 			$sql .= " AND ca.type != 'systemauto'";
 		} elseif ($actioncode == 'AC_ALL_AUTO') {
 			$sql .= " AND ca.type = 'systemauto'";
-		} elseif ($actioncode !== '-1' && $actioncode !== '-3') {
+		} else {
 			if (is_array($actioncode)) {
-				foreach ($actioncode as $key => $val) {
-					if ($val == '-1' || $val == '-2') {
-						unset($actioncode[$key]);
-					}
-				}
-				if (!empty($actioncode)) {
-					$sql .= " AND ca.code IN (".$db->sanitize("'".implode("','", $actioncode)."'", 1).")";
-				}
+				$sql .= " AND ca.code IN (".$db->sanitize("'".implode("','", $actioncode)."'", 1).")";
 			} else {
 				$sql .= " AND ca.code IN (".$db->sanitize("'".implode("','", explode(',', $actioncode))."'", 1).")";
 			}
@@ -609,7 +587,7 @@
 }
 // If the internal user must only see his customers, force searching by him
 $search_sale = 0;
-if (isModEnabled("societe") && !$user->hasRight('societe', 'client', 'voir')) {
+if (!$user->hasRight('societe', 'client', 'voir')) {
 	$search_sale = $user->id;
 }
 // Search on sale representative
@@ -624,7 +602,10 @@
 if ($socid) {
 	$sql .= " AND a.fk_soc = ".((int) $socid);
 }
-
+// We must filter on assignment table
+if ($filtert > 0 || $usergroup > 0) {
+	$sql .= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'";
+}
 if ($mode == 'show_day') {
 	$sql .= " AND (";
 	$sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'";
@@ -635,7 +616,7 @@
 	$sql .= " OR ";
 	$sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'";
 	$sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')";
-	$sql .= ")";
+	$sql .= ')';
 } else {
 	// To limit array
 	$sql .= " AND (";
@@ -653,7 +634,6 @@
 	$sql .= " AND ca.id = ".((int) $type);
 }
 if ($status == '0') {
-	// To do (not started)
 	$sql .= " AND a.percent = 0";
 }
 if ($status === 'na') {
@@ -671,33 +651,26 @@
 	$sql .= " AND (a.percent >= 0 AND a.percent < 100)";
 }
 // We must filter on assignment table
-if (($filtert > 0 || $filtert == -3) || $usergroup > 0) {
-	// TODO Replace with a AND EXISTS
+if ($filtert > 0 || $usergroup > 0) {
 	$sql .= " AND (";
 	if ($filtert > 0) {
-		$sql .= "ar.fk_element = ".((int) $filtert);
-	} elseif ($filtert == -3) {
-		$sql .= "ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds(1))).")";
+		$sql .= "ar.fk_element = ".$filtert;
 	}
 	if ($usergroup > 0) {
 		$sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".((int) $usergroup);
 	}
 	$sql .= ")";
 }
-
 // Sort on date
-$sql .= $db->order("fk_user_action, datep");
-
+$sql .= ' ORDER BY fk_user_action, datep'; //fk_user_action
 //print $sql;
 
 dol_syslog("comm/action/pertype.php", LOG_DEBUG);
 $resql = $db->query($sql);
 if ($resql) {
 	$num = $db->num_rows($resql);
-
-	$MAXONSAMEPAGE = 10000; // Useless to have more. Protection to avoid memory overload when high number of event (for example after a mass import)
 	$i = 0;
-	while ($i < $num && $i < $MAXONSAMEPAGE) {
+	while ($i < $num) {
 		$obj = $db->fetch_object($resql);
 
 		// Discard auto action if option is on

########## comm/action/peruser.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/action/peruser.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/action/peruser.php	2025-06-27 11:43:39.634996000 +0000
@@ -54,14 +54,19 @@
 
 $disabledefaultvalues = GETPOSTINT('disabledefaultvalues');
 
-$action = GETPOST('action', 'aZ09');
-
 $check_holiday = GETPOSTINT('check_holiday');
 $filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3);
-$filtert = GETPOST("search_filtert", "intcomma", 3) ? GETPOST("search_filtert", "intcomma", 3) : GETPOST("filtert", "intcomma", 3);
+$filtert = GETPOSTINT("search_filtert", 3) ? GETPOSTINT("search_filtert", 3) : GETPOSTINT("filtert", 3);
 $usergroup = GETPOSTINT("search_usergroup", 3) ? GETPOSTINT("search_usergroup", 3) : GETPOSTINT("usergroup", 3);
+//if (! ($usergroup > 0) && ! ($filtert > 0)) $filtert = $user->id;
+//$showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1;
 $showbirthday = getDolGlobalInt('AGENDA_ENABLE_SHOW_BIRTHDAY_PER_USER'); // disabled by default
 
+// If no choice done on calendar owner (like on left menu link "Agenda"), we filter on current user by default.
+/*if (empty($filtert) && !getDolGlobalString('AGENDA_ALL_CALENDARS')) {
+	$filtert = (string) $user->id;
+}*/
+
 $sortfield = GETPOST('sortfield', 'aZ09comma');
 $sortorder = GETPOST('sortorder', 'aZ09comma');
 $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
@@ -86,7 +91,7 @@
 	$socid = '';
 }
 
-$canedit = 1;	// can read events of others
+$canedit = 1;
 if (!$user->hasRight('agenda', 'myactions', 'read')) {
 	accessforbidden();
 }
@@ -97,6 +102,8 @@
 	$filtert = (string) $user->id;
 }
 
+$action = GETPOST('action', 'aZ09');
+
 $mode = 'show_peruser';
 $resourceid = GETPOSTINT("search_resourceid") ? GETPOSTINT("search_resourceid") : GETPOSTINT("resourceid");
 $year = GETPOSTINT("year") ? GETPOSTINT("year") : date("Y");
@@ -126,7 +133,6 @@
 	$year = GETPOSTINT('dateselectyear');
 }
 
-// working hours
 $tmp = getDolGlobalString('MAIN_DEFAULT_WORKING_HOURS', '9-18');
 $tmp = str_replace(' ', '', $tmp); // FIX 7533
 $tmparray = explode('-', $tmp);
@@ -142,7 +148,6 @@
 	$end_h = $begin_h + 1;
 }
 
-// working days
 $tmp = getDolGlobalString('MAIN_DEFAULT_WORKING_DAYS', '1-5');
 $tmp = str_replace(' ', '', $tmp); // FIX 7533
 $tmparray = explode('-', $tmp);
@@ -166,22 +171,19 @@
 	$mode = getDolGlobalString('AGENDA_DEFAULT_VIEW', 'show_peruser');
 }
 
-// View by month
 if (GETPOST('viewcal', 'alpha') && $mode != 'show_day' && $mode != 'show_week' && $mode != 'show_peruser') {
 	$mode = 'show_month';
 	$day = '';
-}
-// View by week
+} // View by month
 if (GETPOST('viewweek', 'alpha') || $mode == 'show_week') {
 	$mode = 'show_week';
 	$week = ($week ? $week : date("W"));
 	$day = ($day ? $day : date("d"));
-}
-// View by day
+} // View by week
 if (GETPOST('viewday', 'alpha') || $mode == 'show_day') {
 	$mode = 'show_day';
 	$day = ($day ? $day : date("d"));
-}
+} // View by day
 
 $object = new ActionComm($db);
 
@@ -333,12 +335,10 @@
 }
 
 $param = '';
-if (($actioncode && $actioncode !== '-1') || GETPOSTISSET('search_actioncode')) {
+if ($actioncode || GETPOSTISSET('search_actioncode')) {
 	if (is_array($actioncode)) {
 		foreach ($actioncode as $str_action) {
-			if ($str_action != '-1') {
-				$param .= "&search_actioncode[]=".urlencode($str_action);
-			}
+			$param .= "&search_actioncode[]=".urlencode($str_action);
 		}
 	} else {
 		$param .= "&search_actioncode=".urlencode($actioncode);
@@ -531,16 +531,16 @@
 
 	$urltocreateaction = DOL_URL_ROOT.'/comm/action/card.php?action=create';
 	$urltocreateaction .= '&apyear='.$tmpforcreatebutton['year'].'&apmonth='.$tmpforcreatebutton['mon'].'&apday='.$tmpforcreatebutton['mday'].'&aphour='.$tmpforcreatebutton['hours'].'&apmin='.$tmpforcreatebutton['minutes'];
-	$urltocreateaction .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$newparam);
+	$urltocreateaction .= '&backtopage='.urlencode($_SERVER["PHP_SELF"] . $newparam);
 
 	$newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', $urltocreateaction);
 }
 
 
-$link = '';
-
 // Define the legend/list of calendard to show
 $s = '';
+$link = '';
+
 
 $showextcals = $listofextcals;
 $bookcalcalendars = array();
@@ -554,7 +554,7 @@
 	$sql .= " WHERE bc.status = 1";
 	$sql .= " AND ba.status = 1";
 	$sql .= " AND bc.entity IN (".getEntity('agenda').")";	// bookcal is a "virtual view" of agenda
-	if (!empty($filtert) && $filtert != '-1' && $filtert != '-2') {
+	if (!empty($filtert) && $filtert != '-1') {
 		$sql .= " AND bc.visibility IN (".$db->sanitize($filtert, 0, 0, 0, 0).")";
 	}
 	$resql = $db->query($sql);
@@ -677,7 +677,7 @@
 $sql .= " a.datep,";
 $sql .= " a.datep2,";
 $sql .= " a.percent,";
-$sql .= " a.fk_user_author, a.fk_user_action,";
+$sql .= " a.fk_user_author,a.fk_user_action,";
 $sql .= " a.transparency, a.priority, a.fulldayevent, a.location,";
 $sql .= " a.fk_soc, a.fk_contact, a.fk_project, a.fk_bookcal_calendar,";
 $sql .= " a.fk_element, a.elementtype,";
@@ -692,16 +692,12 @@
 if ($resourceid > 0) {
 	$sql .= ", ".MAIN_DB_PREFIX."element_resources as r";
 }
-
 // We must filter on assignment table
-if (($filtert != '-1' && $filtert != '-2') || $usergroup > 0) {
-	// TODO Replace with a AND EXISTS
+if ($filtert > 0 || $usergroup > 0) {
 	$sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as ar";
-	$sql .= " ON ar.fk_actioncomm = a.id AND ar.element_type = 'user'";
-	if ($filtert != '' && $filtert != '-1' && $filtert != '-2'  && $filtert != '-3') {
-		$sql .= " AND ar.fk_element IN (".$db->sanitize($filtert).")";
-	} elseif ($filtert == '-3') {
-		$sql .= " AND ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds(1))).")";
+	$sql .= " ON ar.fk_actioncomm = a.id AND ar.element_type='user'";
+	if ($filtert > 0) {
+		$sql .= " AND ar.fk_element = ".((int) $filtert);
 	}
 	if ($usergroup > 0) {
 		$sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element AND ugu.fk_usergroup = ".((int) $usergroup);
@@ -710,7 +706,6 @@
 
 $sql .= " WHERE a.fk_action = ca.id";
 $sql .= " AND a.entity IN (".getEntity('agenda').")";	// bookcal is a "virtual view" of agenda
-
 // Condition on actioncode
 if (!empty($actioncode)) {
 	if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE')) {
@@ -731,16 +726,9 @@
 			$sql .= " AND ca.type != 'systemauto'";
 		} elseif ($actioncode == 'AC_ALL_AUTO') {
 			$sql .= " AND ca.type = 'systemauto'";
-		} elseif ($actioncode !== '-1' && $actioncode !== '-3') {
+		} elseif (/* !empty($actioncode) && */ $actioncode !== '-1') {
 			if (is_array($actioncode)) {
-				foreach ($actioncode as $key => $val) {
-					if ($val == '-1' || $val == '-2') {
-						unset($actioncode[$key]);
-					}
-				}
-				if (!empty($actioncode)) {
-					$sql .= " AND ca.code IN (".$db->sanitize("'".implode("','", $actioncode)."'", 1).")";
-				}
+				$sql .= " AND ca.code IN (".$db->sanitize("'".implode("','", $actioncode)."'", 1).")";
 			} else {
 				$sql .= " AND ca.code IN (".$db->sanitize("'".implode("','", explode(',', $actioncode))."'", 1).")";
 			}
@@ -817,13 +805,10 @@
 	$sql .= " AND (a.percent >= 0 AND a.percent < 100)";
 }
 // We must filter on assignment table
-if (($filtert > 0 || $filtert == -3) || $usergroup > 0) {
-	// TODO Replace with a AND EXISTS
+if ($filtert > 0 || $usergroup > 0) {
 	$sql .= " AND (";
 	if ($filtert > 0) {
 		$sql .= "ar.fk_element = ".((int) $filtert);
-	} elseif ($filtert == -3) {
-		$sql .= "ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds(1))).")";
 	}
 	if ($usergroup > 0) {
 		$sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".((int) $usergroup);
@@ -1071,8 +1056,8 @@
 	}
 }
 
-// LEAVE-HOLIDAY CALENDAR
 if ($user->hasRight("holiday", "read")) {
+	// LEAVE-HOLIDAY CALENDAR
 	$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status";
 	$sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u";
 	$sql .= " WHERE u.rowid = x.fk_user";
@@ -1514,7 +1499,6 @@
 // Show div with list of calendars
 print $s;
 
-// Top filters
 print '<div class="liste_titre liste_titre_bydiv centpercent">';
 print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, '', (string) $filtert, '', $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid, $search_categ_cus);
 print '</div>';
@@ -1559,13 +1543,13 @@
 		print $langs->trans("DaysOfWeek").'</span>';
 		print "\n";
 		print '<div class="ui-grid-a  inline-block"><div class="ui-block-a nowraponall">';
-		print '<input type="number" class="shortbis" name="begin_d" value="'.$begin_d.'" min="1" max="7">';
+		print '<input type="number" class="short" name="begin_d" value="'.$begin_d.'" min="1" max="7">';
 		if (empty($conf->dol_use_jmobile)) {
 			print ' - ';
 		} else {
 			print '</div><div class="ui-block-b">';
 		}
-		print '<input type="number" class="shortbis" name="end_d" value="'.$end_d.'" min="1" max="7">';
+		print '<input type="number" class="short" name="end_d" value="'.$end_d.'" min="1" max="7">';
 		print '</div></div>';
 	}
 
@@ -1598,13 +1582,13 @@
 	print $langs->trans("Hours").'</span>';
 	print "\n";
 	print '<div class="ui-grid-a inline-block"><div class="ui-block-a nowraponall">';
-	print '<input type="number" class="shortbis" name="begin_h" value="'.$begin_h.'" min="0" max="23">';
+	print '<input type="number" class="short" name="begin_h" value="'.$begin_h.'" min="0" max="23">';
 	if (empty($conf->dol_use_jmobile)) {
 		print ' - ';
 	} else {
 		print '</div><div class="ui-block-b">';
 	}
-	print '<input type="number" class="shortbis" name="end_h" value="'.$end_h.'" min="1" max="24">';
+	print '<input type="number" class="short" name="end_h" value="'.$end_h.'" min="1" max="24">';
 	if (empty($conf->dol_use_jmobile)) {
 		print ' '.$langs->trans("HourShort");
 	}
@@ -1646,7 +1630,7 @@
 			}
 		}
 	} else {
-		/* Use this list to have lines of all users to show */
+		/* Use this list to have lines for all users */
 		$sql = "SELECT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity";
 		$sql .= " FROM ".$db->prefix()."user as u";
 		if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) {
@@ -1677,13 +1661,6 @@
 			// External users should see only contacts of their company
 			$sql .= " AND u.fk_soc = ".((int) $user->socid);
 		}
-		// Filter on users in hierarchy
-		if (!$canedit || $filtert == '-3') {	// If we can't read event of others
-			if (!$user->hasRight('user', 'user', 'lire') || $filtert == '-3') {
-				$usersInHierarchy = $user->getAllChildIds(1);
-				$sql .= " AND u.rowid IN (".$db->sanitize(implode(',', $usersInHierarchy)).")";
-			}
-		}
 
 		//print $sql;
 		$resql = $db->query($sql);
@@ -2479,7 +2456,7 @@
 			print 'style="background: #'.$color1.'; "';
 		}
 		print 'class="';
-		print $style1.' ';
+		print ($style1 ? $style1.' ' : '');
 		print 'center'.($title1 ? ' classfortooltip' : '').($title1 ? ' cursorpointer' : '').'"';
 		print 'ref="'.$ref1.'_'.$username->id.'_'.sprintf("%04d", $year).'_'.sprintf("%02d", $month).'_'.sprintf("%02d", $day).'_'.sprintf("%02d", $h).'_00_'.($ids1 ? $ids1 : 'none').'"';
 		print ($title1 ? ' title="'.$title1.'"' : '').'>';
@@ -2493,7 +2470,7 @@
 			print 'style="background: #'.$color2.'; "';
 		}
 		print 'class="';
-		print $style2.' ';
+		print ($style2 ? $style2.' ' : '');
 		print 'center'.($title2 ? ' classfortooltip' : '').($title2 ? ' cursorpointer' : '').'"';
 		print ' ref="'.$ref2.'_'.$username->id.'_'.sprintf("%04d", $year).'_'.sprintf("%02d", $month).'_'.sprintf("%02d", $day).'_'.sprintf("%02d", $h).'_15_'.($ids2 ? $ids2 : 'none').'"';
 		print ($title2 ? ' title="'.$title2.'"' : '').'>';
@@ -2507,7 +2484,7 @@
 			print 'style="background: #'.$color3.'; "';
 		}
 		print 'class="';
-		print $style3.' ';
+		print ($style3 ? $style3.' ' : '');
 		print 'center'.($title3 ? ' classfortooltip' : '').($title3 ? ' cursorpointer' : '').'"';
 		print ' ref="'.$ref3.'_'.$username->id.'_'.sprintf("%04d", $year).'_'.sprintf("%02d", $month).'_'.sprintf("%02d", $day).'_'.sprintf("%02d", $h).'_30_'.($ids3 ? $ids3 : 'none').'"';
 		print ($title3 ? ' title="'.$title3.'"' : '').'>';
@@ -2521,7 +2498,7 @@
 			print 'style="background: #'.$color4.'; "';
 		}
 		print 'class="';
-		print $style4.' ';
+		print ($style4 ? $style4.' ' : '');
 		print 'center'.($title4 ? ' classfortooltip' : '').($title4 ? ' cursorpointer' : '').'"';
 		print ' ref="'.$ref4.'_'.$username->id.'_'.sprintf("%04d", $year).'_'.sprintf("%02d", $month).'_'.sprintf("%02d", $day).'_'.sprintf("%02d", $h).'_45_'.($ids4 ? $ids4 : 'none').'"';
 		print ($title4 ? ' title="'.$title4.'"' : '').'>';

########## comm/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/card.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/card.php	2025-06-27 11:43:39.604427000 +0000
@@ -81,7 +81,7 @@
  */
 
 // Load translation files required by the page
-$langs->loadLangs(array('companies', 'banks', 'commercial'));
+$langs->loadLangs(array('companies', 'banks'));
 
 if (isModEnabled('contract')) {
 	$langs->load("contracts");

########## comm/mailing/class/advtargetemailing.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/mailing/class/advtargetemailing.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/mailing/class/advtargetemailing.class.php	2025-06-27 11:43:39.644728000 +0000
@@ -641,27 +641,6 @@
 						if ($arrayquery['options_'.$key] > 0) {
 							$sqlwhere[] = " (te.".$key." = ".((int) $arrayquery["options_".$key]).")";
 						}
-					} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'chkbxlst'
-						&& is_array($arrayquery['options_'.$key])) {
-						if (count($arrayquery['options_'.$key])) {
-							$i2 = 0;
-							$field = "te.".$key;
-							$sqlwhereselllist="";
-							foreach ($arrayquery['options_'.$key] as $data) {
-								$data = trim($data);
-								if ($data) {
-									$sqlwhereselllist .= ($i2 > 0 ? " OR (" : "(").$field." LIKE '".$this->db->escape($data).",%'";
-									$sqlwhereselllist .= " OR ".$field." = '".$this->db->escape($data)."'";
-									$sqlwhereselllist .= " OR ".$field." LIKE '%,".$this->db->escape($data)."'";
-									$sqlwhereselllist .= " OR ".$field." LIKE '%,".$this->db->escape($data).",%'";
-									$sqlwhereselllist .= ")";
-									$i2++; // a criteria for 1 more field was added to string (we can add several criteria for the same field as it is a multiselect search criteria)
-								}
-							}
-							if (!empty($sqlwhereselllist)) {
-								$sqlwhere[] = "( ".$sqlwhereselllist." )";
-							}
-						}
 					} else {
 						if (is_array($arrayquery['options_'.$key])) {
 							$sqlwhere[] = " (te.".$key." IN (".$this->db->sanitize("'".implode("','", $arrayquery["options_".$key])."'", 1)."))";
@@ -805,31 +784,6 @@
 								$sqlwhere[] = " (te.".$key." = ".((int) $arrayquery["options_".$key."_cnct"]).")";
 							}
 						}
-					} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'link') {
-						if ($arrayquery['options_'.$key."_cnct"] > 0) {
-							$sqlwhere[]= " (te.".$key." = ".((int) $arrayquery["options_".$key."_cnct"]).")";
-						}
-					} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'chkbxlst'
-						&& is_array($arrayquery['options_'.$key.'_cnct'])) {
-						if (count($arrayquery['options_'.$key.'_cnct'])) {
-							$i2 = 0;
-							$field = "te.".$key;
-							$sqlwhereselllist="";
-							foreach ($arrayquery['options_'.$key.'_cnct'] as $data) {
-								$data = trim($data);
-								if ($data) {
-									$sqlwhereselllist .= ($i2 > 0 ? " OR (" : "(").$field." LIKE '".$this->db->escape($data).",%'";
-									$sqlwhereselllist .= " OR ".$field." = '".$this->db->escape($data)."'";
-									$sqlwhereselllist .= " OR ".$field." LIKE '%,".$this->db->escape($data)."'";
-									$sqlwhereselllist .= " OR ".$field." LIKE '%,".$this->db->escape($data).",%'";
-									$sqlwhereselllist .= ")";
-									$i2++; // a criteria for 1 more field was added to string (we can add several criteria for the same field as it is a multiselect search criteria)
-								}
-							}
-							if (!empty($sqlwhereselllist)) {
-								$sqlwhere[] = "( ".$sqlwhereselllist." )";
-							}
-						}
 					} else {
 						if (is_array($arrayquery['options_'.$key.'_cnct'])) {
 							$sqlwhere[] = " (te.".$key." IN (".$this->db->sanitize("'".implode("','", $arrayquery["options_".$key."_cnct"])."'", 1)."))";
@@ -934,31 +888,6 @@
 								if ($arrayquery['options_'.$key] != '') {
 									$sqlwhere[] = " (tse.".$key." = ".((int) $arrayquery["options_".$key]).")";
 								}
-							} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'link') {
-								if ($arrayquery['options_'.$key] > 0) {
-									$sqlwhere[]= " (te.".$key." = ".((int) $arrayquery["options_".$key]).")";
-								}
-							} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'chkbxlst'
-								&& is_array($arrayquery['options_'.$key])) {
-								if (count($arrayquery['options_'.$key])) {
-									$i2 = 0;
-									$field = "tse.".$key;
-									$sqlwhereselllist="";
-									foreach ($arrayquery['options_'.$key] as $data) {
-										$data = trim($data);
-										if ($data) {
-											$sqlwhereselllist  .= ($i2 > 0 ? " OR (" : "(").$field." LIKE '".$this->db->escape($data).",%'";
-											$sqlwhereselllist  .= " OR ".$field." = '".$this->db->escape($data)."'";
-											$sqlwhereselllist  .= " OR ".$field." LIKE '%,".$this->db->escape($data)."'";
-											$sqlwhereselllist  .= " OR ".$field." LIKE '%,".$this->db->escape($data).",%'";
-											$sqlwhereselllist  .= ")";
-											$i2++; // a criteria for 1 more field was added to string (we can add several criteria for the same field as it is a multiselect search criteria)
-										}
-									}
-									if (!empty($sqlwhereselllist)) {
-										$sqlwhere[] = "( ".$sqlwhereselllist." )";
-									}
-								}
 							} else {
 								if (is_array($arrayquery['options_'.$key])) {
 									$sqlwhere[] = " (tse.".$key." IN (".$this->db->sanitize("'".implode("','", $arrayquery["options_".$key])."'", 1)."))";

########## comm/propal/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/propal/card.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/propal/card.php	2025-06-27 11:43:39.583676000 +0000
@@ -525,7 +525,7 @@
 					$object->contact_id = GETPOSTINT('contactid');
 					$object->fk_project = GETPOSTINT('projectid');
 					$object->model_pdf = GETPOST('model', 'alphanohtml');
-					$object->author = $user; // deprecated
+					$object->author = $user->id; // deprecated
 					$object->user_author_id = $user->id;
 					$object->note_private = GETPOST('note_private', 'restricthtml');
 					$object->note_public = GETPOST('note_public', 'restricthtml');
@@ -555,8 +555,7 @@
 				$object->contact_id = GETPOSTINT('contactid');
 				$object->fk_project = GETPOSTINT('projectid');
 				$object->model_pdf = GETPOST('model');
-				$object->author = $user; // deprecated
-				$object->user_author_id = $user->id;
+				$object->author = $user->id; // deprecated
 				$object->note_private = GETPOST('note_private', 'restricthtml');
 				$object->note_public = GETPOST('note_public', 'restricthtml');
 				$object->fk_incoterms = GETPOSTINT('incoterm_id');

########## comm/propal/class/api_proposals.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/propal/class/api_proposals.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/propal/class/api_proposals.class.php	2025-06-27 11:43:39.590152000 +0000
@@ -193,7 +193,7 @@
 		$obj_ret = array();
 
 		// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
-		$socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids;
+		$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
 
 		// If the internal user must only see his customers, force searching by him
 		$search_sale = 0;

########## comm/propal/class/propal.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/propal/class/propal.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/propal/class/propal.class.php	2025-06-27 11:43:39.593000000 +0000
@@ -197,7 +197,6 @@
 
 	/**
 	 * @var User user identified by user_author_id
-	 * @deprecated Set only $user_author_id
 	 */
 	public $author;
 

########## comm/propal/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/propal/list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/propal/list.php	2025-06-27 11:43:39.578813000 +0000
@@ -2382,7 +2382,7 @@
 		// Note public
 		if (!empty($arrayfields['p.note_public']['checked'])) {
 			print '<td class="sensiblehtmlcontent center">';
-			print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'</div>';
+			print dolPrintHTML($obj->note_public);
 			print '</td>';
 			if (!$i) {
 				$totalarray['nbfield']++;
@@ -2391,7 +2391,7 @@
 		// Note private
 		if (!empty($arrayfields['p.note_private']['checked'])) {
 			print '<td class="sensiblehtmlcontent center">';
-			print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'</div>';
+			print dolPrintHTML($obj->note_private);
 			print '</td>';
 			if (!$i) {
 				$totalarray['nbfield']++;

########## commande/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/commande/card.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/commande/card.php	2025-06-27 11:43:39.991603000 +0000
@@ -2978,7 +2978,7 @@
 				print '<table class="nobordernopadding centpercent"><tr><td>';
 				print $form->textwithpicto($langs->trans('PointOfSale'), $langs->trans('POSInfo'));
 				print '</td>';
-				if ($action != 'editposinfo' && $usercancreate) {
+				if ($action != 'editposinfo' && $object->status == $object::STATUS_DRAFT && $usercancreate) {
 					print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editposinfo&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetPOSInfo'), 1).'</a></td>';
 				}
 				print '</tr></table>';

########## commande/class/api_orders.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/commande/class/api_orders.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/commande/class/api_orders.class.php	2025-06-27 11:43:39.998045000 +0000
@@ -186,7 +186,7 @@
 		$obj_ret = array();
 
 		// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
-		$socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids;
+		$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
 
 		// If the internal user must only see his customers, force searching by him
 		$search_sale = 0;

########## commande/class/commande.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/commande/class/commande.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/commande/class/commande.class.php	2025-06-27 11:43:40.002622000 +0000
@@ -1068,15 +1068,10 @@
 				for ($i = 0; $i < $num; $i++) {
 					$line = $this->lines[$i];
 
-					// Test and convert into OrderLine object this->lines[$i]. When coming from REST API, we may still have an array
+					// Test and convert into object this->lines[$i]. When coming from REST API, we may still have an array
 					//if (! is_object($line)) $line=json_decode(json_encode($line), false);  // convert recursively array into object.
 					if (!is_object($line)) {
-						$lineobj = new OrderLine($this->db);
-						foreach ($line as $key => $val) {
-							$lineobj->$key = $val;
-						}
-						$line = $lineobj;
-						$this->lines[$i] = $line;
+						$line = (object) $line;
 					}
 
 					// Reset fk_parent_line for no child products and special product
@@ -1829,12 +1824,9 @@
 							$this->line_order(true, 'DESC');
 						} elseif ($ranktouse > 0 && $ranktouse <= count($this->lines)) {
 							// Update all rank of all other lines starting from the same $ranktouse
-							foreach ($this->lines as $tmpline) {
-								if ($tmpline->rang >= $ranktouse) {
-									if (!empty($tmpline->id)) {
-										$this->updateRangOfLine($tmpline->id, $tmpline->rang + 1);
-									}
-								}
+							$linecount = count($this->lines);
+							for ($ii = $ranktouse; $ii <= $linecount; $ii++) {
+								$this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1);
 							}
 						}
 

########## commande/class/orderline.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/commande/class/orderline.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/commande/class/orderline.class.php	2025-06-27 11:43:39.995667000 +0000
@@ -37,7 +37,6 @@
  */
 
 require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php';
-require_once DOL_DOCUMENT_ROOT.'/core/class/commonorder.class.php';		// Because the CommonOrderLine is still in commonorder.class.php file
 require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php';
 
 
@@ -151,42 +150,6 @@
 	 */
 	public $packaging;
 
-
-	// BEGIN MODULEBUILDER PROPERTIES
-	/**
-	 * @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}>  Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
-	 */
-	public $fields = array(
-		'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10),
-		'ref' => array('type' => 'varchar(50)', 'label' => 'Ref', 'enabled' => 1, 'visible' => -1, 'showoncombobox' => 1, 'position' => 15, 'searchall' => 1),
-		'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'visible' => 0, 'position' => 20),
-		'ref_customer' => array('type' => 'varchar(50)', 'label' => 'RefCustomer', 'enabled' => 1, 'visible' => -1, 'position' => 25, 'searchall' => 1),
-		'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 30, 'index' => 1),
-		'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 35),
-		'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 40),
-		'fk_commande' => array('type' => 'integer:Commande:commande/class/commande.class.php', 'label' => 'Order', 'enabled' => 'isModEnabled("societe")', 'visible' => -1, 'notnull' => 1, 'position' => 70),
-		'fk_projet' => array('type' => 'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label' => 'Project', 'enabled' => "isModEnabled('project')", 'visible' => -1, 'position' => 75),
-		'fk_product' => array('type' => 'integer:Product:product/class/product.class.php:1', 'label' => 'ProductOrService', 'enabled' => "isModEnabled('product') || isModEnabled('service')", 'visible' => -1, 'position' => 76),
-		//'fk_commercial_signature' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'SaleRepresentative Signature', 'enabled' => 1, 'visible' => -1, 'position' => 80),
-		//'fk_commercial_suivi' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'SaleRepresentative follower', 'enabled' => 1, 'visible' => -1, 'position' => 85),
-		'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 90),
-		'total_ht' => array('type' => 'double(24,8)', 'label' => 'TotalHT', 'enabled' => 1, 'visible' => -1, 'position' => 125, 'isameasure' => 1),
-		'total_tva' => array('type' => 'double(24,8)', 'label' => 'VAT', 'enabled' => 1, 'visible' => -1, 'position' => 130, 'isameasure' => 1),
-		'localtax1' => array('type' => 'double(24,8)', 'label' => 'LocalTax1', 'enabled' => 1, 'visible' => -1, 'position' => 135, 'isameasure' => 1),
-		'localtax2' => array('type' => 'double(24,8)', 'label' => 'LocalTax2', 'enabled' => 1, 'visible' => -1, 'position' => 140, 'isameasure' => 1),
-		'total_ttc' => array('type' => 'double(24,8)', 'label' => 'TotalTTC', 'enabled' => 1, 'visible' => -1, 'position' => 145, 'isameasure' => 1),
-		'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 105, 'searchall' => 1),
-		'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 110, 'searchall' => 1),
-		'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 115),
-		'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 120),
-		'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => -1, 'position' => 125),
-		'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 135),
-		'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'Last main doc', 'enabled' => 1, 'visible' => -1, 'position' => 140),
-		'statut' => array('type' => 'smallint(6)', 'label' => 'Statut', 'enabled' => 1, 'visible' => -1, 'position' => 500, 'notnull' => 1, 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Validated', 2 => 'Closed'))
-	);
-	// END MODULEBUILDER PROPERTIES
-
-
 	/**
 	 *      Constructor
 	 *

########## commande/customer.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/commande/customer.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/commande/customer.php	2025-06-27 11:43:40.004156000 +0000
@@ -80,9 +80,13 @@
 
 llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-commande page-customer');
 
-// Mode List
+$thirdpartystatic = new Societe($db);
 
-$sql = "SELECT s.rowid, s.nom as name, s.client, s.town, s.datec,";
+/*
+ * Mode List
+ */
+
+$sql = "SELECT s.rowid, s.nom as name, s.client, s.town, s.datec, s.datea,";
 $sql .= " st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta as code_compta_client";
 $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st, ".MAIN_DB_PREFIX."commande as c";
 $sql .= " WHERE s.fk_stcomm = st.id AND c.fk_soc = s.rowid";
@@ -96,6 +100,9 @@
 if (GETPOST("search_code_client")) {
 	$sql .= natural_search("s.code_client", GETPOST("search_code_client"));
 }
+if (dol_strlen($begin)) {
+	$sql .= " AND s.nom LIKE '".$db->escape($begin)."'";
+}
 // If the internal user must only see his customers, force searching by him
 $search_sale = 0;
 if (!$user->hasRight('societe', 'client', 'voir')) {
@@ -114,7 +121,7 @@
 	$sql .= " AND c.fk_soc = ".((int) $socid);
 }
 $sql .= " AND c.fk_statut in (1, 2) AND c.facture = 0";
-$sql .= " GROUP BY s.nom, s.rowid";
+$sql .= " GROUP BY s.nom";
 $sql .= $db->order($sortfield, $sortorder);
 
 // Count total nb of records
@@ -148,7 +155,7 @@
 	print_liste_field_titre("Town", $_SERVER["PHP_SELF"], "s.town", "", "", 'valign="center"', $sortfield, $sortorder);
 	print_liste_field_titre("CustomerCode", $_SERVER["PHP_SELF"], "s.code_client", "", "", 'align="left"', $sortfield, $sortorder);
 	print_liste_field_titre("AccountancyCode", $_SERVER["PHP_SELF"], "s.code_compta", "", "", 'align="left"', $sortfield, $sortorder);
-	print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "datec", "", "", 'class="right"', $sortfield, $sortorder);
+	print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "datec", $addu, "", 'class="right"', $sortfield, $sortorder);
 	print "</tr>\n";
 
 	// Fields title search
@@ -177,7 +184,7 @@
 		$obj = $db->fetch_object($resql);
 
 		print '<tr class="oddeven">';
-		print '<td class="tdoverflowmax150">';
+		print '<td>';
 
 		$result = '';
 		$link = $linkend = '';
@@ -185,7 +192,7 @@
 		$linkend = '</a>';
 		$name = $obj->name;
 		$result .= ($link.img_object($langs->trans("ShowCompany").': '.$name, 'company').$linkend);
-		$result .= $link.$name.$linkend;
+		$result .= $link.(dol_trunc($name, $maxlen)).$linkend;
 
 		print $result;
 		print '</td>';

########## commande/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/commande/list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/commande/list.php	2025-06-27 11:43:40.006328000 +0000
@@ -1026,12 +1026,7 @@
 	}
 }
 if ($search_option == 'late') {
-	// Use delivery date if set and not disabled, otherwise use order date.
-	if (!getDolGlobalString('ORDER_DISABLE_DELIVERY_DATE')) {
-		$sql .= " AND ((c.date_livraison IS NOT NULL AND c.date_livraison < '".$db->idate(dol_now() - $conf->order->client->warning_delay)."') OR (c.date_livraison IS NULL AND c.date_commande < '".$db->idate(dol_now() - $conf->order->client->warning_delay)."'))";
-	} else {
-		$sql .= " AND c.date_commande < '".$db->idate(dol_now() - $conf->order->client->warning_delay)."'";
-	}
+	$sql .= " AND c.date_commande < '".$db->idate(dol_now() - $conf->order->client->warning_delay)."'";
 }
 if ($search_datecloture_start) {
 	$sql .= " AND c.date_cloture >= '".$db->idate($search_datecloture_start)."'";
@@ -2913,8 +2908,8 @@
 
 		// Note public
 		if (!empty($arrayfields['c.note_public']['checked'])) {
-			print '<td class="sensiblehtmlcontent maxwidth250imp classfortooltip" title="'.dolPrintHTMLForAttribute(dolGetFirstLineOfText($obj->note_public, 20)).'">';
-			print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'</div>';
+			print '<td class="flat maxwidth250imp">';
+			print '<div class="small lineheightsmall">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public), 5).'</div>';
 			print '</td>';
 			if (!$i) {
 				$totalarray['nbfield']++;
@@ -2923,8 +2918,8 @@
 
 		// Note private
 		if (!empty($arrayfields['c.note_private']['checked'])) {
-			print '<td class="sensiblehtmlcontent maxwidth250imp classfortooltip" title="'.dolPrintHTMLForAttribute(dolGetFirstLineOfText($obj->note_private, 20)).'">';
-			print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'</div>';
+			print '<td class="flat maxwidth250imp">';
+			print '<div class="small lineheightsmall">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private), 5).'</div>';
 			print '</td>';
 			if (!$i) {
 				$totalarray['nbfield']++;

########## commande/list_det.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/commande/list_det.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/commande/list_det.php	2025-06-27 11:43:39.984996000 +0000
@@ -191,11 +191,11 @@
 $checkedtypetiers = 0;
 $arrayfields = array(
 	// Détail commande
-	'rowid' => array('label' => 'LineID', 'checked' => '-1', 'position' => 1, 'enabled' => '1'),
+	'rowid' => array('label' => 'TechnicalID', 'checked' => '-1', 'position' => 1, 'enabled' => '1'),
+	'pr.ref' => array('label' => 'ProductRef', 'checked' => '1', 'position' => 2),
+	'pr.desc' => array('label' => 'ProductDescription', 'checked' => '-1', 'position' => 3),
+	'cdet.qty' => array('label' => 'QtyOrdered', 'checked' => '1', 'position' => 4),
 	'c.ref' => array('label' => "RefOrder", 'checked' => '1', 'position' => 5),
-	'pr.ref' => array('label' => 'ProductRef', 'checked' => '1', 'position' => 6),
-	'pr.desc' => array('label' => 'ProductDescription', 'checked' => '-1', 'position' => 7),
-	'cdet.qty' => array('label' => 'QtyOrdered', 'checked' => '1', 'position' => 8),
 	'c.ref_client' => array('label' => "RefCustomerOrder", 'checked' => '-1', 'position' => 10),
 	'p.ref' => array('label' => "ProjectRef", 'checked' => '-1', 'enabled' => (string) (int) isModEnabled('project'), 'position' => 20),
 	'p.title' => array('label' => "ProjectLabel", 'checked' => '0', 'enabled' => (string) (int) isModEnabled('project'), 'position' => 25),
@@ -1032,13 +1032,7 @@
 		print '<input class="flat searchstring width50" type="text" name="search_id" value="'.dol_escape_htmltag($search_id).'">';
 		print '</td>';
 	}
-	// Ref order
-	if (!empty($arrayfields['c.ref']['checked'])) {
-		print '<td class="liste_titre">';
-		print '<input class="flat" size="6" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
-		print '</td>';
-	}
-	// Product ref
+	// Détail commande
 	if (!empty($arrayfields['pr.ref']['checked'])) {
 		print '<td class="liste_titre">';
 		print '<input class="flat" size="6" type="text" name="search_refProduct" value="'.dol_escape_htmltag($search_refProduct).'">';
@@ -1055,6 +1049,12 @@
 		print '<td class="liste_titre"></td>';
 	}
 
+	// Ref
+	if (!empty($arrayfields['c.ref']['checked'])) {
+		print '<td class="liste_titre">';
+		print '<input class="flat" size="6" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
+		print '</td>';
+	}
 	// Ref customer
 	if (!empty($arrayfields['c.ref_client']['checked'])) {
 		print '<td class="liste_titre" align="left">';
@@ -1321,14 +1321,11 @@
 		print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'maxwidthsearch center ');
 	}
 
-	// Detail order
+	// Détail commande
 	if (!empty($arrayfields['rowid']['checked'])) {
 		// @phan-suppress-next-line PhanTypeInvalidDimOffset
 		print_liste_field_titre($arrayfields['rowid']['label'], $_SERVER["PHP_SELF"], 'rowid', '', $param, '', $sortfield, $sortorder);
 	}
-	if (!empty($arrayfields['c.ref']['checked'])) {
-		print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], 'c.ref', '', $param, '', $sortfield, $sortorder);
-	}
 	if (!empty($arrayfields['pr.ref']['checked'])) {
 		print_liste_field_titre($arrayfields['pr.ref']['label'], $_SERVER["PHP_SELF"], 'pr.ref', '', $param, '', $sortfield, $sortorder);
 	}
@@ -1339,6 +1336,9 @@
 		print_liste_field_titre($arrayfields['cdet.qty']['label'], $_SERVER["PHP_SELF"], 'cdet.qty', '', $param, '', $sortfield, $sortorder);
 	}
 
+	if (!empty($arrayfields['c.ref']['checked'])) {
+		print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], 'c.ref', '', $param, '', $sortfield, $sortorder);
+	}
 	if (!empty($arrayfields['c.ref_client']['checked'])) {
 		print_liste_field_titre($arrayfields['c.ref_client']['label'], $_SERVER["PHP_SELF"], 'c.ref_client', '', $param, '', $sortfield, $sortorder);
 	}
@@ -1611,22 +1611,6 @@
 			}
 		}
 
-		// Ref order
-		if (!empty($arrayfields['c.ref']['checked'])) {
-			print '<td class="nowraponall">';
-			print $generic_commande->getNomUrl(1, ($search_status != 2 ? 0 : $obj->fk_statut), 0, 0, 0, 1, 1);
-
-			$filename = dol_sanitizeFileName($obj->ref);
-			$filedir = $conf->commande->multidir_output[$conf->entity].'/'.dol_sanitizeFileName($obj->ref);
-			$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid;
-			print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir);
-
-			print '</td>';
-			if (!$i) {
-				$totalarray['nbfield']++;
-			}
-		}
-
 		// Product Ref
 		if (!empty($arrayfields['pr.ref']['checked'])) {
 			if (!empty($obj->product_rowid)) {
@@ -1676,6 +1660,22 @@
 			}
 		}
 
+		// Ref
+		if (!empty($arrayfields['c.ref']['checked'])) {
+			print '<td class="nowraponall">';
+			print $generic_commande->getNomUrl(1, ($search_status != 2 ? 0 : $obj->fk_statut), 0, 0, 0, 1, 1);
+
+			$filename = dol_sanitizeFileName($obj->ref);
+			$filedir = $conf->commande->multidir_output[$conf->entity].'/'.dol_sanitizeFileName($obj->ref);
+			$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid;
+			print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir);
+
+			print '</td>';
+			if (!$i) {
+				$totalarray['nbfield']++;
+			}
+		}
+
 		// Ref customer
 		if (!empty($arrayfields['c.ref_client']['checked'])) {
 			print '<td class="nowrap tdoverflowmax200">'.$obj->ref_client.'</td>';

########## compta/bank/bankentries_list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/bank/bankentries_list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/bank/bankentries_list.php	2025-06-27 11:43:39.897355000 +0000
@@ -796,8 +796,8 @@
 	print '<input type="hidden" name="token" value="'.newToken().'">';
 	print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
 	print '<input type="hidden" name="action" value="'.($action != 'delete' ? $action : 'search').'">';
-	if (!empty($mode)) {
-		print '<input type="hidden" name="mode" value="'.dol_escape_htmltag($mode).'">';
+	if (!empty($view)) {
+		print '<input type="hidden" name="view" value="'.dol_escape_htmltag($view).'">';
 	}
 	print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
 	print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
@@ -845,7 +845,7 @@
 		print '</td>';
 		print '<td>&nbsp;</td>';
 		print '<td class="nowrap">';
-		print $form->select_types_paiements((GETPOST('operation') ? GETPOST('operation') : ($object->type == Account::TYPE_CASH ? 'LIQ' : '')), 'operation', '1,2', 2, 1, 0, 0, 1, '', 1);
+		$form->select_types_paiements((GETPOST('operation') ? GETPOST('operation') : ($object->type == Account::TYPE_CASH ? 'LIQ' : '')), 'operation', '1,2', 2, 1);
 		print '</td>';
 		print '<td>';
 		print '<input name="num_chq" class="flat" type="text" size="4" value="'.GETPOST("num_chq", "alpha").'">';
@@ -853,7 +853,7 @@
 		//if (! $search_account > 0)
 		//{
 		print '<td class=right>';
-		print $form->select_comptes(GETPOSTINT('add_account') ? GETPOSTINT('add_account') : $search_account, 'add_account', 0, '', 1, ($id > 0 || !empty($ref) ? ' disabled="disabled"' : ''), 0, '', 1);
+		$form->select_comptes(GETPOSTINT('add_account') ? GETPOSTINT('add_account') : $search_account, 'add_account', 0, '', 1, ($id > 0 || !empty($ref) ? ' disabled="disabled"' : ''));
 		print '</td>';
 		//}
 		print '<td class="right"><input name="adddebit" class="flat" type="text" size="4" value="'.GETPOST("adddebit", "alpha").'"></td>';
@@ -1138,7 +1138,7 @@
 	}
 	// Type
 	if (!empty($arrayfields['type']['checked'])) {
-		print '<td class="liste_titre">';
+		print '<td class="liste_titre center">';
 		print $form->select_types_paiements(empty($search_type) ? '' : $search_type, 'search_type', '', 2, 1, 1, 0, 1, 'maxwidth100', 1);
 		print '</td>';
 	}
@@ -1240,7 +1240,7 @@
 		$totalarray['nbfield']++;
 	}
 	if (!empty($arrayfields['type']['checked'])) {
-		print_liste_field_titre($arrayfields['type']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder);
+		print_liste_field_titre($arrayfields['type']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'center ');
 		$totalarray['nbfield']++;
 	}
 	if (!empty($arrayfields['b.num_chq']['checked'])) {
@@ -1670,13 +1670,13 @@
 		if (!empty($arrayfields['type']['checked'])) {
 			$labeltype = ($langs->transnoentitiesnoconv("PaymentTypeShort".$objp->fk_type) != "PaymentTypeShort".$objp->fk_type) ? $langs->transnoentitiesnoconv("PaymentTypeShort".$objp->fk_type) : $langs->getLabelFromKey($db, $objp->fk_type, 'c_paiement', 'code', 'libelle', '', 1);
 			if (empty($arrayfields['b.num_chq']['checked'])) {
-				$labeltype .= ($objp->num_chq ? ' <span class="opacitymedium">- '.$objp->num_chq.'</span>' : '');
+				$labeltype .= ($objp->num_chq ? ' - '.$objp->num_chq : '');
 			}
 			print '<td class="tdoverflowmax100" title="'.dolPrintLabel($labeltype).'">';
 			if ($labeltype == 'SOLD') {
 				print '&nbsp;'; //$langs->trans("InitialBankBalance");
 			} else {
-				print dolPrintHtml($labeltype);
+				print dolPrintLabel($labeltype);
 			}
 			print "</td>\n";
 			if (!$i) {

########## compta/bank/various_payment/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/bank/various_payment/list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/bank/various_payment/list.php	2025-06-27 11:43:39.882000000 +0000
@@ -234,7 +234,6 @@
 	}
 }
 
-
 /*
  * View
  */
@@ -404,16 +403,16 @@
 	$param .= '&search_label='.urlencode($search_label);
 }
 if ($search_datep_start) {
-	$param .= '&search_datep_start='.urlencode((string) $search_datep_start);
+	$param .= '&search_datep_start='.urlencode($search_datep_start);
 }
 if ($search_datep_end) {
-	$param .= '&search_datep_end='.urlencode((string) $search_datep_end);
+	$param .= '&search_datep_end='.urlencode($search_datep_end);
 }
 if ($search_datev_start) {
-	$param .= '&search_datev_start='.urlencode((string) $search_datev_start);
+	$param .= '&search_datev_start='.urlencode($search_datev_start);
 }
 if ($search_datev_end) {
-	$param .= '&search_datev_end='.urlencode((string) $search_datev_end);
+	$param .= '&search_datev_end='.urlencode($search_datev_end);
 }
 if ($search_type_id > 0) {
 	$param .= '&search_type_id='.urlencode((string) ($search_type_id));

########## compta/facture/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/facture/card.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/facture/card.php	2025-06-27 11:43:39.831953000 +0000
@@ -5251,7 +5251,7 @@
 			print '<table class="nobordernopadding centpercent"><tr><td>';
 			print $form->textwithpicto($langs->trans('PointOfSale'), $langs->trans('POSInfo'));
 			print '</td>';
-			if ($action != 'editposinfo' && $usercancreate) {
+			if ($action != 'editposinfo' && $object->status == $object::STATUS_DRAFT && $usercancreate) {
 				print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editposinfo&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetPOSInfo'), 1).'</a></td>';
 			}
 			print '</tr></table>';

########## compta/facture/class/api_invoices.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/facture/class/api_invoices.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/facture/class/api_invoices.class.php	2025-06-27 11:43:39.837599000 +0000
@@ -203,7 +203,7 @@
 		$obj_ret = array();
 
 		// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
-		$socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids;
+		$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
 
 		// If the internal user must only see his customers, force searching by him
 		$search_sale = 0;
@@ -1616,10 +1616,10 @@
 	 * Warning: Take care that all invoices are owned by the same customer.
 	 * Example of value for parameter arrayofamounts: {"1": {"amount": "99.99", "multicurrency_amount": ""}, "2": {"amount": "", "multicurrency_amount": "10"}}
 	 *
-	 * @param array   $arrayofamounts      {@from body}  Array with id of invoices with amount to pay for each invoice
+	 * @param array   $arrayofamounts     {@from body}  Array with id of invoices with amount to pay for each invoice
 	 * @phan-param array<string,array{amount:string,multicurrency_amount:string}> $arrayofamounts
 	 * @phpstan-param array<string,array{amount:string,multicurrency_amount:string}> $arrayofamounts
-	 * @param string  $datepaye            {@from body}  Payment date
+	 * @param string  $datepaye           {@from body}  Payment date
 	 * @param int     $paymentid           {@from body}  Payment mode Id {@min 1}
 	 * @param string  $closepaidinvoices   {@from body}  Close paid invoices {@choice yes,no}
 	 * @param int     $accountid           {@from body}  Account Id {@min 1}
@@ -1694,23 +1694,23 @@
 			$totalpaid = $this->invoice->getSommePaiement($is_multicurrency);
 			$totalcreditnotes = $this->invoice->getSumCreditNotesUsed($is_multicurrency);
 			$totaldeposits = $this->invoice->getSumDepositsUsed($is_multicurrency);
-			$remainstopay = $amount = (float) price2num($total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits, 'MT');
+			$remainstopay = $amount = price2num($total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits, 'MT');
 
 			if (!$is_multicurrency && $amountarray["amount"] != 'remain') {
-				$amount = (float) price2num($amountarray["amount"], 'MT');
+				$amount = price2num($amountarray["amount"], 'MT');
 			}
 
 			if ($is_multicurrency && $amountarray["multicurrency_amount"] != 'remain') {
-				$amount = (float) price2num($amountarray["multicurrency_amount"], 'MT');
+				$amount = price2num($amountarray["multicurrency_amount"], 'MT');
 			}
 
-			if (abs($amount) > abs($remainstopay) && !$accepthigherpayment) {
+			if ($amount > $remainstopay && !$accepthigherpayment) {
 				$this->db->rollback();
 				throw new RestException(400, 'Payment amount on invoice ID '.$id.' ('.$amount.') is higher than remain to pay ('.$remainstopay.')');
 			}
 
 			if ($this->invoice->type == Facture::TYPE_CREDIT_NOTE) {
-				$amount = (float) price2num(-1 * abs((float) $amount), 'MT');
+				$amount = price2num(-1 * (float) $amount, 'MT');
 			}
 
 			if ($is_multicurrency) {

########## compta/facture/class/facture.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/facture/class/facture.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/facture/class/facture.class.php	2025-06-27 11:43:39.844663000 +0000
@@ -175,7 +175,6 @@
 	 * @var int id of source invoice if replacement invoice or credit note
 	 */
 	public $fk_facture_source;
-
 	public $linked_objects = array();
 
 	/**
@@ -214,7 +213,7 @@
 	public $situation_cycle_ref;
 
 	/**
-	 * @var ?int Situation counter inside the cycle
+	 * @var int Situation counter inside the cycle
 	 */
 	public $situation_counter;
 
@@ -1081,7 +1080,7 @@
 						0,
 						$fk_parent_line,
 						$fk_product_fournisseur_price,
-						is_null($buyprice) ? '' : $buyprice,	// do not use (float) here, it may be ''
+						$buyprice,
 						$_facrec->lines[$i]->label,
 						empty($_facrec->lines[$i]->array_options) ? null : $_facrec->lines[$i]->array_options,
 						100,	// situation percent is undefined on recurring invoice lines
@@ -1296,7 +1295,6 @@
 		$object->fk_user_author     = $user->id;
 		$object->fk_user_valid      = null;
 		$object->fk_facture_source  = 0;
-		$object->fk_fac_rec_source  = 0;
 		$object->date_creation      = '';
 		$object->date_modification = '';
 		$object->date_validation    = '';
@@ -6191,7 +6189,7 @@
 		} else {
 			$sql .= " AND f.date_lim_reglement = '".$this->db->idate($tmpidate, 'gmt')."'";
 		}
-		$sql .= " AND f.entity IN (".getEntity('facture', 0).")";	// One batch processes only one company (no sharing)
+		$sql .= " AND f.entity IN (".getEntity('facture', 0).")";	// One batch process only one company (no sharing)
 		if (!empty($paymentmode) && $paymentmode != 'all') {
 			$sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '".$this->db->escape($paymentmode)."'";
 		}
@@ -6201,7 +6199,6 @@
 		} else {
 			$sql .= $this->db->order("date_lim_reglement", "ASC");
 		}
-		// TODO Add a date date_last_remind_email in select. We can update date after the result of sendfile() later. To avoid to send it twiceif we rerun the batch.
 
 		$resql = $this->db->query($sql);
 
@@ -6218,217 +6215,210 @@
 
 		if ($resql) {
 			while ($obj = $this->db->fetch_object($resql)) {
-				// Create a loopError that is reset at each loop, this counter is added to the global counter at the end of loop
-				$loopError = 0;
-
-				// Load event
-				$res = $tmpinvoice->fetch($obj->id);
-				if ($res > 0) {
-					$tmpinvoice->fetch_thirdparty();
-
-					$outputlangs = new Translate('', $conf);
-					if ($tmpinvoice->thirdparty->default_lang) {
-						$outputlangs->setDefaultLang($tmpinvoice->thirdparty->default_lang);
-						$outputlangs->loadLangs(array("main", "bills"));
-					} else {
-						$outputlangs = $langs;
-					}
+				if (!$error) {
+					// Load event
+					$res = $tmpinvoice->fetch($obj->id);
+					if ($res > 0) {
+						$tmpinvoice->fetch_thirdparty();
+
+						$outputlangs = new Translate('', $conf);
+						if ($tmpinvoice->thirdparty->default_lang) {
+							$outputlangs->setDefaultLang($tmpinvoice->thirdparty->default_lang);
+							$outputlangs->loadLangs(array("main", "bills"));
+						} else {
+							$outputlangs = $langs;
+						}
 
-					// Select email template according to language of recipient
-					$arraymessage = $formmail->getEMailTemplate($this->db, 'facture_send', $user, $outputlangs, (is_numeric($template) ? $template : 0), 1, (is_numeric($template) ? '' : $template));
-					if (is_numeric($arraymessage) && $arraymessage <= 0) {
-						$langs->load("errors");
-						$this->output .= $langs->trans('ErrorFailedToFindEmailTemplate', $template);
-						return 0;
-					}
+						// Select email template according to language of recipient
+						$arraymessage = $formmail->getEMailTemplate($this->db, 'facture_send', $user, $outputlangs, (is_numeric($template) ? $template : 0), 1, (is_numeric($template) ? '' : $template));
+						if (is_numeric($arraymessage) && $arraymessage <= 0) {
+							$langs->load("errors");
+							$this->output .= $langs->trans('ErrorFailedToFindEmailTemplate', $template);
+							return 0;
+						}
 
-					// PREPARE EMAIL
-					$errormesg = '';
+						// PREPARE EMAIL
+						$errormesg = '';
 
-					// Make substitution in email content
-					$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $tmpinvoice);
+						// Make substitution in email content
+						$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $tmpinvoice);
 
-					complete_substitutions_array($substitutionarray, $outputlangs, $tmpinvoice);
+						complete_substitutions_array($substitutionarray, $outputlangs, $tmpinvoice);
 
-					// Topic
-					$sendTopic = make_substitutions(empty($arraymessage->topic) ? $outputlangs->transnoentitiesnoconv('InformationMessage') : $arraymessage->topic, $substitutionarray, $outputlangs, 1);
+						// Topic
+						$sendTopic = make_substitutions(empty($arraymessage->topic) ? $outputlangs->transnoentitiesnoconv('InformationMessage') : $arraymessage->topic, $substitutionarray, $outputlangs, 1);
 
-					// Content
-					$content = $outputlangs->transnoentitiesnoconv($arraymessage->content);
+						// Content
+						$content = $outputlangs->transnoentitiesnoconv($arraymessage->content);
 
-					$sendContent = make_substitutions($content, $substitutionarray, $outputlangs, 1);
+						$sendContent = make_substitutions($content, $substitutionarray, $outputlangs, 1);
 
-					// Recipient
-					$to = array();
-					if ($forcerecipient) {	// If a recipient was forced
-						$to = array($forcerecipient);
-					} else {
-						$res = $tmpinvoice->fetch_thirdparty();
-						$recipient = $tmpinvoice->thirdparty;
-						if ($res > 0) {
-							$tmparraycontact = $tmpinvoice->liste_contact(-1, 'external', 0, 'BILLING');
-							if (is_array($tmparraycontact) && count($tmparraycontact) > 0) {
-								foreach ($tmparraycontact as $data_email) {
-									if (!empty($data_email['email'])) {
-										$to[] = $tmpinvoice->thirdparty->contact_get_property($data_email['id'], 'email');
+						// Recipient
+						$to = array();
+						if ($forcerecipient) {	// If a recipient was forced
+							$to = array($forcerecipient);
+						} else {
+							$res = $tmpinvoice->fetch_thirdparty();
+							$recipient = $tmpinvoice->thirdparty;
+							if ($res > 0) {
+								$tmparraycontact = $tmpinvoice->liste_contact(-1, 'external', 0, 'BILLING');
+								if (is_array($tmparraycontact) && count($tmparraycontact) > 0) {
+									foreach ($tmparraycontact as $data_email) {
+										if (!empty($data_email['email'])) {
+											$to[] = $tmpinvoice->thirdparty->contact_get_property($data_email['id'], 'email');
+										}
 									}
 								}
+								if (empty($to) && !empty($recipient->email)) {
+									$to[] = $recipient->email;
+								}
+								if (empty($to)) {
+									$errormesg = "Failed to send remind to thirdparty id=".$tmpinvoice->socid.". No email defined for invoice or customer.";
+									$error++;
+								}
+							} else {
+								$errormesg = "Failed to load recipient with thirdparty id=".$tmpinvoice->socid;
+								$error++;
 							}
-							if (empty($to) && !empty($recipient->email)) {
-								$to[] = $recipient->email;
-							}
-							if (empty($to)) {
-								$errormesg = "Failed to send remind to thirdparty id=".$tmpinvoice->socid.". No email defined for invoice or customer.";
-								$loopError++;
-							}
-						} else {
-							$errormesg = "Failed to load recipient with thirdparty id=".$tmpinvoice->socid;
-							$loopError++;
 						}
-					}
-
-					// Sender
-					$from = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
-					if (!empty($arraymessage->email_from)) {	// If a sender is defined into template, we use it in priority
-						$from = (string) $arraymessage->email_from;
-					}
-					if (empty($from)) {
-						$errormesg = "Failed to get sender into global setup MAIN_MAIL_EMAIL_FROM";
-						$loopError++;
-					}
 
-					if (!$loopError && !empty($to)) {
-						$to = implode(',', $to);
-						if (!empty($arraymessage->email_to)) {	// If a recipient is defined into template, we add it
-							$to = $to.','.$arraymessage->email_to;
+						// Sender
+						$from = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
+						if (!empty($arraymessage->email_from)) {	// If a sender is defined into template, we use it in priority
+							$from = (string) $arraymessage->email_from;
 						}
-
-						// Errors Recipient
-						$errors_to = getDolGlobalString('MAIN_MAIL_ERRORS_TO');
-
-						$trackid = 'inv'.$tmpinvoice->id;
-						$sendcontext = 'standard';
-
-						$email_tocc = '';
-						if (!empty($arraymessage->email_tocc)) {	// If a CC is defined into template, we use it
-							$email_tocc = (string) $arraymessage->email_tocc;
+						if (empty($from)) {
+							$errormesg = "Failed to get sender into global setup MAIN_MAIL_EMAIL_FROM";
+							$error++;
 						}
 
-						$email_tobcc = '';
-						if (!empty($arraymessage->email_tobcc)) {	// If a BCC is defined into template, we use it
-							$email_tobcc = (string) $arraymessage->email_tobcc;
-						}
+						if (!$error && !empty($to)) {
+							$this->db->begin();
 
-						//join file is asked
-						$joinFile = [];
-						$joinFileName = [];
-						$joinFileMime = [];
-						if ($arraymessage->joinfiles == 1 && !empty($tmpinvoice->last_main_doc)) {
-							$joinFile[] = DOL_DATA_ROOT.'/'.$tmpinvoice->last_main_doc;
-							$joinFileName[] = basename($tmpinvoice->last_main_doc);
-							$joinFileMime[] = dol_mimetype(DOL_DATA_ROOT.'/'.$tmpinvoice->last_main_doc);
-						}
+							$to = implode(',', $to);
+							if (!empty($arraymessage->email_to)) {	// If a recipient is defined into template, we add it
+								$to = $to.','.$arraymessage->email_to;
+							}
 
-						// Mail Creation
-						$cMailFile = new CMailFile($sendTopic, $to, $from, $sendContent, $joinFile, $joinFileMime, $joinFileName, $email_tocc, $email_tobcc, 0, 1, $errors_to, '', $trackid, '', $sendcontext, '');
+							// Errors Recipient
+							$errors_to = getDolGlobalString('MAIN_MAIL_ERRORS_TO');
 
-						$resultsendmail = $cMailFile->sendfile();
+							$trackid = 'inv'.$tmpinvoice->id;
+							$sendcontext = 'standard';
 
-						$this->db->begin();
+							$email_tocc = '';
+							if (!empty($arraymessage->email_tocc)) {	// If a CC is defined into template, we use it
+								$email_tocc = (string) $arraymessage->email_tocc;
+							}
 
-						// Sending Mail
-						if ($resultsendmail) {
-							$nbMailSend++;
+							$email_tobcc = '';
+							if (!empty($arraymessage->email_tobcc)) {	// If a BCC is defined into template, we use it
+								$email_tobcc = (string) $arraymessage->email_tobcc;
+							}
 
-							// Add a line into event table
-							require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
+							//join file is asked
+							$joinFile = [];
+							$joinFileName = [];
+							$joinFileMime = [];
+							if ($arraymessage->joinfiles == 1 && !empty($tmpinvoice->last_main_doc)) {
+								$joinFile[] = DOL_DATA_ROOT.'/'.$tmpinvoice->last_main_doc;
+								$joinFileName[] = basename($tmpinvoice->last_main_doc);
+								$joinFileMime[] = dol_mimetype(DOL_DATA_ROOT.'/'.$tmpinvoice->last_main_doc);
+							}
 
-							// Insert record of emails sent
-							$actioncomm = new ActionComm($this->db);
+							// Mail Creation
+							$cMailFile = new CMailFile($sendTopic, $to, $from, $sendContent, $joinFile, $joinFileMime, $joinFileName, $email_tocc, $email_tobcc, 0, 1, $errors_to, '', $trackid, '', $sendcontext, '');
 
-							$actioncomm->type_code = 'AC_OTH_AUTO'; // Event insert into agenda automatically
-							$actioncomm->socid = $tmpinvoice->thirdparty->id; // To link to a company
-							$actioncomm->contact_id = 0;
+							// Sending Mail
+							if ($cMailFile->sendfile()) {
+								$nbMailSend++;
+
+								// Add a line into event table
+								require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
+
+								// Insert record of emails sent
+								$actioncomm = new ActionComm($this->db);
+
+								$actioncomm->type_code = 'AC_OTH_AUTO'; // Event insert into agenda automatically
+								$actioncomm->socid = $tmpinvoice->thirdparty->id; // To link to a company
+								$actioncomm->contact_id = 0;
+
+								$actioncomm->code = 'AC_EMAIL';
+								$actioncomm->label = 'sendEmailsRemindersOnInvoiceDueDateOK (nbdays='.$nbdays.' paymentmode='.$paymentmode.' template='.$template.' datetouse='.$datetouse.' forcerecipient='.$forcerecipient.')';
+								$actioncomm->note_private = $sendContent;
+								$actioncomm->fk_project = $tmpinvoice->fk_project;
+								$actioncomm->datep = dol_now();
+								$actioncomm->datef = $actioncomm->datep;
+								$actioncomm->percentage = -1; // Not applicable
+								$actioncomm->authorid = $user->id; // User saving action
+								$actioncomm->userownerid = $user->id; // Owner of action
+								// Fields when action is an email (content should be added into note)
+								$actioncomm->email_msgid = $cMailFile->msgid;
+								$actioncomm->email_subject = $sendTopic;
+								$actioncomm->email_from = $from;
+								$actioncomm->email_sender = '';
+								$actioncomm->email_to = $to;
+								//$actioncomm->email_tocc = $sendtocc;
+								//$actioncomm->email_tobcc = $sendtobcc;
+								//$actioncomm->email_subject = $subject;
+								$actioncomm->errors_to = $errors_to;
+
+								$actioncomm->elementtype = 'invoice';
+								$actioncomm->elementid = $tmpinvoice->id;
+								$actioncomm->fk_element = $tmpinvoice->id;
 
-							$actioncomm->code = 'AC_EMAIL';
-							$actioncomm->label = 'sendEmailsRemindersOnInvoiceDueDateOK (nbdays='.$nbdays.' paymentmode='.$paymentmode.' template='.$template.' datetouse='.$datetouse.' forcerecipient='.$forcerecipient.')';
-							$actioncomm->note_private = $sendContent;
-							$actioncomm->fk_project = $tmpinvoice->fk_project;
-							$actioncomm->datep = dol_now();
-							$actioncomm->datef = $actioncomm->datep;
-							$actioncomm->percentage = -1; // Not applicable
-							$actioncomm->authorid = $user->id; // User saving action
-							$actioncomm->userownerid = $user->id; // Owner of action
-							// Fields when action is an email (content should be added into note)
-							$actioncomm->email_msgid = $cMailFile->msgid;
-							$actioncomm->email_subject = $sendTopic;
-							$actioncomm->email_from = $from;
-							$actioncomm->email_sender = '';
-							$actioncomm->email_to = $to;
-							//$actioncomm->email_tocc = $sendtocc;
-							//$actioncomm->email_tobcc = $sendtobcc;
-							//$actioncomm->email_subject = $subject;
-							$actioncomm->errors_to = $errors_to;
+								//$actioncomm->extraparams = $extraparams;
 
-							$actioncomm->elementtype = 'invoice';
-							$actioncomm->elementid = $tmpinvoice->id;
+								$actioncomm->create($user);
+							} else {
+								$errormesg = $cMailFile->error.' : '.$to;
+								$error++;
 
-							//$actioncomm->extraparams = $extraparams;
+								// Add a line into event table
+								require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
 
-							$actioncomm->create($user);
-						} else {
-							$errormesg = $cMailFile->error.' : '.$to;
-							$loopError++;
+								// Insert record of emails sent
+								$actioncomm = new ActionComm($this->db);
 
-							// Add a line into event table
-							require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
+								$actioncomm->type_code = 'AC_OTH_AUTO'; // Event insert into agenda automatically
+								$actioncomm->socid = $tmpinvoice->thirdparty->id; // To link to a company
+								$actioncomm->contact_id = 0;
+
+								$actioncomm->code = 'AC_EMAIL';
+								$actioncomm->label = 'sendEmailsRemindersOnInvoiceDueDateKO';
+								$actioncomm->note_private = $errormesg;
+								$actioncomm->fk_project = $tmpinvoice->fk_project;
+								$actioncomm->datep = dol_now();
+								$actioncomm->datef = $actioncomm->datep;
+								$actioncomm->percentage = -1; // Not applicable
+								$actioncomm->authorid = $user->id; // User saving action
+								$actioncomm->userownerid = $user->id; // Owner of action
+								// Fields when action is an email (content should be added into note)
+								$actioncomm->email_msgid = $cMailFile->msgid;
+								$actioncomm->email_from = $from;
+								$actioncomm->email_sender = '';
+								$actioncomm->email_to = $to;
+								//$actioncomm->email_tocc = $sendtocc;
+								//$actioncomm->email_tobcc = $sendtobcc;
+								//$actioncomm->email_subject = $subject;
+								$actioncomm->errors_to = $errors_to;
 
-							// Insert record of emails sent
-							$actioncomm = new ActionComm($this->db);
+								//$actioncomm->extraparams = $extraparams;
 
-							$actioncomm->type_code = 'AC_OTH_AUTO'; // Event insert into agenda automatically
-							$actioncomm->socid = $tmpinvoice->thirdparty->id; // To link to a company
-							$actioncomm->contact_id = 0;
-
-							$actioncomm->code = 'AC_EMAIL';
-							$actioncomm->label = 'sendEmailsRemindersOnInvoiceDueDateKO';
-							$actioncomm->note_private = $errormesg;
-							$actioncomm->fk_project = $tmpinvoice->fk_project;
-							$actioncomm->datep = dol_now();
-							$actioncomm->datef = $actioncomm->datep;
-							$actioncomm->percentage = -1; // Not applicable
-							$actioncomm->authorid = $user->id; // User saving action
-							$actioncomm->userownerid = $user->id; // Owner of action
-							// Fields when action is an email (content should be added into note)
-							$actioncomm->email_msgid = $cMailFile->msgid;
-							$actioncomm->email_from = $from;
-							$actioncomm->email_sender = '';
-							$actioncomm->email_to = $to;
-							//$actioncomm->email_tocc = $sendtocc;
-							//$actioncomm->email_tobcc = $sendtobcc;
-							//$actioncomm->email_subject = $subject;
-							$actioncomm->errors_to = $errors_to;
-
-							$actioncomm->elementtype = 'invoice';
-							$actioncomm->elementid = $tmpinvoice->id;
-
-							//$actioncomm->extraparams = $extraparams;
+								$actioncomm->create($user);
+							}
 
-							$actioncomm->create($user);
+							$this->db->commit();	// We always commit
 						}
 
-						$this->db->commit();	// We always commit
-					}
-
-					if ($errormesg) {
-						$errorsMsg[] = $errormesg;
+						if ($errormesg) {
+							$errorsMsg[] = $errormesg;
+						}
+					} else {
+						$errorsMsg[] = 'Failed to fetch record invoice with ID = '.$obj->id;
+						$error++;
 					}
-				} else {
-					$errorsMsg[] = 'Failed to fetch record invoice with ID = '.$obj->id;
-					$loopError++;
 				}
-
-				$error += $loopError;
 			}
 		} else {
 			$error++;

########## compta/facture/invoicetemplate_list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/facture/invoicetemplate_list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/facture/invoicetemplate_list.php	2025-06-27 11:43:39.809542000 +0000
@@ -64,7 +64,6 @@
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'invoicetemplatelist'; // To manage different context of search
 $optioncss  = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
 $mode       = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
-$groupby    = GETPOST('groupby', 'aZ09');
 
 $socid = GETPOSTINT('socid');
 
@@ -183,13 +182,9 @@
 
 $objecttype = 'facture_rec';
 
-$permissiontoread = $user->hasRight("facture", "read");
 $permissionnote = $user->hasRight('facture', 'creer'); // Used by the include of actions_setnotes.inc.php
 $permissiondellink = $user->hasRight('facture', 'creer'); // Used by the include of actions_dellink.inc.php
 $permissiontoedit = $user->hasRight('facture', 'creer'); // Used by the include of actions_lineupdonw.inc.php
-$permissiontodelete = $user->hasRight("facture", "delete");
-
-$uploaddir = $conf->facture->dir_output;
 
 // Security check
 $result = restrictedArea($user, 'facture', $object->id, $objecttype);
@@ -207,7 +202,7 @@
 	$massaction = '';
 }
 
-$parameters = array('arrayfields' => &$arrayfields, 'socid' => $socid);
+$parameters = array('socid' => $socid);
 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
 if ($reshook < 0) {
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@@ -260,8 +255,11 @@
 	}
 
 	// Mass actions
-	/*$objectclass = 'MyObject';
-	$objectlabel = 'MyObject';
+	/*$objectclass='MyObject';
+	$objectlabel='MyObject';
+	$permissiontoread = $user->hasRight("mymodule", "read");
+	$permissiontodelete = $user->hasRight("mymodule", "delete");
+	$uploaddir = $conf->mymodule->dir_output;
 	include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';*/
 }
 
@@ -405,7 +403,7 @@
 		dol_print_error($db);
 	}
 
-	if (($page * $limit) > $nbtotalofrecords) {	// if total resultset is smaller than the paging size (filtering), goto and load page 0
+	if (($page * $limit) > $nbtotalofrecords) {	// if total resultset is smaller then paging size (filtering), goto and load page 0
 		$page = 0;
 		$offset = 0;
 	}
@@ -449,12 +447,6 @@
 if ($limit > 0 && $limit != $conf->liste_limit) {
 	$param .= '&limit='.((int) $limit);
 }
-if ($optioncss != '') {
-	$param .= '&optioncss='.urlencode($optioncss);
-}
-if ($groupby != '') {
-	$param .= '&groupby='.urlencode($groupby);
-}
 if ($socid > 0) {
 	$param .= '&socid='.urlencode((string) ($socid));
 }
@@ -530,11 +522,14 @@
 if ($search_status != '') {
 	$param .= '&search_status='.urlencode($search_status);
 }
+if ($optioncss != '') {
+	$param .= '&optioncss='.urlencode($optioncss);
+}
 // Add $param from extra fields
 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
 // Add $param from hooks
 $parameters = array('param' => &$param);
-$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
 $param .= $hookmanager->resPrint;
 
 // List of mass actions available
@@ -602,7 +597,7 @@
 print '<tr class="liste_titre_filter">';
 // Action column
 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
-	print '<td class="liste_titre center maxwidthsearch">';
+	print '<td class="liste_titre maxwidthsearch center">';
 	$searchpicto = $form->showFilterButtons('left');
 	print $searchpicto;
 	print '</td>';
@@ -734,7 +729,7 @@
 }
 // Action column
 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
-	print '<td class="liste_titre center maxwidthsearch">';
+	print '<td class="liste_titre maxwidthsearch center">';
 	$searchpicto = $form->showFilterButtons();
 	print $searchpicto;
 	print '</td>';

########## compta/facture/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/facture/list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/facture/list.php	2025-06-27 11:43:39.813554000 +0000
@@ -2920,7 +2920,7 @@
 			// Note public
 			if (!empty($arrayfields['f.note_public']['checked'])) {
 				print '<td class="sensiblehtmlcontent center">';
-				print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'</div>';
+				print dolPrintHTML($obj->note_public);
 				print '</td>';
 				if (!$i) {
 					$totalarray['nbfield']++;
@@ -2928,8 +2928,8 @@
 			}
 			// Note private
 			if (!empty($arrayfields['f.note_private']['checked'])) {
-				print '<td class="sensiblehtmlcontent center">';
-				print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'</div>';
+				print '<td class="center">';
+				print dolPrintHTML($obj->note_private);
 				print '</td>';
 				if (!$i) {
 					$totalarray['nbfield']++;

########## compta/paiement/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/paiement/card.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/paiement/card.php	2025-06-27 11:43:39.669352000 +0000
@@ -92,7 +92,7 @@
 
 	$service = 'StripeTest';
 	$servicestatus = 0;
-	if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha')*/) {
+	if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
 		$service = 'StripeLive';
 		$servicestatus = 1;
 	}

########## compta/paiement/class/paiement.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/paiement/class/paiement.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/paiement/class/paiement.class.php	2025-06-27 11:43:39.683439000 +0000
@@ -171,6 +171,11 @@
 	public $num_payment;
 
 	/**
+	 * @var string Id of external payment mode
+	 */
+	public $ext_payment_id;
+
+	/**
 	 * @var int Id of prelevement
 	 */
 	public $id_prelevement;
@@ -181,12 +186,7 @@
 	public $num_prelevement;
 
 	/**
-	 * @var string Id of external payment mode (With Stripe: 'pi_xxx:cus_ccc@pk_ppp', ...)
-	 */
-	public $ext_payment_id;
-
-	/**
-	 * @var string Name of external payment mode ('StripeLive', 'StripeTest', 'stripe' on old version, 'paypal', ...)
+	 * @var string Name of external payment mode
 	 */
 	public $ext_payment_site;
 
@@ -296,8 +296,7 @@
 	/**
 	 *  Create payment of invoices into database.
 	 *  It uses this->amounts and ->multicurrency_amounts to get the list of detail of payment for each invoices for the payment.
-	 *  For payment of a customer invoice, amounts are positive, for payment of credit note, amounts are negative.
-	 *  Can also close the invoice if remain to pay is 0.
+	 *  For payment of a customer invoice, amounts are positive, for payment of credit note, amounts are negative
 	 *  This will set also ->amount and ->multicurrency_amount at end.
 	 *
 	 *  @param	User	  $user                	Object user

########## compta/paiement.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/paiement.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/paiement.php	2025-06-27 11:43:39.666854000 +0000
@@ -828,7 +828,7 @@
 							if (!empty($conf->use_javascript_ajax)) {
 								print '<button class="btn-low-emphasis --btn-icon AutoFillAmount" data-rowname="'.$namef.'" data-value="'.($sign * (float) $multicurrency_remaintopay).'">'.img_picto("Auto fill", 'rightarrow');
 							}
-							print '<input '.$min.' '.$max.' type="text" class="multicurrency_amount" name="'.$namef.'" value="'.GETPOST($namef).'">';
+							print '<input '.$min.' '.$max.' type="number" step="any" size="8" class="multicurrency_amount" name="'.$namef.'" value="'.GETPOST($namef).'">';
 							print '<input type="hidden" class="multicurrency_remain" name="'.$nameRemain.'" value="'.$multicurrency_remaintopay.'">';
 						} else {
 							print '<input type="text" class="maxwidth75" name="'.$namef.'_disabled" value="'.(GETPOST($namef) != '0' ? GETPOST($namef) : '').'" disabled>';
@@ -899,7 +899,7 @@
 					if (!empty($conf->use_javascript_ajax)) {
 						print '<button  class="btn-low-emphasis --btn-icon AutoFillAmount" data-rowname="'.$namef.'" data-value="'.($sign * (float) $remaintopay).'">'.img_picto("Auto fill", 'rightarrow').'</button>';
 					}
-					print '<input '.$max.' '.$min.' type="text" size="8" class="amount" name="'.$namef.'" value="'.dol_escape_htmltag(GETPOST($namef)).'">'; // class is required to be used by javascript callForResult();
+					print '<input '.$max.' '.$min.' type="number" step="any" size="8" class="amount" name="'.$namef.'" value="'.dol_escape_htmltag(GETPOST($namef)).'">'; // class is required to be used by javascript callForResult();
 					print '<input type="hidden" class="remain" name="'.$nameRemain.'" value="'.$remaintopay.'">';
 				} else {
 					print '<input type="text" class="maxwidth75" name="'.$namef.'_disabled" value="'.dol_escape_htmltag(GETPOST($namef)).'" disabled>';

########## compta/prelevement/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/prelevement/card.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/prelevement/card.php	2025-06-27 11:43:39.705154000 +0000
@@ -80,11 +80,8 @@
 $hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist'));
 
 $type = $object->type;
-
-// Check if salary or invoice
+// check if salary pl
 $salaryBonPl = $object->checkIfSalaryBonPrelevement();
-
-// Security check
 if ($type == 'bank-transfer') {
 	$result = restrictedArea($user, 'paymentbybanktransfer', '', '', '');
 
@@ -102,6 +99,7 @@
 }
 
 
+
 /*
  * Actions
  */
@@ -199,6 +197,7 @@
 }
 
 
+
 /*
  * View
  */

########## compta/prelevement/fiche-rejet.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/prelevement/fiche-rejet.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/prelevement/fiche-rejet.php	2025-06-27 11:43:39.702771000 +0000
@@ -1,9 +1,9 @@
 <?php
 /* Copyright (C) 2005      Rodolphe Quiedeville <rodolphe@quiedeville.org>
- * Copyright (C) 2005-2025 Laurent Destailleur  <eldy@users.sourceforge.net>
+ * Copyright (C) 2005      Laurent Destailleur  <eldy@users.sourceforge.net>
  * Copyright (C) 2005-2010 Regis Houssin        <regis.houssin@inodbox.com>
  * Copyright (C) 2010-2012 Juanjo Menent        <jmenent@2byte.es>
- * Copyright (C) 2024      Frédéric France      <frederic.france@free.fr>
+ * Copyright (C) 2024       Frédéric France         <frederic.france@free.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -46,7 +46,7 @@
  */
 
 // Load translation files required by the page
-$langs->loadLangs(array("banks", "categories", "companies", 'withdrawals', 'bills'));
+$langs->loadLangs(array("banks", "categories", 'withdrawals', 'bills'));
 
 // Security check
 if ($user->socid > 0) {
@@ -76,9 +76,6 @@
 // Load object
 include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals
 
-// Check if salary or invoice
-$salaryBonPl = $object->checkIfSalaryBonPrelevement();
-
 // Security check
 if ($user->socid > 0) {
 	accessforbidden();
@@ -92,6 +89,7 @@
 }
 
 
+
 /*
  * View
  */
@@ -227,8 +225,11 @@
 $sql .= " AND pl.fk_prelevement_bons = p.rowid";
 $sql .= " AND p.entity IN (".getEntity('facture').")";
 $sql .= " AND pl.fk_soc = s.rowid";
-$sql .= " AND pl.statut = 3";
+$sql .= " AND pl.statut = 3 ";
 $sql .= " AND pr.fk_prelevement_lignes = pl.rowid";
+/*if ($socid) {
+	$sql .= " AND s.rowid = ".((int) $socid);
+}*/
 $sql .= " ORDER BY pl.amount DESC";
 
 // Count total nb of records
@@ -251,20 +252,16 @@
 	// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
 	print_barre_liste($langs->trans("Rejects"), $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', $num, $nbtotalofrecords, '');
 
-	$param = '&id='.((int) $object->id);
-
 	print"\n<!-- debut table -->\n";
 	print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
 	print '<table class="noborder centpercent">';
 	print '<tr class="liste_titre">';
-	print_liste_field_titre("Line", $_SERVER["PHP_SELF"], "pl.rowid", '', $param, '', $sortfield, $sortorder);
-	print_liste_field_titre((!$salaryBonPl ? "ThirdParty" : "Employee"), $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder);
-	print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "pl.amount", '', $param, '', $sortfield, $sortorder, 'right ');
-	print_liste_field_titre("Reason", $_SERVER["PHP_SELF"], "pr.motif", '', $param, '', $sortfield, $sortorder);
-	print_liste_field_titre("ToBill", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'center ');
-	print_liste_field_titre("");
+	print '<td>'.$langs->trans("Line").'</td><td>'.$langs->trans("ThirdParty").'</td><td class="right">'.$langs->trans("Amount").'</td>';
+	print '<td>'.$langs->trans("Reason").'</td><td align="center">'.$langs->trans("ToBill").'</td>';
+	print '<td class="center">';
 	// Invoice to charge the error. No yet implemented.
 	//print $langs->trans("Invoice");
+	print '</td>';
 	print '</tr>';
 
 	$total = 0;

########## contact/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/contact/list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/contact/list.php	2025-06-27 11:43:39.946308000 +0000
@@ -845,7 +845,7 @@
 if ($optioncss != '') {
 	$param .= '&optioncss='.urlencode($optioncss);
 }
-$param .= '&userid='.urlencode((string) $userid).'&contactname='.urlencode((string) $search_all);
+$param .= '&begin='.urlencode((string) ($begin)).'&userid='.urlencode((string) ($userid)).'&contactname='.urlencode((string) ($search_all));
 $param .= '&type='.urlencode($type).'&view='.urlencode($view);
 if (!empty($search_sale) && $search_sale != '-1') {
 	$param .= '&search_sale='.urlencode($search_sale);

########## contrat/class/api_contracts.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/contrat/class/api_contracts.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/contrat/class/api_contracts.class.php	2025-06-27 11:43:38.871796000 +0000
@@ -114,7 +114,7 @@
 		$obj_ret = array();
 
 		// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
-		$socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids;
+		$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
 
 		// If the internal user must only see his customers, force searching by him
 		$search_sale = 0;

########## contrat/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/contrat/list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/contrat/list.php	2025-06-27 11:43:38.891950000 +0000
@@ -149,7 +149,10 @@
 
 $result = restrictedArea($user, 'contrat', $id);
 
-$diroutputmassaction = $conf->contract->dir_output.'/temp/massgeneration/'.$user->id;
+$diroutputmassaction = $conf->contrat->dir_output.'/temp/massgeneration/'.$user->id;
+
+$staticcontrat = new Contrat($db);
+$staticcontratligne = new ContratLigne($db);
 
 if ($search_status == '') {
 	$search_status = 1;
@@ -158,7 +161,6 @@
 // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
 $object = new Contrat($db);
 $extrafields = new ExtraFields($db);
-$staticcontratligne = new ContratLigne($db);
 
 // fetch optionals attributes and labels
 $extrafields->fetch_name_optionals_label($object->table_element);
@@ -250,7 +252,7 @@
 	$search_town = '';
 	$search_zip = "";
 	$search_state = "";
-	$search_type_thirdparty = '';
+	$search_type = '';
 	$search_country = '';
 	$search_contract = "";
 	$search_ref_customer = "";
@@ -286,6 +288,7 @@
 	$search_status = "";
 	$search_signed_status = '';
 	$toselect = array();
+	$search_type_thirdparty = '';
 	$searchCategoryCustomerList = array();
 	$search_array_options = array();
 }
@@ -293,7 +296,7 @@
 if (empty($reshook)) {
 	$objectclass = 'Contrat';
 	$objectlabel = 'Contracts';
-	$uploaddir = $conf->contract->dir_output;
+	$uploaddir = $conf->contrat->dir_output;
 	include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
 }
 
@@ -340,11 +343,11 @@
 
 $sqlfields = $sql; // $sql fields to remove for count total
 
-$sql .= " FROM ".MAIN_DB_PREFIX."contrat as c";
-$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (c.fk_soc = s.rowid)";
+$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)";
 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)";
 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
+$sql .= ", ".MAIN_DB_PREFIX."contrat as c";
 if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
 	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (c.rowid = ef.fk_object)";
 }
@@ -353,11 +356,8 @@
 	$sql .= ", ".MAIN_DB_PREFIX."element_contact as ec";
 	$sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc";
 }
-// Add table from hooks
-$parameters = array();
-$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
-$sql .= $hookmanager->resPrint;
-$sql .= " WHERE c.entity IN (".getEntity('contract').")";
+$sql .= " WHERE c.fk_soc = s.rowid ";
+$sql .= ' AND c.entity IN ('.getEntity('contract').')';
 if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) {
 	$sql .= " AND s.fk_typent IN (".$db->sanitize($db->escape($search_type_thirdparty)).')';
 }
@@ -394,6 +394,9 @@
 if ($search_country && $search_country != '-1') {
 	$sql .= " AND s.fk_pays IN (".$db->sanitize($search_country).')';
 }
+/*if ($search_sale > 0) {
+	$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale);
+}*/
 if ($search_all) {
 	$sql .= natural_search(array_keys($fieldstosearchall), $search_all);
 }
@@ -661,7 +664,7 @@
 	$param .= '&search_date_creation_startday='.urlencode((string) ($search_date_creation_startday));
 }
 if ($search_date_creation_start) {
-	$param .= '&search_date_creation_start='.urlencode((string) $search_date_creation_start);
+	$param .= '&search_date_creation_start='.urlencode($search_date_creation_start);
 }
 if ($search_date_creation_endmonth) {
 	$param .= '&search_date_creation_endmonth='.urlencode((string) ($search_date_creation_endmonth));
@@ -673,7 +676,7 @@
 	$param .= '&search_date_creation_endday='.urlencode((string) ($search_date_creation_endday));
 }
 if ($search_date_creation_end) {
-	$param .= '&search_date_creation_end='.urlencode((string) $search_date_creation_end);
+	$param .= '&search_date_creation_end='.urlencode($search_date_creation_end);
 }
 if ($search_date_modif_startmonth) {
 	$param .= '&search_date_modif_startmonth='.urlencode((string) ($search_date_modif_startmonth));
@@ -685,7 +688,7 @@
 	$param .= '&search_date_modif_startday='.urlencode((string) ($search_date_modif_startday));
 }
 if ($search_date_modif_start) {
-	$param .= '&search_date_modif_start='.urlencode((string) $search_date_modif_start);
+	$param .= '&search_date_modif_start='.urlencode($search_date_modif_start);
 }
 if ($search_date_modif_endmonth) {
 	$param .= '&search_date_modif_endmonth='.urlencode((string) ($search_date_modif_endmonth));
@@ -697,7 +700,7 @@
 	$param .= '&search_date_modif_endday='.urlencode((string) ($search_date_modif_endday));
 }
 if ($search_date_modif_end) {
-	$param .= '&search_date_modif_end=' . urlencode((string) $search_date_modif_end);
+	$param .= '&search_date_modif_end=' . urlencode($search_date_modif_end);
 }
 if ($search_date_startday > 0) {
 	$param .= '&search_date_startday='.urlencode((string) ($search_date_startday));

########## core/actions_addupdatedelete.inc.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/actions_addupdatedelete.inc.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/actions_addupdatedelete.inc.php	2025-06-27 11:43:41.102435000 +0000
@@ -61,9 +61,6 @@
  * @var string $hidedetails
  * @var string $hidedesc
  * @var string $hideref
- * @var ?string $confirm
- * @var ?int $lineid
- * @var ?int $id
  */
 // $action or $cancel must be defined
 // $object must be defined

########## core/actions_builddoc.inc.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/actions_builddoc.inc.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/actions_builddoc.inc.php	2025-06-27 11:43:41.008508000 +0000
@@ -29,29 +29,20 @@
 // $permissiontoadd must be defined
 // $upload_dir must be defined (example $conf->project->dir_output . "/";)
 // $hidedetails, $hidedesc, $hideref and $moreparams may have been set or not.
-
 /**
  * @var Conf $conf
  * @var Translate $langs
  * @var User $user
- * @var CommonObject $object
- *
  * @var string $action
  * @var int $id
- * @var ?int $permissioncreate
- * @var ?int $usercangeneratedoc
+ * @var CommonObject $object
+ * @var ?int $permissiontocreate
  * @var int $permissiontoadd
  * @var string $upload_dir
- *
  * @var ?int $hidedetails
  * @var ?int $hidedesc
  * @var ?int $hideref
- * @var ?array<string,mixed> $moreparams
  */
-'
-@phan-var-force ?array<string,mixed> $moreparams
-';
-
 if (!empty($permissioncreate) && empty($permissiontoadd)) {
 	$permissiontoadd = $permissioncreate; // For backward compatibility
 }
@@ -96,10 +87,18 @@
 		}
 
 		// To be sure vars is defined
-		$hidedetails = isset($hidedetails) ? $hidedetails : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0);
-		$hidedesc = isset($hidedesc) ? $hidedesc : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0);
-		$hideref = isset($hideref) ? $hideref : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0);
-		$moreparams = isset($moreparams) ? $moreparams : null;
+		if (empty($hidedetails)) {
+			$hidedetails = 0;
+		}
+		if (empty($hidedesc)) {
+			$hidedesc = 0;
+		}
+		if (empty($hideref)) {
+			$hideref = 0;
+		}
+		if (empty($moreparams)) {
+			$moreparams = null;
+		}
 
 		$result = $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
 		if ($result <= 0) {

########## core/actions_massactions.inc.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/actions_massactions.inc.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/actions_massactions.inc.php	2025-06-27 11:43:40.953219000 +0000
@@ -1,5 +1,6 @@
 <?php
-/* Copyright (C) 2015-2025  Laurent Destailleur  	<eldy@users.sourceforge.net>
+
+/* Copyright (C) 2015-2017  Laurent Destailleur  	<eldy@users.sourceforge.net>
  * Copyright (C) 2018-2021  Nicolas ZABOURI	        <info@inovea-conseil.com>
  * Copyright (C) 2018 	    Juanjo Menent           <jmenent@2byte.es>
  * Copyright (C) 2019 	    Ferran Marcet           <fmarcet@2byte.es>
@@ -33,7 +34,6 @@
 
 // $permissiontoread, $permissiontoadd, $permissiontodelete, $permissiontoclose may be defined
 // $uploaddir may be defined (example to $conf->project->dir_output."/";)
-// $hidedetails, $hidedesc, $hideref and $moreparams may have been set or not.
 // $toselect may be defined
 // $diroutputmassaction may be defined
 // $confirm
@@ -47,31 +47,24 @@
  * @var User $user
  *
  * @var string $dolibarr_main_url_root
- * @var string $action
- * @var string $massaction
- * @var string $confirm
- * @var ?int[] $toselect
- * @var ?string $diroutputmassaction
- * @var string $uploaddir
- * @var string $objectclass
- * @var ?string $objectlabel
- *
- * @var int $error
- *
  * @var ?string $permissiontoadd
  * @var ?string $permissiontoread
  * @var ?string $permissiontodelete
  * @var ?string $permissiontoclose
  * @var ?string $permissiontoapprove
+ * @var ?int[] $toselect
+ * @var ?string $diroutputmassaction
+ * @var ?string $objectlabel
  * @var ?string $option
  * @var int $deliveryreceipt
+ * @var string $action
+ * @var string $massaction
+ * @var string $objectclass
+ * @var string $uploaddir
+ * @var string $confirm
  * @var string $month
  * @var string $year
- * @var ?string $search_status
- * @var ?int $hidedetails
- * @var ?int $hidedesc
- * @var ?int $hideref
- * @var ?array<string,mixed> $moreparams
+ * @var int $error
  */
 '
 @phan-var-force ?string $permissiontoread
@@ -83,7 +76,6 @@
 @phan-var-force ?string $objectlabel
 @phan-var-force ?string $option
 @phan-var-force int $deliveryreceipt
-@phan-var-force ?array<string,mixed> $moreparams
 ';
 
 
@@ -95,6 +87,7 @@
 if (empty($massaction)) {
 	$massaction = '';
 }
+$error = 0;
 
 // Note: list of strings for objectclass could be extended to accepted/expected classes
 '
@@ -846,10 +839,7 @@
 	foreach ($listofobjectref as $tmppdf) {
 		$arrayofinclusion[] = '^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'_[a-zA-Z0-9\-\_\'\&\.]+\.pdf$'; // To include PDF generated from ODX files
 	}
-
-	$listoffiles = dol_dir_list($uploaddir, 'all', 1, $arrayofinclusion, '\.meta$|\.png$', 'date', SORT_DESC, 0, 1);
-
-	dol_syslog("Found ".count($listoffiles)." files");
+	$listoffiles = dol_dir_list($uploaddir, 'all', 1, implode('|', $arrayofinclusion), '\.meta$|\.png', 'date', SORT_DESC, 0, 1);
 
 	// build list of files with full path
 	$files = array();
@@ -1092,14 +1082,13 @@
 						}
 						$model = $objecttmp->model_pdf;
 						$ret = $objecttmp->fetch($objecttmp->id); // Reload to get new records
-
 						// To be sure vars is defined
-						$hidedetails = isset($hidedetails) ? $hidedetails : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0);
-						$hidedesc = isset($hidedesc) ? $hidedesc : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0);
-						$hideref = isset($hideref) ? $hideref : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0);
-						$moreparams = isset($moreparams) ? $moreparams : null;
+						$hidedetails = !empty($hidedetails) ? $hidedetails : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0);
+						$hidedesc = !empty($hidedesc) ? $hidedesc : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0);
+						$hideref = !empty($hideref) ? $hideref : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0);
+						$moreparams = !empty($moreparams) ? $moreparams : null;
 
-						$result = $objecttmp->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
+						$result = $objecttmp->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
 						if ($result < 0) {
 							setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
 						}
@@ -1257,10 +1246,18 @@
 			}
 
 			// To be sure vars is defined
-			$hidedetails = isset($hidedetails) ? $hidedetails : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0);
-			$hidedesc = isset($hidedesc) ? $hidedesc : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0);
-			$hideref = isset($hideref) ? $hideref : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0);
-			$moreparams = isset($moreparams) ? $moreparams : null;
+			if (empty($hidedetails)) {
+				$hidedetails = (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0);
+			}
+			if (empty($hidedesc)) {
+				$hidedesc = (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0);
+			}
+			if (empty($hideref)) {
+				$hideref = (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0);
+			}
+			if (empty($moreparams)) {
+				$moreparams = null;
+			}
 
 			$result = $objecttmp->generateDocument($objecttmp->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
 

########## core/actions_sendmails.inc.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/actions_sendmails.inc.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/actions_sendmails.inc.php	2025-06-27 11:43:40.955340000 +0000
@@ -145,7 +145,7 @@
 		$result = $object->fetch($id);
 
 		if (method_exists($object, "fetch_thirdparty") && !in_array($object->element, array('member', 'user', 'expensereport', 'societe', 'contact'))) {
-			$object->fetch_thirdparty();
+			$resultthirdparty = $object->fetch_thirdparty();
 			$thirdparty = $object->thirdparty;
 			if (is_object($thirdparty)) {
 				$sendtosocid = $thirdparty->id;

########## core/ajax/fetchCategories.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/ajax/fetchCategories.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/ajax/fetchCategories.php	2025-06-27 11:43:40.995821000 +0000
@@ -1,6 +1,5 @@
 <?php
 /* Copyright (C) 2024       Frédéric France         <frederic.france@free.fr>
- * Copyright (C) 2025       Laurent Destailleur     <eldy@users.sourceforge.net>
  *
  * 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
@@ -103,7 +102,7 @@
 	}
 	*/
 	foreach ($cate_arbo as $categ) {
-		$response[] = array('id' => $categ['id'], 'label' => $categ['label'], 'fulllabel' => $categ['fulllabel'], 'htmlforoption' => dolPrintHTML((string) $categ['fulllabel']), 'htmlforattribute' => dolPrintHTMLForAttribute((string) $categ['data-html']), 'color' => $categ['color']);
+		$response[] = array('id' => $categ['id'], 'label' => $categ['label'], 'fulllabel' => $categ['fulllabel'], 'htmlforoption' => dolPrintHTML($categ['fulllabel']), 'htmlforattribute' => dolPrintHTMLForAttribute($categ['data-html']), 'color' => $categ['color']);
 	}
 	$response =json_encode($response);
 	echo $response;

########## core/boxes/box_actions_future.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/boxes/box_actions_future.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/boxes/box_actions_future.php	2025-06-27 11:43:41.058402000 +0000
@@ -55,10 +55,6 @@
 		$this->enabled = isModEnabled('agenda');
 
 		$this->hidden = !($user->hasRight('agenda', 'myactions', 'read'));
-
-		$this->urltoaddentry = DOL_URL_ROOT.'/comm/action/card.php?action=create';
-
-		$this->msgNoRecords = 'NoUpcomingEvent';
 	}
 
 	/**
@@ -69,7 +65,7 @@
 	 */
 	public function loadBox($max = 5)
 	{
-		global $user, $langs;
+		global $user, $langs, $conf;
 
 		$this->max = $max;
 
@@ -80,10 +76,7 @@
 		$societestatic = new Societe($this->db);
 		$actionstatic = new ActionComm($this->db);
 
-		$text = $langs->trans("BoxTitleFutureActions", $max);
-		$this->info_box_head = array(
-			'text' => $text.'<a class="paddingleft" href="'.DOL_URL_ROOT.'/comm/action/list.php?sortfield=a.datep&datestart_dtstartday='.dol_print_date($now, '%d').'&datestart_dtstartmonth='.dol_print_date($now, '%m').'&datestart_dtstartyear='.dol_print_date($now, '%Y').'&sortorder=ASC"><span class="badge">...</span></a>'
-		);
+		$this->info_box_head = array('text' => $langs->trans("BoxTitleFutureActions", $max));
 
 		if ($user->hasRight('agenda', 'myactions', 'read')) {
 			$sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage";
@@ -184,6 +177,13 @@
 					$line++;
 				}
 
+				if ($num == 0) {
+					$this->info_box_contents[$line][0] = array(
+						'td' => 'class="center"',
+						'text' => '<span class="opacitymedium">'.$langs->trans("NoActionsToDo").'</span>'
+					);
+				}
+
 				$this->db->free($result);
 			} else {
 				$this->info_box_contents[0][0] = array(

########## core/boxes/box_commandes.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/boxes/box_commandes.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/boxes/box_commandes.php	2025-06-27 11:43:41.035609000 +0000
@@ -121,8 +121,9 @@
 			$result = $this->db->query($sql);
 			if ($result) {
 				$num = $this->db->num_rows($result);
-
+				$num=0;
 				$line = 0;
+
 				while ($line < $num) {
 					$objp = $this->db->fetch_object($result);
 					$date = $this->db->jdate($objp->date_commande);

########## core/boxes/box_contacts.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/boxes/box_contacts.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/boxes/box_contacts.php	2025-06-27 11:43:41.036662000 +0000
@@ -56,7 +56,6 @@
 		$this->hidden = !($user->hasRight('societe', 'lire') && $user->hasRight('societe', 'contact', 'lire'));
 
 		$this->urltoaddentry = DOL_URL_ROOT.'/contact/card.php?action=create';
-
 		$this->msgNoRecords = 'NoRecordedContacts';
 	}
 

########## core/class/CMailFile.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/CMailFile.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/CMailFile.class.php	2025-06-27 11:43:40.181045000 +0000
@@ -205,26 +205,26 @@
 	/**
 	 *	CMailFile
 	 *
-	 *	@param 	string		$subject             	Topic/Subject of mail
-	 *	@param 	string		$to                  	Recipients emails (RFC 2822: "Name firstname <email>[, ...]" or "email[, ...]" or "<email>[, ...]"). Note: the keyword '__SUPERVISOREMAIL__' is not allowed here and must be replaced by caller.
-	 *	@param 	string		$from                	Sender email      (RFC 2822: "Name firstname <email>[, ...]" or "email[, ...]" or "<email>[, ...]")
-	 *	@param 	string		$msg                 	Message
-	 *	@param 	?string[]	$filename_list       	List of files to attach (full path of filename on file system)
-	 *	@param 	?string[]	$mimetype_list       	List of MIME type of attached files
-	 *	@param 	?string[]	$mimefilename_list   	List of attached file name in message
-	 *	@param 	string		$addr_cc             	Email cc (Example: 'abc@def.com, ghk@lmn.com')
-	 *	@param 	string		$addr_bcc            	Email bcc (Note: This is autocompleted with MAIN_MAIL_AUTOCOPY_TO if defined)
-	 *	@param 	int<0,1>	$deliveryreceipt     	Ask a delivery receipt
-	 *	@param 	int<-1,1>	$msgishtml           	1=String IS already html, 0=String IS NOT html, -1=Unknown make autodetection (with fast mode, not reliable)
-	 *	@param 	string		$errors_to      	 	Email for errors-to
-	 *	@param	string|array<string,string>	$css	Css option (should be array, legacy: empty string if none)
-	 *	@param	string		$trackid             	Tracking string (contains type and id of related element)
-	 *  @param  string  	$moreinheader        	More in header. $moreinheader must contains the "\r\n" at end of each line
-	 *  @param  string  	$sendcontext      	 	'standard', 'emailing', 'ticket', 'password', ... (used to define which sending mode and parameters to use)
-	 *  @param	string		$replyto			 	Reply-to email (will be set to the same value than From by default if not provided)
-	 *  @param	string		$upload_dir_tmp		 	Temporary directory (used to convert images embedded as img src=data:image)
-	 *  @param	string		$in_reply_to		 	Message-ID of the message we reply to
-	 *  @param	string		$references			 	String with list of Message-ID of the thread ('<123> <456> ...')
+	 *	@param 	string	$subject             Topic/Subject of mail
+	 *	@param 	string	$to                  Recipients emails (RFC 2822: "Name firstname <email>[, ...]" or "email[, ...]" or "<email>[, ...]"). Note: the keyword '__SUPERVISOREMAIL__' is not allowed here and must be replaced by caller.
+	 *	@param 	string	$from                Sender email      (RFC 2822: "Name firstname <email>[, ...]" or "email[, ...]" or "<email>[, ...]")
+	 *	@param 	string	$msg                 Message
+	 *	@param 	?string[]	$filename_list       List of files to attach (full path of filename on file system)
+	 *	@param 	?string[]	$mimetype_list       List of MIME type of attached files
+	 *	@param 	?string[]	$mimefilename_list   List of attached file name in message
+	 *	@param 	string	$addr_cc             Email cc (Example: 'abc@def.com, ghk@lmn.com')
+	 *	@param 	string	$addr_bcc            Email bcc (Note: This is autocompleted with MAIN_MAIL_AUTOCOPY_TO if defined)
+	 *	@param 	int<0,1>	$deliveryreceipt     Ask a delivery receipt
+	 *	@param 	int<-1,1>	$msgishtml           1=String IS already html, 0=String IS NOT html, -1=Unknown make autodetection (with fast mode, not reliable)
+	 *	@param 	string	$errors_to      	 Email for errors-to
+	 *	@param	string|array<string,string>	$css                 Css option (should be array, legacy: empty string if none)
+	 *	@param	string	$trackid             Tracking string (contains type and id of related element)
+	 *  @param  string  $moreinheader        More in header. $moreinheader must contains the "\r\n" at end of each line
+	 *  @param  string  $sendcontext      	 'standard', 'emailing', 'ticket', 'password', ... (used to define which sending mode and parameters to use)
+	 *  @param	string	$replyto			 Reply-to email (will be set to the same value than From by default if not provided)
+	 *  @param	string	$upload_dir_tmp		 Temporary directory (used to convert images embedded as img src=data:image)
+	 *  @param	string	$in_reply_to		 Message-ID of the message we reply to
+	 *  @param	string	$references			 String with list of Message-ID of the thread ('<123> <456> ...')
 	 */
 	public function __construct($subject, $to, $from, $msg, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $addr_cc = "", $addr_bcc = "", $deliveryreceipt = 0, $msgishtml = 0, $errors_to = '', $css = '', $trackid = '', $moreinheader = '', $sendcontext = 'standard', $replyto = '', $upload_dir_tmp = '', $in_reply_to = '', $references = '')
 	{
@@ -653,8 +653,6 @@
 
 			$this->msgid = time().'.'.mt_rand(100, 999).'.SMTPs-dolibarr-'.$this->trackid.'@'.$host;
 
-			$smtps->setMessageID($this->msgid);
-
 			$this->smtps = $smtps;
 		} elseif ($this->sendmode == 'swiftmailer') {
 			// Use Swift Mailer library

########## core/class/commonincoterm.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/commonincoterm.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/commonincoterm.class.php	2025-06-27 11:43:40.148331000 +0000
@@ -91,8 +91,6 @@
 	 */
 	public function getIncotermsForPDF()
 	{
-		global $langs;
-
 		$sql = "SELECT code FROM ".$this->db->prefix()."c_incoterms WHERE rowid = ".(int) $this->fk_incoterms;
 		$resql = $this->db->query($sql);
 		if ($resql) {
@@ -100,7 +98,7 @@
 			if ($num > 0) {
 				$res = $this->db->fetch_object($resql);
 				if ($res) {
-					return $langs->trans("IncotermLabel").': '.$res->code.' - '.$this->location_incoterms;
+					return 'Incoterm : '.$res->code.' - '.$this->location_incoterms;
 				} else {
 					return $res;
 				}

########## core/class/commoninvoice.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/commoninvoice.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/commoninvoice.class.php	2025-06-27 11:43:40.309147000 +0000
@@ -1341,7 +1341,7 @@
 		// Set a default value for service if not provided
 		if (empty($service)) {
 			$service = 'StripeTest';
-			if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha')*/) {
+			if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
 				$service = 'StripeLive';
 			}
 		}

########## core/class/commonobject.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/commonobject.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/commonobject.class.php	2025-06-27 11:43:40.320417000 +0000
@@ -125,7 +125,7 @@
 
 	/**
 	 * @var int<0,1>|string  	Does this object support multicompany module ?
-	 * 							0=No test on entity, 1=Test with field entity in local table, 'field@table'=Test entity into the field@table (example 'fk_soc@societe')
+	 * 							0=No test on entity, 1=Test with field entity for internal and external users, 'field@table'=Test with link by field@table (example 'fk_soc@societe')
 	 */
 	public $ismultientitymanaged;
 
@@ -9773,7 +9773,7 @@
 	 * @param float		$unitPrice			Product unit price
 	 * @param float		$discountPercent	Line discount percent
 	 * @param int		$fk_product			Product id
-	 * @return float|int<-2,-1>				Return buy price if OK, integer <0 if KO
+	 * @return float|int<-1,-1>				Return buy price if OK, integer <0 if KO
 	 */
 	public function defineBuyPrice($unitPrice = 0.0, $discountPercent = 0.0, $fk_product = 0)
 	{
@@ -9826,8 +9826,7 @@
 				}
 			}
 		}
-
-		return (float) $buyPrice;
+		return $buyPrice;
 	}
 
 	/**

########## core/class/conf.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/conf.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/conf.class.php	2025-06-27 11:43:40.193062000 +0000
@@ -1293,7 +1293,7 @@
 				$this->global->MAIN_MODULE_DOLISTORE_API_SRV = 'https://www.dolistore.com/api/';
 			}
 			if (empty($this->global->MAIN_MODULE_DOLISTORE_API_KEY)) {
-				$this->global->MAIN_MODULE_DOLISTORE_API_KEY = 'dolistorepublicapi';
+				$this->global->MAIN_MODULE_DOLISTORE_API_KEY = 'dolistorecatalogpublickey1234567';
 			}
 
 			// Enable by default the CSRF protection by token.

########## core/class/fiscalyear.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/fiscalyear.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/fiscalyear.class.php	2025-06-27 11:43:40.256927000 +0000
@@ -119,6 +119,8 @@
 		$this->db = $db;
 
 		$this->ismultientitymanaged = 1;
+		$this->labelStatusShort = array(self::STATUS_OPEN => 'Opened', self::STATUS_CLOSED => 'Closed');
+		$this->labelStatus = array(self::STATUS_OPEN => 'Opened', self::STATUS_CLOSED => 'Closed');
 	}
 
 	/**

########## core/class/html.form.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/html.form.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/html.form.class.php	2025-06-27 11:43:40.274117000 +0000
@@ -1,4 +1,5 @@
 <?php
+
 /* Copyright (c) 2002-2007  Rodolphe Quiedeville    <rodolphe@quiedeville.org>
  * Copyright (C) 2004-2012  Laurent Destailleur     <eldy@users.sourceforge.net>
  * Copyright (C) 2004       Benoit Mortier          <benoit.mortier@opensides.be>
@@ -104,18 +105,18 @@
 	/**
 	 * Output key field for an editable field
 	 *
-	 * @param 	string				$text 			Text of label or key to translate
-	 * @param 	string				$htmlname 		Name of select field ('edit' prefix will be added)
-	 * @param 	string				$preselected 	Value to show/edit (not used in this function)
-	 * @param 	object				$object 		Object (on the page we show)
-	 * @param 	int<0,1>|boolean	$perm 			Permission to allow button to edit parameter. Set it to 0 to have a not edited field.
-	 * @param 	string	 			$typeofdata 	Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datehourpicker' 'checkbox:ckeditor:dolibarr_zzz:width:height:savemethod:1:rows:cols', 'select;xxx[:class]'...)
-	 * @param 	string				$moreparam		More param to add on a href URL.
-	 * @param 	int<0,1>			$fieldrequired	1 if we want to show field as mandatory using the "fieldrequired" CSS.
-	 * @param 	int<0,3>			$notabletag		1=Do not output table tags but output a ':', 2=Do not output table tags and no ':', 3=Do not output table tags but output a ' '
-	 * @param 	string				$paramid 		Key of parameter for id ('id', 'socid')
-	 * @param 	string				$help 			Tooltip help
-	 * @return  string								HTML edit field
+	 * @param 	string		$text 			Text of label or key to translate
+	 * @param 	string		$htmlname 		Name of select field ('edit' prefix will be added)
+	 * @param 	string		$preselected 	Value to show/edit (not used in this function)
+	 * @param 	object		$object 		Object (on the page we show)
+	 * @param 	int<0,1>	$perm 			Permission to allow button to edit parameter. Set it to 0 to have a not edited field.
+	 * @param 	string	 	$typeofdata 	Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datehourpicker' 'checkbox:ckeditor:dolibarr_zzz:width:height:savemethod:1:rows:cols', 'select;xxx[:class]'...)
+	 * @param 	string		$moreparam		More param to add on a href URL.
+	 * @param 	int<0,1>	$fieldrequired	1 if we want to show field as mandatory using the "fieldrequired" CSS.
+	 * @param 	int<0,3>	$notabletag		1=Do not output table tags but output a ':', 2=Do not output table tags and no ':', 3=Do not output table tags but output a ' '
+	 * @param 	string		$paramid 		Key of parameter for id ('id', 'socid')
+	 * @param 	string		$help 			Tooltip help
+	 * @return  string						HTML edit field
 	 */
 	public function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdata = 'string', $moreparam = '', $fieldrequired = 0, $notabletag = 0, $paramid = 'id', $help = '')
 	{
@@ -125,7 +126,7 @@
 
 		// TODO change for compatibility
 		if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) {
-			if ($perm) {
+			if (!empty($perm)) {
 				$tmp = explode(':', $typeofdata);
 				$ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">';
 				if ($fieldrequired) {
@@ -2140,13 +2141,13 @@
 	 * @param int<0,1>|string 	$show_empty 	0=list with no empty value, 1=add also an empty value into list
 	 * @param int[]|null		$exclude 		Array list of users id to exclude
 	 * @param int 				$disabled 		If select list must be disabled
-	 * @param int[]|''|'hierarchy'|'hierarchyme'	$include	Array list of users id to include. Use '' for all users or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me
+	 * @param int[]|''|'hierarchy'|'hierarchyme'	$include	Array list of users id to include. User '' for all users or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me
 	 * @param int[]|''			$enableonly 	Array list of users id to be enabled. If defined, it means that others will be disabled
 	 * @param string 			$force_entity 	'0' or list of Ids of environment to force, separated by a comma, or 'default' = do no extend to all entities allowed to superadmin.
 	 * @param int 				$maxlength 		Maximum length of string into list (0=no limit)
 	 * @param int<-1,1>			$showstatus 	0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status
 	 * @param string 			$morefilter 	Add more filters into sql request (Example: '(employee:=:1)'). This value must not come from user input.
-	 * @param int<0,3> 			$showalso 		0=default list, 1=add also a value "Everybody" at beginning of list, 2=add also a value "My team" at beginning of list (if user has at least 1 people), 3=add also "Everybody" + "My Team"
+	 * @param int<0,1> 			$show_every 	0=default list, 1=add also a value "Everybody" at beginning of list
 	 * @param string 			$enableonlytext If option $enableonlytext is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty.
 	 * @param string 			$morecss 		More css
 	 * @param int<0,1> 			$notdisabled 	Show only active users (note: this will also happen, whatever is this option, if USER_HIDE_INACTIVE_IN_COMBOBOX is on).
@@ -2156,14 +2157,14 @@
 	 * @return string|array<int,string|array{id:int,label:string,labelhtml:string,color:string,picto:string}>	HTML select string
 	 * @see select_dolgroups()
 	 */
-	public function select_dolusers($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '', $maxlength = 0, $showstatus = 0, $morefilter = '', $showalso = 0, $enableonlytext = '', $morecss = '', $notdisabled = 0, $outputmode = 0, $multiple = false, $forcecombo = 0)
+	public function select_dolusers($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '', $maxlength = 0, $showstatus = 0, $morefilter = '', $show_every = 0, $enableonlytext = '', $morecss = '', $notdisabled = 0, $outputmode = 0, $multiple = false, $forcecombo = 0)
 	{
 		// phpcs:enable
 		global $conf, $user, $langs, $hookmanager;
 		global $action;
 
 		// If no preselected user defined, we take current user
-		if ((is_numeric($selected) && ($selected < -3 || empty($selected))) && !getDolGlobalString('SOCIETE_DISABLE_DEFAULT_SALESREPRESENTATIVE')) {
+		if ((is_numeric($selected) && ($selected < -2 || empty($selected))) && !getDolGlobalString('SOCIETE_DISABLE_DEFAULT_SALESREPRESENTATIVE')) {
 			$selected = $user->id;
 		}
 
@@ -2173,38 +2174,23 @@
 			$selected = array($selected);
 		}
 
-		// Exclude some users in $excludeUsers string
 		$excludeUsers = null;
+		$includeUsers = null;
+
+		// Exclude some users
 		if (is_array($exclude)) {
 			$excludeUsers = implode(",", $exclude);
 		}
-
-		// Include some users in $includeUsers string
-		$includeUsers = null;
-		$includeUsersArray = array();
+		// Include some uses
 		if (is_array($include)) {
-			$includeUsersArray = $include;
+			$includeUsers = implode(",", $include);
 		} elseif ($include == 'hierarchy') {
-			// Build list includeUsersArray to have only hierarchy
-			$includeUsersArray = $user->getAllChildIds(0);
+			// Build list includeUsers to have only hierarchy
+			$includeUsers = implode(",", $user->getAllChildIds(0));
 		} elseif ($include == 'hierarchyme') {
-			// Build list includeUsersArray to have only hierarchy and current user
-			$includeUsersArray = $user->getAllChildIds(1);
+			// Build list includeUsers to have only hierarchy and current user
+			$includeUsers = implode(",", $user->getAllChildIds(1));
 		}
-		// Get list of allowed users
-		/* We do not limit list of users. Because we should limit this only for combo list into HR features where we may be allowed to
-		 * see all other users and element in other. For example in agenda, we can have permission to read all event of otherusers.
-		 * So we disable this.
-		if (!$user->hasRight('user', 'user', 'lire')) {
-			if (empty($includeUsersArray)) {
-				$includeUsers = implode(",", $user->getAllChildIds(1));
-			} else {
-				$includeUsers = implode(",", array_intersect($includeUsersArray, $user->getAllChildIds(1)));
-			}
-		} else {
-			$includeUsers = implode(",", $includeUsersArray);
-		} */
-		$includeUsers = implode(",", $includeUsersArray);
 
 		$num = 0;
 
@@ -2213,7 +2199,7 @@
 		$outarray2 = array();
 
 		// Do we want to show the label of entity into the combo list ?
-		$showlabelofentity = isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1 && !empty($user->admin) && empty($user->entity) && !preg_match('/^search_/', $htmlname);
+		$showlabelofentity = isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1 && !empty($user->admin) && empty($user->entity);
 		$userissuperadminentityone = isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && empty($user->entity);
 
 		// Forge request to select users
@@ -2312,23 +2298,7 @@
 						'picto' => ''
 					);
 				}
-				if ($showalso == 2 || $showalso == 3) {
-					$out .= '<option value="-3"' . ((in_array(-3, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("MyTeam") . ' --</option>' . "\n";
-
-					$hasAtLeastOneSubordinate = (count($user->getAllChildIds(1)) > 1);
-					if ($hasAtLeastOneSubordinate) {
-						//$sql = "SELECT rowid FROM".MAIN_DB_PREFIX."user "
-						$outarray[-3] = '-- ' . $langs->trans("MyTeam") . ' --';
-						$outarray2[-3] = array(
-							'id' => -3,
-							'label' => '-- ' . $langs->trans("MyTeam") . ' --',
-							'labelhtml' => '-- ' . $langs->trans("MyTeam") . ' --',
-							'color' => '',
-							'picto' => ''
-						);
-					}
-				}
-				if ($showalso == 1 || $showalso == 3) {
+				if ($show_every) {
 					$out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n";
 
 					$outarray[-2] = '-- ' . $langs->trans("Everybody") . ' --';
@@ -5853,7 +5823,7 @@
 	 * @param 	int<0,1>			$include 		[=0] Removed or 1=Keep only
 	 * @param 	string 				$morecss 		More CSS
 	 * @param	int<0,2>			$useempty		0=No empty value, 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. Default is 1.
-	 * @return	string|array<int,string>|array<int,array{id:int,fulllabel:string,data-html?:string,color:string,picto:string}>|array<int,array{rowid:int,id:int,fk_parent:int,label:string,description:string,color:string,position:string,visible:int,ref_ext:string,picto:string,fullpath:string,fulllabel:string,data-html?:string}>		String list or Array of categories
+	 * @return	string|array<int,string>|array<int,array{id:int,fulllabel:string,color:string,picto:string}>|array<int,array{rowid:int,id:int,fk_parent:int,label:string,description:string,color:string,position:string,visible:int,ref_ext:string,picto:string,fullpath:string,fulllabel:string}>		String list or Array of categories
 	 * @see select_categories()
 	 */
 	public function select_all_categories($type, $selected = '', $htmlname = "parent", $maxlength = 64, $fromid = 0, $outputmode = 0, $include = 0, $morecss = '', $useempty = 1)
@@ -6218,8 +6188,8 @@
 
 			$formconfirm .= '
                     resizable: false,
-					height: \'' . dol_escape_js($height) . '\',
-                    width: \'' . dol_escape_js($width) . '\',
+                    height: \'' . ((int) $height) . '\',
+                    width: \'' . ((int) $width) . '\',
                     modal: true,
                     closeOnEscape: false,
                     buttons: {
@@ -9135,7 +9105,7 @@
 			$sql .= " LEFT JOIN " . $this->db->prefix() . "product as p ON p.rowid = t.fk_product";
 		}
 		if (!empty($objecttmp->ismultientitymanaged)) {
-			if ($objecttmp->ismultientitymanaged == 1) {	// @phan-suppress-current-line PhanPluginEmptyStatementIf
+			if ($objecttmp->ismultientitymanaged == 1) {
 				// No need to join/link another table
 			}
 			if (!is_numeric($objecttmp->ismultientitymanaged)) {
@@ -9157,8 +9127,6 @@
 			$sql .= $hookmanager->resPrint;
 		} else {
 			$sql .= " WHERE 1=1";
-
-			// If table need a multientity restriction
 			if (!empty($objecttmp->ismultientitymanaged)) {
 				if ($objecttmp->ismultientitymanaged == 1) {
 					$sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")";
@@ -9174,14 +9142,23 @@
 						$sql .= " WHERE sc.fk_soc = t.fk_soc AND sc.fk_user = ".((int) $user->id).")";
 					}
 				}
-			}
-
-			// If user is external user, we must also make a test on llx_societe_commerciaux
-			if (!empty($user->socid)) {
-				if ($objecttmp->element == 'societe') {
-					$sql .= " AND t.rowid = " . ((int) $user->socid);
-				} elseif (!empty($objecttmp->fields['fk_soc']) || !empty($objecttmp->fields['t.fk_soc']) || property_exists($objecttmp, 'fk_soc') || property_exists($objecttmp, 'socid')) {
-					$sql .= " AND t.fk_soc = " . ((int) $user->socid);
+				// If user is external user, we also make a test on llx_societe_commerciaux
+				if (!empty($user->socid)) {
+					if ($objecttmp->ismultientitymanaged == 1) {
+						if ($objecttmp->element == 'societe') {
+							$sql .= " AND t.rowid = " . ((int) $user->socid);
+						} else {
+							$sql .= " AND t.fk_soc = " . ((int) $user->socid);
+						}
+					}
+					if (!is_numeric($objecttmp->ismultientitymanaged)) {
+						$sql .= " AND t." . $this->db->sanitize($tmparray[0])." = ".((int) $user->socid);
+					}
+					// If the parent table is llx_societe and user is an external user,
+					// then we must also check that user has permissions
+					if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
+						$sql .= " AND t.fk_soc = ".((int) $user->socid);
+					}
 				}
 			}
 
@@ -10851,18 +10828,18 @@
 	/**
 	 * Return HTML code to output a photo
 	 *
-	 * @param string 	$modulepart 						Key to define module concerned ('societe', 'userphoto', 'memberphoto')
+	 * @param string 	$modulepart 				Key to define module concerned ('societe', 'userphoto', 'memberphoto')
 	 * @param Societe|Adherent|Contact|User|CommonObject	$object	Object containing data to retrieve file name
-	 * @param int 		$width 								Width of photo
-	 * @param int 		$height 							Height of photo (auto if 0)
-	 * @param int<0,1>	$caneditfield 						Add edit fields
-	 * @param string 	$cssclass 							CSS name to use on img for photo
-	 * @param string 	$imagesize 							'mini', 'small' or '' (original)
-	 * @param int<0,1>	$addlinktofullsize 					Add link to fullsize image
-	 * @param int<0,1>	$cache 								1=Accept to use image in cache
-	 * @param ''|'user'|'environment' 	$forcecapture 		'', 'user' (user-facing camera) or 'environment' ('outward-facing camera'). Force the parameter capture on HTML input file element to ask a smartphone to allow to open camera to take photo. Auto if ''.
-	 * @param int<0,1>	$noexternsourceoverwrite 			No overwrite image with extern source (like 'gravatar' or other module)
-	 * @return string                            			HTML code to output photo
+	 * @param int 		$width 						Width of photo
+	 * @param int 		$height 					Height of photo (auto if 0)
+	 * @param int<0,1>	$caneditfield 				Add edit fields
+	 * @param string 	$cssclass 					CSS name to use on img for photo
+	 * @param string 	$imagesize 					'mini', 'small' or '' (original)
+	 * @param int<0,1>	$addlinktofullsize 			Add link to fullsize image
+	 * @param int<0,1>	$cache 						1=Accept to use image in cache
+	 * @param ''|'user'|'environment' 	$forcecapture 	'', 'user' or 'environment'. Force parameter capture on HTML input file element to ask a smartphone to allow to open camera to take photo. Auto if ''.
+	 * @param int<0,1>	$noexternsourceoverwrite 	No overwrite image with extern source (like 'gravatar' or other module)
+	 * @return string                            	HTML code to output photo
 	 * @see getImagePublicURLOfObject()
 	 */
 	public static function showphoto($modulepart, $object, $width = 100, $height = 0, $caneditfield = 0, $cssclass = 'photowithmargin', $imagesize = '', $addlinktofullsize = 1, $cache = 0, $forcecapture = '', $noexternsourceoverwrite = 0)
@@ -11040,7 +11017,7 @@
 				if ($maxmin > 0) {
 					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">';    // MAX_FILE_SIZE must precede the field type=file
 				}
-				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . dolPrintHTMLForAttribute($capture) . '"' : '') . '>';
+				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>';
 				$ret .= '</td></tr>';
 				$ret .= '</table>';
 			}

########## core/class/html.formaccounting.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/html.formaccounting.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/html.formaccounting.class.php	2025-06-27 11:43:40.177925000 +0000
@@ -666,6 +666,7 @@
 	public static function printJournalLine($langs, $date, $ref, $accountAccounting, $labelOperation, $paymentMode, $amount)
 	{
 		$out = '<tr class="oddeven">';
+		$out .= '<td></td>';
 		$out .= '<td>'.$date.'</td>';
 		$out .= '<td>'.$ref.'</td>';
 		// Ledger account

########## core/class/html.formfile.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/html.formfile.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/html.formfile.class.php	2025-06-27 11:43:40.217546000 +0000
@@ -256,7 +256,7 @@
 			$out .= '<label for="overwritefile" class="opacitylow paddingleft paddingright">'.$langs->trans("OverwriteIfExists").'</label>';
 			$out .= '</span>';
 		}
-		$out .= '<input type="submit" class="button smallpaddingimp reposition" name="sendit" value="'.$langs->trans("Upload").'"';
+		$out .= '<input type="submit" class="button small reposition" name="sendit" value="'.$langs->trans("Upload").'"';
 		$out .= (!getDolGlobalString('MAIN_UPLOAD_DOC') || empty($perm) ? ' disabled' : '');
 		$out .= '>';
 
@@ -357,7 +357,7 @@
 			$out2 .= '<input type="hidden" name="objectid" value="'.$object->id.'">';
 			$out2 .= '</div>';
 			$out2 .= '<div class="inline-block" style="padding-right: 10px;">';
-			$out2 .= '<input type="submit" class="button smallpaddingimp reposition" name="linkit" value="'.$langs->trans("ToLink").'"';
+			$out2 .= '<input type="submit" class="button small reposition" name="linkit" value="'.$langs->trans("ToLink").'"';
 			$out2 .= (!getDolGlobalString('MAIN_UPLOAD_DOC') || empty($perm) ? ' disabled' : '');
 			$out2 .= '>';
 			$out2 .= '</div>';

########## core/class/html.formprojet.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/html.formprojet.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/html.formprojet.class.php	2025-06-27 11:43:40.156954000 +0000
@@ -400,7 +400,7 @@
 			}
 
 			if (empty($option_only)) {
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'."\n";
+				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
 			}
 			if (!empty($show_empty)) {
 				$out .= '<option value="0" class="optiongrey">';
@@ -411,7 +411,7 @@
 				} else {
 					$out .= '&nbsp;';
 				}
-				$out .= '</option>'."\n";
+				$out .= '</option>';
 			}
 
 			$num = $this->db->num_rows($resql);
@@ -486,7 +486,7 @@
 							$out .= '<option value="' . $obj->rowid . '" selected';
 							$out .= ' data-html="' . dol_escape_htmltag($labeltoshowhtml) . '"';
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
-							$out .= '>' . $labeltoshow . '</option>'."\n";
+							$out .= '>' . $labeltoshow . '</option>';
 						} else {
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
 								$resultat = '';
@@ -500,7 +500,7 @@
 								$resultat .= ' data-html="' . dol_escape_htmltag($labeltoshowhtml) . '"';
 								$resultat .= '>';
 								$resultat .= $labeltoshow;
-								$resultat .= '</option>'."\n";
+								$resultat .= '</option>';
 							}
 							$out .= $resultat;
 						}
@@ -509,7 +509,7 @@
 				}
 			}
 			if (empty($option_only)) {
-				$out .= '</select>'."\n";
+				$out .= '</select>';
 			}
 
 			$this->nboftasks = $num;

########## core/class/html.formticket.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/html.formticket.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/html.formticket.class.php	2025-06-27 11:43:40.288904000 +0000
@@ -1685,19 +1685,10 @@
 			}
 			*/
 
-			// From (and Reply-To if defined)
+			// From
 			$from = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM');
-			$replyto = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_REPLYTO');
-			print '<tr class="email_line"><td class="width200"><span class="">'.$langs->trans("MailFrom");
-			if ($replyto) {
-				print ' <span class="opacitymedium">('.$langs->trans("MailReply").')</span>';
-			}
-			print '</span></td>';
-			print '<td><span class="">'.img_picto('', 'email', 'class="pictofixedwidth"').$from;
-			if ($replyto) {
-				print ' <span class="opacitymedium">('.$replyto.')</span>';
-			}
-			print '</span></td></tr>';
+			print '<tr class="email_line"><td class="width200"><span class="">'.$langs->trans("MailFrom").'</span></td>';
+			print '<td><span class="">'.img_picto('', 'email', 'class="pictofixedwidth"').$from.'</span></td></tr>';
 
 			// Recipients / adressed-to
 			print '<tr class="email_line"><td>'.$langs->trans('MailRecipients');

########## core/class/notify.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/notify.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/notify.class.php	2025-06-27 11:43:40.163934000 +0000
@@ -662,12 +662,10 @@
 		//$urlwithroot=DOL_MAIN_URL_ROOT;						// This is to use same domain name than current
 
 		// Define some vars
-		$application = constant('DOL_APPLICATION_TITLE');
-		$applicationcustom = getDolGlobalString('MAIN_APPLICATION_TITLE');
-		if ($applicationcustom) {
-			$application = (preg_match('/^\+/', $applicationcustom) ? $application : '').$applicationcustom;
+		$application = 'Dolibarr';
+		if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
+			$application = getDolGlobalString('MAIN_APPLICATION_TITLE');
 		}
-
 		$from = getDolGlobalString('NOTIFICATION_EMAIL_FROM');
 		$object_type = '';
 		$link = '';

########## core/class/smtps.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/smtps.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/smtps.class.php	2025-06-27 11:43:40.173577000 +0000
@@ -78,11 +78,6 @@
 	private $_smtpsToken = null;
 
 	/**
-	 * @var ?string Message-ID to use
-	 */
-	private $_msgId = null;
-
-	/**
 	 * @var ?array{org:string,real?:string,addr:string,user:string,host:string} Who sends the Message
 	 * This can be defined via a INI file or via a setter method
 	 */
@@ -298,20 +293,8 @@
 	 */
 	private $_options = array();
 
-
-	/**
-	 * Set Message-ID
-	 *
-	 * @param	string	$_msgId		Message-ID to use
-	 * @return	void
-	 */
-	public function setMessageID($_msgId = '')
-	{
-		$this->_msgId = $_msgId;
-	}
-
 	/**
-	 * Set options
+	 * Set delivery receipt
 	 *
 	 * @param	array<string,array<string,mixed>>	$_options	An array of options for stream_context_create()
 	 * @return	void
@@ -1563,15 +1546,16 @@
 
 		$host = dol_getprefix('email');
 
+		//NOTE: Message-ID should probably contain the username of the user who sent the msg
 		$_header .= 'Subject: '.$this->getSubject()."\r\n";
 		$_header .= 'Date: '.date("r")."\r\n";
 
 		$trackid = $this->getTrackId();
 		if ($trackid) {
-			$_header .= 'Message-ID: <'.(empty($this->_msgId) ? uniqid().'.SMTPs-dolibarr-'.$trackid.'@'.$host : $this->_msgId).">\r\n";
+			$_header .= 'Message-ID: <'.time().'.SMTPs-dolibarr-'.$trackid.'@'.$host.">\r\n";
 			$_header .= 'X-Dolibarr-TRACKID: '.$trackid.'@'.$host."\r\n";
 		} else {
-			$_header .= 'Message-ID: <'.(empty($this->_msgId) ? uniqid().'.SMTPs@'.$host : $this->_msgId).">\r\n";
+			$_header .= 'Message-ID: <'.time().'.SMTPs@'.$host.">\r\n";
 		}
 		if (!empty($_SERVER['REMOTE_ADDR'])) {
 			$_header .= "X-RemoteAddr: ".$_SERVER['REMOTE_ADDR']."\r\n";

########## core/customreports.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/customreports.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/customreports.php	2025-06-27 11:43:40.346063000 +0000
@@ -1,6 +1,6 @@
 <?php
-/* Copyright (C) 2020-2024	Laurent Destailleur		<eldy@users.sourceforge.net>
- * Copyright (C) 2024-2025	MDW						<mdeweerd@users.noreply.github.com>
+/* Copyright (C) 2020-2024 Laurent Destailleur  <eldy@users.sourceforge.net>
+ * Copyright (C) 2024-2025	MDW					<mdeweerd@users.noreply.github.com>
  * Copyright (C) 2024		Frédéric France			<frederic.france@free.fr>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -39,10 +39,7 @@
  * @var Translate $langs
  * @var User $user
  *
- * @var ?int[]	$toselect  			Items selected on page, only used to see if not empty here
- * @var ?int	$SHOWLEGEND			Show legend or not
- * @var	string	$customreportkey	Custom report key
- * @var string	$customsql			Custom SQL
+ * @var ?int[]	$toselect  Items selected on page, only used to see if not empty here
  */
 '
 @phan-var-force ?int[] $toselect
@@ -92,6 +89,8 @@
 	$pageprev = $page - 1;
 	$pagenext = $page + 1;
 
+	$diroutputmassaction = $conf->user->dir_temp.'/'.$user->id.'/customreport';
+
 	$object = null;
 } else {
 	// When included into a main page
@@ -129,7 +128,7 @@
 if (!empty($object)) {
 	$objecttype = $object->element.($object->module ? '@'.$object->module : '');
 }
-if ((!is_string($objecttype) || empty($objecttype)) && isModEnabled('societe')) {
+if (!is_string($objecttype) || empty($objecttype)) {
 	$objecttype = 'thirdparty';
 }
 '@phan-var-force string $objecttype';  // Help phan that suggests $objecttype can be null
@@ -159,13 +158,12 @@
 $ObjectClassName = '';
 // Objects available by default
 $arrayoftype = array(
-	'thirdparty' => array('label' => 'ThirdParties', 'picto' => 'company', 'ObjectClassName' => 'Societe', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/societe/class/societe.class.php", 'langs' => 'companies'),
+	'thirdparty' => array('langs' => 'companies', 'label' => 'ThirdParties', 'picto' => 'company', 'ObjectClassName' => 'Societe', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/societe/class/societe.class.php"),
 	'contact' => array('label' => 'Contacts', 'picto' => 'contact', 'ObjectClassName' => 'Contact', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/contact/class/contact.class.php"),
-	'proposal' => array('label' => 'Proposals', 'picto' => 'proposal', 'ObjectClassName' => 'Propal', 'enabled' => isModEnabled('propal'), 'ClassPath' => "/comm/propal/class/propal.class.php", 'langs' => 'propal'),
-	'order' => array('label' => 'Orders', 'picto' => 'order', 'ObjectClassName' => 'Commande', 'enabled' => isModEnabled('order'), 'ClassPath' => "/commande/class/commande.class.php", 'langs' => 'orders'),
-	'orderdet' => array('label' => 'SaleOrderLines', 'picto' => 'order', 'ObjectClassName' => 'OrderLine', 'enabled' => isModEnabled('order'), 'ClassPath' => "/commande/class/orderline.class.php", 'langs' => 'orders'),
-	'invoice' => array('label' => 'Invoices', 'picto' => 'bill', 'ObjectClassName' => 'Facture', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/facture/class/facture.class.php", 'langs' => 'bills'),
-	'invoice_template' => array('label' => 'PredefinedInvoices', 'picto' => 'bill', 'ObjectClassName' => 'FactureRec', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/facture/class/facture-rec.class.php", 'langs' => 'bills'),
+	'proposal' => array('label' => 'Proposals', 'picto' => 'proposal', 'ObjectClassName' => 'Propal', 'enabled' => isModEnabled('propal'), 'ClassPath' => "/comm/propal/class/propal.class.php"),
+	'order' => array('label' => 'Orders', 'picto' => 'order', 'ObjectClassName' => 'Commande', 'enabled' => isModEnabled('order'), 'ClassPath' => "/commande/class/commande.class.php"),
+	'invoice' => array('langs' => 'facture', 'label' => 'Invoices', 'picto' => 'bill', 'ObjectClassName' => 'Facture', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/facture/class/facture.class.php"),
+	'invoice_template' => array('label' => 'PredefinedInvoices', 'picto' => 'bill', 'ObjectClassName' => 'FactureRec', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/class/facturerec.class.php", 'langs' => 'bills'),
 	'contract' => array('label' => 'Contracts', 'picto' => 'contract', 'ObjectClassName' => 'Contrat', 'enabled' => isModEnabled('contract'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs' => 'contracts'),
 	'contractdet' => array('label' => 'ContractLines', 'picto' => 'contract', 'ObjectClassName' => 'ContratLigne', 'enabled' => isModEnabled('contract'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs' => 'contracts'),
 	'bom' => array('label' => 'BOM', 'picto' => 'bom', 'ObjectClassName' => 'Bom', 'enabled' => isModEnabled('bom')),
@@ -211,7 +209,6 @@
 
 		if ($fileforclass !== null) {
 			dol_include_once($fileforclass);
-
 			$ObjectClassName = $arrayoftype[$objecttype]['ObjectClassName'];
 		}
 		if (!empty($ObjectClassName)) {
@@ -357,9 +354,10 @@
 	$features .= (empty($object->module) ? '' : '@'.$object->module);
 }
 
-// Security check
 restrictedArea($user, $features, 0, '');
 
+$error = 0;
+
 
 /*
  * Actions
@@ -386,7 +384,6 @@
 	}
 }
 
-// Define $newarrayoftype that is array of object available for report
 $newarrayoftype = array();
 foreach ($arrayoftype as $key => $val) {
 	if (dol_eval((string) $val['enabled'], 1, 1, '1')) {
@@ -638,8 +635,7 @@
 	// Select object
 	print '<div class="divadvancedsearchfield center floatnone">';
 	print '<div class="inline-block"><span class="opacitymedium">'.$langs->trans("StatisticsOn").'</span></div> ';
-
-	print $form->selectarray('objecttype', $newarrayoftype, $objecttype, 0, 0, 0, '', 1, 0, 0, '', 'minwidth250', 1, '', 0, 1);
+	print $form->selectarray('objecttype', $newarrayoftype, $objecttype, 0, 0, 0, '', 1, 0, 0, '', 'minwidth200', 1, '', 0, 1);
 	if (empty($conf->use_javascript_ajax)) {
 		print '<input type="submit" class="button buttongen button-save nomargintop" name="changeobjecttype" value="'.$langs->trans("Refresh").'">';
 	} else {
@@ -655,41 +651,40 @@
 	}
 	print '</div><div class="clearboth"></div>';
 
-	if (!empty($newarrayoftype)) {
-		// Filter (you can use param &show_search_component_params_hidden=1 for debug)
-		if (!empty($object)) {
-			print '<div class="divadvancedsearchfield">';
-			print $form->searchComponent(array($object->element => $object->fields), $search_component_params, array(), $search_component_params_hidden, $arrayoffilterfields);
-			print '</div>';
-		}
-
-		// YAxis (add measures into array)
-		$count = 0;
-		//var_dump($arrayofmesures);
-		print '<div class="divadvancedsearchfield clearboth">';
-		print '<div class="inline-block"><span class="fas fa-ruler-combined paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Measures")).'"></span><span class="fas fa-caret-left caretleftaxis" title="'.dol_escape_htmltag($langs->trans("Measures")).'"></span></div>';
-		$simplearrayofmesures = array();
-		foreach ($arrayofmesures as $key => $val) {
-			$simplearrayofmesures[$key] = $arrayofmesures[$key]['label'];
-		}
-		print $form->multiselectarray('search_measures', $simplearrayofmesures, $search_measures, 0, 0, 'minwidth300 widthcentpercentminusx', 1, 0, '', '', $langs->transnoentitiesnoconv("Measures"));	// Fill the array $arrayofmeasures with possible fields
-		print '</div>';
-
-		// XAxis
-		$count = 0;
+	// Filter (you can use param &show_search_component_params_hidden=1 for debug)
+	if (!empty($object)) {
 		print '<div class="divadvancedsearchfield">';
-		print '<div class="inline-block"><span class="fas fa-ruler-combined paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("XAxis")).'"></span><span class="fas fa-caret-down caretdownaxis" title="'.dol_escape_htmltag($langs->trans("XAxis")).'"></span></div>';
-		//var_dump($arrayofxaxis);
-		print $formother->selectXAxisField($object, $search_xaxis, $arrayofxaxis, $langs->trans("XAxis"), 'minwidth300 maxwidth400 widthcentpercentminusx');	// Fill the array $arrayofxaxis with possible fields
+		print $form->searchComponent(array($object->element => $object->fields), $search_component_params, array(), $search_component_params_hidden, $arrayoffilterfields);
 		print '</div>';
+	}
 
-		// Group by
-		$count = 0;
-		print '<div class="divadvancedsearchfield">';
-		print '<div class="inline-block opacitymedium"><span class="fas fa-ruler-horizontal paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("GroupBy")).'"></span></div>';
-		print $formother->selectGroupByField($object, $search_groupby, $arrayofgroupby, 'minwidth250 maxwidth300 widthcentpercentminusx', $langs->trans("GroupBy"));	// Fill the array $arrayofgroupby with possible fields
-		print '</div>';
+	// YAxis (add measures into array)
+	$count = 0;
+	//var_dump($arrayofmesures);
+	print '<div class="divadvancedsearchfield clearboth">';
+	print '<div class="inline-block"><span class="fas fa-ruler-combined paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Measures")).'"></span><span class="fas fa-caret-left caretleftaxis" title="'.dol_escape_htmltag($langs->trans("Measures")).'"></span></div>';
+	$simplearrayofmesures = array();
+	foreach ($arrayofmesures as $key => $val) {
+		$simplearrayofmesures[$key] = $arrayofmesures[$key]['label'];
 	}
+	print $form->multiselectarray('search_measures', $simplearrayofmesures, $search_measures, 0, 0, 'minwidth300 widthcentpercentminusx', 1, 0, '', '', $langs->transnoentitiesnoconv("Measures"));	// Fill the array $arrayofmeasures with possible fields
+	print '</div>';
+
+	// XAxis
+	$count = 0;
+	print '<div class="divadvancedsearchfield">';
+	print '<div class="inline-block"><span class="fas fa-ruler-combined paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("XAxis")).'"></span><span class="fas fa-caret-down caretdownaxis" title="'.dol_escape_htmltag($langs->trans("XAxis")).'"></span></div>';
+	//var_dump($arrayofxaxis);
+	print $formother->selectXAxisField($object, $search_xaxis, $arrayofxaxis, $langs->trans("XAxis"), 'minwidth300 maxwidth400 widthcentpercentminusx');	// Fill the array $arrayofxaxis with possible fields
+	print '</div>';
+
+	// Group by
+	$count = 0;
+	print '<div class="divadvancedsearchfield">';
+	print '<div class="inline-block opacitymedium"><span class="fas fa-ruler-horizontal paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("GroupBy")).'"></span></div>';
+	print $formother->selectGroupByField($object, $search_groupby, $arrayofgroupby, 'minwidth250 maxwidth300 widthcentpercentminusx', $langs->trans("GroupBy"));	// Fill the array $arrayofgroupby with possible fields
+	print '</div>';
+
 
 	if ($mode == 'grid') {
 		// YAxis
@@ -752,12 +747,13 @@
 		print '</div>';
 	}
 
-	if (!empty($newarrayoftype)) {
-		print '<div class="divadvancedsearchfield">';
-		print '<input type="submit" class="button buttongen button-save nomargintop" value="'.$langs->trans("Refresh").'">';
-		print '</div>';
-	}
+	//if ($mode == 'graph') {
+	//
+	//}
 
+	print '<div class="divadvancedsearchfield">';
+	print '<input type="submit" class="button buttongen button-save nomargintop" value="'.$langs->trans("Refresh").'">';
+	print '</div>';
 	print '</div>';
 	print '</form>';
 }
@@ -1221,10 +1217,6 @@
 print '<!-- Section to show the result -->'."\n";
 print '<div class="customreportsoutput'.($totalnbofrecord ? '' : ' customreportsoutputnotdata').'">';
 
-if (empty($newarrayoftype)) {
-	$langs->load("admin");
-	print info_admin($langs->trans("NoSupportedModulesHaveBeenActivated"), 0, 0, 'warning');
-}
 
 if ($mode == 'grid') {
 	// TODO

########## core/js/lib_head.js.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/js/lib_head.js.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/js/lib_head.js.php	2025-06-27 11:43:40.363090000 +0000
@@ -677,11 +677,6 @@
 		});
 		if (forcereload) {
 			var url = window.location.href;
-
-			/* reset action param */
-			url = url.replace(/action=\w+/g, '');
-
-			/* reset dol_resetcache param */
 			if (url.indexOf('dol_resetcache') < 0) {
 				if (url.indexOf('?') > -1) {
 					url = url + "&dol_resetcache=1";
@@ -689,8 +684,6 @@
 					url = url + "?dol_resetcache=1";
 				}
 			}
-
-			/* reset page_y param */
 			var page_y = $(document).scrollTop();
 			url = url.replace(/page_y=\d+/g, '');
 			if (page_y > 0) {

########## core/lib/admin.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/admin.lib.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/admin.lib.php	2025-06-27 11:43:41.383895000 +0000
@@ -1575,7 +1575,7 @@
  */
 function activateModulesRequiredByCountry($country_code)
 {
-	global $db;
+	global $db, $conf, $langs;
 
 	$modulesdir = dolGetModulesDirs();
 
@@ -1736,8 +1736,8 @@
 /**
  *	Show array with constants to edit
  *
- *	@param	array<string,array{type:string,label:string,tooltip?:string}>|array<int,string>	$tableau		Array of constants array('key'=>array('type'=>type, 'label'=>label, 'tooltip'=>tooltip)
- *                                                                                          				where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ...
+ *	@param	array<string,array{type:string,label:string}>|array<int,string>	$tableau		Array of constants array('key'=>array('type'=>type, 'label'=>label)
+ *                                                                                          where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ...
  *	@param	int<2,3>	$strictw3c		0=Include form into table (deprecated), 1=Form is outside table to respect W3C (deprecated), 2=No form nor button at all, 3=No form nor button at all and each field has a unique name (form is output by caller, recommended)  (typed as int<2,3> to highlight the deprecated values)
  *  @param  string  	$helptext       Tooltip help to use for the column name of values
  *  @param	string		$text			Text to use for the column name of values

########## core/lib/agenda.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/agenda.lib.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/agenda.lib.php	2025-06-27 11:43:41.385902000 +0000
@@ -104,7 +104,7 @@
 		// Assigned to user
 		print '<div class="divsearchfield">';
 		print img_picto($langs->trans("ActionsToDoBy"), 'user', 'class="pictofixedwidth inline-block"');
-		print $form->select_dolusers($filtert, 'search_filtert', 1, null, (int) !$canedit, '', '', '0', 0, 0, '', 2, '', 'minwidth100 maxwidth250 widthcentpercentminusx');
+		print $form->select_dolusers($filtert, 'search_filtert', 1, null, (int) !$canedit, '', '', '0', 0, 0, '', 0, '', 'minwidth100 maxwidth250 widthcentpercentminusx');
 		print '</div>';
 
 		// Assigned to user group

########## core/lib/company.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/company.lib.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/company.lib.php	2025-06-27 11:43:41.398161000 +0000
@@ -219,7 +219,7 @@
 
 		$servicestatus = 0;
 		if (isModEnabled('stripe')) {
-			if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha')*/) {
+			if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
 				$servicestatus = 1;
 			}
 
@@ -1399,10 +1399,10 @@
 		$param .= '&search_note_private='.urlencode($search_note_private);
 	}
 	if ($search_birthday_dtstart != '') {
-		$param .= '&search_birthday_dtstart='.urlencode((string) $search_birthday_dtstart);
+		$param .= '&search_birthday_dtstart='.urlencode($search_birthday_dtstart);
 	}
 	if ($search_birthday_dtend != '') {
-		$param .= '&search_birthday_dtend='.urlencode((string) $search_birthday_dtend);
+		$param .= '&search_birthday_dtend='.urlencode($search_birthday_dtend);
 	}
 	if ($optioncss != '') {
 		$param .= '&optioncss='.urlencode($optioncss);
@@ -1657,7 +1657,7 @@
 			// Photo - Name
 			if (!empty($arrayfields['t.name']['checked'])) {
 				print '<td class="tdoverflowmax150">';
-				print $form->showphoto('contact', $contactstatic, 0, 0, 0, 'photorefnoborder valignmiddle marginrightonly', 'small', 1, 0, 'user');
+				print $form->showphoto('contact', $contactstatic, 0, 0, 0, 'photorefnoborder valignmiddle marginrightonly', 'small', 1, 0, '1');
 				print $contactstatic->getNomUrl(0, '', 0, '&backtopage='.urlencode($backtopage));
 				print '</td>';
 			}

########## core/lib/date.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/date.lib.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/date.lib.php	2025-06-27 11:43:41.295081000 +0000
@@ -1334,35 +1334,16 @@
 		return 'ErrorBadParameter_num_open_day';
 	}
 
+	//print 'num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday;
 	if ($timestampStart < $timestampEnd) {
-		// --- 1. Calculate Gross Working Days ---
-		// Gross working days = total days in range - non-working days (weekends & public holidays).
-		$nbOpenDay = num_between_day($timestampStart, $timestampEnd, $lastday) - num_public_holiday($timestampStart, $timestampEnd, $country_code, $lastday);
+		$numdays = num_between_day($timestampStart, $timestampEnd, $lastday);
 
-		// --- 2. Apply Contextual Half-Day Deductions ---
-		$halfday = (int) $halfday; // Ensure $halfday is an integer for reliable comparisons.
-
-		// Check if start/end days are working days just ONCE to optimize performance
-		// by avoiding redundant calls to the potentially slow num_public_holiday() function.
-		$isStartDayWorking = (num_public_holiday($timestampStart, $timestampStart, $country_code, 1) == 0);
-		$isEndDayWorking   = (num_public_holiday($timestampEnd, $timestampEnd, $country_code, 1) == 0);
-
-		// Deduct 0.5 if the leave starts in the afternoon of a working day.
-		if (($halfday == -1 || $halfday == 2) && $isStartDayWorking) {
-			$nbOpenDay -= 0.5;
-		}
-
-		// Deduct 0.5 if the leave ends in the morning of a different, working day.
-		if (($halfday == 1 || $halfday == 2) && date('Y-m-d', $timestampStart) != date('Y-m-d', $timestampEnd) && $isEndDayWorking) {
-			$nbOpenDay -= 0.5;
+		$numholidays = num_public_holiday($timestampStart, $timestampEnd, $country_code, $lastday);
+		$nbOpenDay = ($numdays - $numholidays);
+		if ($inhour == 1 && $nbOpenDay <= 3) {
+			$nbOpenDay *= 24;
 		}
-
-		// --- 3. Return Final Value ---
-		if ($inhour == 1) {
-			return $nbOpenDay * 24;
-		}
-
-		return $nbOpenDay;
+		return $nbOpenDay - (($inhour == 1 ? 12 : 0.5) * abs($halfday));
 	} elseif ($timestampStart == $timestampEnd) {
 		$numholidays = 0;
 		if ($lastday) {

########## core/lib/files.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/files.lib.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/files.lib.php	2025-06-27 11:43:41.308113000 +0000
@@ -47,8 +47,8 @@
  * @param	string			$utf8_path     	Starting path from which to search. This is a full path.
  * @param	string			$types        	Can be "directories", "files", or "all"
  * @param	int				$recursive		Determines whether subdirectories are searched
- * @param	string|string[]	$filter        	Regex or Array of Regex filter to restrict list. The regex value must be escaped for '/' by doing preg_quote($var,'/'), since this char is used for preg_match function,
- *                  	                    but must NOT contains the start and end '/'. Filter is checked into basename only.
+ * @param	string			$filter        	Regex filter to restrict list. This regex value must be escaped for '/' by doing preg_quote($var,'/'), since this char is used for preg_match function,
+ *                  	                    but must not contains the start and end '/'. Filter is checked into basename only.
  * @param	string|string[]	$excludefilter  Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). Exclude is checked both into fullpath and into basename (So '^xxx' may exclude 'xxx/dirscanned/...' and dirscanned/xxx').
  * @param	string			$sortcriteria	Sort criteria ('','fullname','relativename','name','date','size')
  * @param	int 			$sortorder		Sort order (SORT_ASC, SORT_DESC)
@@ -66,39 +66,22 @@
 	global $object;
 
 	if ($recursive <= 1) {	// Avoid too verbose log
+		// Verify filters (only on first call to function)
+		$filters_ok = true;
 		$error_info = "";
-
-		// Verify filters (only on the first call of the function)
-		$filter_ok = true;
-		if (!is_array($filter)) {
-			if (strlen($filter) > 25000) {	// Note that limit depends on syntax of filter
-				dol_syslog("Value for filter is too large", LOG_ERR);
-				$filter_ok = false;
-			} else {
-				// Check that all '/' are escaped.
-				if ((int) preg_match('/(?:^|[^\\\\])\//', $filter) > 0) {
-					$excludefilter_ok = false;
-					$error_info .= " error='filter_has_unescaped_slash'";
-					dol_syslog("'$filter' has unescaped '/'", LOG_ERR);
-				}
-			}
-		}
-
 		// Ensure we have an array for the exclusions
-		$excludefilter_ok = true;
 		$exclude_array = ($excludefilter === null || $excludefilter === '') ? array() : (is_array($excludefilter) ? $excludefilter : array($excludefilter));
-		foreach ($exclude_array as $f) {
+		foreach ((array($filter) + $exclude_array) as $f) {
 			// Check that all '/' are escaped.
 			if ((int) preg_match('/(?:^|[^\\\\])\//', $f) > 0) {
-				$excludefilter_ok = false;
-				$error_info .= " error='excludefilter_has_unescaped_slash'";
+				$filters_ok = false;
+				$error_info .= " error='$f unescaped_slash'";
 				dol_syslog("'$f' has unescaped '/'", LOG_ERR);
 			}
 		}
-
-		dol_syslog("files.lib.php::dol_dir_list path=".$utf8_path." types=".$types." recursive=".$recursive." filter=".json_encode($filter)." excludefilter=".json_encode($excludefilter).$error_info);
-		// print 'xxx'."files.lib.php::dol_dir_list path=".$utf8_path." types=".$types." recursive=".$recursive." filter=".json_encode($filter)." excludefilter=".json_encode($exclude_array);
-		if (!$filter_ok || !$excludefilter_ok) {
+		dol_syslog("files.lib.php::dol_dir_list path=".$utf8_path." types=".$types." recursive=".$recursive." filter=".$filter." excludefilter=".json_encode($excludefilter).$error_info);
+		// print 'xxx'."files.lib.php::dol_dir_list path=".$utf8_path." types=".$types." recursive=".$recursive." filter=".$filter." excludefilter=".json_encode($exclude_array);
+		if (!$filters_ok) {
 			// Return empty array when filters are invalid
 			return array();
 		}
@@ -173,10 +156,11 @@
 					$utf8_file = $os_file;
 				}
 
+				$qualified = 1;
+
 				$utf8_fullpathfile = $utf8_path_cursor."/".$utf8_file;  // Temp variable for speed
 
 				// Check if file is qualified
-				$qualified = 1;
 				foreach ($excludefilterarray as $filt) {
 					if (preg_match('/'.$filt.'/i', $utf8_file) || preg_match('/'.$filt.'/i', $utf8_fullpathfile)) {
 						$qualified = 0;
@@ -201,28 +185,7 @@
 								$fileperm = dol_fileperm($utf8_fullpathfile);
 							}
 
-							$qualifiedforfilter = 0;
-							if (empty($filter)) {
-								$qualifiedforfilter = 1;
-							} else {
-								$testpregmatch = false;
-								if (is_array($filter)) {
-									$chunks = array_chunk($filter, 500);
-									foreach ($chunks as $chunk) {
-										$testpregmatch = preg_match('/'.implode('|', $chunk).'/i', $utf8_file);	// May failed if $filter too large
-										if ($testpregmatch) {
-											break;
-										}
-									}
-								} else {
-									$testpregmatch = preg_match('/'.$filter.'/i', $utf8_file);		// May failed if $filter too large
-								}
-								if ($testpregmatch) {
-									$qualifiedforfilter = 1;
-								}
-							}
-
-							if ($qualifiedforfilter) {	// We do not search key $filter into all $path, only into $file part
+							if (!$filter || preg_match('/'.$filter.'/i', $utf8_file)) {	// We do not search key $filter into all $path, only into $file part
 								$reg = array();
 								preg_match('/([^\/]+)\/[^\/]+$/', $utf8_fullpathfile, $reg);
 								$level1name = (isset($reg[1]) ? $reg[1] : '');
@@ -256,28 +219,7 @@
 							$filesize = dol_filesize($utf8_fullpathfile);
 						}
 
-						$qualifiedforfilter = 0;
-						if (empty($filter)) {
-							$qualifiedforfilter = 1;
-						} else {
-							$testpregmatch = false;
-							if (is_array($filter)) {
-								$chunks = array_chunk($filter, 500);
-								foreach ($chunks as $chunk) {
-									$testpregmatch = preg_match('/'.implode('|', $chunk).'/i', $utf8_file);	// May failed if $filter too large
-									if ($testpregmatch) {
-										break;
-									}
-								}
-							} else {
-								$testpregmatch = preg_match('/'.$filter.'/i', $utf8_file);		// May failed if $filter too large
-							}
-							if ($testpregmatch) {
-								$qualifiedforfilter = 1;
-							}
-						}
-
-						if ($qualifiedforfilter) {	// We do not search key $filter into all $path, only into $file part
+						if (!$filter || preg_match('/'.$filter.'/i', $utf8_file)) {	// We do not search key $filter into $utf8_path, only into $utf8_file
 							if (empty($nbsecondsold) || $filedate <= ($now - $nbsecondsold)) {
 								preg_match('/([^\/]+)\/[^\/]+$/', $utf8_fullpathfile, $reg);
 								$level1name = (isset($reg[1]) ? $reg[1] : '');
@@ -343,7 +285,7 @@
 		$sql .= ", description";
 	}
 	$sql .= " FROM ".MAIN_DB_PREFIX."ecm_files";
-	if (!empty($object->entity)) {
+	if (!empty($object->entity) && $object->entity != $conf->entity) {
 		$sql .= " WHERE entity = ".((int) $object->entity);
 	} else {
 		$sql .= " WHERE entity = ".((int) $conf->entity);
@@ -390,7 +332,6 @@
 					"acl" => $obj->acl,
 					"share" => $obj->share,
 					"description" => ($mode ? $obj->description : '')
-					// TODO Add 'content' with $mode == 2 ?
 				);
 			}
 			$i++;
@@ -464,7 +405,6 @@
 	//var_dump($relativedir);
 	//var_dump($filearray);
 	//var_dump($filearrayindatabase);
-	//var_dump($object->entity);
 
 	// Complete filearray with properties found into $filearrayindatabase
 	foreach ($filearray as $key => $val) {
@@ -496,7 +436,6 @@
 
 			if (!preg_match('/([\\/]temp[\\/]|[\\/]thumbs|\.meta$)/', $rel_filename)) {     // If not a tmp file
 				dol_syslog("list_of_documents We found a file called '".$filearray[$key]['name']."' not indexed into database. We add it");
-
 				include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
 				$ecmfile = new EcmFiles($db);
 
@@ -513,10 +452,6 @@
 				$ecmfile->gen_or_uploaded = 'unknown';
 				$ecmfile->description = ''; // indexed content
 				$ecmfile->keywords = ''; // keyword content
-				// When you scan file with dol_dir_list_in_database, you scan for files in entity of object (like with projects), even if you
-				// are connected into another entity. So we must also create record that was not found into the entity scan, so the one of the object).
-				$ecmfile->entity = empty($object->entity) ? $conf->entity : $object->entity;
-
 				$result = $ecmfile->create($user);
 				if ($result < 0) {
 					setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings');

########## core/lib/ftp.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/ftp.lib.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/ftp.lib.php	2025-06-27 11:43:41.312317000 +0000
@@ -1,7 +1,7 @@
 <?php
-/* Copyright (C) 2022-2025	Laurent Destailleur 	<eldy@users.sourceforge.net>
+/* Copyright (C) 2022-2023	Laurent Destailleur 	<eldy@users.sourceforge.net>
  * Copyright (C) 2022	    Anthony Berton       	<bertonanthony@gmail.com>
- * Copyright (C) 2024		MDW						<mdeweerd@users.noreply.github.com>
+ * Copyright (C) 2024		MDW							<mdeweerd@users.noreply.github.com>
  *
  * 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
@@ -122,9 +122,9 @@
 /**
  * Tell if an entry is a FTP directory
  *
- * @param 		resource|FTP\Connection		$connect_id		Connection handler
- * @param 		string						$dir			Directory
- * @return		int											1=directory, 0=not a directory
+ * @param 		resource	$connect_id		Connection handler
+ * @param 		string		$dir			Directory
+ * @return		int			1=directory, 0=not a directory
  */
 function ftp_isdir($connect_id, $dir)
 {
@@ -139,11 +139,13 @@
 /**
  * Tell if an entry is a FTP directory
  *
- * @param 		resource|FTP\Connection		$connect_id		Connection handler
- * @return		boolean										Result of closing
+ * @param 		resource	$connect_id		Connection handler
+ * @return		boolean						Result of closing
  */
 function dol_ftp_close($connect_id)
 {
+	global $conf;
+
 	// Close FTP connection
 	if ($connect_id) {
 		if (!getDolGlobalString('FTP_CONNECT_WITH_SFTP')) {
@@ -156,18 +158,21 @@
 /**
  * Delete a FTP file
  *
- * @param 		resource|FTP\Connection	$connect_id		Connection handler
- * @param 		string					$file			File
- * @param 		string					$newsection		Directory
+ * @param 		resource	$connect_id		Connection handler
+ * @param 		string		$file			File
+ * @param 		string		$newsection			$newsection
  * @return		bool
  */
 function dol_ftp_delete($connect_id, $file, $newsection)
 {
+	global $conf;
+
 	if (getDolGlobalString('FTP_CONNECT_WITH_SFTP')) {
 		$newsection = ssh2_sftp_realpath($connect_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169
 	}
 
 	// Remote file
+	$filename = $file;
 	$remotefile = $newsection.(preg_match('@[\\\/]$@', $newsection) ? '' : '/').$file;
 	$newremotefileiso = mb_convert_encoding($remotefile, 'ISO-8859-1');
 
@@ -183,19 +188,22 @@
 /**
  * Download a FTP file
  *
- * @param 		resource|FTP\Connection		$connect_id		Connection handler
- * @param 		string						$localfile		The local file path
- * @param 		string						$file			The remote file path
- * @param 		string						$newsection		Directory
+ * @param 		resource	$connect_id		Connection handler
+ * @param 		string		$localfile		The local file path
+ * @param 		string		$file					The remote file path
+ * @param 		string		$newsection			$newsection
  * @return		bool|resource
  */
 function dol_ftp_get($connect_id, $localfile, $file, $newsection)
 {
+	global $conf;
+
 	if (getDolGlobalString('FTP_CONNECT_WITH_SFTP')) {
 		$newsection = ssh2_sftp_realpath($connect_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169
 	}
 
 	// Remote file
+	$filename = $file;
 	$remotefile = $newsection.(preg_match('@[\\\/]$@', $newsection) ? '' : '/').$file;
 	$newremotefileiso = mb_convert_encoding($remotefile, 'ISO-8859-1');
 
@@ -209,19 +217,22 @@
 /**
  * Upload a FTP file
  *
- * @param 		resource|FTP\Connection	$connect_id		Connection handler
- * @param 		string					$file			File name
- * @param 		string					$localfile		The path to the local file
- * @param 		string					$newsection		Directory
+ * @param 		resource	$connect_id		Connection handler
+ * @param 		string		$file			File name
+ * @param 		string		$localfile		The path to the local file
+ * @param 		string		$newsection		$newsection
  * @return		bool
  */
 function dol_ftp_put($connect_id, $file, $localfile, $newsection)
 {
+	global $conf;
+
 	if (getDolGlobalString('FTP_CONNECT_WITH_SFTP')) {
 		$newsection = ssh2_sftp_realpath($connect_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169
 	}
 
 	// Remote file
+	$filename = $file;
 	$remotefile = $newsection.(preg_match('@[\\\/]$@', $newsection) ? '' : '/').$file;
 	$newremotefileiso = mb_convert_encoding($remotefile, 'ISO-8859-1');
 
@@ -235,18 +246,21 @@
 /**
  * Remove FTP directory
  *
- * @param 		resource|FTP\Connection	$connect_id		Connection handler
- * @param 		string					$file			File
- * @param 		string					$newsection		Directory
+ * @param 		resource	$connect_id		Connection handler
+ * @param 		string		$file			File
+ * @param 		string		$newsection			$newsection
  * @return		bool
  */
 function dol_ftp_rmdir($connect_id, $file, $newsection)
 {
+	global $conf;
+
 	if (getDolGlobalString('FTP_CONNECT_WITH_SFTP')) {
 		$newsection = ssh2_sftp_realpath($connect_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169
 	}
 
 	// Remote file
+	$filename = $file;
 	$remotefile = $newsection.(preg_match('@[\\\/]$@', $newsection) ? '' : '/').$file;
 	$newremotefileiso = mb_convert_encoding($remotefile, 'ISO-8859-1');
 
@@ -261,13 +275,15 @@
 /**
  * Remove FTP directory
  *
- * @param 		resource|FTP\Connection		$connect_id		Connection handler
- * @param 		string						$newdir			Dir create
- * @param 		string						$newsection		Directory
+ * @param 		resource	$connect_id		Connection handler
+ * @param 		string		$newdir			Dir create
+ * @param 		string		$newsection		$newsection
  * @return		bool|string
  */
 function dol_ftp_mkdir($connect_id, $newdir, $newsection)
 {
+	global $conf;
+
 	if (getDolGlobalString('FTP_CONNECT_WITH_SFTP')) {
 		$newsection = ssh2_sftp_realpath($connect_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169
 	}

########## core/lib/functions.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/functions.lib.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/functions.lib.php	2025-06-27 11:43:41.321005000 +0000
@@ -462,7 +462,7 @@
  * @param   string	$type		Type of database (mysql, pgsql...)
  * @param	string	$host		Address of database server
  * @param	string	$user		Authorized username
- * @param	string	$pass		Password (clear)
+ * @param	string	$pass		Password
  * @param	string	$name		Name of database
  * @param	int		$port		Port of database server
  * @return	DoliDB				A DoliDB instance
@@ -1530,6 +1530,7 @@
 		dol_syslog('functions::dol_include_once Tried to load unexisting file: '.$relpath, LOG_WARNING);
 		return false;
 	}
+
 	if (!empty($classname) && !class_exists($classname)) {
 		return include $fullpath;
 	} else {
@@ -1995,7 +1996,7 @@
 }
 
 /**
- *  Returns text slugified (lowercase and no special char, separator is "-").
+ *  Returns text slugified (no special char, separator is "-".
  *
  *  @param	string	$stringtoslugify		String to slugify
  *  @return string							Slugified string
@@ -4816,7 +4817,7 @@
 	if ($trusted) {	// Return only IP we can rely on (not spoofable by the client)
 		$ip = (empty($_SERVER['REMOTE_ADDR']) ? '' : $_SERVER['REMOTE_ADDR']);	// value may be the IP of a proxy
 		// Note that if apache module remoteip has been enabled, REMOTE_ADDR can contain the real client (the value from cloudFlare HTTP_CF_CONNECTING_IP for example)
-		// This can happen if the proxy were added in the list of trusted proxy.
+		// if the proxy were added in the list of trusted proxy.
 		return $ip;
 	}
 
@@ -6513,7 +6514,7 @@
  *	@param	int<0,2>	$thead	 		0=To use with standard table format, 1=To use inside <thead><tr>, 2=To use with <div>
  *	@param	string		$file			Url used when we click on sort picto
  *	@param	string		$field			Field to use for new sorting. Empty if this field is not sortable. Example "t.abc" or "t.abc,t.def"
- *	@param	string		$begin       	("" by default)
+ *	@param	string		$begin       		("" by default)
  *	@param	string		$moreparam		Add more parameters on sort url links ("" by default)
  *	@param  string		$moreattrib		Add more attributes on th ("" by default). To add more css class, use param $prefix.
  *	@param  ?string		$sortfield	 	Current field used to sort (Ex: 'd.datep,d.id')
@@ -6587,8 +6588,8 @@
 			}
 		}
 		$sortordertouseinlink = preg_replace('/,$/', '', $sortordertouseinlink);
-		$out .= '<a class="reposition" href="'.$file.'?sortfield='.urlencode($field).'&sortorder='.urlencode($sortordertouseinlink).'&begin='.urlencode($begin).$options.'"';
-		//$out .= (getDolGlobalString('MAIN_DISABLE_WRAPPING_ON_COLUMN_TITLE') ? '' : ' title="'.dol_escape_htmltag($langs->trans($name)).'"');
+		$out .= '<a class="reposition" href="'.$file.'?sortfield='.$field.'&sortorder='.$sortordertouseinlink.'&begin='.$begin.$options.'"';
+		//$out .= (empty($conf->global->MAIN_DISABLE_WRAPPING_ON_COLUMN_TITLE) ? ' title="'.dol_escape_htmltag($langs->trans($name)).'"' : '');
 		$out .= '>';
 	}
 	if ($tooltip) {
@@ -6616,12 +6617,17 @@
 		}
 
 		if (!$sortorder || ($field1 != $sortfield1)) {
-			// Nothing
+			//$out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=asc&begin='.$begin.$options.'">'.img_down("A-Z",0).'</a>';
+			//$out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=desc&begin='.$begin.$options.'">'.img_up("Z-A",0).'</a>';
 		} else {
 			if (preg_match('/^DESC/', $sortorder)) {
+				//$out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=asc&begin='.$begin.$options.'">'.img_down("A-Z",0).'</a>';
+				//$out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=desc&begin='.$begin.$options.'">'.img_up("Z-A",1).'</a>';
 				$sortimg .= '<span class="nowrap">'.img_up("Z-A", 0, 'paddingright').'</span>';
 			}
 			if (preg_match('/^ASC/', $sortorder)) {
+				//$out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=asc&begin='.$begin.$options.'">'.img_down("A-Z",1).'</a>';
+				//$out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=desc&begin='.$begin.$options.'">'.img_up("Z-A",0).'</a>';
 				$sortimg .= '<span class="nowrap">'.img_down("A-Z", 0, 'paddingright').'</span>';
 			}
 		}
@@ -7052,7 +7058,7 @@
  *		Function to format a value into an amount for visual output
  *		Function used into PDF and HTML pages
  *
- *		@param	int|float|string|null	$amount			Amount value to format
+ *		@param	string|float			$amount			Amount value to format
  *		@param	int<0,1>				$form			Type of formatting: 1=HTML, 0=no formatting (no by default)
  *		@param	Translate|string|null	$outlangs		Object langs for output. '' use default lang. 'none' use international separators.
  *		@param	int						$trunc			1=Truncate if there is more decimals than MAIN_MAX_DECIMALS_SHOWN (default), 0=Does not truncate. Deprecated because amount are rounded (to unit or total amount accuracy) before being inserted into database or after a computation, so this parameter should be useless.
@@ -7172,7 +7178,7 @@
  *	Function to use on each input amount before any numeric test or database insert. A better name for this function
  *  should be roundtext2num().
  *
- *	@param	int|float|string|null	$amount		Amount to convert/clean or round
+ *	@param	string|float	$amount			Amount to convert/clean or round
  *	@param	''|'MU'|'MT'|'MS'|'CU'|'CT'|int<0,max>	$rounding		''=No rounding
  *                                                                  'MU'=Round to Max unit price (MAIN_MAX_DECIMALS_UNIT)
  *                                                                  'MT'=Round to Max for totals with Tax (MAIN_MAX_DECIMALS_TOT)
@@ -7260,7 +7266,6 @@
 			//   - `[^,]*,`: Any sequence of characters that is not ',' with ',' accepted as the decimal point (from start of string because of earlier `^`);
 			//   - `[^.]*\.`: Any sequence of characters that is not a '.' with '.' accepted as the decimal point (from start of string.
 			// - `(?<dec>[^.,]*)`: The sequence after the character accepted as the decimal point, not including it.
-			$matches = array();
 			if (preg_match('/^(?<int>[^,]*,|[^.]*\.)(?<dec>[^.,]*)$/u', $amount, $matches)) {
 				$intPart = $matches['int'];
 				$decPart = $matches['dec'];
@@ -7285,15 +7290,15 @@
 	if ($rounding) {
 		$nbofdectoround = '';
 		if ($rounding == 'MU') {
-			$nbofdectoround = getDolGlobalInt('MAIN_MAX_DECIMALS_UNIT');	// usually 5
+			$nbofdectoround = getDolGlobalString('MAIN_MAX_DECIMALS_UNIT');
 		} elseif ($rounding == 'MT') {
-			$nbofdectoround = getDolGlobalInt('MAIN_MAX_DECIMALS_TOT');		// usually 2 or 3
+			$nbofdectoround = getDolGlobalString('MAIN_MAX_DECIMALS_TOT');
 		} elseif ($rounding == 'MS') {
-			$nbofdectoround = isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? getDolGlobalInt('MAIN_MAX_DECIMALS_STOCK') : 5;
+			$nbofdectoround = isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? $conf->global->MAIN_MAX_DECIMALS_STOCK : 5;
 		} elseif ($rounding == 'CU') {
-			$nbofdectoround = getDolGlobalInt('MAIN_MAX_DECIMALS_CURRENCY_UNIT', getDolGlobalInt('MAIN_MAX_DECIMALS_UNIT'));	// TODO Use param of currency
+			$nbofdectoround = max(getDolGlobalString('MAIN_MAX_DECIMALS_UNIT'), 8);	// TODO Use param of currency
 		} elseif ($rounding == 'CT') {
-			$nbofdectoround = getDolGlobalInt('MAIN_MAX_DECIMALS_CURRENCY_TOT', getDolGlobalInt('MAIN_MAX_DECIMALS_TOT'));		// TODO Use param of currency
+			$nbofdectoround = max(getDolGlobalString('MAIN_MAX_DECIMALS_TOT'), 8);		// TODO Use param of currency
 		} elseif (is_numeric($rounding)) {
 			$nbofdectoround = (int) $rounding;
 		}
@@ -8530,21 +8535,14 @@
 {
 	if (is_null($allowed_attributes)) {
 		$allowed_attributes = array(
-			"allow", "allowfullscreen", "alt", "async", "class", "contenteditable", "crossorigin", "data-html", "frameborder", "height", "href", "id", "name", "property", "rel", "src", "style", "target", "title", "type", "width",
+			"allow", "allowfullscreen", "alt", "async", "class", "content", "contenteditable", "crossorigin", "data-html", "frameborder", "height", "href", "id", "name", "property", "rel", "src", "style", "target", "title", "type", "width",
 			// HTML5
 			"header", "footer", "nav", "section", "menu", "menuitem"
 		);
 	}
-	// Always add content and http-equiv for meta tags, required to force encoding and keep html content in utf8 by load/saveHTML functions.
-	if (!in_array("content", $allowed_attributes)) {
-		$allowed_attributes[] = "content";
-	}
-	if (!in_array("http-equiv", $allowed_attributes)) {
-		$allowed_attributes[] = "http-equiv";
-	}
 
 	if (class_exists('DOMDocument') && !empty($stringtoclean)) {
-		$stringtoclean = '<?xml encoding="UTF-8"><html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body>'.$stringtoclean.'</body></html>';
+		$stringtoclean = '<?xml encoding="UTF-8"><html><body>'.$stringtoclean.'</body></html>';
 
 		// Warning: loadHTML does not support HTML5 on old libxml versions.
 		$dom = new DOMDocument('', 'UTF-8');
@@ -8595,15 +8593,12 @@
 			}
 		}
 
-		$dom->encoding = 'UTF-8';
-
 		$return = $dom->saveHTML();	// This may add a LF at end of lines, so we will trim later
 		//$return = '<html><body>aaaa</p>bb<p>ssdd</p>'."\n<p>aaa</p>aa<p>bb</p>";
 
 		$return = preg_replace('/^'.preg_quote('<?xml encoding="UTF-8">', '/').'/', '', $return);
-		$return = preg_replace('/^'.preg_quote('<html><head><', '/').'[^<>]*'.preg_quote('></head><body>', '/').'/', '', $return);
-		$return = preg_replace('/'.preg_quote('</body></html>', '/').'$/', '', trim($return));
-
+		$return = preg_replace('/^'.preg_quote('<html><body>', '/').'/', '', $return);
+		$return = preg_replace('/'.preg_quote('</body></html>', '/').'$/', '', $return);
 		return trim($return);
 	} else {
 		return $stringtoclean;
@@ -8775,24 +8770,17 @@
 					// like 'abc' that wrongly ends up, without the trick, with '<p>abc</p>'
 
 					if (dol_textishtml($out)) {
-						$out = '<?xml encoding="UTF-8"><html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body><div class="tricktoremove">'.$out.'</div></body></html>';
+						$out = '<?xml encoding="UTF-8"><div class="tricktoremove">'.$out.'</div>';
 					} else {
-						$out = '<?xml encoding="UTF-8"><html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body><div class="tricktoremove">'.dol_nl2br($out).'</div></body></html>';
+						$out = '<?xml encoding="UTF-8"><div class="tricktoremove">'.dol_nl2br($out).'</div>';
 					}
 
 					$dom->loadHTML($out, LIBXML_HTML_NODEFDTD | LIBXML_ERR_NONE | LIBXML_HTML_NOIMPLIED | LIBXML_NONET | LIBXML_NOWARNING | LIBXML_NOERROR | LIBXML_NOXMLDECL);
-
-					$dom->encoding = 'UTF-8';
-
 					$out = trim($dom->saveHTML());
 
-					// Remove the trick added to solve pb with text in utf8 and text without parent tag
-					$out = preg_replace('/^'.preg_quote('<?xml encoding="UTF-8">', '/').'/', '', $out);
-					$out = preg_replace('/^'.preg_quote('<html><head><', '/').'[^<>]+'.preg_quote('></head><body><div class="tricktoremove">', '/').'/', '', $out);
-					$out = preg_replace('/'.preg_quote('</div></body></html>', '/').'$/', '', trim($out));
-					//                  $out = preg_replace('/^<\?xml encoding="UTF-8"><div class="tricktoremove">/', '', $out);
-					//                  $out = preg_replace('/<\/div>$/', '', $out);
-					//                  var_dump('rrrrrrrrrrrrrrrrrrrrrrrrrrrrr'.$out);
+					// Remove the trick added to solve pb with text without parent tag
+					$out = preg_replace('/^<\?xml encoding="UTF-8"><div class="tricktoremove">/', '', $out);
+					$out = preg_replace('/<\/div>$/', '', $out);
 				} catch (Exception $e) {
 					// If error, invalid HTML string with no way to clean it
 					//print $e->getMessage();
@@ -8906,7 +8894,7 @@
 			$out = preg_replace('/on(repeat|begin|finish|beforeinput)[a-z]*\s*=/i', '', $out);
 		} while ($oldstringtoclean != $out);
 
-				// Check the limit of external links that are automatically executed in a Rich text content. We count:
+		// Check the limit of external links that are automatically executed in a Rich text content. We count:
 		// '<img' to avoid <img src="http...">,  we can only accept "<img src="data:..."
 		// 'url(' to avoid inline style like background: url(http...
 		// '<link' to avoid <link href="http...">
@@ -9304,9 +9292,7 @@
 		$substitutionarray = array_merge($substitutionarray, array(
 			'__MYCOMPANY_NAME__'    => $mysoc->name,
 			'__MYCOMPANY_EMAIL__'   => $mysoc->email,
-			'__MYCOMPANY_URL__'     => $mysoc->url,
 			'__MYCOMPANY_PHONE__'   => dol_print_phone($mysoc->phone, '', 0, 0, '', " ", '', '', -1),
-			'__MYCOMPANY_PHONEMOBILE__' => dol_print_phone($mysoc->phone_mobile, '', 0, 0, '', " ", '', '', -1),
 			'__MYCOMPANY_FAX__'     => dol_print_phone($mysoc->fax, '', 0, 0, '', " ", '', '', -1),
 			'__MYCOMPANY_PROFID1__' => $mysoc->idprof1,
 			'__MYCOMPANY_PROFID2__' => $mysoc->idprof2,
@@ -9442,7 +9428,6 @@
 			}
 		} else {
 			'@phan-var-force Adherent|Delivery $object';
-			/** @var Adherent|Delivery $object */
 			$substitutionarray['__ID__'] = $object->id;
 			$substitutionarray['__REF__'] = $object->ref;
 			$substitutionarray['__NEWREF__'] = $object->newref;
@@ -9483,7 +9468,6 @@
 
 			if (is_object($object) && ($object->element == 'adherent' || $object->element == 'member') && $object->id > 0) {
 				'@phan-var-force Adherent $object';
-				/** @var Adherent $object */
 				$birthday = (empty($object->birth) ? '' : dol_print_date($object->birth, 'day'));
 
 				$substitutionarray['__MEMBER_ID__'] = (isset($object->id) ? $object->id : '');
@@ -9582,14 +9566,12 @@
 
 			if (is_object($object) && $object->element == 'recruitmentcandidature') {
 				'@phan-var-force RecruitmentCandidature $object';
-				/** @var RecruitmentCandidature $object */
 				$substitutionarray['__CANDIDATE_FULLNAME__'] = $object->getFullName($outputlangs);
 				$substitutionarray['__CANDIDATE_FIRSTNAME__'] = isset($object->firstname) ? $object->firstname : '';
 				$substitutionarray['__CANDIDATE_LASTNAME__'] = isset($object->lastname) ? $object->lastname : '';
 			}
 			if (is_object($object) && $object->element == 'conferenceorboothattendee') {
 				'@phan-var-force ConferenceOrBoothAttendee $object';
-				/** ConferenceOrBoothAttendee $object */
 				$substitutionarray['__ATTENDEE_FULLNAME__'] = $object->getFullName($outputlangs);
 				$substitutionarray['__ATTENDEE_FIRSTNAME__'] = isset($object->firstname) ? $object->firstname : '';
 				$substitutionarray['__ATTENDEE_LASTNAME__'] = isset($object->lastname) ? $object->lastname : '';
@@ -9597,7 +9579,6 @@
 
 			if (is_object($object) && $object->element == 'project') {
 				'@phan-var-force Project $object';
-				/** @var Project $object */
 				$substitutionarray['__PROJECT_ID__'] = $object->id;
 				$substitutionarray['__PROJECT_REF__'] = $object->ref;
 				$substitutionarray['__PROJECT_NAME__'] = $object->title;
@@ -9631,26 +9612,22 @@
 
 			if (is_object($object) && $object->element == 'facture') {
 				'@phan-var-force Facture $object';
-				/** @var Facture $object */
 				$substitutionarray['__INVOICE_SITUATION_NUMBER__'] = isset($object->situation_counter) ? $object->situation_counter : '';
 			}
 			if (is_object($object) && $object->element == 'shipping') {
 				'@phan-var-force Expedition $object';
-				/** @var Expedition $object */
 				$substitutionarray['__SHIPPINGTRACKNUM__'] = $object->tracking_number;
 				$substitutionarray['__SHIPPINGTRACKNUMURL__'] = $object->tracking_url;
 				$substitutionarray['__SHIPPINGMETHOD__'] = $object->shipping_method;
 			}
 			if (is_object($object) && $object->element == 'reception') {
 				'@phan-var-force Reception $object';
-				/** @var Reception $object */
 				$substitutionarray['__RECEPTIONTRACKNUM__'] = $object->tracking_number;
 				$substitutionarray['__RECEPTIONTRACKNUMURL__'] = $object->tracking_url;
 			}
 
 			if (is_object($object) && $object->element == 'contrat' && $object->id > 0 && is_array($object->lines)) {
 				'@phan-var-force Contrat $object';
-				/** @var Contrat $object */
 				$dateplannedstart = '';
 				$datenextexpiration = '';
 				foreach ($object->lines as $line) {
@@ -9672,7 +9649,6 @@
 			// add substitution variables for ticket
 			if (is_object($object) && $object->element == 'ticket') {
 				'@phan-var-force Ticket $object';
-				/** @var Ticket $object */
 				$substitutionarray['__TICKET_TRACKID__'] = $object->track_id;
 				$substitutionarray['__TICKET_SUBJECT__'] = $object->subject;
 				$substitutionarray['__TICKET_TYPE__'] = $object->type_code;
@@ -9803,55 +9779,46 @@
 
 				if (is_object($object) && $object->element == 'propal') {
 					'@phan-var-force Propal $object';
-					/** @var Propal $object */
 					$substitutionarray['__URL_PROPOSAL__'] = DOL_MAIN_URL_ROOT."/comm/propal/card.php?id=".$object->id;
 					require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
 					$substitutionarray['__ONLINE_SIGN_URL__'] = getOnlineSignatureUrl(0, 'proposal', $object->ref, 1, $object);
 				}
 				if (is_object($object) && $object->element == 'commande') {
 					'@phan-var-force Commande $object';
-					/** @var Commande $object */
 					$substitutionarray['__URL_ORDER__'] = DOL_MAIN_URL_ROOT."/commande/card.php?id=".$object->id;
 				}
 				if (is_object($object) && $object->element == 'facture') {
 					'@phan-var-force Facture $object';
-					/** @var Facture $object */
 					$substitutionarray['__URL_INVOICE__'] = DOL_MAIN_URL_ROOT."/compta/facture/card.php?id=".$object->id;
 				}
 				if (is_object($object) && $object->element == 'contrat') {
 					'@phan-var-force Contrat $object';
-					/** @var Contrat $object */
 					$substitutionarray['__URL_CONTRACT__'] = DOL_MAIN_URL_ROOT."/contrat/card.php?id=".$object->id;
 					require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
 					$substitutionarray['__ONLINE_SIGN_URL__'] = getOnlineSignatureUrl(0, 'contract', $object->ref, 1, $object);
 				}
 				if (is_object($object) && $object->element == 'fichinter') {
 					'@phan-var-force Fichinter $object';
-					/** @var Fichinter $object */
 					$substitutionarray['__URL_FICHINTER__'] = DOL_MAIN_URL_ROOT."/fichinter/card.php?id=".$object->id;
 					require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
 					$substitutionarray['__ONLINE_SIGN_FICHINTER_URL__'] = getOnlineSignatureUrl(0, 'fichinter', $object->ref, 1, $object);
 				}
 				if (is_object($object) && $object->element == 'supplier_proposal') {
 					'@phan-var-force SupplierProposal $object';
-					/** @var SupplierProposal $object */
 					$substitutionarray['__URL_SUPPLIER_PROPOSAL__'] = DOL_MAIN_URL_ROOT."/supplier_proposal/card.php?id=".$object->id;
 				}
 				if (is_object($object) && $object->element == 'invoice_supplier') {
 					'@phan-var-force FactureFournisseur $object';
-					/** @var FactureFournisseur $object */
 					$substitutionarray['__URL_SUPPLIER_INVOICE__'] = DOL_MAIN_URL_ROOT."/fourn/facture/card.php?id=".$object->id;
 				}
 				if (is_object($object) && $object->element == 'shipping') {
 					'@phan-var-force Expedition $object';
-					/** @var Expedition $object */
 					$substitutionarray['__URL_SHIPMENT__'] = DOL_MAIN_URL_ROOT."/expedition/card.php?id=".$object->id;
 				}
 			}
 
 			if (is_object($object) && $object->element == 'action') {
 				'@phan-var-force ActionComm $object';
-				/** @var ActionComm $object */
 				$substitutionarray['__EVENT_LABEL__'] = $object->label;
 				$substitutionarray['__EVENT_TYPE__'] = $outputlangs->trans("Action".$object->type_code);
 				$substitutionarray['__EVENT_DATE__'] = dol_print_date($object->datep, 'day', 'auto', $outputlangs);
@@ -9861,7 +9828,6 @@
 	}
 	if ((empty($exclude) || !in_array('objectamount', $exclude)) && (empty($include) || in_array('objectamount', $include))) {
 		'@phan-var-force Facture|FactureRec $object';
-		/** @var Facture|FactureRec|null $object */
 		include_once DOL_DOCUMENT_ROOT.'/core/lib/functionsnumtoword.lib.php';
 
 		$substitutionarray['__DATE_YMD__']          = is_object($object) ? (isset($object->date) ? dol_print_date($object->date, 'day', false, $outputlangs) : null) : '';
@@ -9960,8 +9926,6 @@
 			'__MONTH_TEXT_SHORT__' => $outputlangs->trans('MonthShort'.sprintf("%02d", $tmp['mon'])),
 			'__MONTH_TEXT_MIN__' => $outputlangs->trans('MonthVeryShort'.sprintf("%02d", $tmp['mon'])),
 			'__YEAR__' => (string) $tmp['year'],
-			'__YEAR_PREVIOUS_MONTH__' => (string) $tmp3['year'],
-			'__YEAR_NEXT_MONTH__' => (string) $tmp5['year'],
 			'__PREVIOUS_DAY__' => (string) $tmp2['day'],
 			'__PREVIOUS_MONTH__' => (string) $tmp3['month'],
 			'__PREVIOUS_MONTH_TEXT__' => $outputlangs->trans('Month'.sprintf("%02d", $tmp3['month'])),
@@ -10908,14 +10872,14 @@
 
 /**
  * Replace eval function to add more security.
- * This function is called by verifCond() for example.
+ * This function is called by verifCond() or trans() and transnoentitiesnoconv().
  *
  * @param 	string		$s					String to evaluate
  * @param	int<0,1>	$returnvalue		0=No return (deprecated, used to execute eval($a=something)). 1=Value of eval is returned (used to eval($something)).
  * @param   int<0,1>	$hideerrors     	1=Hide errors
- * @param	string		$onlysimplestring	'0' (deprecated, do not use it anymore) = Accept all chars,
- *                                          '1' (most common use) = Accept only simple string with char 'a-z0-9\s^$_+-.*>&|=!?():"\',/@';',
- *                                          '2' (used for example for the compute property of extrafields) = Accept also '<[]'
+ * @param	string		$onlysimplestring	'0' (deprecated, do not use it anymore)=Accept all chars,
+ *                                          '1' (most common use)=Accept only simple string with char 'a-z0-9\s^$_+-.*>&|=!?():"\',/@';',
+ *                                          '2' (used for example for the compute property of extrafields)=Accept also '<[]'
  * @return	string							Return result of eval (even if type can be int, it is safer to assume string and find all potential typing issues as abs(dol_eval(...)).
  * @see verifCond(), checkPHPCode() to see sanitizing rules that should be very close.
  * @phan-suppress PhanPluginUnsafeEval
@@ -11282,26 +11246,14 @@
 		$forbiddenphpstrings = array_merge($forbiddenphpstrings, array('_ENV', '_SESSION', '_COOKIE', '_GET', '_GLOBAL', '_POST', '_REQUEST', 'ReflectionFunction'));
 
 		// We list all forbidden function as keywords we don't want to see (we don't mind it if is "kewyord(" or just "keyword", we don't want "keyword" at all)
-		// We must exclude all functions that allow to execute another function. This includes all function that has a parameter with type "callable" to avoid things
-		// like we can do with array_map and its callable parameter:  dol_eval('json_encode(array_map(implode("",["ex","ec"]), ["id"]))', 1, 1, '0')
 		$forbiddenphpfunctions = array();
 		$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("override_function", "session_id", "session_create_id", "session_regenerate_id"));
 		$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("get_defined_functions", "get_defined_vars", "get_defined_constants", "get_declared_classes"));
 		$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("function", "call_user_func", "call_user_func_array"));
-
-		$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("array_all", "array_any", "array_diff_ukey", "array_filter", "array_find", "array_find_key", "array_map", "array_reduce", "array_intersect_uassoc", "array_intersect_ukey", "array_walk", "array_walk_recursive"));
-		$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("usort", "uasort", "uksort", "preg_replace_callback", "preg_replace_callback_array", "header_register_callback"));
-		$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("set_error_handler", "set_exception_handler", "libxml_set_external_entity_loader", "register_shutdown_function", "register_tick_function", "unregister_tick_function"));
-		$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("spl_autoload_register", "spl_autoload_unregister", "iterator_apply", "session_set_save_handler"));
-		$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("forward_static_call", "forward_static_call_array", "register_postsend_function"));
-
-		$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("ob_start"));
-
 		$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include", "require_once", "include_once"));
 		$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("exec", "passthru", "shell_exec", "system", "proc_open", "popen"));
 		$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("dol_eval", "dol_eval_new", "dol_eval_standard", "dol_concatdesc", "executeCLI", "verifCond", "GETPOST"));	// native dolibarr functions
 		$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("eval", "create_function", "assert", "mb_ereg_replace")); // function with eval capabilities
-		$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("readline_completion_function", "readline_callback_handler_install"));
 		$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("dol_compress_dir", "dol_decode", "dol_delete_file", "dol_delete_dir", "dol_delete_dir_recursive", "dol_copy", "archiveOrBackupFile")); // more dolibarr functions
 		$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask"));
 		$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include"));

########## core/lib/geturl.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/geturl.lib.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/geturl.lib.php	2025-06-27 11:43:41.365699000 +0000
@@ -66,7 +66,7 @@
 	 print $nvpStr;
 	 exit;*/
 	curl_setopt($ch, CURLOPT_VERBOSE, 1);
-	curl_setopt($ch, CURLOPT_USERAGENT, 'Dolibarr geturl function');	// set the Dolibarr user agent name
+	curl_setopt($ch, CURLOPT_USERAGENT, 'Dolibarr geturl function');
 
 	// We use @ here because this may return warning if safe mode is on or open_basedir is on (following location is forbidden when safe mode is on).
 	// We force value to false so we will manage redirection ourself later.
@@ -178,7 +178,7 @@
 
 	do {
 		if ($maxRedirection < 1) {
-			return array('http_code' => 400, 'content' => 'Maximum number of redirections reached', 'curl_error_no' => 1, 'curl_error_msg' => 'Maximum number of redirections reached');
+			break;
 		}
 
 		curl_setopt($ch, CURLOPT_URL, $newUrl);
@@ -192,7 +192,7 @@
 		if (in_array($hosttocheck, array('metadata.google.internal'))) {
 			$info['http_code'] = 400;
 			$info['content'] = 'Error bad hostname '.$hosttocheck.' (Used by Google metadata). This value for hostname is not allowed.';
-			return array('http_code' => 400, 'content' => $info['content'], 'curl_error_no' => 1, 'curl_error_msg' => $info['content']);
+			break;
 		}
 
 		// Clean host name $hosttocheck to convert it into an IP $iptocheck
@@ -220,7 +220,7 @@
 			if ($tmpresult) {
 				$info['http_code'] = 400;
 				$info['content'] = $tmpresult;
-				return array('http_code' => 400, 'content' => $tmpresult, 'curl_error_no' => 1, 'curl_error_msg' => $tmpresult);
+				break;
 			}
 		}
 
@@ -371,10 +371,9 @@
 
 /**
  * Function get second level domain name.
- * For example: https://www.abc.mydomain.com/dir/page.html returns 'mydomain' with mode 0, 'mydomain.om' with mode 1, 'abc.mydomain.com' with mode 2.
- * For example: part1@mydomain.com returns 'mydomain.com' with mode 1
+ * For example: https://www.abc.mydomain.com/dir/page.html return 'mydomain'
  *
- * @param	string	  $url 				    Full URL or Email.
+ * @param	string	  $url 				    Full URL.
  * @param	int	 	  $mode					0=return 'mydomain', 1=return 'mydomain.com', 2=return 'abc.mydomain.com'
  * @return	string						    Returns domaine name
  */
@@ -399,10 +398,8 @@
 		$mode++;
 	}
 
-	$tmpdomain = preg_replace('/^https?:\/\/[^:]+:[^@]+@/i', '', $url); 	// Remove http(s)://login@pass in https://login@pass:mydomain.com/path, so we now got mydomain.com/path
-	$tmpdomain = preg_replace('/^https?:\/\//i', '', $tmpdomain); 			// Remove http(s)://
-	$tmpdomain = preg_replace('/\/.*$/i', '', $tmpdomain); 					// Remove part after /
-	$tmpdomain = preg_replace('/^[^@]+@/i', '', $tmpdomain); 				// Remove part1@ in part1@part2 (for emails)
+	$tmpdomain = preg_replace('/^https?:\/\//i', '', $url); // Remove http(s)://
+	$tmpdomain = preg_replace('/\/.*$/i', '', $tmpdomain); // Remove part after /
 	if ($mode == 3) {
 		$tmpdomain = preg_replace('/^.*\.([^\.]+)\.([^\.]+)\.([^\.]+)\.([^\.]+)$/', '\1.\2.\3.\4', $tmpdomain);
 	} elseif ($mode == 2) {

########## core/lib/pdf.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/pdf.lib.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/pdf.lib.php	2025-06-27 11:43:41.344170000 +0000
@@ -1873,9 +1873,7 @@
 			if ($detail->batch) {
 				$dte[] = $outputlangs->transnoentitiesnoconv('printBatch', $detail->batch);
 			}
-			if ($detail->qty) {
-				$dte[] = $outputlangs->transnoentitiesnoconv('printQty', (string) $detail->qty);
-			}
+			$dte[] = $outputlangs->transnoentitiesnoconv('printQty', (string) $detail->qty);
 
 			// Add also info of planned warehouse for lot
 			if ($object->element == 'shipping' && $detail->fk_origin_stock > 0 && getDolGlobalInt('PRODUCTBATCH_SHOW_WAREHOUSE_ON_SHIPMENT')) {
@@ -2590,7 +2588,7 @@
 				$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DatePropal");
 				$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date, 'day', '', $outputlangs);
 			}
-		} elseif ($objecttype == 'commande' || $objecttype == 'supplier_order' || $objecttype == 'order_supplier') {
+		} elseif ($objecttype == 'commande' || $objecttype == 'supplier_order') {
 			'@phan-var-force array<Commande|CommandeFournisseur> $objects';
 			$outputlangs->load('orders');
 
@@ -2749,17 +2747,15 @@
 }
 
 /**
- *	Return line total amount discount.
- *  Calculated by taking the unit price (subprice) * quantity - (total without tax)
+ *	Return line total amount discount
  *
  *	@param	Commande|Facture|Propal			$object				Object
  *	@param	int								$i					Current line number
  *  @param  Translate						$outputlangs		Object langs for output
  *  @param	int<0,2>						$hidedetails		Hide details (0=no, 1=yes, 2=just special lines)
- *  @param	int<0,1>						$multicurrency		1=Get value in the foreign currency
  * 	@return	int|float|string									Return total of line excl tax
  */
-function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails = 0, $multicurrency = 0)
+function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails = 0)
 {
 	global $hookmanager;
 
@@ -2781,8 +2777,7 @@
 				'i' => $i,
 				'outputlangs' => $outputlangs,
 				'hidedetails' => $hidedetails,
-				'special_code' => $special_code,
-				'multicurrency' => $multicurrency
+				'special_code' => $special_code
 			);
 
 			$action = '';
@@ -2797,11 +2792,7 @@
 		}
 
 		if (empty($hidedetails) || $hidedetails > 1) {
-			if (empty($multicurrency)) {
-				return (float) price2num($sign * (($object->lines[$i]->subprice * (float) $object->lines[$i]->qty) - $object->lines[$i]->total_ht), 'MT', 1);
-			} else {
-				return (float) price2num($sign * (($object->lines[$i]->multicurrency_subprice * (float) $object->lines[$i]->qty) - $object->lines[$i]->multicurrency_total_ht), 'MT', 1);
-			}
+			return (float) price2num($sign * (($object->lines[$i]->subprice * (float) $object->lines[$i]->qty) - $object->lines[$i]->total_ht), 'MT', 1);
 		}
 	}
 	return 0;

########## core/lib/security.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/security.lib.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/security.lib.php	2025-06-27 11:43:41.245124000 +0000
@@ -178,7 +178,7 @@
  *  Note: If a backup is restored onto another instance with a different $conf->file->instance_unique_id, then decoded value will differ.
  *
  *	@param   string		$chain		string to decode
- *	@param   string		$key		If '', we use $conf->file->dolcrypt_key else $conf->file->instance_unique_id
+ *	@param   string		$key		If '', we use $conf->file->instance_unique_id
  *	@return  string					encoded string
  *  @since v17
  *  @see dolEncrypt(), dol_hash()

########## core/lib/security2.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/security2.lib.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/security2.lib.php	2025-06-27 11:43:41.247029000 +0000
@@ -152,14 +152,8 @@
 		// Title
 		$appli = constant('DOL_APPLICATION_TITLE');
 		$title = $appli.(getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '' : ' '.constant('DOL_VERSION'));
-
-		$customapplication = getDolGlobalString('MAIN_APPLICATION_TITLE');
-		if ($customapplication) {
-			if (preg_match('/^\+/', $customapplication)) {
-				$title .= $customapplication;
-			} else {
-				$title = $customapplication;
-			}
+		if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
+			$title = getDolGlobalString('MAIN_APPLICATION_TITLE');
 		}
 		$titletruedolibarrversion = constant('DOL_VERSION'); // $title used by login template after the @ to inform of true Dolibarr version
 

########## core/lib/website.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/website.lib.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/website.lib.php	2025-06-27 11:43:41.353025000 +0000
@@ -1512,14 +1512,9 @@
 					dol_mkdir(dirname($filetosave));
 
 					$fp = fopen($filetosave, "w");
-					if ($fp) {
-						fwrite($fp, $tmpgeturl['content']);
-						fclose($fp);
-						dolChmod($filetosave);
-					} else {
-						setEventMessages('Error failed to open file '.$filetosave.' for writing', null, 'errors');
-						//print 'Failed to open file '.$filetosave.' for writing.';
-					}
+					fwrite($fp, $tmpgeturl['content']);
+					fclose($fp);
+					dolChmod($filetosave);
 				}
 			}
 		}

########## core/login/functions_openid_connect.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/login/functions_openid_connect.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/login/functions_openid_connect.php	2025-06-27 11:43:40.379661000 +0000
@@ -121,7 +121,7 @@
 		return false;
 	}
 
-	// Step 3: retrieve user info (login, email, ...) from OIDC server using token
+	// Step 3: retrieve user info using token
 	$userinfo_headers = array('Authorization: Bearer '.$token_content->access_token);
 	$userinfo_response = getURLContent(getDolGlobalString('MAIN_AUTHENTICATION_OIDC_USERINFO_URL'), 'GET', '', 1, $userinfo_headers, array('https'), 2);
 	$userinfo_content = json_decode($userinfo_response['content']);
@@ -159,12 +159,7 @@
 	// Success: retrieve claim to return to Dolibarr as login
 	$sql = 'SELECT login, entity, datestartvalidity, dateendvalidity';
 	$sql .= ' FROM '.MAIN_DB_PREFIX.'user';
-	if ($login_claim === 'email') {
-		// If login claim is email, check both login and email fields
-		$sql .= " WHERE (login = '".$db->escape($userinfo_content->$login_claim)."' OR email = '".$db->escape($userinfo_content->$login_claim)."')";
-	} else {
-		$sql .= " WHERE login = '".$db->escape($userinfo_content->$login_claim)."'";
-	}
+	$sql .= " WHERE login = '".$db->escape($userinfo_content->$login_claim)."'";
 	$sql .= ' AND entity IN (0,'.(array_key_exists('dol_entity', $_SESSION) ? ((int) $_SESSION["dol_entity"]) : 1).')';
 
 	dol_syslog("functions_openid::check_user_password_openid", LOG_DEBUG);
@@ -174,11 +169,6 @@
 		dol_syslog("functions_openid_connect::check_user_password_openid_connect::Error with sql query (".$db->error().")");
 		return false;
 	}
-	$numres = $db->num_rows($resql);
-	if ($numres > 1) {
-		dol_syslog("functions_openid_connect::check_user_password_openid_connect::Error more than 1 result from the query");
-		return false;
-	}
 	$obj = $db->fetch_object($resql);
 	if (!$obj) {
 		dol_syslog("functions_openid_connect::check_user_password_openid_connect::Error no result from the query");

########## core/modules/accountancy/doc/pdf_balance.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/accountancy/doc/pdf_balance.modules.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/accountancy/doc/pdf_balance.modules.php	2025-06-27 11:43:40.564998000 +0000
@@ -502,7 +502,7 @@
 			$curY,
 			$nexY,
 			$default_font_size,
-			$langs->transnoentities('GrandTotals'),
+			$langs->trans('GrandTotals'),
 			$tab_top_newpage,
 			$totalDebit,
 			$totalCredit,

########## core/modules/accountancy/doc/pdf_bookkeeping.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/accountancy/doc/pdf_bookkeeping.modules.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/accountancy/doc/pdf_bookkeeping.modules.php	2025-06-27 11:43:40.562967000 +0000
@@ -511,7 +511,7 @@
 			$curY,
 			$nexY,
 			$default_font_size,
-			$langs->transnoentities('GrandTotals'),
+			$langs->trans('GrandTotals'),
 			$tab_top_newpage,
 			$totalDebit,
 			$totalCredit,

########## core/modules/accountancy/doc/pdf_ledger.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/accountancy/doc/pdf_ledger.modules.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/accountancy/doc/pdf_ledger.modules.php	2025-06-27 11:43:40.567274000 +0000
@@ -512,7 +512,7 @@
 			$curY,
 			$nexY,
 			$default_font_size,
-			$langs->transnoentities('GrandTotals'),
+			$langs->trans('GrandTotals'),
 			$tab_top_newpage,
 			$totalDebit,
 			$totalCredit,

########## core/modules/asset/mod_asset_standard.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/asset/mod_asset_standard.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/asset/mod_asset_standard.php	2025-06-27 11:43:40.698985000 +0000
@@ -98,7 +98,7 @@
 		$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
 		if ($object->ismultientitymanaged == 1) {
 			$sql .= " AND entity = ".$conf->entity;
-		} elseif (!is_numeric($object->ismultientitymanaged)) {
+		} elseif ($object->ismultientitymanaged == 2) {
 			// TODO
 		}
 
@@ -137,7 +137,7 @@
 		$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
 		if ($object->ismultientitymanaged == 1) {
 			$sql .= " AND entity = ".$conf->entity;
-		} elseif (!is_numeric($object->ismultientitymanaged)) {
+		} elseif ($object->ismultientitymanaged == 2) {
 			// TODO
 		}
 

########## core/modules/commande/doc/pdf_einstein.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/commande/doc/pdf_einstein.modules.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/commande/doc/pdf_einstein.modules.php	2025-06-27 11:43:40.648800000 +0000
@@ -937,41 +937,31 @@
 		// Get Total HT
 		$total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
 
-		// Total discount
-		$total_discount_on_lines = 0;
-		$multicurrency_total_discount_on_lines = 0;
+		// Total remise
+		$total_line_remise = 0;
 		foreach ($object->lines as $i => $line) {
 			$resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2);
-			$multicurrency_resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2, 1);
-
-			$total_discount_on_lines += (is_numeric($resdiscount) ? $resdiscount : 0);
-			$multicurrency_total_discount_on_lines += (is_numeric($multicurrency_resdiscount) ? $multicurrency_resdiscount : 0);
-			// If line was a negative line, we do not count the discount as a discount
+			$total_line_remise += (is_numeric($resdiscount) ? $resdiscount : 0);
+			// Gestion remise sous forme de ligne négative
 			if ($line->total_ht < 0) {
-				$total_discount_on_lines += -$line->total_ht;
-				$multicurrency_total_discount_on_lines += -$line->multicurrency_total_ht;
+				$total_line_remise += -$line->total_ht;
 			}
 		}
+		if ($total_line_remise > 0) {
+			$pdf->SetFillColor(255, 255, 255);
+			$pdf->SetXY($col1x, $tab2_top + $tab2_hl);
+			$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
+			$pdf->SetXY($col2x, $tab2_top + $tab2_hl);
+			$pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true);
+
+			$index++;
 
-		if ($total_discount_on_lines > 0) {
 			// Show total NET before discount
 			$pdf->SetFillColor(255, 255, 255);
 			$pdf->SetXY($col1x, $tab2_top);
 			$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true);
 			$pdf->SetXY($col2x, $tab2_top);
-
-			$total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines));
-			$pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true);
-
-			$index++;
-
-			$pdf->SetFillColor(255, 255, 255);
-			$pdf->SetXY($col1x, $tab2_top + $tab2_hl);
-			$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
-			$pdf->SetXY($col2x, $tab2_top + $tab2_hl);
-
-			$total_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines);
-			$pdf->MultiCell($largcol2, $tab2_hl, price($total_discount_to_show, 0, $outputlangs), 0, 'R', true);
+			$pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true);
 
 			$index++;
 		}
@@ -981,7 +971,7 @@
 		$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
 		$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', true);
 
-		$total_ht = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
+		$total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
 		$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
 		$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', true);
 
@@ -1170,7 +1160,7 @@
 
 							$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true);
 
-							$total_localtax = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
+							$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
 
 							$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
 							$pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true);

########## core/modules/commande/doc/pdf_eratosthene.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php	2025-06-27 11:43:40.642905000 +0000
@@ -1214,41 +1214,33 @@
 		// Get Total HT
 		$total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
 
-		// Total discount
-		$total_discount_on_lines = 0;
-		$multicurrency_total_discount_on_lines = 0;
+		// Total remise
+		$total_line_remise = 0;
 		foreach ($object->lines as $i => $line) {
 			$resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2);
-			$multicurrency_resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2, 1);
-
-			$total_discount_on_lines += (is_numeric($resdiscount) ? $resdiscount : 0);
-			$multicurrency_total_discount_on_lines += (is_numeric($multicurrency_resdiscount) ? $multicurrency_resdiscount : 0);
-			// If line was a negative line, we do not count the discount as a discount
+			$total_line_remise += (is_numeric($resdiscount) ? $resdiscount : 0);
+			// Gestion remise sous forme de ligne négative
 			if ($line->total_ht < 0) {
-				$total_discount_on_lines += -$line->total_ht;
-				$multicurrency_total_discount_on_lines += -$line->multicurrency_total_ht;
+				$total_line_remise += -$line->total_ht;
 			}
 		}
+		$total_line_remise = (float) price2num($total_line_remise, 'MT', 1);
 
-		if ($total_discount_on_lines > 0) {
-			// Show total NET before discount
-			$pdf->SetFillColor(255, 255, 255);
-			$pdf->SetXY($col1x, $tab2_top);
-			$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true);
-			$pdf->SetXY($col2x, $tab2_top);
-
-			$total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines));
-			$pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true);
-
-			$index++;
-
+		if ($total_line_remise > 0) {
 			$pdf->SetFillColor(255, 255, 255);
 			$pdf->SetXY($col1x, $tab2_top + $tab2_hl);
 			$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
 			$pdf->SetXY($col2x, $tab2_top + $tab2_hl);
+			$pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true);
 
-			$total_discount_to_show = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines);
-			$pdf->MultiCell($largcol2, $tab2_hl, price($total_discount_to_show, 0, $outputlangs), 0, 'R', true);
+			$index++;
+
+			// Show total NET before discount
+			$pdf->SetFillColor(255, 255, 255);
+			$pdf->SetXY($col1x, $tab2_top);
+			$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true);
+			$pdf->SetXY($col2x, $tab2_top);
+			$pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true);
 
 			$index++;
 		}
@@ -1257,7 +1249,7 @@
 		$pdf->SetFillColor(255, 255, 255);
 		$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
 		$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', true);
-		$total_ht = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
+		$total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
 		$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
 		$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', true);
 
@@ -1265,7 +1257,6 @@
 		$pdf->SetFillColor(248, 248, 248);
 
 		$total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
-		$total_ttc_origin = $object->total_ttc;
 
 		$this->atleastoneratenotnull = 0;
 		if (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) {
@@ -1300,7 +1291,7 @@
 
 							$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true);
 
-							$total_localtax = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
+							$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
 
 							$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
 							$pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true);
@@ -1459,21 +1450,7 @@
 				$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalTTC", $mysoc->country_code) : ''), $useborder, 'L', true);
 
 				$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
-				if (!isModEnabled("multicurrency") || $object->multicurrency_tx == 1 || getDolGlobalInt('MULTICURRENCY_SHOW_ALSO_MAIN_CURRENCY_ON_PDF') == 0) {
-					$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true);
-				} else {
-					$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true);
-
-					//$pdf->writeHTMLCell($largcol2, $tab2_hl, null, null, '<font size="-2">('.price($sign * $object->total_ttc, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).')</font> &nbsp; '.price($sign * $total_ttc, 0, $outputlangs), $useborder, 1, true, true, 'R');
-					$index++;
-					$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
-					$pdf->SetTextColor(0, 0, 60);
-					$pdf->SetFillColor(224, 224, 224);
-					$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalTTC") : '').' ('.$outputlangs->getCurrencySymbol($mysoc->currency_code).')', $useborder, 'L', true);
-
-					$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
-					$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc_origin, 0, $outputlangs, 1, -1, -1, $mysoc->currency_code), $useborder, 'L', true);
-				}
+				$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true);
 			}
 		}
 

########## core/modules/expensereport/doc/pdf_standard_expensereport.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php	2025-06-27 11:43:40.779089000 +0000
@@ -713,7 +713,7 @@
 		$pdf->SetFont('', 'B', $default_font_size + 4);
 		$pdf->SetXY($posx, $posy);
 		$pdf->SetTextColor(0, 0, 60);
-		$pdf->MultiCell($this->page_largeur - $this->marge_droite - $posx, 6, $outputlangs->trans("ExpenseReport"), 0, 'R');
+		$pdf->MultiCell($this->page_largeur - $this->marge_droite - $posx, 6, $langs->trans("ExpenseReport"), 0, 'R');
 
 		$pdf->SetFont('', '', $default_font_size - 1);
 

########## core/modules/facture/doc/pdf_crabe.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/facture/doc/pdf_crabe.modules.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/facture/doc/pdf_crabe.modules.php	2025-06-27 11:43:40.518976000 +0000
@@ -1480,41 +1480,31 @@
 		// Get Total HT
 		$total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
 
-		// Total discount
-		$total_discount_on_lines = 0;
-		$multicurrency_total_discount_on_lines = 0;
+		// Total remise
+		$total_line_remise = 0;
 		foreach ($object->lines as $i => $line) {
 			$resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2);
-			$multicurrency_resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2, 1);
-
-			$total_discount_on_lines += (is_numeric($resdiscount) ? $resdiscount : 0);
-			$multicurrency_total_discount_on_lines += (is_numeric($multicurrency_resdiscount) ? $multicurrency_resdiscount : 0);
-			// If line was a negative line, we do not count the discount as a discount
+			$total_line_remise += (is_numeric($resdiscount) ? $resdiscount : 0);
+			// Gestion remise sous forme de ligne négative
 			if ($line->total_ht < 0) {
-				$total_discount_on_lines += -$line->total_ht;
-				$multicurrency_total_discount_on_lines += -$line->multicurrency_total_ht;
+				$total_line_remise += -$line->total_ht;
 			}
 		}
+		if ($total_line_remise > 0) {
+			$pdf->SetFillColor(255, 255, 255);
+			$pdf->SetXY($col1x, $tab2_top + $tab2_hl);
+			$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
+			$pdf->SetXY($col2x, $tab2_top + $tab2_hl);
+			$pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true);
+
+			$index++;
 
-		if ($total_discount_on_lines > 0) {
 			// Show total NET before discount
 			$pdf->SetFillColor(255, 255, 255);
 			$pdf->SetXY($col1x, $tab2_top);
 			$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true);
 			$pdf->SetXY($col2x, $tab2_top);
-
-			$total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines));
-			$pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true);
-
-			$index++;
-
-			$pdf->SetFillColor(255, 255, 255);
-			$pdf->SetXY($col1x, $tab2_top + $tab2_hl);
-			$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
-			$pdf->SetXY($col2x, $tab2_top + $tab2_hl);
-
-			$total_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines);
-			$pdf->MultiCell($largcol2, $tab2_hl, price($total_discount_to_show, 0, $outputlangs), 0, 'R', true);
+			$pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true);
 
 			$index++;
 		}
@@ -1524,7 +1514,7 @@
 		$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
 		$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total") : ''), 0, 'L', true);
 
-		$total_ht = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
+		$total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
 		$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
 		$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ht, 0, $outputlangs), 0, 'R', true);
 

########## core/modules/facture/doc/pdf_sponge.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/facture/doc/pdf_sponge.modules.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/facture/doc/pdf_sponge.modules.php	2025-06-27 11:43:40.514927000 +0000
@@ -1755,7 +1755,7 @@
 			}
 
 			if ($fac->type === Facture::TYPE_CREDIT_NOTE) {
-				$facSign = '-';
+				$facSign = '-'; // les avoirs
 			}
 
 
@@ -1798,41 +1798,31 @@
 		// Get Total HT
 		$total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
 
-		// Total discount
-		$total_discount_on_lines = 0;
-		$multicurrency_total_discount_on_lines = 0;
+		// Total remise
+		$total_line_remise = 0;
 		foreach ($object->lines as $i => $line) {
 			$resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2);
-			$multicurrency_resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2, 1);
-
-			$total_discount_on_lines += (is_numeric($resdiscount) ? $resdiscount : 0);
-			$multicurrency_total_discount_on_lines += (is_numeric($multicurrency_resdiscount) ? $multicurrency_resdiscount : 0);
-			// If line was a negative line, we do not count the discount as a discount
+			$total_line_remise += (is_numeric($resdiscount) ? $resdiscount : 0);
+			// Gestion remise sous forme de ligne négative
 			if ($line->total_ht < 0) {
-				$total_discount_on_lines += -$line->total_ht;
-				$multicurrency_total_discount_on_lines += -$line->multicurrency_total_ht;
+				$total_line_remise += -$line->total_ht;
 			}
 		}
+		if ($total_line_remise > 0) {
+			$pdf->SetFillColor(255, 255, 255);
+			$pdf->SetXY($col1x, $tab2_top + $tab2_hl);
+			$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
+			$pdf->SetXY($col2x, $tab2_top + $tab2_hl);
+			$pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true);
+
+			$index++;
 
-		if ($total_discount_on_lines > 0) {
 			// Show total NET before discount
 			$pdf->SetFillColor(255, 255, 255);
 			$pdf->SetXY($col1x, $tab2_top);
 			$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true);
 			$pdf->SetXY($col2x, $tab2_top);
-
-			$total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines));
-			$pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true);
-
-			$index++;
-
-			$pdf->SetFillColor(255, 255, 255);
-			$pdf->SetXY($col1x, $tab2_top + $tab2_hl);
-			$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
-			$pdf->SetXY($col2x, $tab2_top + $tab2_hl);
-
-			$total_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines);
-			$pdf->MultiCell($largcol2, $tab2_hl, price($total_discount_to_show, 0, $outputlangs), 0, 'R', true);
+			$pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true);
 
 			$index++;
 		}
@@ -1842,7 +1832,7 @@
 		$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
 		$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total") : ''), 0, 'L', true);
 
-		$total_ht = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
+		$total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
 		$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
 		$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ht, 0, $outputlangs), 0, 'R', true);
 
@@ -2068,7 +2058,7 @@
 
 							$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true);
 
-							$total_localtax = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
+							$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
 
 							$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
 							$pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true);
@@ -2097,17 +2087,8 @@
 				if (!isModEnabled("multicurrency") || $object->multicurrency_tx == 1 || getDolGlobalInt('MULTICURRENCY_SHOW_ALSO_MAIN_CURRENCY_ON_PDF') == 0) {
 					$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', true);
 				} else {
-					$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', true);
-
+					$pdf->MultiCell($largcol2, $tab2_hl, '('.price($sign * $total_ttc_origin, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).')   '.price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', true);
 					//$pdf->writeHTMLCell($largcol2, $tab2_hl, null, null, '<font size="-2">('.price($sign * $object->total_ttc, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).')</font> &nbsp; '.price($sign * $total_ttc, 0, $outputlangs), $useborder, 1, true, true, 'R');
-					$index++;
-					$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
-					$pdf->SetTextColor(0, 0, 60);
-					$pdf->SetFillColor(224, 224, 224);
-					$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalTTC") : '').' ('.$outputlangs->getCurrencySymbol($mysoc->currency_code).')', $useborder, 'L', true);
-
-					$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
-					$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc_origin, 0, $outputlangs, 1, -1, -1, $mysoc->currency_code), $useborder, 'L', true);
 				}
 
 				// Retained warranty
@@ -2169,18 +2150,11 @@
 			$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
 			$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Paid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("Paid") : ''), 0, 'L', false);
 			$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
-			//if (!isModEnabled("multicurrency") || $object->multicurrency_tx == 1 || getDolGlobalInt('MULTICURRENCY_SHOW_ALSO_MAIN_CURRENCY_ON_PDF') == 0) {
-			$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', false);
-			//} else {
-			//		$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', false);
-			//
-			//		$index++;
-			//		$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
-			//		$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Paid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("Paid") : '').' ('.$outputlangs->getCurrencySymbol($mysoc->currency_code).')', $useborder, 'L', true);
-
-			//		$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
-			//		$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle_origin + $depositsamount_origin, 0, $outputlangs, 1, -1, -1, $mysoc->currency_code), $useborder, 'L', true);
-			//}
+			if (!isModEnabled("multicurrency") || $object->multicurrency_tx == 1 || getDolGlobalInt('MULTICURRENCY_SHOW_ALSO_MAIN_CURRENCY_ON_PDF') == 0) {
+				$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', false);
+			} else {
+				$pdf->MultiCell($largcol2, $tab2_hl, '('.price($deja_regle_origin + $depositsamount_origin, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).')   '.price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', false);
+			}
 
 			// Credit note
 			if ($creditnoteamount) {
@@ -2215,17 +2189,7 @@
 			if (!isModEnabled("multicurrency") || $object->multicurrency_tx == 1 || getDolGlobalInt('MULTICURRENCY_SHOW_ALSO_MAIN_CURRENCY_ON_PDF') == 0) {
 				$pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', true);
 			} else {
-				$pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', true);
-
-				//$pdf->MultiCell($largcol2, $tab2_hl, '('.price($resteapayer_origin, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).')   '.price($resteapayer, 0, $outputlangs), 0, 'R', true);
-				$index++;
-				$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
-				$pdf->SetTextColor(0, 0, 60);
-				$pdf->SetFillColor(224, 224, 224);
-				$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RemainderToPay") : '').' ('.$outputlangs->getCurrencySymbol($mysoc->currency_code).')', $useborder, 'L', true);
-
-				$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
-				$pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer_origin, 0, $outputlangs, 1, -1, -1, $mysoc->currency_code), $useborder, 'L', true);
+				$pdf->MultiCell($largcol2, $tab2_hl, '('.price($resteapayer_origin, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).')   '.price($resteapayer, 0, $outputlangs), 0, 'R', true);
 			}
 
 			$pdf->SetFont('', '', $default_font_size - 1);

########## core/modules/hrm/doc/pdf_standard_evaluation.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php	2025-06-27 11:43:40.538886000 +0000
@@ -115,8 +115,7 @@
 	 */
 	public function __construct($db)
 	{
-		global $langs, $mysoc;
-
+		global $conf, $langs, $mysoc, $user;
 		// Translations
 		$langs->loadLangs(array("main", "hrm"));
 
@@ -306,8 +305,6 @@
 				$iniY = $tab_top + 7;
 				$nexY = $tab_top + 7;
 
-				$showmorebeforepagebreak = 0;
-
 				$pdf->setTopMargin($tab_top_newpage);
 				// Loop on each lines
 				$i = 0;
@@ -327,10 +324,10 @@
 					$curY = $nexY;
 					$pdf->startTransaction();
 
-					// Shod fields of line
 					$this->printLine($pdf, $object, $i, $curY, $default_font_size, $outputlangs, $hidedetails);
 
 
+
 					$pageposafter = $pdf->getPage();
 					if ($pageposafter > $pageposbefore) {
 						// There is a pagebreak
@@ -498,64 +495,39 @@
 	 */
 	protected function printLine(&$pdf, $object, $linenumber, $curY, $default_font_size, $outputlangs, $hidedetails = 0)
 	{
+		global $conf;
 		$objectligne = $object->lines[$linenumber];
 		$pdf->SetFont('', '', $default_font_size - 1);
 		$pdf->SetTextColor(0, 0, 0);
 
-		// Rank of employee
-		$rankemptoshow = "-";
-		if ($objectligne->rankorder > 0) {
-			$rankemptoshow = (string) $objectligne->rankorder;
-		} elseif ($objectligne->rankorder < 0) {
-			$rankemptoshow = $outputlangs->transnoentitiesnoconv("NA");
-		}
-		$pdf->SetXY($this->posxrankemp, $curY);
-		$pdf->MultiCell($this->posxrequiredrank - $this->posxrankemp - 0.8, 4, $rankemptoshow, 0, 'C');
-
-		// Expected required Rank
-		$rankexpectedtoshow = "-";
-		if ($objectligne->required_rank > 0) {
-			if ($objectligne->rankorder != 0) {
-				$rankexpectedtoshow = $objectligne->required_rank;
-			}
-		} elseif ($objectligne->required_rank < 0) {
-			$rankexpectedtoshow = $outputlangs->transnoentitiesnoconv("NA");
-		}
-		$pdf->SetXY($this->posxrequiredrank, $curY);
-		$pdf->MultiCell($this->posxresult - $this->posxrequiredrank - 0.8, 4, $rankexpectedtoshow, 0, 'C');
-
 		// Result
 		$pdf->SetXY($this->posxresult - 1, $curY);
 
-		if ($objectligne->required_rank < 0) {	// NA
-			$pdf->SetFillColor(255, 255, 255);
-		} elseif ($objectligne->rankorder > $objectligne->required_rank) {	// Higher than expected
+		if ($objectligne->rankorder > $objectligne->required_rank) {
 			// Teal Green
-			$pdf->SetFillColor(20, 129, 111);
-		} elseif ($objectligne->rankorder == $objectligne->required_rank) {	// Same than expected
+			$pdf->SetFillColor(0, 109, 91);
+		} elseif ($objectligne->rankorder == $objectligne->required_rank) {
 			// Seafoam Green
-			$pdf->SetFillColor(169, 236, 201);
-		} elseif ($objectligne->rankorder < $objectligne->required_rank) {	// Lower than expected
-			// Red
+			$pdf->SetFillColor(159, 226, 191);
+		} elseif ($objectligne->rankorder < $objectligne->required_rank) {
+			// red
 			$pdf->SetFillColor(205, 92, 92);
 		}
-		if ($objectligne->rankorder <= 0 || $objectligne->required_rank == 0) {
+		if ($objectligne->rankorder == 0 || $objectligne->required_rank == 0) {
 			// No fill color
-			$pdf->SetFillColor(240, 240, 240);
-		}
-		$result = "-";
-		if ($objectligne->required_rank < 0) {
-			if ($objectligne->rankorder > 0) {
-				$result = $objectligne->rankorder;
-			}
-		} elseif ($objectligne->rankorder < 0) {
-			$result = $outputlangs->transnoentitiesnoconv("NA");
-		} elseif ($objectligne->required_rank != 0 && $objectligne->rankorder != 0) {
-			$result = $objectligne->rankorder . "/" . $objectligne->required_rank;
+			$pdf->SetFillColor(255, 255, 255);
 		}
+		$result = (($objectligne->required_rank != 0 && $objectligne->rankorder != 0) ? $objectligne->rankorder . "/" . $objectligne->required_rank : "-");
 		$pdf->MultiCell($this->posxresult - 210 - 0.8 - 4, 4, $result, 0, 'C', true);
 
-		// The next fields can be on several lines so we output them at end so the pos on next line will work correctly
+
+		// required Rank
+		$pdf->SetXY($this->posxrequiredrank, $curY);
+		$pdf->MultiCell($this->posxresult - $this->posxrequiredrank - 0.8, 4, (($objectligne->required_rank != 0 && $objectligne->rankorder != 0) ? $objectligne->required_rank : "-"), 0, 'C');
+
+		// Rank Employee
+		$pdf->SetXY($this->posxrankemp, $curY);
+		$pdf->MultiCell($this->posxrequiredrank - $this->posxrankemp - 0.8, 4, (($objectligne->rankorder != 0) ? $objectligne->rankorder : "-"), 0, 'C');
 
 		// Skill
 		$skill = new Skill($this->db);
@@ -568,6 +540,8 @@
 		}
 		$pdf->writeHTMLCell($this->posxrankemp - $this->posxskill - 0.8, 4, $this->posxskill - 1, $curY, $comment, 0, 1);
 
+
+
 		// Line num
 		$pdf->SetXY($this->posxpiece, $curY);
 		$pdf->writeHTMLCell($this->posxskill - $this->posxpiece - 0.8, 3, $this->posxpiece - 1, $curY, (string) ($linenumber + 1), 0, 1, false, false, 'C');

########## core/modules/hrm/mod_evaluation_standard.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/hrm/mod_evaluation_standard.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/hrm/mod_evaluation_standard.php	2025-06-27 11:43:40.540971000 +0000
@@ -98,7 +98,7 @@
 		$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
 		if ($object->ismultientitymanaged == 1) {
 			$sql .= " AND entity = ".$conf->entity;
-		} elseif (!is_numeric($object->ismultientitymanaged)) {
+		} elseif ($object->ismultientitymanaged == 2) {
 			// TODO
 		}
 
@@ -136,7 +136,7 @@
 		$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
 		if ($object->ismultientitymanaged == 1) {
 			$sql .= " AND entity = ".$conf->entity;
-		} elseif (!is_numeric($object->ismultientitymanaged)) {
+		} elseif ($object->ismultientitymanaged == 2) {
 			// TODO
 		}
 

########## core/modules/modCron.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/modCron.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/modCron.class.php	2025-06-27 11:43:40.811188000 +0000
@@ -39,6 +39,8 @@
 	 */
 	public function __construct($db)
 	{
+		global $langs, $conf;
+
 		$this->db = $db;
 		$this->numero = 2300;
 
@@ -139,8 +141,8 @@
 								'url'=>'/cron/list.php?leftmenu=admintools',
 								'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
 								'position'=>500,
-								'enabled'=>'isModEnabled("cron") && preg_match(\'/^(admintools|all)/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
-								'perms'=>'$user->hasRight("cron", "read")', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
+								'enabled'=>'$conf->cron->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
+								'perms'=>'$user->rights->cron->read', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
 								'target'=>'',
 								'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
 		$r++;

########## core/modules/modMultiCurrency.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/modMultiCurrency.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/modMultiCurrency.class.php	2025-06-27 11:43:40.738613000 +0000
@@ -154,7 +154,7 @@
 				'parameters' => '0,0,cron',
 				'comment' => 'Update all the currencies using the currencylayer API. An API key needs to be given in the multi-currency module config page to have this job working.<br>First param is not used, Second parameter is 0 to update only already existing currency defined into the Multicurrency module or 1 to add any currency. Third parameter must be "cron".',
 				'frequency' => 1,
-				'unitfrequency' => 604800,
+				'unitfrequency' => 2678400,
 				'status' => $statusatinstall,
 				'test' => 'isModEnabled("cron")',
 				'datestart' => $datestart

########## core/modules/propale/doc/pdf_azur.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/propale/doc/pdf_azur.modules.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/propale/doc/pdf_azur.modules.php	2025-06-27 11:43:40.681909000 +0000
@@ -1111,8 +1111,7 @@
 	protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs, $outputlangsbis = null)
 	{
 		// phpcs:enable
-		global $mysoc;
-
+		global $conf, $mysoc;
 		$default_font_size = pdf_getPDFFontSize($outputlangs);
 
 		$tab2_top = $posy;
@@ -1133,41 +1132,31 @@
 		// Get Total HT
 		$total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
 
-		// Total discount
-		$total_discount_on_lines = 0;
-		$multicurrency_total_discount_on_lines = 0;
+		// Total remise
+		$total_line_remise = 0;
 		foreach ($object->lines as $i => $line) {
 			$resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2);
-			$multicurrency_resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2, 1);
-
-			$total_discount_on_lines += (is_numeric($resdiscount) ? $resdiscount : 0);
-			$multicurrency_total_discount_on_lines += (is_numeric($multicurrency_resdiscount) ? $multicurrency_resdiscount : 0);
-			// If line was a negative line, we do not count the discount as a discount
+			$total_line_remise += (is_numeric($resdiscount) ? $resdiscount : 0);
+			// Gestion remise sous forme de ligne négative
 			if ($line->total_ht < 0) {
-				$total_discount_on_lines += -$line->total_ht;
-				$multicurrency_total_discount_on_lines += -$line->multicurrency_total_ht;
+				$total_line_remise += -$line->total_ht;
 			}
 		}
+		if ($total_line_remise > 0) {
+			$pdf->SetFillColor(255, 255, 255);
+			$pdf->SetXY($col1x, $tab2_top + $tab2_hl);
+			$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
+			$pdf->SetXY($col2x, $tab2_top + $tab2_hl);
+			$pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true);
+
+			$index++;
 
-		if ($total_discount_on_lines > 0) {
 			// Show total NET before discount
 			$pdf->SetFillColor(255, 255, 255);
 			$pdf->SetXY($col1x, $tab2_top);
 			$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true);
 			$pdf->SetXY($col2x, $tab2_top);
-
-			$total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines));
-			$pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true);
-
-			$index++;
-
-			$pdf->SetFillColor(255, 255, 255);
-			$pdf->SetXY($col1x, $tab2_top + $tab2_hl);
-			$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
-			$pdf->SetXY($col2x, $tab2_top + $tab2_hl);
-
-			$total_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines);
-			$pdf->MultiCell($largcol2, $tab2_hl, price($total_discount_to_show, 0, $outputlangs), 0, 'R', true);
+			$pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true);
 
 			$index++;
 		}
@@ -1323,7 +1312,7 @@
 
 							$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true);
 
-							$total_localtax = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
+							$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
 
 							$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
 							$pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true);

########## core/modules/propale/doc/pdf_cyan.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/propale/doc/pdf_cyan.modules.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/propale/doc/pdf_cyan.modules.php	2025-06-27 11:43:40.684047000 +0000
@@ -1087,8 +1087,7 @@
 	 */
 	public function drawInfoTable(&$pdf, $object, $posy, $outputlangs)
 	{
-		global $mysoc;
-
+		global $conf, $mysoc;
 		$default_font_size = pdf_getPDFFontSize($outputlangs);
 
 		$pdf->SetFont('', '', $default_font_size - 1);
@@ -1302,41 +1301,31 @@
 		// Get Total HT
 		$total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
 
-		// Total discount
-		$total_discount_on_lines = 0;
-		$multicurrency_total_discount_on_lines = 0;
+		// Total remise
+		$total_line_remise = 0;
 		foreach ($object->lines as $i => $line) {
 			$resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2);
-			$multicurrency_resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2, 1);
-
-			$total_discount_on_lines += (is_numeric($resdiscount) ? $resdiscount : 0);
-			$multicurrency_total_discount_on_lines += (is_numeric($multicurrency_resdiscount) ? $multicurrency_resdiscount : 0);
-			// If line was a negative line, we do not count the discount as a discount
+			$total_line_remise += (is_numeric($resdiscount) ? $resdiscount : 0);
+			// Gestion remise sous forme de ligne négative
 			if ($line->total_ht < 0) {
-				$total_discount_on_lines += -$line->total_ht;
-				$multicurrency_total_discount_on_lines += -$line->multicurrency_total_ht;
+				$total_line_remise += -$line->total_ht;
 			}
 		}
+		if ($total_line_remise > 0) {
+			$pdf->SetFillColor(255, 255, 255);
+			$pdf->SetXY($col1x, $tab2_top + $tab2_hl);
+			$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
+			$pdf->SetXY($col2x, $tab2_top + $tab2_hl);
+			$pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true);
+
+			$index++;
 
-		if ($total_discount_on_lines > 0) {
 			// Show total NET before discount
 			$pdf->SetFillColor(255, 255, 255);
 			$pdf->SetXY($col1x, $tab2_top);
 			$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true);
 			$pdf->SetXY($col2x, $tab2_top);
-
-			$total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines));
-			$pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true);
-
-			$index++;
-
-			$pdf->SetFillColor(255, 255, 255);
-			$pdf->SetXY($col1x, $tab2_top + $tab2_hl);
-			$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
-			$pdf->SetXY($col2x, $tab2_top + $tab2_hl);
-
-			$total_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines);
-			$pdf->MultiCell($largcol2, $tab2_hl, price($total_discount_to_show, 0, $outputlangs), 0, 'R', true);
+			$pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true);
 
 			$index++;
 		}
@@ -1354,7 +1343,6 @@
 		$pdf->SetFillColor(248, 248, 248);
 
 		$total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
-		$total_ttc_origin = $object->total_ttc;
 
 		$this->atleastoneratenotnull = 0;
 		if (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) {
@@ -1535,21 +1523,7 @@
 				$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalTTC") : ''), $useborder, 'L', true);
 
 				$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
-				if (!isModEnabled("multicurrency") || $object->multicurrency_tx == 1 || getDolGlobalInt('MULTICURRENCY_SHOW_ALSO_MAIN_CURRENCY_ON_PDF') == 0) {
-					$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true);
-				} else {
-					$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true);
-
-					//$pdf->writeHTMLCell($largcol2, $tab2_hl, null, null, '<font size="-2">('.price($sign * $object->total_ttc, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).')</font> &nbsp; '.price($sign * $total_ttc, 0, $outputlangs), $useborder, 1, true, true, 'R');
-					$index++;
-					$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
-					$pdf->SetTextColor(0, 0, 60);
-					$pdf->SetFillColor(224, 224, 224);
-					$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalTTC") : '').' ('.$outputlangs->getCurrencySymbol($mysoc->currency_code).')', $useborder, 'L', true);
-
-					$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
-					$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc_origin, 0, $outputlangs, 1, -1, -1, $mysoc->currency_code), $useborder, 'L', true);
-				}
+				$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true);
 			}
 		}
 

########## core/modules/societe/doc/doc_generic_odt.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php	2025-06-27 11:43:40.441120000 +0000
@@ -95,7 +95,7 @@
 	 */
 	public function info($langs)
 	{
-		global $langs;
+		global $conf, $langs;
 
 		// Load traductions files required by page
 		$langs->loadLangs(array("companies", "errors"));

########## core/modules/stocktransfer/mod_stocktransfer_standard.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php	2025-06-27 11:43:40.463911000 +0000
@@ -99,7 +99,7 @@
 		$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
 		if ($object->ismultientitymanaged == 1) {
 			$sql .= " AND entity = ".$conf->entity;
-		} elseif (!is_numeric($object->ismultientitymanaged)) {
+		} elseif ($object->ismultientitymanaged == 2) {
 			// TODO
 		}
 
@@ -137,7 +137,7 @@
 		$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
 		if ($object->ismultientitymanaged == 1) {
 			$sql .= " AND entity = ".$conf->entity;
-		} elseif (!is_numeric($object->ismultientitymanaged)) {
+		} elseif ($object->ismultientitymanaged == 2) {
 			// TODO
 		}
 

########## core/modules/workstation/mod_workstation_standard.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/workstation/mod_workstation_standard.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/workstation/mod_workstation_standard.php	2025-06-27 11:43:40.632264000 +0000
@@ -97,7 +97,7 @@
 		$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."-%'";
 		if ($object->ismultientitymanaged == 1) {
 			$sql .= " AND entity = ".$conf->entity;
-		} elseif (!is_numeric($object->ismultientitymanaged)) {
+		} elseif ($object->ismultientitymanaged == 2) {
 			// TODO
 		}
 

########## core/tpl/login.tpl.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/tpl/login.tpl.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/tpl/login.tpl.php	2025-06-27 11:43:40.140838000 +0000
@@ -148,20 +148,12 @@
 	'/core/js/dst.js'.(empty($conf->dol_use_jmobile) ? '' : '?version='.urlencode(DOL_VERSION))
 );
 
-// We display application title
-$application = constant('DOL_APPLICATION_TITLE');
-$applicationcustom = getDolGlobalString('MAIN_APPLICATION_TITLE');
-if ($applicationcustom) {
-	$application = (preg_match('/^\+/', $applicationcustom) ? $application : '').$applicationcustom;
-}
-
-// We define login title
-if ($applicationcustom) {
-	$titleofloginpage = $langs->trans('Login').' '.$application;
+// We display application title instead Login term
+if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
+	$titleofloginpage = getDolGlobalString('MAIN_APPLICATION_TITLE');
 } else {
 	$titleofloginpage = $langs->trans('Login');
 }
-// Title of HTML page must have pattern ' @ (?:Doli[a-zA-Z]+ |)(\\d+)\\.(\\d+)\\.([^\\s]+)' to be detected as THE login page by webviews.
 $titleofloginpage .= ' @ '.$titletruedolibarrversion; // $titletruedolibarrversion is defined by dol_loginfunction in security2.lib.php. We must keep the @, some tools use it to know it is login page and find true dolibarr version.
 
 $disablenofollow = 1;
@@ -264,12 +256,12 @@
 
 
 <!-- Title with version -->
-<div class="login_table_title center" tabindex="-1" title="<?php echo dolPrintHTMLForAttribute($title); ?>">
+<div class="login_table_title center" tabindex="-1" title="<?php echo dol_escape_htmltag($title); ?>">
 <?php
 if ($disablenofollow) {
 	echo '<a class="login_table_title" tabindex="-1" href="https://www.dolibarr.org" target="_blank" rel="noopener noreferrer external">';
 }
-echo dolPrintHTML($title);
+echo dol_escape_htmltag($title);
 if ($disablenofollow) {
 	echo '</a>';
 }

########## core/tpl/massactions_pre.tpl.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/tpl/massactions_pre.tpl.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/tpl/massactions_pre.tpl.php	2025-06-27 11:43:40.142035000 +0000
@@ -333,7 +333,7 @@
 	// Make substitution in email content
 	$substitutionarray = getCommonSubstitutionArray($langs, 0, null, $object);
 
-	$substitutionarray['__EMAIL__'] = empty($sendto) ? '__EMAIL__' : $sendto;
+	$substitutionarray['__EMAIL__'] = $sendto;
 	$substitutionarray['__CHECK_READ__'] = '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag=undefined&securitykey='.dol_hash(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY')."-undefined", 'md5').'" width="1" height="1" style="width:1px;height:1px" border="0"/>';
 	$substitutionarray['__ONLINE_PAYMENT_URL__'] = 'UrlToPayOnlineIfApplicable';
 	$substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__'] = 'TextAndUrlToPayOnlineIfApplicable';

########## core/tpl/objectline_create.tpl.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/tpl/objectline_create.tpl.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/tpl/objectline_create.tpl.php	2025-06-27 11:43:40.121206000 +0000
@@ -26,29 +26,25 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ * Need to have the following variables defined:
+ * $object (invoice, order, ...)
+ * $conf
+ * $langs
+ * $dateSelector
+ * $forceall (0 by default, 1 for supplier invoices/orders)
+ * $senderissupplier (0 by default, 1 or 2 for supplier invoices/orders)
+ * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
  */
-
 /**
- * @var Conf $conf
  * @var CommonObject $this
  * @var CommonObject $object
  * @var CommonObjectLine $line
- * @var ExtraFields $extrafields
  * @var Form $form
  * @var HookManager $hookmanager
  * @var Translate $langs
  * @var User $user
- * @var Societe $buyer
- * @var Societe $seller
- *
- * @var string $action
- * @var string $usehm
- * @var int $dateSelector
- * @var int $forceall (0 by default, 1 for supplier invoices/orders)
- * @var int $senderissupplier (0 by default, 1 or 2 for supplier invoices/orders)
- * @var int $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
  */
-
 // Protection to avoid direct call of template
 if (empty($object) || !is_object($object)) {
 	print "Error: this template page cannot be called directly as an URL";
@@ -631,18 +627,18 @@
 	}
 
 	if (!$date_start) {
-		if (getDolGlobalString('MAIN_DEFAULT_DATE_START_HOUR') != '') {
+		if (isset($conf->global->MAIN_DEFAULT_DATE_START_HOUR)) {
 			print 'jQuery("#date_starthour").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_START_HOUR').'");';
 		}
-		if (getDolGlobalString('MAIN_DEFAULT_DATE_START_MIN') != '') {
+		if (isset($conf->global->MAIN_DEFAULT_DATE_START_MIN)) {
 			print 'jQuery("#date_startmin").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_START_MIN').'");';
 		}
 	}
 	if (!$date_end) {
-		if (getDolGlobalString('MAIN_DEFAULT_DATE_END_HOUR')) {
+		if (isset($conf->global->MAIN_DEFAULT_DATE_END_HOUR)) {
 			print 'jQuery("#date_endhour").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_END_HOUR').'");';
 		}
-		if (getDolGlobalString('MAIN_DEFAULT_DATE_END_MIN')) {
+		if (isset($conf->global->MAIN_DEFAULT_DATE_END_MIN)) {
 			print 'jQuery("#date_endmin").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_END_MIN').'");';
 		}
 	}

########## core/tpl/objectline_edit.tpl.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/tpl/objectline_edit.tpl.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/tpl/objectline_edit.tpl.php	2025-06-27 11:43:40.122882000 +0000
@@ -36,20 +36,15 @@
  */
 
 /**
- * @var Conf $conf
+ * @var CommonObject $this
+ * @var CommonObject $object
+ * @var CommonObjectLine $line
  * @var Form $form
  * @var HookManager $hookmanager
  * @var Translate $langs
  * @var User $user
- * @var ExtraFields $extrafields
- * @var CommonObject $this
- * @var CommonObject $object
- * @var CommonObjectLine $line
  * @var Societe $seller
  * @var Societe $buyer
- *
- * @var string $action
- * @var int	$dateSelector
  */
 
 // Protection to avoid direct call of template
@@ -413,7 +408,7 @@
 			}
 		}
 	}
-	$hourmin = getDolGlobalInt('MAIN_USE_HOURMIN_IN_DATE_RANGE');
+	$hourmin = (isset($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE : '');
 	print $form->selectDate($line->date_start, 'date_start', $hourmin, $hourmin, $line->date_start ? 0 : 1, "updateline", 1, 0);
 	print ' '.$langs->trans('to').' ';
 	print $form->selectDate($line->date_end, 'date_end', $hourmin, $hourmin, $line->date_end ? 0 : 1, "updateline", 1, 0);
@@ -440,10 +435,12 @@
 		<?php
 	}
 	if (!$line->date_start) {
-		if (getDolGlobalString('MAIN_DEFAULT_DATE_START_HOUR') != '') {
+		if (isset($conf->global->MAIN_DEFAULT_DATE_START_HOUR)) {
 			print 'jQuery("#date_starthour").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_START_HOUR').'");';
 		}
-		if (getDolGlobalString('MAIN_DEFAULT_DATE_START_MIN') != '') {
+
+
+		if (isset($conf->global->MAIN_DEFAULT_DATE_START_MIN)) {
 			print 'jQuery("#date_startmin").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_START_MIN').'");';
 		}
 
@@ -458,10 +455,10 @@
 		}
 	}
 	if (!$line->date_end) {
-		if (getDolGlobalString('MAIN_DEFAULT_DATE_END_HOUR') != '') {
+		if (isset($conf->global->MAIN_DEFAULT_DATE_END_HOUR)) {
 			print 'jQuery("#date_endhour").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_END_HOUR').'");';
 		}
-		if (getDolGlobalString('MAIN_DEFAULT_DATE_END_MIN') != '') {
+		if (isset($conf->global->MAIN_DEFAULT_DATE_END_MIN)) {
 			print 'jQuery("#date_endmin").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_END_MIN').'");';
 		}
 

########## core/tpl/objectline_title.tpl.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/tpl/objectline_title.tpl.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/tpl/objectline_title.tpl.php	2025-06-27 11:43:40.124049000 +0000
@@ -42,7 +42,6 @@
  * @var Form $form
  * @var HookManager $hookmanager
  * @var Translate $langs
- * @var Conf $conf
  * @var User $user
  */
 
@@ -122,7 +121,7 @@
 
 // Multicurrency
 if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) {
-	print '<th class="linecoluht_currency right" style="width: 80px">'.$langs->trans('PriceUTTC').' ('.$langs->getCurrencySymbol($this->multicurrency_code).')</th>';
+	print '<th class="linecoluht_currency right" style="width: 80px">'.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).'</th>';
 }
 
 if (!empty($inputalsopricewithtax) && !getDolGlobalInt('MAIN_NO_INPUT_PRICE_WITH_TAX')) {
@@ -211,7 +210,7 @@
 
 // Multicurrency
 if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) {
-	print '<th class="linecoltotalht_currency right">'.$langs->trans('TotalHTShort').' ('.$langs->getCurrencySymbol($this->multicurrency_code).')</th>';
+	print '<th class="linecoltotalht_currency right">'.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).'</th>';
 }
 
 if ($outputalsopricetotalwithtax) {

########## core/tpl/objectline_view.tpl.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/tpl/objectline_view.tpl.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/tpl/objectline_view.tpl.php	2025-06-27 11:43:40.125311000 +0000
@@ -26,7 +26,10 @@
  *
  * Need to have the following variables defined:
  * $object (invoice, order, ...)
+ * $conf
+ * $langs
  * $dateSelector
+ * $forceall (0 by default, 1 for supplier invoices/orders)
  * $element     (used to test $user->rights->$element->creer)
  * $permtoedit  (used to replace test $user->rights->$element->creer)
  * $senderissupplier (0 by default, 1 for supplier invoices/orders)
@@ -51,9 +54,9 @@
  *
  * @var string $action
  * @var int $i
- * @var int $forceall
+ * @var 0|1 $forceall
  * @var int $num
- * @var int $senderissupplier
+ * @var 0|1 $senderissupplier
  * @var string $text
  * @var string $description
  */

########## core/triggers/interface_50_modAgenda_ActionsAuto.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php	2025-06-27 11:43:40.938603000 +0000
@@ -1603,7 +1603,7 @@
 		// Insertion action
 		require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
 		$actioncomm = new ActionComm($this->db);
-		$actioncomm->type_code   = $object->actiontypecode; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_TICKET_CREATE', 'AC_XXX'...)
+		$actioncomm->type_code   = $object->actiontypecode; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
 		$actioncomm->code        = 'AC_'.$action;
 		$actioncomm->label       = $object->actionmsg2;		// Label of event
 		$actioncomm->note_private = $object->actionmsg;		// Description
@@ -1616,19 +1616,14 @@
 		$actioncomm->contact_id  = $contactforactionid; // deprecated, now managed by setting $actioncomm->socpeopleassigned later
 		$actioncomm->authorid    = $user->id; // User saving action
 		$actioncomm->userownerid = $user->id; // Owner of action
-
 		// Fields defined when action is an email (content should be into object->actionmsg to be added into event note, subject should be into object->actionmsg2 to be added into event label)
 		if (!property_exists($object, 'email_fields_no_propagate_in_actioncomm') || empty($object->email_fields_no_propagate_in_actioncomm)) {
-			'@phan-var-force ActionComm $object';  // TODO: None of the dolibarr classes has all the fields, check class type or properties (email_date)
-			// If event is to record a message after an email received, we use the date of email as date of event.
-			if (!empty($object->email_date) && $actioncomm->type_code === 'AC_TICKET_CREATE') {
-				$actioncomm->datep         = $object->email_date;
-				$actioncomm->datef         = $object->email_date;
-			}
+			'@phan-var-force ActionComm $object';  // TODO: Non of the dolibarr classes has all the fields, check class type or properties (email_date)
+			$actioncomm->datep         = empty($object->email_date) ? $now : $object->email_date;
+			$actioncomm->datef         = empty($object->email_date) ? $now : $object->email_date;
 			$actioncomm->email_msgid   = empty($object->email_msgid) ? null : $object->email_msgid;
 			$actioncomm->email_from    = empty($object->email_from) ? null : $object->email_from;
-			$actioncomm->email_reply_to = empty($object->email_reply_to) ? null : $object->email_reply_to;
-			$actioncomm->email_subject = empty($object->email_subject) ? null : $object->email_subject;
+			$actioncomm->email_sender  = empty($object->email_sender) ? null : $object->email_sender;
 			$actioncomm->email_to      = empty($object->email_to) ? null : $object->email_to;
 			$actioncomm->email_tocc    = empty($object->email_tocc) ? null : $object->email_tocc;
 			$actioncomm->email_tobcc   = empty($object->email_tobcc) ? null : $object->email_tobcc;
@@ -1662,8 +1657,6 @@
 			}
 		}
 
-		$actioncomm->ip = getUserRemoteIP(1);
-
 		$ret = $actioncomm->create($user); // User creating action
 
 		if ($ret > 0 && getDolGlobalString('MAIN_COPY_FILE_IN_EVENT_AUTO')) {

########## core/triggers/interface_50_modEventOrganization_EventOrganization.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php	2025-06-27 11:43:40.944594000 +0000
@@ -71,7 +71,7 @@
 	 */
 	public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
 	{
-		if (!isModEnabled('eventorganization')) {
+		if (empty($conf->eventorganization) || empty($conf->eventorganization->enabled)) {
 			return 0; // Module not active, we do nothing
 		}
 

########## core/triggers/interface_50_modTicket_TicketEmail.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php	2025-06-27 11:43:40.949377000 +0000
@@ -65,7 +65,7 @@
 
 		$ok = 0;
 
-		if (!isModEnabled('ticket')) {
+		if (empty($conf->ticket) || !isModEnabled('ticket')) {
 			return 0; // Module not active, we do nothing
 		}
 

########## core/triggers/interface_80_modStripe_Stripe.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php	2025-06-27 11:43:40.951309000 +0000
@@ -81,7 +81,7 @@
 
 		$service = 'StripeTest';
 		$servicestatus = 0;
-		if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha') */) {
+		if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
 			$service = 'StripeLive';
 			$servicestatus = 1;
 		}

########## cron/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/cron/card.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/cron/card.php	2025-06-27 11:43:40.016269000 +0000
@@ -438,7 +438,7 @@
 	print '<tr><td class="fieldrequired">';
 	print $langs->trans('CronEvery')."</td>";
 	print "<td>";
-	print '<select name="nbfrequency" id="nbfrequency" class="width50 maxwidth50imp">';
+	print '<select name="nbfrequency">';
 	for ($i = 1; $i <= 60; $i++) {
 		if ($object->frequency == $i) {
 			print "<option value='".$i."' selected>".$i."</option>";
@@ -447,8 +447,7 @@
 		}
 	}
 	print "</select>";
-	print ajax_combobox('nbfrequency');
-	$input = " &nbsp;<input type=\"radio\" name=\"unitfrequency\" value=\"60\" id=\"frequency_minute\" ";
+	$input = " <input type=\"radio\" name=\"unitfrequency\" value=\"60\" id=\"frequency_minute\" ";
 	if ($object->unitfrequency == "60") {
 		$input .= ' checked />';
 	} else {
@@ -457,7 +456,7 @@
 	$input .= "<label for=\"frequency_minute\">".$langs->trans('Minutes')."</label>";
 	print $input;
 
-	$input = " &nbsp;<input type=\"radio\" name=\"unitfrequency\" value=\"3600\" id=\"frequency_heures\" ";
+	$input = " <input type=\"radio\" name=\"unitfrequency\" value=\"3600\" id=\"frequency_heures\" ";
 	if ($object->unitfrequency == "3600") {
 		$input .= ' checked />';
 	} else {
@@ -466,7 +465,7 @@
 	$input .= "<label for=\"frequency_heures\">".$langs->trans('Hours')."</label>";
 	print $input;
 
-	$input = " &nbsp;<input type=\"radio\" name=\"unitfrequency\" value=\"86400\" id=\"frequency_jours\" ";
+	$input = " <input type=\"radio\" name=\"unitfrequency\" value=\"86400\" id=\"frequency_jours\" ";
 	if ($object->unitfrequency == "86400") {
 		$input .= ' checked />';
 	} else {
@@ -475,7 +474,7 @@
 	$input .= "<label for=\"frequency_jours\">".$langs->trans('Days')."</label>";
 	print $input;
 
-	$input = " &nbsp;<input type=\"radio\" name=\"unitfrequency\" value=\"604800\" id=\"frequency_semaine\" ";
+	$input = " <input type=\"radio\" name=\"unitfrequency\" value=\"604800\" id=\"frequency_semaine\" ";
 	if ($object->unitfrequency == "604800") {
 		$input .= ' checked />';
 	} else {
@@ -484,7 +483,7 @@
 	$input .= "<label for=\"frequency_semaine\">".$langs->trans('Weeks')."</label>";
 	print $input;
 
-	$input = " &nbsp;<input type=\"radio\" name=\"unitfrequency\" value=\"2678400\" id=\"frequency_month\" ";
+	$input = " <input type=\"radio\" name=\"unitfrequency\" value=\"2678400\" id=\"frequency_month\" ";
 	if ($object->unitfrequency == "2678400") {
 		$input .= ' checked />';
 	} else {

########## datapolicy/admin/setup.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/datapolicy/admin/setup.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/datapolicy/admin/setup.php	2025-06-27 11:43:40.027418000 +0000
@@ -2,7 +2,7 @@
 /* Copyright (C) 2004-2017 Laurent Destailleur  <eldy@users.sourceforge.net>
  * Copyright (C) 2018      Nicolas ZABOURI      <info@inovea-conseil.com>
  * Copyright (C) 2024      MDW                  <mdeweerd@users.noreply.github.com>
- * Copyright (C) 2024      Frédéric France         <frederic.france@free.fr>
+ * Copyright (C) 2024       Frédéric France         <frederic.france@free.fr>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -39,7 +39,7 @@
  */
 
 // Translations
-$langs->loadLangs(array('admin', 'companies', 'cron', 'members', 'datapolicy'));
+$langs->loadLangs(array('admin', 'companies', 'members', 'datapolicy'));
 
 // Parameters
 $action = GETPOST('action', 'aZ09');

########## don/class/api_donations.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/don/class/api_donations.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/don/class/api_donations.class.php	2025-06-27 11:43:41.457876000 +0000
@@ -110,7 +110,7 @@
 		$obj_ret = array();
 
 		// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
-		$socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids;
+		$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
 
 		$sql = "SELECT t.rowid";
 		if ((!DolibarrApiAccess::$user->hasRight('societe', 'client', 'voir') && !$socids)) {

########## don/paiement/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/don/paiement/list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/don/paiement/list.php	2025-06-27 11:43:41.465542000 +0000
@@ -87,8 +87,6 @@
 
 $search_all = trim(GETPOST('search_all', 'alphanohtml'));
 
-$object = new Don($db);
-
 $morejs = array();
 $morecss = array();
 
@@ -165,6 +163,7 @@
  */
 
 $form = new Form($db);
+$donationstatic = new Don($db);
 $companystatic = new Societe($db);
 $bankline = new AccountLine($db);
 $accountstatic = new Account($db);
@@ -472,7 +471,7 @@
 	$totalarray['nbfield']++;
 }
 if (!empty($arrayfields['pd.num_paiement']['checked'])) {
-	print_liste_field_titre($arrayfields['pd.num_paiement']['label'], $_SERVER["PHP_SELF"], "pd.num_payment", '', $param, '', $sortfield, $sortorder, '', $arrayfields['pd.num_paiement']['tooltip']);
+	print_liste_field_titre($arrayfields['pd.num_paiement']['label'], $_SERVER["PHP_SELF"], "pd.num_payment", '', $param, '', $sortfield, $sortorder, '', $arrayfields['p.num_paiement']['tooltip']);
 	$totalarray['nbfield']++;
 }
 if (!empty($arrayfields['transaction']['checked'])) {
@@ -566,7 +565,7 @@
 		if ($obj->soc_id > 0) {
 			print $companystatic->getNomUrl(1, '', 24);
 		} else {
-			print $object->societe = $obj->societe;
+			print $donationstatic->societe = $obj->societe;
 		}
 		print '</td>';
 		if (!$i) {

########## emailcollector/class/emailcollector.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/emailcollector/class/emailcollector.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/emailcollector/class/emailcollector.class.php	2025-06-27 11:43:39.449201000 +0000
@@ -513,6 +513,8 @@
 	 */
 	public function fetchAll(User $user, $activeOnly = 0, $sortfield = 's.rowid', $sortorder = 'ASC', $limit = 100, $page = 0)
 	{
+		global $langs;
+
 		$obj_ret = array();
 
 		$sql = "SELECT s.rowid";
@@ -546,6 +548,7 @@
 		} else {
 			$this->errors[] = 'EmailCollector::fetchAll Error when retrieve emailcollector list';
 			dol_syslog('EmailCollector::fetchAll Error when retrieve emailcollector list', LOG_ERR);
+			$ret = -1;
 		}
 		if (!count($obj_ret)) {
 			dol_syslog('EmailCollector::fetchAll No emailcollector found', LOG_DEBUG);
@@ -1847,9 +1850,7 @@
 					$trackidfoundintomsgidid = $reg[1];
 				}
 
-				// Now apply some filters.
-
-				//If there is an emailcollector filter on trackid
+				// If there is an emailcollecter filter on trackid
 				if ($searchfilterdoltrackid > 0) {
 					if (empty($trackidfoundintorecipienttype) && empty($trackidfoundintomsgidtype)) {
 						if (empty($headers['References']) || !preg_match('/@'.preg_quote($host, '/').'/', $headers['References'])) {
@@ -1944,8 +1945,7 @@
 
 
 				if (getDolGlobalString('MAIN_IMAP_USE_PHPIMAP')) {
-					$dateformated = dol_print_date($overview['date'], 'dayrfc', 'gmt');		// May generate a warning "dol_print_date($overview['date'], 'dayrfc', 'gmt')" in log
-					dol_syslog("msgid=".$overview['message_id']." date=".$dateformated." from=".$overview['from']." to=".$overview['to']." subject=".$overview['subject']);
+					dol_syslog("msgid=".$overview['message_id']." date=".dol_print_date($overview['date'], 'dayrfc', 'gmt')." from=".$overview['from']." to=".$overview['to']." subject=".$overview['subject']);
 
 					// Removed emojis
 					$overview['subject'] = removeEmoji($overview['subject'], getDolGlobalInt('MAIN_EMAIL_COLLECTOR_ACCEPT_EMOJIS', 1));
@@ -2159,8 +2159,6 @@
 				// var_dump($headers['References']);
 				// var_dump($arrayofreferences);
 
-				// We loop on References, but as soon as we found one that allow us to find an existing object,
-				// we do a break (See line with comment "Exit loop of references").
 				foreach ($arrayofreferences as $reference) {
 					//print "Process mail ".$iforemailloop." email_msgid ".$msgid.", date ".dol_print_date($dateemail, 'dayhour', 'gmt').", subject ".$subject.", reference ".dol_escape_htmltag($reference)."<br>\n";
 					if (!empty($trackidfoundintorecipienttype)) {
@@ -2322,7 +2320,7 @@
 								$projectid = $objectemail->id;
 							}
 
-							if ($objectemail instanceof Ticket) {	// For tickets, we have a column to store all met references, so we complete it if we need to.
+							if ($objectemail instanceof Ticket) {
 								$ticketid = $objectemail->id;
 
 								$changeonticket_references = false;
@@ -2341,8 +2339,7 @@
 									}
 								}
 								if ($changeonticket_references) {
-									$operationslog .= '<br>We complete ticket ID='.$ticketid.' with property origin_references='.$objectemail->origin_references;
-									$objectemail->update($user, 1);		// We complete the references field with all references mentioned into this email. This field is for technical tracking purpose, not a user field, so no need to execute triggers
+									$objectemail->update($user, 1);		// We complete the references field, that is a field for technical tracking purpose, not a user field, so no need to execute triggers
 								}
 							}
 						}
@@ -2455,8 +2452,7 @@
 				 }
 				 */
 
-
-				// Now do all operations for the email (extract variables and creating data)
+				// Do operations (extract variables and creating data)
 				if ($mode < 2) {	// 0=Mode production, 1=Mode test (read IMAP and try SQL update then rollback), 2=Mode test with no SQL updates
 					foreach ($this->actions as $operation) {
 						$errorforthisaction = 0;
@@ -2513,10 +2509,7 @@
 							$tickettocreate = new Ticket($this->db);
 							$errorfetchticket = 0;
 							$alreadycreated = 0;
-							if ($ticketid > 0) {
-								$alreadycreated = $tickettocreate->fetch($ticketid);
-							}
-							if ($alreadycreated == 0 && !empty($trackid)) {
+							if (!empty($trackid)) {
 								$alreadycreated = $tickettocreate->fetch(0, '', $trackid);
 							}
 							if ($alreadycreated == 0 && !empty($msgid)) {
@@ -2530,7 +2523,7 @@
 									$operationslog .= '<br>Ticket not found using trackid='.$trackid.' or msgid='.$msgid;
 									$ticketalreadyexists = 0;
 								} else {
-									$operationslog .= '<br>Ticket already found using trackid='.$trackid.' or msgid='.$msgid.", we replace operation 'ticket' with 'recordevent' to add a new message";	// We change the operation type to do
+									$operationslog .= '<br>Ticket already found using trackid='.$trackid.' or msgid='.$msgid;	// We change the operation type to do
 									$ticketalreadyexists = 1;
 									$operation['type'] = 'recordevent';
 								}
@@ -2539,15 +2532,11 @@
 							}
 						}
 
-						// Process now the operation according to its type
+						// Process now the operation type
 
 						// Search and create thirdparty
 						if ($operation['type'] == 'loadthirdparty' || $operation['type'] == 'loadandcreatethirdparty') {
-							if ($thirdpartyid > 0) {
-								// We already have found the thirdparty id to load, so we bypass the action loadthirdparty
-								$idtouseforthirdparty = $thirdpartyid;
-								$operationslog .= '<br>We already have found a related thirdparty id, so we bypass the action loadthirdparty and use idtouseforthirdparty='.$idtouseforthirdparty;
-							} elseif (empty($operation['actionparam'])) {
+							if (empty($operation['actionparam'])) {
 								$errorforactions++;
 								$this->error = "Action loadthirdparty or loadandcreatethirdparty has empty parameter. Must be a rule like 'name=HEADER:^From:(.*);' or 'name=SET:xxx' or 'name=EXTRACT:(body|subject):regex where 'name' can be replaced with 'id' or 'email' to define how to set or extract data. More properties can also be set, for example client=SET:2;";
 								$this->errors[] = $this->error;
@@ -2877,7 +2866,7 @@
 
 							$alreadycreated = $actioncomm->fetch(0, '', '', $msgid);
 							if ($alreadycreated == 0) {
-								$operationslog .= '<br>We did not find existing actioncomm with msgid='.$msgid;
+								$operationslog .= '<br>We did not find existing actionmail with msgid='.$msgid;
 
 								if ($projectstatic->id > 0) {
 									if ($projectfoundby) {
@@ -2990,8 +2979,6 @@
 										$operationslog .= '<br>Event created -> id='.dol_escape_htmltag((string) $actioncomm->id);
 									}
 								}
-							} else {
-								$operationslog .= '<br>An event in actioncomm table already exists for the msgid = '.$msgid.' so we bypass this action.';
 							}
 						} elseif ($operation['type'] == 'recordjoinpiece') {
 							$data = [];
@@ -3469,11 +3456,6 @@
 										}
 									}
 								}
-							} else {
-								// Do nothing in action ticket if ticket already exists.
-								// Note that if we want to add a new event to a ticket, we should have a collector with action "Record event in agenda" or hope the type of action 'ticket' was
-								// already replaced automatically by operation "recordevent".
-								$operationslog .= '<br>Ticket already exists, so we bypass action "ticket"';
 							}
 						} elseif ($operation['type'] == 'candidature') {
 							// Create candidature

########## eventorganization/class/conferenceorbooth.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/eventorganization/class/conferenceorbooth.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/eventorganization/class/conferenceorbooth.class.php	2025-06-27 11:43:41.426304000 +0000
@@ -332,7 +332,7 @@
 
 		// Manage filter
 		if (is_array($filter)) {	// deprecated, use $filter = USF syntax
-			dol_syslog("You are using a deprecated use of fetchAll. filter parameter must be an USF string now.", LOG_WARNING);
+			dol_syslog("You are using a deprecated use of fetchAll. filter parameter mus be an USF string now.", LOG_WARNING);
 			$sqlwhere = array();
 			if (count($filter) > 0) {
 				foreach ($filter as $key => $value) {

########## eventorganization/class/conferenceorboothattendee.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/eventorganization/class/conferenceorboothattendee.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/eventorganization/class/conferenceorboothattendee.class.php	2025-06-27 11:43:41.429455000 +0000
@@ -476,7 +476,7 @@
 
 		// Manage filter
 		if (is_array($filter)) {	// deprecated, use $filter = USF syntax
-			dol_syslog("You are using a deprecated use of fetchAll. filter parameter must be an USF string now.", LOG_WARNING);
+			dol_syslog("You are using a deprecated use of fetchAll. filter parameter mus be an USF string now.", LOG_WARNING);
 			$sqlwhere = array();
 			if (count($filter) > 0) {
 				foreach ($filter as $key => $value) {

########## expedition/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/expedition/card.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/expedition/card.php	2025-06-27 11:43:46.888812000 +0000
@@ -213,7 +213,7 @@
 			setEventMessages($object->error, $object->errors, 'errors');
 		}
 
-		$result = $object->setValueFrom('ref_customer', GETPOST('ref_customer', 'alpha'), '', null, 'text', '', $user, 'SHIPPING_MODIFY');
+		$result = $object->setValueFrom('ref_customer', GETPOST('ref_customer', 'alpha'), '', null, 'text', '', $user, 'SHIPMENT_MODIFY');
 		if ($result < 0) {
 			setEventMessages($object->error, $object->errors, 'errors');
 			$action = 'editref_customer';
@@ -236,7 +236,7 @@
 
 		if (!$error) {
 			// Actions on extra fields
-			$result = $object->updateExtraField($attribute_name, 'SHIPPING_MODIFY');
+			$result = $object->updateExtraField($attribute_name, 'SHIPMENT_MODIFY');
 			if ($result < 0) {
 				setEventMessages($object->error, $object->errors, 'errors');
 				$error++;

########## expedition/class/api_shipments.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/expedition/class/api_shipments.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/expedition/class/api_shipments.class.php	2025-06-27 11:43:46.899487000 +0000
@@ -112,7 +112,7 @@
 		$obj_ret = array();
 
 		// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
-		$socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids;
+		$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
 
 		// If the internal user must only see his customers, force searching by him
 		$search_sale = 0;

########## expedition/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/expedition/list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/expedition/list.php	2025-06-27 11:43:46.905939000 +0000
@@ -1688,7 +1688,7 @@
 		// Note public
 		if (!empty($arrayfields['e.note_public']['checked'])) {
 			print '<td class="sensiblehtmlcontent center">';
-			print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'</div>';
+			print dolPrintHTML($obj->note_public);
 			print '</td>';
 			if (!$i) {
 				$totalarray['nbfield']++;
@@ -1697,7 +1697,7 @@
 		// Note private
 		if (!empty($arrayfields['e.note_private']['checked'])) {
 			print '<td class="sensiblehtmlcontent center">';
-			print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'</div>';
+			print dolPrintHTML($obj->note_private);
 			print '</td>';
 			if (!$i) {
 				$totalarray['nbfield']++;

########## expedition/shipment.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/expedition/shipment.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/expedition/shipment.php	2025-06-27 11:43:46.909818000 +0000
@@ -209,7 +209,7 @@
 		}
 
 		if (!$error) {
-			$result = $object->updateExtraField($attribute_name, 'SHIPPING_MODIFY');
+			$result = $object->updateExtraField($attribute_name, 'SHIPMENT_MODIFY');
 			if ($result < 0) {
 				setEventMessages($object->error, $object->errors, 'errors');
 				$error++;

########## expensereport/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/expensereport/card.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/expensereport/card.php	2025-06-27 11:43:47.069795000 +0000
@@ -174,7 +174,6 @@
 /*
  * Actions
  */
-
 $error = 0;
 
 $value_unit_ht = price2num(GETPOST('value_unit_ht', 'alpha'), 'MU');
@@ -411,9 +410,9 @@
 					$newlang = GETPOST('lang_id', 'aZ09');
 				}
 				if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
-					$tmpuser = new User($db);
-					$tmpuser->fetch($object->fk_user_author);
-					$newlang = $tmpuser->lang;
+					$user = new User($db);
+					$user->fetch($object->fk_user_author);
+					$newlang = $user->lang;
 				}
 				if (!empty($newlang)) {
 					$outputlangs = new Translate("", $conf);
@@ -530,9 +529,9 @@
 					$newlang = GETPOST('lang_id', 'aZ09');
 				}
 				if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
-					$tmpuser = new User($db);
-					$tmpuser->fetch($object->fk_user_author);
-					$newlang = $tmpuser->lang;
+					$user = new User($db);
+					$user->fetch($object->fk_user_author);
+					$newlang = $user->lang;
 				}
 				if (!empty($newlang)) {
 					$outputlangs = new Translate("", $conf);
@@ -644,9 +643,9 @@
 					$newlang = GETPOST('lang_id', 'aZ09');
 				}
 				if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
-					$tmpuser = new User($db);
-					$tmpuser->fetch($object->fk_user_author);
-					$newlang = $tmpuser->lang;
+					$user = new User($db);
+					$user->fetch($object->fk_user_author);
+					$newlang = $user->lang;
 				}
 				if (!empty($newlang)) {
 					$outputlangs = new Translate("", $conf);
@@ -762,9 +761,9 @@
 					$newlang = GETPOST('lang_id', 'aZ09');
 				}
 				if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
-					$tmpuser = new User($db);
-					$tmpuser->fetch($object->fk_user_author);
-					$newlang = $tmpuser->lang;
+					$user = new User($db);
+					$user->fetch($object->fk_user_author);
+					$newlang = $user->lang;
 				}
 				if (!empty($newlang)) {
 					$outputlangs = new Translate("", $conf);
@@ -880,9 +879,9 @@
 							$newlang = GETPOST('lang_id', 'aZ09');
 						}
 						if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
-							$tmpuser = new User($db);
-							$tmpuser->fetch($object->fk_user_author);
-							$newlang = $tmpuser->lang;
+							$user = new User($db);
+							$user->fetch($object->fk_user_author);
+							$newlang = $user->lang;
 						}
 						if (!empty($newlang)) {
 							$outputlangs = new Translate("", $conf);
@@ -996,9 +995,9 @@
 						$newlang = GETPOST('lang_id', 'aZ09');
 					}
 					if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
-						$tmpuser = new User($db);
-						$tmpuser->fetch($object->fk_user_author);
-						$newlang = $tmpuser->lang;
+						$user = new User($db);
+						$user->fetch($object->fk_user_author);
+						$newlang = $user->lang;
 					}
 					if (!empty($newlang)) {
 						$outputlangs = new Translate("", $conf);
@@ -1037,9 +1036,9 @@
 					$newlang = GETPOST('lang_id', 'aZ09');
 				}
 				if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
-					$tmpuser = new User($db);
-					$tmpuser->fetch($object->fk_user_author);
-					$newlang = $tmpuser->lang;
+					$user = new User($db);
+					$user->fetch($object->fk_user_author);
+					$newlang = $user->lang;
 				}
 				if (!empty($newlang)) {
 					$outputlangs = new Translate("", $conf);
@@ -1050,13 +1049,9 @@
 
 				$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
 			}
-
-			header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
-			exit;
 		}
 	}
 
-
 	if ($action == 'set_paid' && $id > 0 && $user->hasRight('expensereport', 'to_paid')) {
 		$object = new ExpenseReport($db);
 		$object->fetch($id);
@@ -1072,9 +1067,9 @@
 					$newlang = GETPOST('lang_id', 'aZ09');
 				}
 				if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
-					$tmpuser = new User($db);
-					$tmpuser->fetch($object->fk_user_author);
-					$newlang = $tmpuser->lang;
+					$user = new User($db);
+					$user->fetch($object->fk_user_author);
+					$newlang = $user->lang;
 				}
 				if (!empty($newlang)) {
 					$outputlangs = new Translate("", $conf);
@@ -1088,78 +1083,74 @@
 		}
 
 		if ($result > 0) {
-			// TODO We must never send an email without a setup or confirm option to choose if email is
-			// sent or not. So we add a hidden constant to avoid this for the moment.
-			if (getDolGlobalString('EXPENSEREPORT_SEND_EMAIL_ON_STATUS_PAID')) {
-				// Send mail
-
-				// TO
-				$destinataire = new User($db);
-				$destinataire->fetch($object->fk_user_author);
-				$emailTo = $destinataire->email;
-
-				// FROM
-				$expediteur = new User($db);
-				$expediteur->fetch($user->id);
-				$emailFrom = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
-
-				if ($emailFrom && $emailTo) {
-					$filename = array();
-					$filedir = array();
-					$mimetype = array();
-
-					// SUBJECT
-					$societeName = getDolGlobalString('MAIN_INFO_SOCIETE_NOM');
-					if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
-						$societeName = getDolGlobalString('MAIN_APPLICATION_TITLE');
-					}
-
-					$subject = $societeName." - ".$langs->transnoentities("ExpenseReportPaid");
-
-					// CONTENT
-					$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
-					$link = '<a href="'.$link.'">'.$link.'</a>';
-					$message = $langs->transnoentities("ExpenseReportPaidMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $link);
-
-					// Generate pdf before attachment
-					$object->setDocModel($user, "");
-					$resultPDF = expensereport_pdf_create($db, $object, '', "", $langs);
-
-					// PREPARE SEND
-					$mailfile = new CMailFile($subject, $emailTo, $emailFrom, $message, $filedir, $mimetype, $filename, '', '', 0, -1);
-
-					if (empty($mailfile->error)) {
-						// SEND
-						$result = $mailfile->sendfile();
-						if ($result) {
-							$mesg = $langs->trans('MailSuccessfulySent', $mailfile->getValidAddress($emailFrom, 2), $mailfile->getValidAddress($emailTo, 2));
-							setEventMessages($mesg, null, 'mesgs');
+			// Send mail
+
+			// TO
+			$destinataire = new User($db);
+			$destinataire->fetch($object->fk_user_author);
+			$emailTo = $destinataire->email;
+
+			// FROM
+			$expediteur = new User($db);
+			$expediteur->fetch($user->id);
+			$emailFrom = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
+
+			if ($emailFrom && $emailTo) {
+				$filename = array();
+				$filedir = array();
+				$mimetype = array();
+
+				// SUBJECT
+				$societeName = getDolGlobalString('MAIN_INFO_SOCIETE_NOM');
+				if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
+					$societeName = getDolGlobalString('MAIN_APPLICATION_TITLE');
+				}
+
+				$subject = $societeName." - ".$langs->transnoentities("ExpenseReportPaid");
 
-							header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
-							exit;
+				// CONTENT
+				$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
+				$link = '<a href="'.$link.'">'.$link.'</a>';
+				$message = $langs->transnoentities("ExpenseReportPaidMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $link);
+
+				// Generate pdf before attachment
+				$object->setDocModel($user, "");
+				$resultPDF = expensereport_pdf_create($db, $object, '', "", $langs);
+
+				// PREPARE SEND
+				$mailfile = new CMailFile($subject, $emailTo, $emailFrom, $message, $filedir, $mimetype, $filename, '', '', 0, -1);
+
+				if (empty($mailfile->error)) {
+					// SEND
+					$result = $mailfile->sendfile();
+					if ($result) {
+						$mesg = $langs->trans('MailSuccessfulySent', $mailfile->getValidAddress($emailFrom, 2), $mailfile->getValidAddress($emailTo, 2));
+						setEventMessages($mesg, null, 'mesgs');
+						header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
+						exit;
+					} else {
+						$langs->load("other");
+						if ($mailfile->error) {
+							$mesg = '';
+							$mesg .= $langs->trans('ErrorFailedToSendMail', $emailFrom, $emailTo);
+							$mesg .= '<br>'.$mailfile->error;
+							setEventMessages($mesg, null, 'errors');
 						} else {
-							$langs->load("other");
-							if ($mailfile->error) {
-								$mesg = '';
-								$mesg .= $langs->trans('ErrorFailedToSendMail', $emailFrom, $emailTo);
-								$mesg .= '<br>'.$mailfile->error;
-								setEventMessages($mesg, null, 'errors');
-							} else {
-								setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings');
-							}
+							setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings');
 						}
-					} else {
-						setEventMessages($mailfile->error, $mailfile->errors, 'errors');
 					}
 				} else {
-					setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings');
+					setEventMessages($mailfile->error, $mailfile->errors, 'errors');
+					$action = '';
 				}
+			} else {
+				setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings');
+				$action = '';
 			}
 		} else {
 			setEventMessages($langs->trans("FailedToSetPaid"), null, 'warnings');
+			$action = '';
 		}
-
-		$action = '';
 	}
 
 	if ($action == "addline" && $user->hasRight('expensereport', 'creer')) {
@@ -1254,9 +1245,12 @@
 					$outputlangs = $langs;
 					$newlang = GETPOST('lang_id', 'alpha');
 					if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
-						$tmpuser = new User($db);
-						$tmpuser->fetch($object->fk_user_author);
-						$newlang = $tmpuser->lang;
+						$user = new User($db);
+						$user->fetch($object->fk_user_author);
+						$newlang = $user->lang;
+					}
+					if (empty($newlang)) {
+						$newlang = $langs;
 					}
 					if (!empty($newlang)) {
 						$outputlangs = new Translate("", $conf);
@@ -1309,9 +1303,9 @@
 						$newlang = GETPOST('lang_id', 'aZ09');
 					}
 					if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
-						$tmpuser = new User($db);
-						$tmpuser->fetch($object->fk_user_author);
-						$newlang = $tmpuser->lang;
+						$user = new User($db);
+						$user->fetch($object->fk_user_author);
+						$newlang = $user->lang;
 					}
 					if (!empty($newlang)) {
 						$outputlangs = new Translate("", $conf);
@@ -1408,9 +1402,9 @@
 							$newlang = GETPOST('lang_id', 'aZ09');
 						}
 						if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
-							$tmpuser = new User($db);
-							$tmpuser->fetch($object->fk_user_author);
-							$newlang = $tmpuser->lang;
+							$user = new User($db);
+							$user->fetch($object->fk_user_author);
+							$newlang = $user->lang;
 						}
 						if (!empty($newlang)) {
 							$outputlangs = new Translate("", $conf);
@@ -1432,7 +1426,8 @@
 					unset($date);
 				}
 
-				$action = '';
+				//header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
+				//exit;
 			} else {
 				setEventMessages($object->error, $object->errors, 'errors');
 			}
@@ -1608,7 +1603,6 @@
 
 				// End of page
 				llxFooter();
-
 				$db->close();
 
 				exit;
@@ -1617,7 +1611,7 @@
 
 		$head = expensereport_prepare_head($object);
 
-		if ($action == 'edit' && ($object->status <= ExpenseReport::STATUS_VALIDATED || $object->status == ExpenseReport::STATUS_REFUSED)) {
+		if ($action == 'edit' && ($object->status < 3 || $object->status == ExpenseReport::STATUS_REFUSED)) {
 			print "<form name='update' action=\"".$_SERVER['PHP_SELF']."\" method=\"post\">\n";
 			print '<input type="hidden" name="token" value="'.newToken().'">';
 			print '<input type="hidden" name="id" value="'.$id.'">';
@@ -2073,16 +2067,13 @@
 				$remaintopay = price2num($object->total_ttc - (float) $totalpaid);
 				$resteapayeraffiche = $remaintopay;
 
-				if ($remaintopay > 0) {
-					$cssforamountpaymentcomplete = 'amountremaintopay';
-				} else {
-					$cssforamountpaymentcomplete = 'amountpaymentcomplete';
-				}
+				$cssforamountpaymentcomplete = 'amountpaymentcomplete';
 
 				if ($object->status == ExpenseReport::STATUS_REFUSED) {
-					$cssforamountpaymentcomplete = 'amountpaymentneutral strikefordisabled';
-				} elseif ($object->paid == 1 && $remaintopay > 0) {
-					$cssforamountpaymentcomplete = 'amountpaymentneutral strikefordisabled';
+					$cssforamountpaymentcomplete = 'amountpaymentneutral';
+					$resteapayeraffiche = 0;
+				} elseif ($object->paid == 0) {
+					$cssforamountpaymentcomplete = 'amountpaymentneutral';
 				}
 				print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans("AlreadyPaid").':</td><td class="right">'.price($totalpaid).'</td><td></td></tr>';
 				print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans("AmountExpected").':</td><td class="right">'.price($object->total_ttc).'</td><td></td></tr>';
@@ -2445,8 +2436,8 @@
 
 						// Select project
 						if (isModEnabled('project')) {
-							print '<td class="nowraponall">';
-							print $formproject->select_projects(-1, (string) $line->fk_project, 'fk_project', 0, 0, $projectRequired ? 0 : 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth300');
+							print '<td>';
+							$formproject->select_projects(-1, (string) $line->fk_project, 'fk_project', 0, 0, $projectRequired ? 0 : 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth300');
 							print '</td>';
 						}
 
@@ -2812,11 +2803,11 @@
 		}
 	}
 
-	/* If status is "Draft"
+	/* Si l'état est "Brouillon"
 	 *	ET user à droit "creer/supprimer"
-	 *	ET fk_user_author == user courant
-	 * 	Afficher : "Enregistrer" / "Modifier" / "Supprimer"
-	 */
+	*	ET fk_user_author == user courant
+	* 	Afficher : "Enregistrer" / "Modifier" / "Supprimer"
+	*/
 	if ($user->hasRight('expensereport', 'creer') && $object->status == ExpenseReport::STATUS_DRAFT) {
 		if (in_array($object->fk_user_author, $childids) || $user->hasRight('expensereport', 'writeall_advance')) {
 			// Modify
@@ -2829,7 +2820,7 @@
 		}
 	}
 
-	/* If status if "Refused"
+	/* Si l'état est "Refusée"
 	 *	ET user à droit "creer/supprimer"
 	 *	ET fk_user_author == user courant
 	 * 	Afficher : "Enregistrer" / "Modifier" / "Supprimer"
@@ -2911,9 +2902,6 @@
 		print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=cancel&token='.newToken().'&id='.$object->id.'">'.$langs->trans("Cancel").'</a></div>';
 	}
 
-	// If status is Closed
-	// ---------------------
-
 	// TODO Replace this. It should be SetUnpaid and should go back to status unpaid not canceled.
 	if (($user->hasRight('expensereport', 'approve') || $user->hasRight('expensereport', 'to_paid')) && $object->status == ExpenseReport::STATUS_CLOSED) {
 		// Cancel

########## expensereport/class/api_expensereports.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/expensereport/class/api_expensereports.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/expensereport/class/api_expensereports.class.php	2025-06-27 11:43:47.076634000 +0000
@@ -131,7 +131,7 @@
 		$obj_ret = array();
 
 		// case of external user, $societe param is ignored and replaced by user's socid
-		//$socid = DolibarrApiAccess::$user->socid ?: $societe;
+		//$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $societe;
 
 		$sql = "SELECT t.rowid";
 		$sql .= " FROM ".MAIN_DB_PREFIX."expensereport AS t LEFT JOIN ".MAIN_DB_PREFIX."expensereport_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields

########## expensereport/class/expensereport.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/expensereport/class/expensereport.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/expensereport/class/expensereport.class.php	2025-06-27 11:43:47.078648000 +0000
@@ -756,8 +756,8 @@
 				}
 				$this->user_validator_infos = dolGetFirstLastname($user_approver->firstname, $user_approver->lastname);
 
-				$this->fk_statut                = (int) $obj->status; // deprecated
-				$this->status                   = (int) $obj->status;
+				$this->fk_statut                = $obj->status; // deprecated
+				$this->status                   = $obj->status;
 				$this->fk_c_paiement            = $obj->fk_c_paiement;
 				$this->paid                     = $obj->paid;
 
@@ -815,7 +815,7 @@
 		$this->db->begin();
 
 		$sql = "UPDATE ".MAIN_DB_PREFIX."expensereport";
-		$sql .= " SET fk_statut = ".self::STATUS_CLOSED.", paid = 1";
+		$sql .= " SET fk_statut = ".self::STATUS_CLOSED.", paid=1";
 		$sql .= " WHERE rowid = ".((int) $id)." AND fk_statut = ".self::STATUS_APPROVED;
 
 		dol_syslog(get_class($this)."::setPaid", LOG_DEBUG);
@@ -834,10 +834,6 @@
 
 				if (empty($error)) {
 					$this->db->commit();
-
-					$this->status = self::STATUS_CLOSED;
-					$this->paid = 1;
-
 					return 1;
 				} else {
 					$this->db->rollback();

########## expensereport/index.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/expensereport/index.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/expensereport/index.php	2025-06-27 11:43:47.082380000 +0000
@@ -89,7 +89,7 @@
 llxHeader('', $langs->trans("TripsAndExpenses"), $help_url);
 
 
-$label = $somme = array();
+$label = $somme = $nb = array();
 
 $totalnb = $totalsum = 0;
 $sql = "SELECT tf.code, tf.label, count(de.rowid) as nb, sum(de.total_ht) as km";
@@ -102,6 +102,7 @@
 	$childids[] = $user->id;
 	$sql .= " AND d.fk_user_author IN (".$db->sanitize(implode(',', $childids)).")\n";
 }
+
 $sql .= " GROUP BY tf.code, tf.label";
 
 $result = $db->query($sql);
@@ -229,8 +230,8 @@
 	print '<th class="right">'.$langs->trans("AmountTTC").'</th>';
 	print '<th class="right">'.$langs->trans("DateModificationShort").'</th>';
 	print '<th>';
-	print '<a class="badge" title="'.$langs->trans("FullList").'" href="'.DOL_URL_ROOT.'/expensereport/list.php?sortfield=d.tms&sortorder=DESC">';
-	print '...';
+	print '<a href="'.DOL_URL_ROOT.'/expensereport/list.php?sortfield=d.tms&sortorder=DESC">';
+	print img_picto($langs->trans("FullList"), 'expensereport');
 	print '</a>';
 	print '</th>';
 	print '</tr>';

########## exports/class/export.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/exports/class/export.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/exports/class/export.class.php	2025-06-27 11:43:38.903326000 +0000
@@ -426,6 +426,7 @@
 				}
 				break;
 			case 'Duree':
+				break;
 			case 'Numeric':
 				// if there is a signe +
 				if (strpos($ValueField, "+") > 0) {
@@ -648,6 +649,7 @@
 				$szMsg = $langs->trans('ExportDateFilter');
 				break;
 			case 'Duree':
+				break;
 			case 'Numeric':
 				$szMsg = $langs->trans('ExportNumericFilter');
 				break;

########## fichinter/class/api_interventions.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/fichinter/class/api_interventions.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/fichinter/class/api_interventions.class.php	2025-06-27 11:43:40.053134000 +0000
@@ -147,7 +147,7 @@
 		$obj_ret = array();
 
 		// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
-		$socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids;
+		$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
 
 		// If the internal user must only see his customers, force searching by him
 		$search_sale = 0;

########## fichinter/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/fichinter/list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/fichinter/list.php	2025-06-27 11:43:40.062051000 +0000
@@ -996,7 +996,7 @@
 		// Note public
 		if (!empty($arrayfields['f.note_public']['checked'])) {
 			print '<td class="sensiblehtmlcontent center">';
-			print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'</div>';
+			print dolPrintHTML($obj->note_public);
 			print '</td>';
 			if (!$i) {
 				$totalarray['nbfield']++;
@@ -1005,7 +1005,7 @@
 		// Note private
 		if (!empty($arrayfields['f.note_private']['checked'])) {
 			print '<td class="sensiblehtmlcontent center">';
-			print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'</div>';
+			print dolPrintHTML($obj->note_private);
 			print '</td>';
 			if (!$i) {
 				$totalarray['nbfield']++;

########## filefunc.inc.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/filefunc.inc.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/filefunc.inc.php	2025-06-27 11:43:46.916637000 +0000
@@ -1,7 +1,7 @@
 <?php
 /* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  * Copyright (C) 2003      Xavier Dutoit        <doli@sydesy.com>
- * Copyright (C) 2004-2025 Laurent Destailleur  <eldy@users.sourceforge.net>
+ * Copyright (C) 2004-2017 Laurent Destailleur  <eldy@users.sourceforge.net>
  * Copyright (C) 2004      Sebastien Di Cintio  <sdicintio@ressource-toi.org>
  * Copyright (C) 2004      Benoit Mortier       <benoit.mortier@opensides.be>
  * Copyright (C) 2005-2011 Regis Houssin        <regis.houssin@inodbox.com>
@@ -9,8 +9,8 @@
  * Copyright (C) 2006 	   Andre Cianfarani     <andre.cianfarani@acdeveloppement.net>
  * Copyright (C) 2010      Juanjo Menent        <jmenent@2byte.es>
  * Copyright (C) 2015      Bahfir Abbes         <bafbes@gmail.com>
- * Copyright (C) 2024-2025 MDW					<mdeweerd@users.noreply.github.com>
- * Copyright (C) 2024      Frédéric France      <frederic.france@free.fr>
+ * Copyright (C) 2024-2025	MDW					<mdeweerd@users.noreply.github.com>
+ * Copyright (C) 2024       Frédéric France         <frederic.france@free.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -63,7 +63,7 @@
 	define('DOL_APPLICATION_TITLE', 'Dolibarr');
 }
 if (!defined('DOL_VERSION')) {
-	define('DOL_VERSION', '22.0.0'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
+	define('DOL_VERSION', '22.0.0-beta'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
 }
 
 if (!defined('EURO')) {
@@ -488,11 +488,11 @@
 if ((!empty($dolibarr_main_db_pass) && preg_match('/(dolcrypt|crypted):/i', $dolibarr_main_db_pass)) || !empty($dolibarr_main_db_encrypted_pass)) {
 	if (!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) {
 		$dolibarr_main_db_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass);
-		$dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this so we can use it later to know the password was initially encrypted
 		$dolibarr_main_db_pass = dol_decode($dolibarr_main_db_pass);
-	} elseif (!empty($dolibarr_main_db_pass) && preg_match('/dolcrypt:/i', $dolibarr_main_db_pass)) {
 		$dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this so we can use it later to know the password was initially encrypted
+	} elseif (!empty($dolibarr_main_db_pass) && preg_match('/dolcrypt:/i', $dolibarr_main_db_pass)) {
 		$dolibarr_main_db_pass = dolDecrypt($dolibarr_main_db_pass, (empty($dolibarr_main_dolcrypt_key) ? (empty($dolibarr_main_instance_unique_id) ? '' : $dolibarr_main_instance_unique_id) : $dolibarr_main_dolcrypt_key));
+		$dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this so we can use it later to know the password was initially encrypted
 	} else {
 		$dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
 	}

########## fourn/ajax/getSupplierPrices.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/fourn/ajax/getSupplierPrices.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/fourn/ajax/getSupplierPrices.php	2025-06-27 11:43:41.502671000 +0000
@@ -122,7 +122,7 @@
 			}
 		}
 
-		$prices[] = array("id" => 'pmpprice', "price" => price2num($price, 'MU'), "label" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency));  // For price field, we must use price2num(), for label or title, price()
+		$prices[] = array("id" => 'pmpprice', "price" => price2num($price), "label" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency));  // For price field, we must use price2num(), for label or title, price()
 	}
 
 	// Add price for costprice (at end)

########## fourn/class/api_supplier_invoices.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/fourn/class/api_supplier_invoices.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/fourn/class/api_supplier_invoices.class.php	2025-06-27 11:43:41.527997000 +0000
@@ -117,7 +117,7 @@
 		$obj_ret = array();
 
 		// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
-		$socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids;
+		$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
 
 		// If the internal user must only see his customers, force searching by him
 		$search_sale = 0;

########## fourn/class/api_supplier_orders.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/fourn/class/api_supplier_orders.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/fourn/class/api_supplier_orders.class.php	2025-06-27 11:43:41.529272000 +0000
@@ -111,7 +111,7 @@
 		$obj_ret = array();
 
 		// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
-		$socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids;
+		$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
 
 		// If the internal user must only see his customers, force searching by him
 		$search_sale = 0;

########## fourn/class/fournisseur.commande.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/fourn/class/fournisseur.commande.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/fourn/class/fournisseur.commande.class.php	2025-06-27 11:43:41.533826000 +0000
@@ -3547,7 +3547,7 @@
 	 */
 	public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
 	{
-		global $langs;
+		global $conf, $langs;
 
 		if (!dol_strlen($modele)) {
 			$modele = '';	// No doc template/generation by default

########## fourn/commande/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/fourn/commande/list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/fourn/commande/list.php	2025-06-27 11:43:41.496322000 +0000
@@ -205,7 +205,7 @@
 $arrayfields = array(
 	'u.login' => array('label' => "AuthorRequest", 'enabled' => '1', 'position' => 41),
 	's.name_alias' => array('label' => "AliasNameShort", 'position' => 51, 'checked' => '0'),
-	's.town' => array('label' => "Town", 'enabled' => '1', 'position' => 55, 'checked' => '0'),
+	's.town' => array('label' => "Town", 'enabled' => '1', 'position' => 55, 'checked' => '1'),
 	's.zip' => array('label' => "Zip", 'enabled' => '1', 'position' => 56, 'checked' => '1'),
 	'state.nom' => array('label' => "StateShort", 'enabled' => '1', 'position' => 57),
 	'country.code_iso' => array('label' => "Country", 'enabled' => '1', 'position' => 58),
@@ -2103,7 +2103,7 @@
 			// Note public
 			if (!empty($arrayfields['cf.note_public']['checked'])) {
 				print '<td class="sensiblehtmlcontent center">';
-				print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'</div>';
+				print dolPrintHTML($obj->note_public);
 				print '</td>';
 				if (!$i) {
 					$totalarray['nbfield']++;
@@ -2113,7 +2113,7 @@
 			// Note private
 			if (!empty($arrayfields['cf.note_private']['checked'])) {
 				print '<td class="sensiblehtmlcontent center">';
-				print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'</div>';
+				print dolPrintHTML($obj->note_private);
 				print '</td>';
 				if (!$i) {
 					$totalarray['nbfield']++;

########## fourn/facture/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/fourn/facture/card.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/fourn/facture/card.php	2025-06-27 11:43:41.556380000 +0000
@@ -3638,7 +3638,7 @@
 			if (GETPOST('calculationrule')) {
 				$calculationrule = GETPOST('calculationrule', 'alpha');
 			} else {
-				$calculationrule = (!getDolGlobalString('MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND_SUPPLIER') ? 'totalofround' : 'roundoftotal');
+				$calculationrule = (!getDolGlobalString('MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND') ? 'totalofround' : 'roundoftotal');
 			}
 			if ($calculationrule == 'totalofround') {
 				$calculationrulenum = 1;

########## fourn/facture/paiement.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/fourn/facture/paiement.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/fourn/facture/paiement.php	2025-06-27 11:43:41.548605000 +0000
@@ -232,7 +232,7 @@
 					}
 				}
 
-				$formquestion[$i++] = array('type' => 'hidden', 'name' => $key, 'value' => GETPOSTFLOAT($key));
+				$formquestion[$i++] = array('type' => 'hidden', 'name' => $key, 'value' => GETPOSTINT($key));
 			}
 		}
 

########## holiday/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/holiday/list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/holiday/list.php	2025-06-27 11:43:47.090912000 +0000
@@ -90,7 +90,7 @@
 	$sortorder = "DESC";
 }
 if (!$sortfield) {
-	$sortfield = "cp.date_debut";
+	$sortfield = "cp.ref";
 }
 
 $search_all          = trim(GETPOST('search_all', 'alphanohtml'));

########## hrm/class/skill.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/hrm/class/skill.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/hrm/class/skill.class.php	2025-06-27 11:43:46.998538000 +0000
@@ -197,7 +197,7 @@
 	 */
 	public function __construct(DoliDB $db)
 	{
-		global $langs;
+		global $conf, $langs;
 
 		$this->db = $db;
 
@@ -245,8 +245,11 @@
 	 */
 	public function create(User $user, $notrigger = 0)
 	{
+		global $langs,$conf;
+
 		$resultcreate = $this->createCommon($user, $notrigger);
 
+
 		if ($resultcreate > 0) {
 			// skillDet create
 			$this->createSkills();
@@ -263,9 +266,9 @@
 	 */
 	public function createSkills($i = 1)
 	{
-		global $user, $langs;
+		global $conf, $user, $langs;
 
-		$maxNumberSkill = getDolGlobalInt('HRM_MAXRANK', self::DEFAULT_MAX_RANK_PER_SKILL);
+		$MaxNumberSkill = getDolGlobalInt('HRM_MAXRANK', self::DEFAULT_MAX_RANK_PER_SKILL);
 		$defaultSkillDesc = getDolGlobalString('HRM_DEFAULT_SKILL_DESCRIPTION', $langs->trans("NoDescription"));
 
 		$error = 0;
@@ -275,9 +278,8 @@
 		$this->db->begin();
 
 		// Create level 0 of skills
-		/* Removed this. if a skill is not required for a job, the skill will just not be added to the job profile or will be added with expected level = N/A
 		$skilldet = new Skilldet($this->db);
-		$skilldet->description = $langs->transnoentitiesnoconv('SkillNotRequired');
+		$skilldet->description = $langs->trans('SkillNotRequired');
 		$skilldet->rankorder = 0;
 		$skilldet->fk_skill = $this->id;
 
@@ -285,17 +287,15 @@
 		if ($result <= 0) {
 			$error++;
 		}
-		*/
 
 		// Create level of skills
-		while ($i <= $maxNumberSkill) {
+		while ($i <= $MaxNumberSkill) {
 			$skilldet = new Skilldet($this->db);
 			$skilldet->description = $defaultSkillDesc . " " . $i;
 			$skilldet->rankorder = $i;
 			$skilldet->fk_skill = $this->id;
 
 			$result =  $skilldet->create($user);
-
 			if ($result <= 0) {
 				$error++;
 			}
@@ -914,13 +914,11 @@
 	 */
 	public function LibStatut($status, $mode = 0)
 	{
-		// phpcs:enable
 		if (empty($status)) {
 			$status = 0;
 		}
 
-		return '';
-		/*
+		// phpcs:enable
 		if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
 			global $langs;
 			//$langs->load("hrm");
@@ -939,7 +937,6 @@
 		}
 
 		return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
-		*/
 	}
 
 	/**

########## hrm/class/skilldet.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/hrm/class/skilldet.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/hrm/class/skilldet.class.php	2025-06-27 11:43:47.005722000 +0000
@@ -179,7 +179,7 @@
 	 */
 	public function __construct(DoliDB $db)
 	{
-		global $langs;
+		global $conf, $langs;
 
 		$this->db = $db;
 
@@ -193,6 +193,12 @@
 			$this->fields['entity']['enabled'] = 0;
 		}
 
+		// Example to show how to set values of fields definition dynamically
+		/*if ($user->rights->hrm->skilldet->read) {
+			$this->fields['myfield']['visible'] = 1;
+			$this->fields['myfield']['noteditable'] = 0;
+		}*/
+
 		// Unset fields that are disabled
 		foreach ($this->fields as $key => $val) {
 			if (isset($val['enabled']) && empty($val['enabled'])) {
@@ -237,8 +243,7 @@
 	 */
 	public function createFromClone(User $user, $fromid)
 	{
-		global $extrafields;
-
+		global $langs, $extrafields;
 		$error = 0;
 
 		dol_syslog(__METHOD__, LOG_DEBUG);
@@ -476,7 +481,7 @@
 	 */
 	public function validate($user, $notrigger = 0)
 	{
-		global $conf;
+		global $conf, $langs;
 
 		require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
 
@@ -945,7 +950,7 @@
 	 */
 	public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
 	{
-		global $langs;
+		global $conf, $langs;
 
 		$result = 0;
 		$includedocgeneration = 0;

########## hrm/compare.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/hrm/compare.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/hrm/compare.php	2025-06-27 11:43:46.981483000 +0000
@@ -216,63 +216,62 @@
 			</div>
 			<br><br>
 
-			<div id="compare" class="centpercent" style="position:relative;">
+			<div id="compare" width="100%" style="position:relative;">
+
+				<?php if ($fk_usergroup1 > 0 || $fk_usergroup2 > 0 || $fk_job > 0) { ?>
+					<table width="100%">
+						<tr>
+							<th></th>
+							<th><?php print $langs->trans('Skill'); ?></th>
+							<th><?php print $langs->trans('rank'); ?></th>
+							<th><?php print $langs->trans('difference'); ?></th>
+							<th><?php print $langs->trans('rank'); ?></th>
+							<th></th>
+						</tr>
+
+						<?php
+						echo '<tr><td id="list-user-left" style="width:30%" valign="top">';
 
-				<?php if ($fk_usergroup1 > 0 || $fk_usergroup2 > 0 || $fk_job > 0) {
 						$TUser1 = $TUser2 = array();
 
-						$userlist1 = displayUsersListWithPicto($TUser1, $fk_usergroup1, 'list1');	// This fill also the $TUser1
+						$userlist1 = displayUsersListWithPicto($TUser1, $fk_usergroup1, 'list1');
+
 
+						$skill = new Skill($db);
 						$TSkill1 = getSkillForUsers($TUser1);
 
-					if ($fk_job > 0) {
-						$TSkill2 = getSkillForJob($fk_job);
+						if ($fk_job > 0) {
+							$TSkill2 = getSkillForJob($fk_job);
 
-						$job = new Job($db);
-						$job->fetch($fk_job);
-						$userlist2 = '<ul>
+							$job = new Job($db);
+							$job->fetch($fk_job);
+							$userlist2 = '<ul>
 											<li>
 												<h3>' . $job->label . '</h3>
 												<p>' . $job->description . '</p>
 											</li>
 										</ul>';
-					} else {
-						$userlist2 = displayUsersListWithPicto($TUser2, $fk_usergroup2, 'list2');
-						$TSkill2 = getSkillForUsers($TUser2);
-					}
+						} else {
+							$userlist2 = displayUsersListWithPicto($TUser2, $fk_usergroup2, 'list2');
+							$TSkill2 = getSkillForUsers($TUser2);
+						}
 
 						$TMergedSkills = mergeSkills($TSkill1, $TSkill2);
-					?>
-					<table class="centpercent">
-						<tr>
-							<th class="left"><?php print $langs->trans('Employees'); ?></th>
-							<th class="left" style="padding-left: 10px;"><?php print $langs->trans('Skill'); ?></th>
-							<th><?php print $langs->trans('HighestRank'); ?></th>
-							<th><?php print $langs->trans('difference'); ?></th>
-							<th><?php print $langs->trans($fk_job > 0 ? 'ExpectedRank' : 'HighestRank'); ?></th>
-							<th></th>
-						</tr>
 
-						<?php
-						echo '<tr>';
-
-						echo '<td id="list-user-left" style="width:25%; padding-right: 10px; border-right: 1px solid #ccc" class="valigntop">';
 						echo $userlist1;
-						echo '</td>';
 
-						echo '<td id="" style="width:20%; padding-left: 10px;" valign="top">' . skillList($TMergedSkills) . '</td>';
-
-						echo '<td id="" style="width:10%" valign="top">' . rate($TMergedSkills, 'rate1') . '</td>';
+						echo '</td>';
 
+						echo '<td id="" style="width:20%" valign="top">' . skillList($TMergedSkills) . '</td>';
+						echo '<td id="" style="width:5%" valign="top">' . rate($TMergedSkills, 'rate1') . '</td>';
 						echo '<td id="" style="width:10%" valign="top">' . diff($TMergedSkills) . '</td>';
+						echo '<td id="" style="width:5%" valign="top">' . rate($TMergedSkills, 'rate2') . '</td>';
 
-						echo '<td id="" style="width:10%; padding-right: 10px;" valign="top">' . rate($TMergedSkills, 'rate2') . '</td>';
+						echo '<td id="list-user-right" style="width:30%" valign="top">';
 
-						echo '<td id="list-user-right" style="width:25%; padding-left: 10px; border-left: 1px solid #ccc;" class="valigntop">';
 						echo $userlist2;
-						echo '</td>';
 
-						echo '</tr>';
+						echo '</td></tr>';
 
 						?>
 
@@ -331,11 +330,10 @@
 }
 
 /**
- * Return a html list with rank information
- *
- * @param 	array<int,stdClass> $TMergedSkills 	Skill list for display
- * @param 	string 				$field 			Which column of comparison we are working with ('rate1' or 'rate2')
- * @return 	string								String to show for level
+ * 	Return a html list with rank information
+ * 		@param array<int,stdClass> $TMergedSkills skill list for display
+ * 		@param string $field which column of comparison we are working with
+ * 		@return string
  */
 function rate(&$TMergedSkills, $field)
 {
@@ -350,7 +348,7 @@
 			$note = 'x';
 			$class .= ' none';
 		} else {
-			$note = $sk->$field < 0 ? $langs->trans("NA") : $sk->$field;
+			$note = $sk->$field;
 			$how_many = ($field === 'rate1') ? $sk->how_many_max1 : $sk->how_many_max2;
 		}
 
@@ -360,8 +358,8 @@
 			$trad = $langs->trans('HighestRank');
 		}
 
-		$out .= '<li fk_skill="' . $id . '" class="center">
-	      <p class="nowraponall"><span class="' . $class . ' classfortooltip" title="' . $trad . '">' . $note . '</span>' . ($how_many > 0 ? '<span class="bubble classfortooltip" title="' . $langs->trans('HowManyUserWithThisMaxNote') . '">' . $how_many . '</span>' : '') . '</p>
+		$out .= '<li fk_skill="' . $id . '" style="text-align:center;">
+	      <p><span class="' . $class . ' classfortooltip" title="' . $trad . '">' . $note . '</span>' . ($how_many > 0 ? '<span class="bubble classfortooltip" title="' . $langs->trans('HowManyUserWithThisMaxNote') . '">' . $how_many . '</span>' : '') . '</p>
 	    </li>';
 	}
 
@@ -393,10 +391,10 @@
 }
 
 /**
- * Create an array of lines [ skillLabel,description, maxrank on group1 , minrank needed for this skill ]
+ *  create an array of lines [ skillLabel,description, maxrank on group1 , minrank needed for this skill ]
  *
- * @param array<int,stdClass> $TSkill1 		Skill list of first column
- * @param array<int,stdClass> $TSkill2 		Skill list of second column
+ * @param array<int,stdClass> $TSkill1 skill list of first column
+ * @param array<int,stdClass> $TSkill2 skill list of second column
  * @return array<int,stdClass>
  */
 function mergeSkills($TSkill1, $TSkill2)
@@ -410,7 +408,6 @@
 
 		$Tab[$sk->fk_skill]->rate1 = $sk->rankorder;
 		$Tab[$sk->fk_skill]->how_many_max1 = $sk->how_many_max;
-
 		$Tab[$sk->fk_skill]->label = $sk->label;
 		$Tab[$sk->fk_skill]->description = $sk->description;
 	}
@@ -420,10 +417,9 @@
 			$Tab[$sk->fk_skill] = new stdClass();
 		}
 		$Tab[$sk->fk_skill]->rate2 = $sk->rankorder;
-		$Tab[$sk->fk_skill]->how_many_max2 = $sk->how_many_max;
-
 		$Tab[$sk->fk_skill]->label = $sk->label;
 		$Tab[$sk->fk_skill]->description = $sk->description;
+		$Tab[$sk->fk_skill]->how_many_max2 = $sk->how_many_max;
 	}
 
 	return $Tab;
@@ -515,60 +511,52 @@
 /**
  * 		Allow to get skill(s) of a user
  *
- * 		@param int[] 	$TUser 			array of employees we need to get skills
+ * 		@param int[] $TUser array of employees we need to get skills
  * 		@return array<int,stdClass>
  */
 function getSkillForUsers($TUser)
 {
 	global $db;
 
-	// I go back to the user with the highest score in a given group for all the skills assessed in that group
+	//I go back to the user with the highest score in a given group for all the skills assessed in that group
 	if (empty($TUser)) {
 		return array();
 	}
 
-	$sql = 'SELECT sk.rowid, sk.label, sk.description, sk.skill_type,';
+	$sql = 'SELECT sk.rowid, sk.label, sk.description, sk.skill_type, sr.fk_object, sr.objecttype, sr.fk_skill, ';
 	$sql .= ' MAX(sr.rankorder) as rankorder';
 	$sql .= ' FROM '.MAIN_DB_PREFIX.'hrm_skill sk';
-	$sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'hrm_skillrank sr';
-	$sql .= " WHERE sk.rowid = sr.fk_skill AND sr.objecttype = '".$db->escape(SkillRank::SKILLRANK_TYPE_USER)."'";
+	$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'hrm_skillrank sr ON (sk.rowid = sr.fk_skill)';
+	$sql .= " WHERE sr.objecttype = '".$db->escape(SkillRank::SKILLRANK_TYPE_USER)."'";
 	$sql .= ' AND sr.fk_object IN ('.$db->sanitize(implode(',', $TUser)).')';
-	$sql .= ' AND rankorder >= 0';
-	$sql .= " GROUP BY sk.rowid, sk.label, sk.description, sk.skill_type"; // group by skill
-	$sql .= " ORDER BY sk.rowid ASC";
+	$sql .= " GROUP BY sk.rowid, sk.label, sk.description, sk.skill_type, sr.fk_object, sr.objecttype, sr.fk_skill "; // group par competence
 
 	$resql = $db->query($sql);
 	$Tab = array();
 
 	if ($resql) {
-		// For each skill, we count the number of times that the max score has been reached within a given group
+		//For each skill, we count the number of times that the max score has been reached within a given group
 		$num = 0;
 		while ($obj = $db->fetch_object($resql)) {
-			$Tab[$num] = new stdClass();
-
-			$Tab[$num]->fk_skill = $obj->rowid;
-			$Tab[$num]->label = $obj->label;
-			$Tab[$num]->description = $obj->description;
-			$Tab[$num]->skill_type = $obj->skill_type;
-			//$Tab[$num]->fk_object = $obj->fk_object;
-			$Tab[$num]->objectType = SkillRank::SKILLRANK_TYPE_USER;
-
-			$Tab[$num]->rankorder = $obj->rankorder;
-
-			// Get how_many_max
 			$sql1 = "SELECT COUNT(rowid) as how_many_max FROM ".MAIN_DB_PREFIX."hrm_skillrank as sr";
 			$sql1 .= " WHERE sr.rankorder = ".((int) $obj->rankorder);
 			$sql1 .= " AND sr.objecttype = '".$db->escape(SkillRank::SKILLRANK_TYPE_USER)."'";
-			$sql1 .= " AND sr.fk_skill = ".((int) $obj->rowid);
+			$sql1 .= " AND sr.fk_skill = ".((int) $obj->fk_skill);
 			$sql1 .= " AND sr.fk_object IN (".$db->sanitize(implode(',', $TUser)).")";
 			$resql1 = $db->query($sql1);
 
 			$objMax = $db->fetch_object($resql1);
 
+			$Tab[$num] = new stdClass();
+			$Tab[$num]->fk_skill = $obj->fk_skill;
+			$Tab[$num]->label = $obj->label;
+			$Tab[$num]->description = $obj->description;
+			$Tab[$num]->skill_type = $obj->skill_type;
+			$Tab[$num]->fk_object = $obj->fk_object;
+			$Tab[$num]->objectType = SkillRank::SKILLRANK_TYPE_USER;
+			$Tab[$num]->rankorder = $obj->rankorder;
 			$Tab[$num]->how_many_max = $objMax->how_many_max;
 
-			$db->free($resql1);
-
 			$num++;
 		}
 	} else {

########## hrm/css/style.css
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/hrm/css/style.css	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/hrm/css/style.css	2025-06-27 11:43:46.973986000 +0000
@@ -24,14 +24,14 @@
 }
 
 #compare li {
-  padding-top: 10px;
-  padding-bottom: 10px;
+  padding: 10px;
   overflow: auto;
-  border-bottom: 2px solid #ccc;
+  border-bottom: 2px solid #98b880;
 }
 #compare ul.competence li,#compare ul.note li {
   height:48px;
   overflow: hidden;
+  border-bottom: 2px solid #6C286C;
 }
 
 #compare li:hover {
@@ -49,6 +49,7 @@
 }
 
 span.note {
+	font: bold Helvetica, Verdana, sans-serif;
 	background: #eee none repeat scroll 0 0;
     border: 1px solid #ccc;
     border-radius: 3px;
@@ -85,20 +86,39 @@
 	height: 25px;
 	border-width:3px;
 }
-
-/* Must be same colors than into the pdf_standard_evaluation.modules.php */
-span.happy {
-	background: rgb(169, 236, 201);
+span.toohappy {
+	background: #3097D1;
+	border:5px solid #3097D1;
 }
 span.veryhappy {
-	background: rgb(20, 129, 111);
+	border:5px solid #3097D1;
+}
+span.toosad {
+	background: #ccc;
+	border:5px solid #ccc;
 }
 span.sad {
-	background:rgb(205, 92, 92);
+	background:#bd4147;
+}
+/*span.diffnote {
+	display: inline-block;
+	background: url(img/smiley.png);
+	width:42px;
+	height: 42px;
+	overflow: hidden;
+}
+span.toohappy {
+	background-position: -105px 0px;
+}
+span.veryhappy {
+	background-position: -53px 0px;
 }
 span.toosad {
-	background: rgb(205, 92, 92);
+	background-position: -105px -52px;
 }
+span.sad {
+	background-position: 0px -52px;
+}*/
 
 span.bubble {
 	background-color: #ccc;

########## hrm/evaluation_card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/hrm/evaluation_card.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/hrm/evaluation_card.php	2025-06-27 11:43:46.983114000 +0000
@@ -581,15 +581,15 @@
 
 				$Tab[$num]->required_rank = '<span title="'.$required_rank_desc.'" class="radio_js_bloc_number TNote_1">' . $required_rank . '</span>';
 
-				if ($obj->userRankForSkill < 0 || $obj->required_rank < 0) {
+				if ($obj->userRankForSkill == -1) {
 					$title = $langs->trans('NA');
-					$class .= 'na';
+					$class .= 'veryhappy diffnote';
 				} elseif ($obj->userRankForSkill > $obj->required_rank) {
 					$title = $langs->trans('MaxlevelGreaterThanShort');
-					$class .= 'veryhappy';
+					$class .= 'veryhappy diffnote';
 				} elseif ($obj->userRankForSkill == $obj->required_rank) {
 					$title = $langs->trans('MaxLevelEqualToShort');
-					$class .= 'happy';
+					$class .= 'happy diffnote';
 				} elseif ($obj->userRankForSkill < $obj->required_rank) {
 					$title = $langs->trans('MaxLevelLowerThanShort');
 					$class .= 'sad';

########## hrm/evaluation_list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/hrm/evaluation_list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/hrm/evaluation_list.php	2025-06-27 11:43:47.041708000 +0000
@@ -91,10 +91,11 @@
 
 // Default sort order (if not yet defined by previous GETPOST)
 if (!$sortfield) {
-	$sortfield = "t.ref"; 		// Set here default search field. By default 1st field in definition.
+	reset($object->fields);					// Reset is required to avoid key() to return null.
+	$sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
 }
 if (!$sortorder) {
-	$sortorder = "DESC";
+	$sortorder = "ASC";
 }
 
 // Initialize array of search criteria

########## hrm/index.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/hrm/index.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/hrm/index.php	2025-06-27 11:43:46.985277000 +0000
@@ -274,7 +274,7 @@
 				print '<td class="tdoverflowmax100">'.$userstatic->getNomUrl(-1, 'leave').'</td>';
 
 				$leavecode = empty($typeleaves[$obj->fk_type]) ? 'Undefined' : $typeleaves[$obj->fk_type]['code'];
-				print '<td class="tdoverflowmax80" title="'.dol_escape_htmltag($langs->trans($leavecode)).'">'.dol_escape_htmltag($langs->trans($leavecode)).'</td>';
+				print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($langs->trans($leavecode)).'">'.dol_escape_htmltag($langs->trans($leavecode)).'</td>';
 
 				$starthalfday = ($obj->halfday == -1 || $obj->halfday == 2) ? 'afternoon' : 'morning';
 				$endhalfday = ($obj->halfday == 1 || $obj->halfday == 2) ? 'morning' : 'afternoon';

########## hrm/skill_card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/hrm/skill_card.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/hrm/skill_card.php	2025-06-27 11:43:47.010915000 +0000
@@ -138,7 +138,6 @@
 
 	// action update on Skilldet must be done before real update action in core/actions_addupdatedelete.inc.php
 	$skilldetArray = GETPOST("descriptionline", "array:alphanohtml");
-
 	if (!$error) {
 		if (is_array($skilldetArray) && count($skilldetArray) > 0) {
 			if ($action == 'update' && $permissiontoadd) {
@@ -172,7 +171,6 @@
 				$arraySkill = $object->fetchLines();
 				'@phan-var-force Skilldet[] $arraySkill';
 				$index = 0;
-
 				foreach ($arraySkill as $skilldet) {
 					if ($skilldet->rankorder != 0) {
 						if (isset($skilldetArray[$index])) {
@@ -379,12 +377,11 @@
 				//                  $value = GETPOSTISSET($key) ? price2num(GETPOST($key, 'alphanohtml')) : $sk->$key;
 				//              } elseif (preg_match('/^(text|html)/', $val['type'])) {
 				//                  $tmparray = explode(':', $val['type']);
-				//if (!empty($tmparray[1])) {
-				//	$check = $tmparray[1];
-				//} else {
-				//	$check = 'restricthtml';
-				//}
-				$check = 'restricthtml';
+				if (!empty($tmparray[1])) {
+					$check = $tmparray[1];
+				} else {
+					$check = 'restricthtml';
+				}
 
 				$skilldetArray = GETPOST("descriptionline", "array");
 				if (empty($skilldetArray)) {

########## index.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/index.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/index.php	2025-06-27 11:43:48.787786000 +0000
@@ -94,16 +94,11 @@
 	$form = new Form($db);
 }
 
-$appli = constant('DOL_APPLICATION_TITLE');
-$applicustom = getDolGlobalString('MAIN_APPLICATION_TITLE');
-if ($applicustom) {
-	$appli = (preg_match('/^\+/', $applicustom) ? $appli : '').$applicustom;
-} else {
-	$appli .= " ".DOL_VERSION;
-}
-
 // Title
-$title = $langs->trans("HomeArea").' - '.$appli;
+$title = $langs->trans("HomeArea").' - Dolibarr '.DOL_VERSION;
+if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
+	$title = $langs->trans("HomeArea").' - ' . getDolGlobalString('MAIN_APPLICATION_TITLE');
+}
 
 llxHeader('', $title);
 

########## knowledgemanagement/class/api_knowledgemanagement.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php	2025-06-27 11:43:57.317996000 +0000
@@ -147,7 +147,7 @@
 			throw new RestException(403);
 		}
 
-		$socid = DolibarrApiAccess::$user->socid ?: 0;
+		$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : 0;
 
 		$restrictonsocid = 0; // Set to 1 if there is a field socid in table of object
 

########## knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php	2025-06-27 11:43:57.332875000 +0000
@@ -96,7 +96,7 @@
 		$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
 		if ($object->ismultientitymanaged == 1) {
 			$sql .= " AND entity = ".$conf->entity;
-		} elseif (!is_numeric($object->ismultientitymanaged)) {
+		} elseif ($object->ismultientitymanaged == 2) {
 			// TODO
 		}
 
@@ -134,7 +134,7 @@
 		$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
 		if ($object->ismultientitymanaged == 1) {
 			$sql .= " AND entity = ".$conf->entity;
-		} elseif (!is_numeric($object->ismultientitymanaged)) {
+		} elseif ($object->ismultientitymanaged == 2) {
 			// TODO
 		}
 

########## main.inc.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/main.inc.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/main.inc.php	2025-06-27 11:43:57.391828000 +0000
@@ -597,7 +597,7 @@
 
 			// Process error of captcha validation
 			if (!$ok) {
-				dol_syslog('--- Security warning: Bad value for code, connection refused', LOG_NOTICE);
+				dol_syslog('Bad value for code, connection refused', LOG_NOTICE);
 				// Load translation files required by page
 				$langs->loadLangs(array('main', 'errors'));
 
@@ -667,13 +667,6 @@
 			$langs->setDefaultLang($langcode);
 		}
 
-		// Test HTTP header
-		if (!empty($_SERVER['HTTP_EXPOSED_CREDENTIAL_CHECK'])) {
-			// TODO Read option $dolibarr_main_no_leaked_credentials with value 1, 2, ... and return
-			//dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"].' refused by option $dolibarr_main_no_leaked_credentials='.$dolibarr_main_no_leaked_credentials, LOG_NOTICE);
-			dol_syslog('--- Security warning: credentials reported as leaked were used to try to login. HTTP_EXPOSED_CREDENTIAL_CHECK='.((int) $_SERVER['HTTP_EXPOSED_CREDENTIAL_CHECK']), LOG_NOTICE);
-		}
-
 		// Validation of login/pass/entity
 		// If ok, the variable login will be returned
 		// If error, we will put error message in session under the name dol_loginmesg
@@ -1653,9 +1646,8 @@
 
 		// Displays title
 		$appli = constant('DOL_APPLICATION_TITLE');
-		$applicustom = getDolGlobalString('MAIN_APPLICATION_TITLE');
-		if ($applicustom) {
-			$appli = (preg_match('/^\+/', $applicustom) ? $appli : '').$applicustom;
+		if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
+			$appli = getDolGlobalString('MAIN_APPLICATION_TITLE');
 		}
 
 		print '<title>';
@@ -2059,9 +2051,15 @@
 
 		// Define link to login card
 		$appli = constant('DOL_APPLICATION_TITLE');
-		$applicustom = getDolGlobalString('MAIN_APPLICATION_TITLE');
-		if ($applicustom) {
-			$appli = (preg_match('/^\+/', $applicustom) ? $appli : '').$applicustom;
+		if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
+			$appli = getDolGlobalString('MAIN_APPLICATION_TITLE');
+			if (preg_match('/\d\.\d/', $appli)) {
+				if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) {
+					$appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core
+				}
+			} else {
+				$appli .= " ".DOL_VERSION;
+			}
 		} else {
 			$appli .= " ".DOL_VERSION;
 		}
@@ -2452,9 +2450,15 @@
 
 	// Define version to show
 	$appli = constant('DOL_APPLICATION_TITLE');
-	$applicustom = getDolGlobalString('MAIN_APPLICATION_TITLE');
-	if ($applicustom) {
-		$appli = (preg_match('/^\+/', $applicustom) ? $appli : '').$applicustom;
+	if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
+		$appli = getDolGlobalString('MAIN_APPLICATION_TITLE');
+		if (preg_match('/\d\.\d/', $appli)) {
+			if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) {
+				$appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core
+			}
+		} else {
+			$appli .= " ".DOL_VERSION;
+		}
 	} else {
 		$appli .= " ".DOL_VERSION;
 	}
@@ -3315,18 +3319,19 @@
 			}
 
 			$appli = constant('DOL_APPLICATION_TITLE');
-			$applicustom = getDolGlobalString('MAIN_APPLICATION_TITLE');
-			if ($applicustom) {
-				$appli = (preg_match('/^\+/', $applicustom) ? $appli : '').$applicustom;
+			if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
+				$appli = getDolGlobalString('MAIN_APPLICATION_TITLE');
+				$doliurl = '';
+				if (preg_match('/\d\.\d/', $appli)) {
+					if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) {
+						$appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core
+					}
+				} else {
+					$appli .= " ".DOL_VERSION;
+				}
 			} else {
 				$appli .= " ".DOL_VERSION;
 			}
-
-			// Clean doliurl if we use a custom application name
-			if ($applicustom) {
-				$doliurl = '';
-			}
-
 			print '<div id="blockvmenuhelpapp" class="blockvmenuhelp">';
 			if ($doliurl) {
 				print '<a class="help" target="_blank" rel="noopener noreferrer" href="'.$doliurl.'">';

########## modulebuilder/index.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/modulebuilder/index.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/modulebuilder/index.php	2025-06-27 11:43:57.413887000 +0000
@@ -600,7 +600,6 @@
 	// Now we update the object file to set $this->isextrafieldmanaged to 1
 	$srcfile = $dirins.'/'.strtolower($module).'/class/'.strtolower($objectname).'.class.php';
 	$arrayreplacement = array('/\$this->isextrafieldmanaged = 0;/' => '$this->isextrafieldmanaged = 1;');
-	$arrayreplacement = array('/\$isextrafieldmanaged = 0;/' => '$isextrafieldmanaged = 1;');
 	dolReplaceInFile($srcfile, $arrayreplacement, '', '0', 0, 1);
 }
 
@@ -1225,10 +1224,10 @@
 				if ($fieldname == 'fk_soc') {
 					$label = 'ThirdParty';
 				}
-				if (in_array($fieldname, array('tms', 'date_modification'))) {
+				if ($fieldname == 'tms') {
 					$label = 'DateModification';
 				}
-				if (in_array($fieldname, array('datec', 'date_creation'))) {
+				if ($fieldname == 'datec') {
 					$label = 'DateCreation';
 				}
 				if ($fieldname == 'date_valid') {
@@ -1321,31 +1320,16 @@
 				}
 
 				// type
-				$picto = '';
-				if (isset($obj->Picto)) {	// This should never exists
+				if (isset($obj->Picto)) {
 					$picto = $obj->Picto;
 				}
-				if (preg_match('/^fk_soc/', $obj->Field)) {
+				if ($obj->Field == 'fk_soc') {
 					$picto = 'company';
-				} elseif (preg_match('/^fk_contact/', $obj->Field)) {
-					$picto = 'contact';
-				} elseif (preg_match('/^fk_bank/', $obj->Field)) {
-					$picto = 'bank';
-				} elseif (preg_match('/^fk_user/', $obj->Field)) {
-					$picto = 'user';
-				} elseif (preg_match('/^fk_warehouse/', $obj->Field)) {
-					$picto = 'warehouse';
-				} elseif (preg_match('/^fk_prod/', $obj->Field)) {
-					$picto = 'product';
-				} elseif (preg_match('/^fk_proj/', $obj->Field)) {
+				}
+				if (preg_match('/^fk_proj/', $obj->Field)) {
 					$picto = 'project';
-				} elseif (preg_match('/^fk_task/', $obj->Field)) {
-					$picto = 'task';
 				}
 
-				// lang
-				$lang = $module.'@'.$module;
-
 				// Build the property string
 				$stringforproperties .= "'".$obj->Field."' => array('type' => '".$type."', 'label' => '".$label."',";
 				if ($default != '') {
@@ -1378,9 +1362,6 @@
 				if ($csslist) {
 					$stringforproperties .= ", 'csslist' => '".$csslist."'";
 				}
-
-				$stringforproperties .= ", 'lang' => '".$lang."'";
-
 				$stringforproperties .= "),\n";
 				$i += 5;
 			}
@@ -3491,11 +3472,7 @@
 	print '<input type="text" name="editorurl" value="'.(GETPOSTISSET('editorurl') ? GETPOST('editorurl') : getDolGlobalString('MODULEBUILDER_SPECIFIC_EDITOR_URL', $mysoc->url)).'" placeholder="'.dol_escape_htmltag($langs->trans("EditorUrl")).'"><br>';
 	print '</div></div>';
 
-	print '</div>';	// End div tagtable
-
-	print '<br><center>';
-	print '<input type="submit" class="button" name="create" value="'.dol_escape_htmltag($langs->trans("Create")).'"'.($dirins ? '' : ' disabled="disabled"').'>';
-	print '</center>';
+	print '<br><input type="submit" class="button" name="create" value="'.dol_escape_htmltag($langs->trans("Create")).'"'.($dirins ? '' : ' disabled="disabled"').'>';
 	print '</form>';
 } elseif ($module == 'deletemodule') {
 	print '<!-- Form to init a module -->'."\n";

########## modulebuilder/template/class/actions_mymodule.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/modulebuilder/template/class/actions_mymodule.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/modulebuilder/template/class/actions_mymodule.class.php	2025-06-27 11:43:57.434335000 +0000
@@ -102,9 +102,12 @@
 	 */
 	public function doActions($parameters, &$object, &$action, $hookmanager)
 	{
+		global $conf, $user, $langs;
+
 		$error = 0; // Error counter
 
 		/* print_r($parameters); print_r($object); echo "action: " . $action; */
+		// @phan-suppress-next-line PhanPluginEmptyStatementIf
 		if (in_array($parameters['currentcontext'], array('somecontext1', 'somecontext2'))) {	    // do something only for the context 'somecontext1' or 'somecontext2'
 			// Do what you want here...
 			// You can for example load and use call global vars like $fieldstosearchall to overwrite them, or update the database depending on $action and GETPOST values.
@@ -213,8 +216,7 @@
 
 		/* print_r($parameters); print_r($object); echo "action: " . $action; */
 		// @phan-suppress-next-line PhanPluginEmptyStatementIf
-		if (in_array($parameters['currentcontext'], array('somecontext1', 'somecontext2'))) {
-			// do something only for the context 'somecontext1' or 'somecontext2'
+		if (in_array($parameters['currentcontext'], array('somecontext1', 'somecontext2'))) {		// do something only for the context 'somecontext1' or 'somecontext2'
 		}
 
 		return $ret;

########## modulebuilder/template/class/api_mymodule.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/modulebuilder/template/class/api_mymodule.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/modulebuilder/template/class/api_mymodule.class.php	2025-06-27 11:43:57.432943000 +0000
@@ -121,7 +121,7 @@
 			throw new RestException(403);
 		}
 
-		$socid = DolibarrApiAccess::$user->socid ?: 0;
+		$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : 0;
 
 		$restrictonsocid = 0; // Set to 1 if there is a field socid in table of object
 

########## modulebuilder/template/class/myobject.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/modulebuilder/template/class/myobject.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/modulebuilder/template/class/myobject.class.php	2025-06-27 11:43:57.435959000 +0000
@@ -34,41 +34,30 @@
 class MyObject extends CommonObject
 {
 	/**
-	 * @var string 		ID of module.
+	 * @var string 	ID of module.
 	 */
 	public $module = 'mymodule';
 
 	/**
-	 * @var string 		ID to identify managed object.
+	 * @var string 	ID to identify managed object.
 	 */
 	public $element = 'myobject';
 
 	/**
-	 * @var string 		Name of table without prefix where object is stored. This is also the key used for extrafields management (so extrafields know the link to the parent table).
+	 * @var string 	Name of table without prefix where object is stored. This is also the key used for extrafields management (so extrafields know the link to the parent table).
 	 */
 	public $table_element = 'mymodule_myobject';
 
 	/**
-	 * @var string 		If permission must be checkec with hasRight('mymodule', 'read') and not hasright('mymodyle', 'myobject', 'read'), you can uncomment this line
+	 * @var string 	If permission must be checkec with hasRight('mymodule', 'read') and not hasright('mymodyle', 'myobject', 'read'), you can uncomment this line
 	 */
 	//public $element_for_permission = 'mymodule';
 
 	/**
-	 * @var string 		String with name of icon for myobject. Must be a 'fa-xxx' fontawesome code (or 'fa-xxx_fa_color_size') or 'myobject@mymodule' if picto is file 'img/object_myobject.png'.
+	 * @var string 	String with name of icon for myobject. Must be a 'fa-xxx' fontawesome code (or 'fa-xxx_fa_color_size') or 'myobject@mymodule' if picto is file 'img/object_myobject.png'.
 	 */
 	public $picto = 'fa-file';
 
-	/**
-	 * @var int<0,1>	Does object support extrafields ? 0=No, 1=Yes
-	 */
-	public $isextrafieldmanaged = 0;
-
-	/**
-	 * @var int<0,1>|string|null  	Does this object support multicompany module ?
-	 * 								0=No test on entity, 1=Test with field entity in local table, 'field@table'=Test entity into the field@table (example 'fk_soc@societe')
-	 */
-	public $ismultientitymanaged = 0;
-
 
 	const STATUS_DRAFT = 0;
 	const STATUS_VALIDATED = 1;
@@ -123,24 +112,24 @@
 	 * Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
 	 */
 	public $fields = array(
-		'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => 'Id', 'lang' => 'mymodule@mymodule'),
-		'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'validate' => 1, 'comment' => 'Reference of object', 'lang' => 'mymodule@mymodule'),
-		'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => 1, 'alwayseditable' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => 'Help text', 'showoncombobox' => 2, 'validate' => 1, 'lang' => 'mymodule@mymodule'),
-		'amount' => array('type' => 'price', 'label' => 'Amount', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => 1, 'default' => 'null', 'isameasure' => 1, 'help' => 'Help text for amount', 'validate' => 1, 'lang' => 'mymodule@mymodule'),
-		'qty' => array('type' => 'real', 'label' => 'Qty', 'enabled' => 1, 'position' => 45, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'css' => 'maxwidth75imp', 'help' => 'Help text for quantity', 'validate' => 1, 'lang' => 'mymodule@mymodule'),
-		'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))', 'label' => 'ThirdParty', 'picto' => 'company', 'enabled' => 'isModEnabled("societe")', 'position' => 50, 'notnull' => -1, 'visible' => 1, 'index' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150', 'help' => 'OrganizationEventLinkToThirdParty', 'validate' => 1, 'lang' => 'mymodule@mymodule'),
-		'fk_project' => array('type' => 'integer:Project:projet/class/project.class.php:1', 'label' => 'Project', 'picto' => 'project', 'enabled' => 'isModEnabled("project")', 'position' => 52, 'notnull' => -1, 'visible' => -1, 'index' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150', 'validate' => 1, 'lang' => 'mymodule@mymodule'),
-		'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 3, 'validate' => 1, 'lang' => 'mymodule@mymodule'),
-		'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'position' => 61, 'notnull' => 0, 'visible' => 0, 'cssview' => 'wordbreak', 'validate' => 1, 'lang' => 'mymodule@mymodule'),
-		'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'position' => 62, 'notnull' => 0, 'visible' => 0, 'cssview' => 'wordbreak', 'validate' => 1, 'lang' => 'mymodule@mymodule'),
-		'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 500, 'notnull' => 1, 'visible' => -2, 'lang' => 'mymodule@mymodule'),
-		'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 501, 'notnull' => 0, 'visible' => -2, 'lang' => 'mymodule@mymodule'),
-		'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'picto' => 'user', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => '0', 'csslist' => 'tdoverflowmax150', 'lang' => 'mymodule@mymodule'),
-		'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'picto' => 'user', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2, 'csslist' => 'tdoverflowmax150', 'lang' => 'mymodule@mymodule'),
-		'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'position' => 600, 'notnull' => 0, 'visible' => 0, 'lang' => 'mymodule@mymodule'),
-		'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2, 'lang' => 'mymodule@mymodule'),
-		'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'position' => 1010, 'notnull' => -1, 'visible' => 0, 'lang' => 'mymodule@mymodule'),
-		'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'position' => 2000, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'arrayofkeyval' => array(0 => 'Draft', '1' => 'Validated', 9 => 'Canceled'), 'validate' => 1, 'lang' => 'mymodule@mymodule'),
+		'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => 'Id'),
+		'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'validate' => 1, 'comment' => 'Reference of object'),
+		'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => 1, 'alwayseditable' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => 'Help text', 'showoncombobox' => 2, 'validate' => 1,),
+		'amount' => array('type' => 'price', 'label' => 'Amount', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => 1, 'default' => 'null', 'isameasure' => 1, 'help' => 'Help text for amount', 'validate' => 1,),
+		'qty' => array('type' => 'real', 'label' => 'Qty', 'enabled' => 1, 'position' => 45, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'css' => 'maxwidth75imp', 'help' => 'Help text for quantity', 'validate' => 1,),
+		'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))', 'label' => 'ThirdParty', 'picto' => 'company', 'enabled' => 'isModEnabled("societe")', 'position' => 50, 'notnull' => -1, 'visible' => 1, 'index' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150', 'help' => 'OrganizationEventLinkToThirdParty', 'validate' => 1,),
+		'fk_project' => array('type' => 'integer:Project:projet/class/project.class.php:1', 'label' => 'Project', 'picto' => 'project', 'enabled' => 'isModEnabled("project")', 'position' => 52, 'notnull' => -1, 'visible' => -1, 'index' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150', 'validate' => 1,),
+		'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 3, 'validate' => 1,),
+		'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'position' => 61, 'notnull' => 0, 'visible' => 0, 'cssview' => 'wordbreak', 'validate' => 1,),
+		'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'position' => 62, 'notnull' => 0, 'visible' => 0, 'cssview' => 'wordbreak', 'validate' => 1,),
+		'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 500, 'notnull' => 1, 'visible' => -2,),
+		'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 501, 'notnull' => 0, 'visible' => -2,),
+		'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'picto' => 'user', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => '0', 'csslist' => 'tdoverflowmax150',),
+		'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'picto' => 'user', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2, 'csslist' => 'tdoverflowmax150',),
+		'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'position' => 600, 'notnull' => 0, 'visible' => 0,),
+		'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2,),
+		'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'position' => 1010, 'notnull' => -1, 'visible' => 0,),
+		'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'position' => 2000, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'arrayofkeyval' => array(0 => 'Draft', '1' => 'Validated', 9 => 'Canceled'), 'validate' => 1,),
 	);
 
 	/**
@@ -251,6 +240,8 @@
 		global $langs;
 
 		$this->db = $db;
+		$this->ismultientitymanaged = 0;
+		$this->isextrafieldmanaged = 1;
 
 		if (!getDolGlobalInt('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid']) && !empty($this->fields['ref'])) {
 			$this->fields['rowid']['visible'] = 0;

########## modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php	2025-06-27 11:43:57.449716000 +0000
@@ -97,7 +97,7 @@
 		$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
 		if ($object->ismultientitymanaged == 1) {
 			$sql .= " AND entity = ".$conf->entity;
-		} elseif (!is_numeric($object->ismultientitymanaged)) { // @phan-suppress-current-line PhanPluginEmptyStatementIf
+		} elseif ($object->ismultientitymanaged == 2) { // @phan-suppress-current-line PhanPluginEmptyStatementIf
 			// TODO
 		}
 
@@ -135,7 +135,7 @@
 		$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
 		if ($object->ismultientitymanaged == 1) {
 			$sql .= " AND entity = ".$conf->entity;
-		} elseif (!is_numeric($object->ismultientitymanaged)) {
+		} elseif ($object->ismultientitymanaged == 2) {
 			// TODO
 		}
 

########## modulebuilder/template/myobject_list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/modulebuilder/template/myobject_list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/modulebuilder/template/myobject_list.php	2025-06-27 11:43:57.501437000 +0000
@@ -162,8 +162,8 @@
 	}
 }
 
-// List of fields to search into when doing a "search in all"
 $fieldstosearchall = array();
+// List of fields to search into when doing a "search in all"
 // foreach ($object->fields as $key => $val) {
 // 	if (!empty($val['searchall'])) {
 // 		$fieldstosearchall['t.'.$key] = $val['label'];
@@ -850,13 +850,7 @@
 				} elseif ($key == 'rowid') {
 					print $object->showOutputField($val, $key, (string) $object->id, '');
 				} else {
-					if ($val['type'] == 'html') {
-						print '<div class="small lineheightsmall twolinesmax-normallineheight">';
-					}
 					print $object->showOutputField($val, $key, (string) $object->$key, '');
-					if ($val['type'] == 'html') {
-						print '</div>';
-					}
 				}
 				print '</td>';
 				if (!$i) {

########## mrp/class/api_mos.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/mrp/class/api_mos.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/mrp/class/api_mos.class.php	2025-06-27 11:43:57.682041000 +0000
@@ -108,7 +108,7 @@
 		$obj_ret = array();
 		$tmpobject = new Mo($this->db);
 
-		$socid = DolibarrApiAccess::$user->socid ?: 0;
+		$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : 0;
 
 		$restrictonsocid = 0; // Set to 1 if there is a field socid in table of object
 

########## mrp/class/mo.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/mrp/class/mo.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/mrp/class/mo.class.php	2025-06-27 11:43:57.684180000 +0000
@@ -2045,10 +2045,7 @@
 		if ($this->status != Mo::STATUS_VALIDATED && $this->status != Mo::STATUS_INPROGRESS) {
 			return false;
 		}
-		if (empty($this->date_end_planned)) {
-			return false;
-		}
-		return (dol_now() > ((int) $this->date_end_planned + $conf->mrp->progress->warning_delay));
+		return (dol_now() > ($this->date_end_planned + $conf->mrp->progress->warning_delay));
 	}
 
 

########## mrp/mo_list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/mrp/mo_list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/mrp/mo_list.php	2025-06-27 11:43:57.693323000 +0000
@@ -32,6 +32,7 @@
 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
 require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
 require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
+
 // load mrp libraries
 require_once __DIR__.'/class/mo.class.php';
 
@@ -57,7 +58,6 @@
 $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
 $optioncss  = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
 $mode = GETPOST('mode', 'alpha');
-$groupby = GETPOST('groupby', 'aZ09');	// Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut'
 
 $id = GETPOSTINT('id');
 
@@ -65,7 +65,7 @@
 $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
 $sortfield = GETPOST('sortfield', 'aZ09comma');
 $sortorder = GETPOST('sortorder', 'aZ09comma');
-$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page');
+$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
 $also_cancel_consumed_and_produced_lines = (GETPOST('alsoCancelConsumedAndProducedLines', 'alpha') ? 1 : 0);
 $changeDate = GETPOST('change_date', 'alpha');
 
@@ -128,16 +128,15 @@
 }
 
 // Definition of array of fields for columns
-$tableprefix = 't';
 $arrayfields = array();
 foreach ($object->fields as $key => $val) {
 	// If $val['visible']==0, then we never show the field
 	if (!empty($val['visible'])) {
 		$visible = (int) dol_eval((string) $val['visible'], 1);
-		$arrayfields[$tableprefix.'.'.$key] = array(
+		$arrayfields['t.'.$key] = array(
 			'label' => $val['label'],
-			'checked' => (($visible < 0) ? '0' : '1'),
-			'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)),
+			'checked' => (($visible < 0) ? 0 : 1),
+			'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
 			'position' => $val['position'],
 			'help' => isset($val['help']) ? $val['help'] : ''
 		);
@@ -145,7 +144,7 @@
 
 	if ($key == 'fk_parent_line') {
 		$visible = (int) dol_eval((string) $val['visible'], 1);
-		$arrayfields[$tableprefix.'.'.$key] = array(
+		$arrayfields['t.'.$key] = array(
 			'label' => $val['label'],
 			'checked' => (($visible <= 0) ? 0 : 1),
 			'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
@@ -183,7 +182,7 @@
 	$massaction = '';
 }
 
-$parameters = array('arrayfields' => &$arrayfields);
+$parameters = array();
 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
 if ($reshook < 0) {
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@@ -307,8 +306,8 @@
 
 // Build and execute select
 // --------------------------------------------------------------------
-$sql = "SELECT ";
-$sql .= " ".$object->getFieldList('t');
+$sql = 'SELECT ';
+$sql .= $object->getFieldList('t');
 // Add fields from extrafields
 if (!empty($extrafields->attributes[$object->table_element]['label'])) {
 	foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
@@ -323,13 +322,13 @@
 
 $sqlfields = $sql; // $sql fields to remove for count total
 
-$sql .= " FROM ".$db->prefix().$object->table_element." as t";
+$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
 if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
 	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
 }
-$sql .= " LEFT JOIN ".$db->prefix()."mrp_production as lineparent ON t.fk_parent_line = lineparent.rowid";
-$sql .= " LEFT JOIN ".$db->prefix()."mrp_mo as moparent ON lineparent.fk_mo = moparent.rowid";
-$sql .= " LEFT JOIN ".$db->prefix()."product as p ON t.fk_product = p.rowid";
+$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_production as lineparent ON t.fk_parent_line = lineparent.rowid";
+$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_mo as moparent ON lineparent.fk_mo = moparent.rowid";
+$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON t.fk_product = p.rowid";
 // Add table from hooks
 $parameters = array();
 $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
@@ -432,7 +431,7 @@
 		dol_print_error($db);
 	}
 
-	if (($page * $limit) > $nbtotalofrecords) {	// if total resultset is smaller than the paging size (filtering), goto and load page 0
+	if (($page * $limit) > $nbtotalofrecords) {	// if total resultset is smaller than paging size (filtering), goto and load page 0
 		$page = 0;
 		$offset = 0;
 	}
@@ -482,9 +481,6 @@
 if ($optioncss != '') {
 	$param .= '&optioncss='.urlencode($optioncss);
 }
-if ($groupby != '') {
-	$param .= '&groupby='.urlencode($groupby);
-}
 foreach ($search as $key => $val) {
 	if (is_array($search[$key])) {
 		foreach ($search[$key] as $skey) {
@@ -493,9 +489,9 @@
 			}
 		}
 	} elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) {
-		$param .= '&search_'.$key.'month='.GETPOSTINT('search_'.$key.'month');
-		$param .= '&search_'.$key.'day='.GETPOSTINT('search_'.$key.'day');
-		$param .= '&search_'.$key.'year='.GETPOSTINT('search_'.$key.'year');
+		$param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int'));
+		$param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int'));
+		$param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int'));
 	} elseif ($search[$key] != '') {
 		$param .= '&search_'.$key.'='.urlencode($search[$key]);
 	}
@@ -674,7 +670,7 @@
 			}
 			print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
 		} elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
-			print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth125', 1);
+			print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1);
 		} elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
 			print '<input type="text" class="flat maxwidth'.($val['type'] == 'integer' ? '50' : '75').'" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
 		} elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
@@ -726,10 +722,9 @@
 		$cssforfield .= ($cssforfield ? ' ' : '').'center';
 	} elseif (in_array($val['type'], array('timestamp'))) {
 		$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
-	} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
+	} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
 		$cssforfield .= ($cssforfield ? ' ' : '').'right';
 	}
-	$cssforfield = preg_replace('/small\s*/', '', $cssforfield);	// the 'small' css must not be used for the title label
 	if (!empty($arrayfields['t.'.$key]['checked'])) {
 		if ($key == "fk_product") {
 			print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 'p.ref', '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n";
@@ -742,7 +737,7 @@
 // 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, 'totalarray' => &$totalarray);
+$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder);
 $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
 print $hookmanager->resPrint;
 // Action column
@@ -784,7 +779,7 @@
 	$object->setVarsFromFetchObj($obj);
 
 
-	if ($mode == 'kanban' || $mode == 'kanbangroupby') {
+	if ($mode == 'kanban') {
 		if ($i == 0) {
 			print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
 			print '<div class="box-flex-container kanban">';
@@ -856,7 +851,7 @@
 			if (!empty($arrayfields['t.'.$key]['checked'])) {
 				print '<td'.($cssforfield ? ' class="'.$cssforfield.((preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) ? ' classfortooltip' : '').'"' : '');
 				if (preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) {
-					print ' title="'.dolPrintHTMLForAttribute((string) $object->$key).'"';
+					print ' title="'.dol_escape_htmltag((string) $object->$key).'"';
 				}
 				print '>';
 				if ($key == 'status') {
@@ -869,14 +864,7 @@
 				} elseif ($key == 'rowid') {
 					print $object->showOutputField($val, $key, (string) $object->id, '');
 				} else {
-					if ($val['type'] == 'html') {
-						print '<div class="small lineheightsmall twolinesmax-normallineheight">';
-					}
 					print $object->showOutputField($val, $key, (string) $object->$key, '');
-					if ($val['type'] == 'html') {
-						print '</div>';
-					}
-
 					if ($key == 'date_end_planned' && $object->hasDelay()) {
 						print img_warning($langs->trans('Alert').' - '.$langs->trans('Late'));
 					}
@@ -946,7 +934,7 @@
 $db->free($resql);
 
 $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
-$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook
 print $hookmanager->resPrint;
 
 print '</table>'."\n";

########## mrp/mo_movements.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/mrp/mo_movements.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/mrp/mo_movements.php	2025-06-27 11:43:57.695015000 +0000
@@ -97,7 +97,7 @@
 $object = new Mo($db);
 $extrafields = new ExtraFields($db);
 $diroutputmassaction = $conf->mrp->dir_output.'/temp/massgeneration/'.$user->id;
-$hookmanager->initHooks(array('mocard', 'globalcard', 'mocardmovelist' )); // Note that conf->hooks_modules contains array
+$hookmanager->initHooks(array('mocard', 'globalcard')); // Note that conf->hooks_modules contains array
 
 // Fetch optionals attributes and labels
 $extrafields->fetch_name_optionals_label($object->table_element);
@@ -966,7 +966,7 @@
 		// Inventory code
 		if (!empty($arrayfields['m.inventorycode']['checked'])) {
 			print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($objp->inventorycode).'">';
-			//print '<a href="' . DOL_URL_ROOT . '/product/stock/movement_list.php' . '?id=' . ((int) $objp->entrepot_id) . '&search_inventorycode=' . urlencode($objp->inventorycode) . '&search_type_mouvement=' . urlencode($objp->type_mouvement) . '">';
+			//print '<a href="' . DOL_URL_ROOT . '/product/stock/movement_card.php' . '?id=' . $objp->entrepot_id . '&amp;search_inventorycode=' . $objp->inventorycode . '&amp;search_type_mouvement=' . $objp->type_mouvement . '">';
 			print dol_escape_htmltag($objp->inventorycode);
 			//print '</a>';
 			print '</td>';

########## partnership/class/api_partnerships.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/partnership/class/api_partnerships.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/partnership/class/api_partnerships.class.php	2025-06-27 11:43:57.521976000 +0000
@@ -113,7 +113,7 @@
 			throw new RestException(403);
 		}
 
-		$socid = DolibarrApiAccess::$user->socid ?: 0;
+		$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : 0;
 
 		$restrictonsocid = 0; // Set to 1 if there is a field socid in table of object
 

########## partnership/core/modules/partnership/mod_partnership_standard.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/partnership/core/modules/partnership/mod_partnership_standard.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/partnership/core/modules/partnership/mod_partnership_standard.php	2025-06-27 11:43:57.531293000 +0000
@@ -97,7 +97,7 @@
 		$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
 		if ($object->ismultientitymanaged == 1) {
 			$sql .= " AND entity = ".$conf->entity;
-		} elseif (!is_numeric($object->ismultientitymanaged)) {
+		} elseif ($object->ismultientitymanaged == 2) {
 			// TODO
 		}
 
@@ -135,7 +135,7 @@
 		$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
 		if ($object->ismultientitymanaged == 1) {
 			$sql .= " AND entity = ".$conf->entity;
-		} elseif (!is_numeric($object->ismultientitymanaged)) {
+		} elseif ($object->ismultientitymanaged == 2) {
 			// TODO
 		}
 

########## paypal/lib/paypal.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/paypal/lib/paypal.lib.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/paypal/lib/paypal.lib.php	2025-06-27 11:43:59.592903000 +0000
@@ -459,7 +459,7 @@
 
 	// TODO problem with triggers
 	$API_version = "98.0";
-	if (getDolGlobalString('PAYPAL_API_SANDBOX')/* || GETPOST('forcesandbox', 'alpha') */) {		// We can force sand box with param 'forcesandbox'
+	if (getDolGlobalString('PAYPAL_API_SANDBOX') || GETPOST('forcesandbox', 'alpha')) {		// We can force sand box with param 'forcesandbox'
 		$API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
 		$API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=";
 	} else {

########## paypal/lib/paypalfunctions.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/paypal/lib/paypalfunctions.lib.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/paypal/lib/paypalfunctions.lib.php	2025-06-27 11:43:59.593938000 +0000
@@ -49,7 +49,7 @@
  ' For the sandbox, the URL is       https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=
  ' For the live site, the URL is        https://www.paypal.com/webscr&cmd=_express-checkout&token=
  */
-if (getDolGlobalString('PAYPAL_API_SANDBOX')/* || GETPOST('forcesandbox', 'alpha') */) {		// We can force sand box with param 'forcesandbox'
+if (getDolGlobalString('PAYPAL_API_SANDBOX') || GETPOST('forcesandbox', 'alpha')) {		// We can force sand box with param 'forcesandbox'
 	$API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
 	$API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=";
 } else {

########## product/ajax/products.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/ajax/products.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/ajax/products.php	2025-06-27 11:43:59.716228000 +0000
@@ -184,7 +184,7 @@
 			$sql .= " WHERE fk_product = ".((int) $id);
 			$sql .= " AND entity IN (".getEntity('productprice').")";
 			$sql .= " AND price_level = ".((int) $price_level);
-			$sql .= " ORDER BY date_price DESC, rowid";
+			$sql .= " ORDER BY date_price";
 			$sql .= " DESC LIMIT 1";
 
 			$result = $db->query($sql);

########## product/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/card.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/card.php	2025-06-27 11:43:59.629832000 +0000
@@ -1363,18 +1363,6 @@
 $sellOrEatByMandatoryList = null;
 if (isModEnabled('productbatch')) {
 	$sellOrEatByMandatoryList = Product::getSellOrEatByMandatoryList();
-
-	$disableSellBy = getDolGlobalString('PRODUCT_DISABLE_SELLBY');
-	$disableEatBy  = getDolGlobalString('PRODUCT_DISABLE_EATBY');
-
-	if ($disableSellBy) {
-		unset($sellOrEatByMandatoryList[Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_BY]);
-		unset($sellOrEatByMandatoryList[Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_AND_EAT]);
-	}
-	if ($disableEatBy) {
-		unset($sellOrEatByMandatoryList[Product::SELL_OR_EAT_BY_MANDATORY_ID_EAT_BY]);
-		unset($sellOrEatByMandatoryList[Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_AND_EAT]);
-	}
 }
 
 $title = $langs->trans('ProductServiceCard');

########## product/class/api_products.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/class/api_products.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/class/api_products.class.php	2025-06-27 11:43:59.748232000 +0000
@@ -3,7 +3,6 @@
  * Copyright (C) 2019		Cedric Ancelin			<icedo.anc@gmail.com>
  * Copyright (C) 2024		Frédéric France			<frederic.france@free.fr>
  * Copyright (C) 2024-2025	MDW						<mdeweerd@users.noreply.github.com>
- * Copyright (C) 2025		William Mead			<william@m34d.com>
  *
  * 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
@@ -197,13 +196,15 @@
 	 */
 	public function index($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $sqlfilters = '', $ids_only = false, $variant_filter = 0, $pagination_data = false, $includestockdata = 0, $properties = '')
 	{
+		global $db, $conf;
+
 		if (!DolibarrApiAccess::$user->hasRight('produit', 'lire')) {
 			throw new RestException(403);
 		}
 
 		$obj_ret = array();
 
-		$socid = DolibarrApiAccess::$user->socid ?: '';
+		$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : '';
 
 		$sql = "SELECT t.rowid, t.ref, t.ref_ext";
 		$sql .= " FROM ".$this->db->prefix()."product as t";
@@ -450,10 +451,8 @@
 				if ($this->product->tva_npr != $oldproduct->tva_npr) {
 					$pricemodified = true;
 				}
-				if (!empty($this->product->default_vat_code)) {
-					if ($this->product->default_vat_code != $oldproduct->default_vat_code) {
-						$pricemodified = true;
-					}
+				if ($this->product->default_vat_code != $oldproduct->default_vat_code) {
+					$pricemodified = true;
 				}
 
 				if ($this->product->price_base_type == 'TTC') {
@@ -799,7 +798,7 @@
 			throw new RestException(400, 'API not available: this mode of pricing is not enabled by setup');
 		}
 
-		$socid = DolibarrApiAccess::$user->socid ?: '';
+		$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : '';
 		if ($socid > 0 && $socid != $thirdparty_id) {
 			throw new RestException(403, 'Getting prices for all customers or for the customer ID '.$thirdparty_id.' is not allowed for login '.DolibarrApiAccess::$user->login);
 		}
@@ -919,7 +918,7 @@
 			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
 		}
 
-		$socid = DolibarrApiAccess::$user->socid ?: '';
+		$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : '';
 		if ($socid > 0 && $socid != $fourn_id) {
 			throw new RestException(403, 'Adding purchase price for the supplier ID '.$fourn_id.' is not allowed for login '.DolibarrApiAccess::$user->login);
 		}
@@ -1017,7 +1016,7 @@
 		$obj_ret = array();
 
 		// Force id of company for external users
-		$socid = DolibarrApiAccess::$user->socid ?: '';
+		$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : '';
 		if ($socid > 0) {
 			if ($supplier != $socid || empty($supplier)) {
 				throw new RestException(403, 'As an external user, you can request only for your supplier id = '.$socid);
@@ -1130,7 +1129,7 @@
 			throw new RestException(403);
 		}
 
-		$socid = DolibarrApiAccess::$user->socid ?: '';
+		$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : '';
 
 		$result = $this->product->fetch($id, $ref, $ref_ext, $barcode);
 		if (!$result) {

########## product/class/product.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/class/product.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/class/product.class.php	2025-06-27 11:43:59.745911000 +0000
@@ -363,14 +363,12 @@
 	/**
 	 * Cost price
 	 *
-	 * @var ?float
+	 * @var float
 	 */
 	public $cost_price;
 
 	/**
-	 * Average price value for product entry into stock (PMP)
-	 *
-	 * @var ?float
+	 * @var float Average price value for product entry in stock (PMP)
 	 */
 	public $pmp;
 
@@ -783,7 +781,7 @@
 	 *
 	 * @var array<string,array<int,array{0:int,1:float,2:int,3:string,4:int,5:string}>>
 	 */
-	public $sousprods = array();
+	public $sousprods;
 
 	/**
 	 * @var array<int,array{id:int,id_parent:int,ref:string,nb:int,nb_total:int,stock:float,stock_alert:float,label:string,fullpath:string,type:int,desiredstick:float,level:int,incdec:int<0,1>,entity:CommonObject}> Path of subproducts. Build from ->sousprods with get_arbo_each_prod()
@@ -1958,9 +1956,9 @@
 	}
 
 	/**
-	 * Get the array of labels of Sell by or Eat by all mandatory flags for each status
+	 * Get sell or eat by mandatory list
 	 *
-	 * @return 	array{0:string,1:string,2:string,3:string}	Array of labels of Sell by or Eat by all mandatory flags
+	 * @return 	array{0:string,1:string,2:string,3:string}	Sell or eat by mandatory list
 	 */
 	public static function getSellOrEatByMandatoryList()
 	{
@@ -1977,9 +1975,9 @@
 	}
 
 	/**
-	 * Get the label for sell by or eat by mandatory flag of the current product
+	 * Get sell or eat by mandatory label
 	 *
-	 * @return 	string		Sell or eat by mandatory label
+	 * @return 	string	Sell or eat by mandatory label
 	 */
 	public function getSellOrEatByMandatoryLabel()
 	{
@@ -1996,8 +1994,8 @@
 	/**
 	 *    Update or add a translation for a product
 	 *
-	 * @param  User $user 	Object user making update
-	 * @return int        	Return integer <0 if KO, >0 if OK
+	 * @param  User $user Object user making update
+	 * @return int        Return integer <0 if KO, >0 if OK
 	 */
 	public function setMultiLangs($user)
 	{
@@ -3058,7 +3056,7 @@
 				$this->price_min = $obj->price_min;
 				$this->price_min_ttc = $obj->price_min_ttc;
 				$this->price_base_type = $obj->price_base_type;
-				$this->cost_price = isset($obj->cost_price) ? (float) $obj->cost_price : null;
+				$this->cost_price = $obj->cost_price;
 				$this->default_vat_code = $obj->default_vat_code;
 				$this->tva_tx = $obj->tva_tx;
 				//! French VAT NPR
@@ -6111,7 +6109,7 @@
 	 * @param	float			$nbpiece		nb of units (should be always positive, use $movement to decide if we add or remove)
 	 * @param	int<0,1>		$movement		0 = add, 1 = remove
 	 * @param	string			$label			Label of stock movement
-	 * @param	int|float		$price			Unit price HT of product, used to calculate average weighted price (PMP in french). If 0, average weighted price is not changed.
+	 * @param	float			$price			Unit price HT of product, used to calculate average weighted price (PMP in french). If 0, average weighted price is not changed.
 	 * @param	string			$inventorycode	Inventory code
 	 * @param	string			$origin_element	Origin element type
 	 * @param	?int			$origin_id		Origin id of element
@@ -6167,22 +6165,22 @@
 	/**
 	 *  Adjust stock in a warehouse for product with batch number
 	 *
-	 * @param	User			$user           	User asking change
-	 * @param	int				$id_entrepot    	Id of warehouse
-	 * @param	float			$nbpiece        	Nb of units (should be always positive, use $movement to decide if we add or remove)
-	 * @param	int<0,1>		$movement       	0 = add, 1 = remove
-	 * @param	string			$label          	Label of stock movement
-	 * @param	int|float		$price          	Price to use for stock eval
-	 * @param	int|string		$dlc            	eat-by date
-	 * @param	int|string		$dluo           	sell-by date
-	 * @param	string			$lot            	Lot number
-	 * @param	string			$inventorycode  	Inventory code
-	 * @param	string			$origin_element 	Origin element type
-	 * @param	?int			$origin_id      	Origin id of element
-	 * @param	int				$disablestockchangeforsubproduct	Disable stock change for sub-products of kit (useful only if product is a subproduct)
-	 * @param	?ExtraFields	$extrafields		Array of extrafields
-	 * @param	boolean			$force_update_batch Force update batch
-	 * @return int              		        	Return integer <0 if KO, >0 if OK
+	 * @param	User		$user           user asking change
+	 * @param	int			$id_entrepot    id of warehouse
+	 * @param	float		$nbpiece        nb of units (should be always positive, use $movement to decide if we add or remove)
+	 * @param	int<0,1>	$movement       0 = add, 1 = remove
+	 * @param	string		$label          Label of stock movement
+	 * @param	float		$price          Price to use for stock eval
+	 * @param	int|string	$dlc            eat-by date
+	 * @param	int|string	$dluo           sell-by date
+	 * @param	string		$lot            Lot number
+	 * @param	string		$inventorycode  Inventory code
+	 * @param	string		$origin_element Origin element type
+	 * @param	?int		$origin_id      Origin id of element
+	 * @param	int			$disablestockchangeforsubproduct	Disable stock change for sub-products of kit (useful only if product is a subproduct)
+	 * @param	?ExtraFields	$extrafields	Array of extrafields
+	 * @param	boolean		$force_update_batch   Force update batch
+	 * @return int                      Return integer <0 if KO, >0 if OK
 	 */
 	public function correct_stock_batch($user, $id_entrepot, $nbpiece, $movement, $label = '', $price = 0, $dlc = '', $dluo = '', $lot = '', $inventorycode = '', $origin_element = '', $origin_id = null, $disablestockchangeforsubproduct = 0, $extrafields = null, $force_update_batch = false)
 	{

########## product/inventory/inventory.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/inventory/inventory.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/inventory/inventory.php	2025-06-27 11:43:59.768611000 +0000
@@ -1149,7 +1149,7 @@
 				}
 				$pmp_valuation = $pmp_expected * $valuetoshow;
 				print '<td class="right">';
-				print is_null($pmp_expected) ? '' : price($pmp_expected);
+				print price($pmp_expected);
 				print '<input type="hidden" name="expectedpmp_'.$obj->rowid.'" value="'.$pmp_expected.'"/>';
 				print '</td>';
 				print '<td class="right">';
@@ -1171,7 +1171,7 @@
 					$pmp_real = $product_static->pmp;
 				}
 				$pmp_valuation_real = $pmp_real * $qty_view;
-				print '<input type="text" class="maxwidth75 right realpmp'.$obj->fk_product.'" name="realpmp_'.$obj->rowid.'" id="id_'.$obj->rowid.'_input_pmp" value="'.(is_null($pmp_real) ? '' : price2num($pmp_real)).'">';
+				print '<input type="text" class="maxwidth75 right realpmp'.$obj->fk_product.'" name="realpmp_'.$obj->rowid.'" id="id_'.$obj->rowid.'_input_pmp" value="'.price2num($pmp_real).'">';
 				print '</td>';
 				print '<td class="right">';
 				print '<input type="text" class="maxwidth75 right realvaluation'.$obj->fk_product.'" name="realvaluation_'.$obj->rowid.'" id="id_'.$obj->rowid.'_input_real_valuation" value="'.$pmp_valuation_real.'">';
@@ -1198,7 +1198,7 @@
 			print '</td>';
 		} else {
 			if (getDolGlobalString('INVENTORY_MANAGE_REAL_PMP')) {
-				// PMP Expected
+				//PMP Expected
 				if (!empty($obj->pmp_expected)) {
 					$pmp_expected = $obj->pmp_expected;
 				} else {
@@ -1206,7 +1206,7 @@
 				}
 				$pmp_valuation = $pmp_expected * $valuetoshow;
 				print '<td class="right">';
-				print is_null($pmp_expected) ? '' : price($pmp_expected);
+				print price($pmp_expected);
 				print '</td>';
 				print '<td class="right">';
 				print price($pmp_valuation);
@@ -1216,7 +1216,7 @@
 				print $obj->qty_view;	// qty found
 				print '</td>';
 
-				// PMP Real
+				//PMP Real
 				print '<td class="right">';
 				if (!empty($obj->pmp_real)) {
 					$pmp_real = $obj->pmp_real;
@@ -1224,7 +1224,7 @@
 					$pmp_real = $product_static->pmp;
 				}
 				$pmp_valuation_real = $pmp_real * $obj->qty_view;
-				print is_null($pmp_real) ? '' : price($pmp_real);
+				print price($pmp_real);
 				print '</td>';
 				print '<td class="right">';
 				print price($pmp_valuation_real);

########## product/stats/commande_fournisseur.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/stats/commande_fournisseur.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/stats/commande_fournisseur.php	2025-06-27 11:43:59.732485000 +0000
@@ -279,7 +279,6 @@
 
 						$supplierorderstatic->id = $objp->commandeid;
 						$supplierorderstatic->ref = $objp->ref;
-
 						$supplierorderstatic->statut = $objp->status;	// deprecated
 						$supplierorderstatic->status = $objp->status;
 						$supplierorderstatic->billed = $objp->billed;

########## product/stock/class/api_stockmovements.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/stock/class/api_stockmovements.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/stock/class/api_stockmovements.class.php	2025-06-27 11:43:59.701992000 +0000
@@ -48,7 +48,7 @@
 	 */
 	public function __construct()
 	{
-		global $db;
+		global $db, $conf;
 		$this->db = $db;
 		$this->stockmovement = new MouvementStock($this->db);
 	}
@@ -89,7 +89,7 @@
 	 * @param string	$sortorder	Sort order
 	 * @param int		$limit		Limit for list
 	 * @param int		$page		Page number
-	 * @param string    $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.fk_product:=:1) and (t.date_creation:<:'20160101')"
+	 * @param string    $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.product_id:=:1) and (t.date_creation:<:'20160101')"
 	 * @param string    $properties	Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names
 	 * @return array                Array of warehouse objects
 	 * @phan-return MouvementStock[]
@@ -99,6 +99,8 @@
 	 */
 	public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '')
 	{
+		global $conf;
+
 		$obj_ret = array();
 
 		if (!DolibarrApiAccess::$user->hasRight('stock', 'lire')) {
@@ -170,8 +172,8 @@
 	 * @param string $dluo Sell-by date. {@from body} {@type date}
 	 * @param string $origin_type   Origin type (Element of source object, like 'project', 'inventory', ...)
 	 * @param int $origin_id     Origin id (Id of source object)
-	 * @return  int                         ID of stock movement
 	 *
+	 * @return  int                         ID of stock movement
 	 * @throws RestException
 	 */
 	public function post($product_id, $warehouse_id, $qty, $type = 2, $lot = '', $movementcode = '', $movementlabel = '', $price = '', $datem = '', $dlc = '', $dluo = '', $origin_type = '', $origin_id = 0)

########## product/stock/class/api_warehouses.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/stock/class/api_warehouses.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/stock/class/api_warehouses.class.php	2025-06-27 11:43:59.700767000 +0000
@@ -46,7 +46,7 @@
 	 */
 	public function __construct()
 	{
-		global $db;
+		global $db, $conf;
 		$this->db = $db;
 		$this->warehouse = new Entrepot($this->db);
 	}
@@ -99,6 +99,8 @@
 	 */
 	public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $category = 0, $sqlfilters = '', $properties = '')
 	{
+		global $db, $conf;
+
 		$obj_ret = array();
 
 		if (!DolibarrApiAccess::$user->hasRight('stock', 'lire')) {
@@ -286,6 +288,9 @@
 		// phpcs:enable
 		$object = parent::_cleanObjectDatas($object);
 
+		// Remove the subscriptions because they are handled as a subresource.
+		//unset($object->subscriptions);
+
 		return $object;
 	}
 

########## product/stock/class/mouvementstock.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/stock/class/mouvementstock.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/stock/class/mouvementstock.class.php	2025-06-27 11:43:59.698264000 +0000
@@ -205,7 +205,7 @@
 	 *													0=input (stock increase by a stock transfer), 1=output (stock decrease by a stock transfer),
 	 *													2=output (stock decrease), 3=input (stock increase)
 	 *                          		            	Note that qty should be > 0 with 0 or 3, < 0 with 1 or 2.
-	 *	@param		int|float		$price				Unit price HT of product, used to calculate average weighted price (AWP or PMP in french). If 0, average weighted price is not changed.
+	 *	@param		float			$price				Unit price HT of product, used to calculate average weighted price (AWP or PMP in french). If 0, average weighted price is not changed.
 	 *	@param		string			$label				Label of stock movement
 	 *	@param		string			$inventorycode		Inventory code
 	 *	@param		int|string		$datem				Force date of movement

########## product/stock/massstockmove.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/stock/massstockmove.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/stock/massstockmove.php	2025-06-27 11:43:59.684499000 +0000
@@ -216,7 +216,7 @@
 				// Define value of products moved
 				$pricesrc = 0;
 				if (!empty($product->pmp)) {
-					$pricesrc = (float) $product->pmp;
+					$pricesrc = $product->pmp;
 				}
 				$pricedest = $pricesrc;
 

########## product/stock/movement_list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/stock/movement_list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/stock/movement_list.php	2025-06-27 11:43:59.646684000 +0000
@@ -400,6 +400,8 @@
 		if ($product->hasbatch()) {
 			$batch = GETPOST('batch_number', 'alphanohtml');
 
+			//$eatby=GETPOST('eatby');
+			//$sellby=GETPOST('sellby');
 			$eatby = dol_mktime(0, 0, 0, GETPOSTINT('eatbymonth'), GETPOSTINT('eatbyday'), GETPOSTINT('eatbyyear'));
 			$sellby = dol_mktime(0, 0, 0, GETPOSTINT('sellbymonth'), GETPOSTINT('sellbyday'), GETPOSTINT('sellbyyear'));
 
@@ -508,16 +510,17 @@
 
 			if ($product->hasbatch()) {
 				$pdluo = new Productbatch($db);
-				$srcwarehouseid = 0;
-
-				$eatby = dol_mktime(0, 0, 0, GETPOSTINT('eatbymonth'), GETPOSTINT('eatbyday'), GETPOSTINT('eatbyyear'));
-				$sellby = dol_mktime(0, 0, 0, GETPOSTINT('sellbymonth'), GETPOSTINT('sellbyday'), GETPOSTINT('sellbyyear'));
 
+				$srcwarehouseid = 0;
+				$eatby = -1;
+				$sellby = -1;
 				if ($pdluoid > 0) {
 					$result = $pdluo->fetch($pdluoid);
 					if ($result) {
 						$srcwarehouseid = $pdluo->warehouseid;
 						$batch = $pdluo->batch;
+						$eatby = $pdluo->eatby;
+						$sellby = $pdluo->sellby;
 					} else {
 						setEventMessages($pdluo->error, $pdluo->errors, 'errors');
 						$error++;
@@ -525,6 +528,8 @@
 				} else {
 					$srcwarehouseid = $id;
 					$batch = GETPOST('batch_number', 'alphanohtml');
+					$eatby = $d_eatby;
+					$sellby = $d_sellby;
 				}
 
 				$result1 = -1;
@@ -537,7 +542,7 @@
 						GETPOSTFLOAT("nbpiece"),
 						1,
 						GETPOST("label", 'san_alpha'),
-						(float) $pricesrc,
+						$pricesrc,
 						$eatby,
 						$sellby,
 						$batch,
@@ -554,7 +559,7 @@
 						GETPOSTFLOAT("nbpiece"),
 						0,
 						GETPOST("label", 'san_alpha'),
-						(float) $pricedest,
+						$pricedest,
 						$eatby,
 						$sellby,
 						$batch,
@@ -573,7 +578,7 @@
 					GETPOSTFLOAT("nbpiece"),
 					1,
 					GETPOST("label", 'san_alpha'),
-					(float) $pricesrc,
+					$pricesrc,
 					GETPOST('inventorycode', 'alphanohtml'),
 					'',
 					null,
@@ -588,7 +593,7 @@
 					GETPOSTFLOAT("nbpiece"),
 					0,
 					GETPOST("label", 'san_alpha'),
-					(float) $pricedest,
+					$pricedest,
 					GETPOST('inventorycode', 'alphanohtml'),
 					'',
 					null,
@@ -826,6 +831,10 @@
 	}
 }
 
+
+// Output page
+// --------------------------------------------------------------------
+
 $i = 0;
 $help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:M&oacute;dulo_Stocks';
 if ($msid) {
@@ -992,8 +1001,6 @@
 
 // Transfer of units
 if ($action == "transfert") {
-	$d_eatby = GETPOSTDATE('eatby');	// used by the tpl
-	$d_sellby = GETPOSTDATE('sellby');	// used by the tpl
 	include DOL_DOCUMENT_ROOT.'/product/stock/tpl/stocktransfer.tpl.php';
 	print '<br>';
 }

########## product/stock/product.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/stock/product.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/stock/product.php	2025-06-27 11:43:59.648494000 +0000
@@ -434,7 +434,7 @@
 						(float) $nbpiece,
 						1,
 						GETPOST("label", 'alphanohtml'),
-						(float) $pricesrc,
+						$pricesrc,
 						$eatby,
 						$sellby,
 						$batch,
@@ -452,7 +452,7 @@
 						(float) $nbpiece,
 						0,
 						GETPOST("label", 'alphanohtml'),
-						(float) $pricedest,
+						$pricedest,
 						$eatby,
 						$sellby,
 						(string) $batch,
@@ -471,7 +471,7 @@
 						(float) $nbpiece,
 						1,
 						GETPOST("label", 'alphanohtml'),
-						(float) $pricesrc,
+						$pricesrc,
 						GETPOST('inventorycode', 'alphanohtml')
 					);
 					if ($result1 < 0) {
@@ -486,7 +486,7 @@
 						(float) $nbpiece,
 						0,
 						GETPOST("label", 'alphanohtml'),
-						(float) $pricedest,
+						$pricedest,
 						GETPOST('inventorycode', 'alphanohtml')
 					);
 					if ($result2 < 0) {

########## product/stock/stockatdate.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/stock/stockatdate.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/stock/stockatdate.php	2025-06-27 11:43:59.654222000 +0000
@@ -504,12 +504,6 @@
 
 	// Fields title search
 	print '<tr class="liste_titre_filter">';
-	if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
-		print '<td class="liste_titre center maxwidthsearch">';
-		$searchpicto = $form->showFilterButtons('left');
-		print $searchpicto;
-		print '</td>';
-	}
 	print '<td class="liste_titre"><input class="flat" type="text" name="search_ref" size="8" value="'.dol_escape_htmltag($search_ref).'"></td>';
 	print '<td class="liste_titre"><input class="flat" type="text" name="search_nom" size="8" value="'.dol_escape_htmltag($search_nom).'"></td>';
 	print '<td class="liste_titre"></td>';
@@ -526,13 +520,10 @@
 	$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
 	print $hookmanager->resPrint;
 
-	// Action column
-	if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
-		print '<td class="liste_titre center maxwidthsearch">';
-		$searchpicto = $form->showFilterButtons();
-		print $searchpicto;
-		print '</td>';
-	}
+	print '<td class="liste_titre maxwidthsearch">';
+	$searchpicto = $form->showFilterAndCheckAddButtons(0);
+	print $searchpicto;
+	print '</td>';
 	print '</tr>';
 
 	$fieldtosortcurrentstock = 'stock';
@@ -542,10 +533,6 @@
 
 	// Lines of title
 	print '<tr class="liste_titre">';
-	// Action column
-	if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
-		print_liste_field_titre('', $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'left ');
-	}
 	print_liste_field_titre('ProductRef', $_SERVER["PHP_SELF"], 'p.ref', $param, '', '', $sortfield, $sortorder);
 	print_liste_field_titre('Label', $_SERVER["PHP_SELF"], 'p.label', $param, '', '', $sortfield, $sortorder);
 
@@ -570,10 +557,7 @@
 	$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
 	print $hookmanager->resPrint;
 
-	// Action column
-	if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
-		print_liste_field_titre('', $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'right ');
-	}
+	print_liste_field_titre('', $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'right ');
 
 	print "</tr>\n";
 }
@@ -674,11 +658,6 @@
 		} else {
 			print '<tr class="oddeven">';
 
-			// Action column
-			if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
-				print '<td class="left"></td>';
-			}
-
 			// Product ref
 			print '<td class="nowrap">'.$prod->getNomUrl(1, '').'</td>';
 
@@ -771,10 +750,8 @@
 			$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
 			print $hookmanager->resPrint;
 
-			// Action column
-			if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
-				print '<td class="right"></td>';
-			}
+			// Action
+			print '<td class="right"></td>';
 
 			print '</tr>'."\n";
 		}

########## product/stock/tpl/stocktransfer.tpl.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/stock/tpl/stocktransfer.tpl.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/stock/tpl/stocktransfer.tpl.php	2025-06-27 11:43:59.673978000 +0000
@@ -15,20 +15,20 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ * $object must be defined
+ * $backtopage
  */
 
 /**
  * @var Conf $conf
  * @var DoliDB $db
  * @var Form $form
+ * @var Product|MouvementStock $object
  * @var FormProduct $formproduct
  * @var Translate $langs
- * @var Product|Entrepot|MouvementStock $object
  *
- * @var string 	$backtopage
- * @var ?int	$id
- * @var int		$d_eatby
- * @var int		$d_sellby
+ * @var string $backtopage
  */
 
 // Protection to avoid direct call of template
@@ -38,7 +38,7 @@
 }
 
 '
-@phan-var-force Entrepot|Product|MouvementStock $object
+@phan-var-force Entrepot|MouvementStock $object
 @phan-var-force FormProduct $formproduct
 @phan-var-force string $backtopage
 ';
@@ -86,7 +86,7 @@
 }
 print '<table class="border centpercent">';
 
-// Source product or stock movement
+// Source warehouse or product
 print '<tr>';
 if ($object->element == 'product') {
 	/** @var Product $object */

########## projet/class/api_projects.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/projet/class/api_projects.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/projet/class/api_projects.class.php	2025-06-27 11:43:57.742629000 +0000
@@ -209,7 +209,7 @@
 		$obj_ret = array();
 
 		// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
-		$socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids;
+		$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
 
 		// If the internal user must only see his customers, force searching by him
 		$search_sale = 0;

########## projet/class/api_tasks.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/projet/class/api_tasks.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/projet/class/api_tasks.class.php	2025-06-27 11:43:57.743993000 +0000
@@ -120,7 +120,7 @@
 		$obj_ret = array();
 
 		// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
-		$socids = DolibarrApiAccess::$user->socid ?: 0;
+		$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : 0;
 
 		// If the internal user must only see his customers, force searching by him
 		$search_sale = 0;
@@ -500,7 +500,6 @@
 	 * @return  array
 	 * @phan-return array{success:array{code:int,message:string}}
 	 * @phpstan-return array{success:array{code:int,message:string}}
-	 * @throws RestException
 	 */
 	public function delete($id)
 	{
@@ -516,7 +515,7 @@
 			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
 		}
 
-		if ($this->task->delete(DolibarrApiAccess::$user) <= 0) {
+		if (!$this->task->delete(DolibarrApiAccess::$user)) {
 			throw new RestException(500, 'Error when delete task : '.$this->task->error);
 		}
 

########## projet/class/project.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/projet/class/project.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/projet/class/project.class.php	2025-06-27 11:43:57.736832000 +0000
@@ -1415,7 +1415,7 @@
 	 *
 	 * 	@param	int<0,2>	$withpicto		          0=No picto, 1=Include picto into link, 2=Only picto
 	 * 	@param	string		$option			          Variant where the link point to ('', 'nolink')
-	 * 	@param	int			$addlabel		          0=Default, 1=Add label into string, n>1=Add the n first chars of label in ref, -1=Label replace the ref
+	 * 	@param	int			$addlabel		          0=Default, 1=Add label into string, >1=Add first chars into string
 	 *  @param	string		$moreinpopup	          Text to add into popup
 	 *  @param	string		$sep			          Separator between ref and label if option addlabel is set
 	 *  @param	int<0,1>   	$notooltip		          1=Disable tooltip
@@ -1505,15 +1505,11 @@
 			$result .= img_object(($notooltip ? '' : $label), $picto, 'class="pictofixedwidth em088"', 0, 0, $notooltip ? 0 : 1);
 		}
 		if ($withpicto != 2) {
-			if ($addlabel >= 0) {
-				$result .= $this->ref;
-			} else {
-				$result .= $this->title;
-			}
+			$result .= $this->ref;
 		}
 		$result .= $linkend;
 		if ($withpicto != 2) {
-			$result .= (($addlabel > 0 && $this->title) ? '<span class="opacitymedium">'.$sep.dol_trunc($this->title, ($addlabel > 1 ? $addlabel : 0)).'</span>' : '');
+			$result .= (($addlabel && $this->title) ? '<span class="opacitymedium">'.$sep.dol_trunc($this->title, ($addlabel > 1 ? $addlabel : 0)).'</span>' : '');
 		}
 
 		global $action;

########## projet/class/task.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/projet/class/task.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/projet/class/task.class.php	2025-06-27 11:43:57.740919000 +0000
@@ -1010,7 +1010,7 @@
 	 *	@param	int		$withpicto		0=No picto, 1=Include picto into link, 2=Only picto
 	 *	@param	string	$option			'withproject' or ''
 	 *  @param	string	$mode			Mode 'task', 'time', 'contact', 'note', document' define page to link to.
-	 * 	@param	int		$addlabel		0=Default, 1=Add label into string, >1=Add first chars into string, -1=Label replace the ref
+	 * 	@param	int		$addlabel		0=Default, 1=Add label into string, >1=Add first chars into string
 	 *  @param	string	$sep			Separator between ref and label if option addlabel is set
 	 *  @param	int   	$notooltip		1=Disable tooltip
 	 *  @param  int     $save_lastsearch_value    -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
@@ -1072,15 +1072,11 @@
 			$result .= img_object(($notooltip ? '' : $label), $picto, 'class="paddingright"', 0, 0, $notooltip ? 0 : 1);
 		}
 		if ($withpicto != 2) {
-			if ($addlabel >= 0) {
-				$result .= $this->ref;
-			} else {
-				$result .= $this->label;
-			}
+			$result .= $this->ref;
 		}
 		$result .= $linkend;
 		if ($withpicto != 2) {
-			$result .= (($addlabel > 0 && $this->label) ? '<span class="opacitymedium">'.$sep.dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)).'</span>' : '');
+			$result .= (($addlabel && $this->label) ? $sep.dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
 		}
 
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);

########## projet/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/projet/list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/projet/list.php	2025-06-27 11:43:57.759581000 +0000
@@ -105,7 +105,8 @@
 $pagenext = $page + 1;
 
 $search_all = GETPOST('search_all', 'alphanohtml');
-$search_entity = GETPOSTINT('search_entity');
+$search_entity = ($user->entity > 0 ? $user->entity : GETPOSTINT('search_entity'));
+
 $search_ref = GETPOST("search_ref", 'alpha');
 $search_label = GETPOST("search_label", 'alpha');
 $search_societe = GETPOST("search_societe", 'alpha');
@@ -617,10 +618,11 @@
 $parameters = array();
 $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
 $sql .= $hookmanager->resPrint;
+
 if ($search_entity > 0) {
 	$sql .= " WHERE p.entity = ".((int) $search_entity);
 } else {
-	$sql .= " WHERE p.entity IN (".getEntity('project').')';
+	$sql .= " WHERE p.entity IN (".getEntity('project', (GETPOSTINT('search_current_entity') ? 0 : 1)).')';
 }
 if (!$user->hasRight('projet', 'all', 'lire')) {
 	$sql .= " AND p.rowid IN (".$db->sanitize($projectsListId).")"; // public and assigned to, or restricted to company for external users
@@ -963,7 +965,7 @@
 	$param .= '&search_date_start_startday='.urlencode((string) ($search_date_start_startday));
 }
 if ($search_date_start_start) {
-	$param .= '&search_date_start_start='.urlencode((string) $search_date_start_start);
+	$param .= '&search_date_start_start='.urlencode($search_date_start_start);
 }
 if ($search_date_start_endmonth) {
 	$param .= '&search_date_start_endmonth='.urlencode((string) ($search_date_start_endmonth));
@@ -987,7 +989,7 @@
 	$param .= '&search_date_end_startday='.urlencode((string) ($search_date_end_startday));
 }
 if ($search_date_end_start) {
-	$param .= '&search_date_end_start='.urlencode((string) $search_date_end_start);
+	$param .= '&search_date_end_start='.urlencode($search_date_end_start);
 }
 if ($search_date_end_endmonth) {
 	$param .= '&search_date_end_endmonth='.urlencode((string) ($search_date_end_endmonth));
@@ -999,7 +1001,7 @@
 	$param .= '&search_date_end_endday='.urlencode((string) ($search_date_end_endday));
 }
 if ($search_date_end_end) {
-	$param .= '&search_date_end_end=' . urlencode((string) $search_date_end_end);
+	$param .= '&search_date_end_end=' . urlencode($search_date_end_end);
 }
 if ($search_date_creation_startmonth) {
 	$param .= '&search_date_creation_startmonth='.urlencode((string) ($search_date_creation_startmonth));
@@ -1011,7 +1013,7 @@
 	$param .= '&search_date_creation_startday='.urlencode((string) ($search_date_creation_startday));
 }
 if ($search_date_creation_start) {
-	$param .= '&search_date_creation_start='.urlencode((string) $search_date_creation_start);
+	$param .= '&search_date_creation_start='.urlencode($search_date_creation_start);
 }
 if ($search_date_creation_endmonth) {
 	$param .= '&search_date_creation_endmonth='.urlencode((string) ($search_date_creation_endmonth));
@@ -1035,7 +1037,7 @@
 	$param .= '&search_date_modif_startday='.urlencode((string) ($search_date_modif_startday));
 }
 if ($search_date_modif_start) {
-	$param .= '&search_date_modif_start='.urlencode((string) $search_date_modif_start);
+	$param .= '&search_date_modif_start='.urlencode($search_date_modif_start);
 }
 if ($search_date_modif_endmonth) {
 	$param .= '&search_date_modif_endmonth='.urlencode((string) ($search_date_modif_endmonth));
@@ -1047,7 +1049,7 @@
 	$param .= '&search_date_modif_endday='.urlencode((string) ($search_date_modif_endday));
 }
 if ($search_date_modif_end) {
-	$param .= '&search_date_modif_end=' . urlencode((string) $search_date_modif_end);
+	$param .= '&search_date_modif_end=' . urlencode($search_date_modif_end);
 }
 if (!empty($search_category_array)) {
 	foreach ($search_category_array as $tmpval) {

########## projet/tasks/time.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/projet/tasks/time.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/projet/tasks/time.php	2025-06-27 11:43:57.771080000 +0000
@@ -1,4 +1,5 @@
 <?php
+
 /* Copyright (C) 2005		Rodolphe Quiedeville	<rodolphe@quiedeville.org>
  * Copyright (C) 2006-2023	Laurent Destailleur		<eldy@users.sourceforge.net>
  * Copyright (C) 2010-2012	Regis Houssin			<regis.houssin@inodbox.com>
@@ -285,9 +286,6 @@
 		$error++;
 	}
 
-	//If timespent date is not provided in POST (for eg, because in list the column date is hidden) we keep the actual date
-	$timespent_date = dol_mktime(12, 0, 0, GETPOSTINT("timelinemonth"), GETPOSTINT("timelineday"), GETPOSTINT("timelineyear"));
-
 	if (!$error) {
 		if (GETPOSTINT('taskid') != $id) {        // GETPOST('taskid') is id of new task
 			$id_temp = GETPOSTINT('taskid'); // should not overwrite $id
@@ -303,11 +301,11 @@
 			$object->timespent_old_duration = GETPOSTINT("old_duration");
 			$object->timespent_duration = GETPOSTINT("new_durationhour") * 60 * 60; // We store duration in seconds
 			$object->timespent_duration += (GETPOSTINT("new_durationmin") ? GETPOSTINT('new_durationmin') : 0) * 60; // We store duration in seconds
-			if (GETPOST("timelinehour") != '' && GETPOST("timelinehour") >= 0 && !empty($timespent_date)) {    // If hour was entered
+			if (GETPOST("timelinehour") != '' && GETPOST("timelinehour") >= 0) {    // If hour was entered
 				$object->timespent_date = dol_mktime(GETPOSTINT("timelinehour"), GETPOSTINT("timelinemin"), 0, GETPOSTINT("timelinemonth"), GETPOSTINT("timelineday"), GETPOSTINT("timelineyear"));
 				$object->timespent_withhour = 1;
-			} elseif (!empty($timespent_date)) {
-				$object->timespent_date = $timespent_date;
+			} else {
+				$object->timespent_date = dol_mktime(12, 0, 0, GETPOSTINT("timelinemonth"), GETPOSTINT("timelineday"), GETPOSTINT("timelineyear"));
 				$object->timespent_withhour = 0;
 			}
 			$object->timespent_fk_user = GETPOSTINT("userid_line");
@@ -328,8 +326,7 @@
 		} else {
 			$object->fetch($id, $ref);
 
-			$object->fetchTimeSpent(GETPOSTINT('lineid'));
-
+			$object->timespent_id = GETPOSTINT("lineid");
 			$object->timespent_note = GETPOST("timespent_note_line", "alphanohtml");
 			$object->timespent_old_duration = GETPOSTINT("old_duration");
 			$object->timespent_duration = GETPOSTINT("new_durationhour") * 60 * 60; // We store duration in seconds
@@ -337,8 +334,8 @@
 			if (GETPOST("timelinehour") != '' && GETPOST("timelinehour") >= 0) {    // If hour was entered
 				$object->timespent_date = dol_mktime(GETPOSTINT("timelinehour"), GETPOSTINT("timelinemin"), 0, GETPOSTINT("timelinemonth"), GETPOSTINT("timelineday"), GETPOSTINT("timelineyear"));
 				$object->timespent_withhour = 1;
-			} elseif (!empty($timespent_date)) {
-				$object->timespent_date = $timespent_date;
+			} else {
+				$object->timespent_date = dol_mktime(12, 0, 0, GETPOSTINT("timelinemonth"), GETPOSTINT("timelineday"), GETPOSTINT("timelineyear"));
 				$object->timespent_withhour = 0;
 			}
 			$object->timespent_fk_user = GETPOSTINT("userid_line");
@@ -1493,7 +1490,7 @@
 					print $langs->trans('ServiceToUseOnLines');
 					print '</td>';
 					print '<td>';
-					$form->select_produits(0, 'productid', 1, 0, $projectstatic->thirdparty->price_level, 1, 2, '', 0, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500');
+					$form->select_produits(0, 'productid', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 0, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500');
 					print '</td>';
 					print '</tr>';
 				}
@@ -1887,7 +1884,7 @@
 				if (isModEnabled("service") && !empty($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) {
 					print '<td class="nowraponall">';
 					print img_picto('', 'service');
-					print $form->select_produits((GETPOSTISSET('fk_product') ? GETPOSTINT("fk_product") : ''), 'fk_product', 1, 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth150', 0, '', null, 1);
+					print $form->select_produits((GETPOSTISSET('fk_product') ? GETPOSTINT("fk_product") : ''), 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth150', 0, '', null, 1);
 					print '</td>';
 				}
 			}
@@ -2068,11 +2065,11 @@
 		}
 		if (!empty($allprojectforuser)) {
 			if (!empty($arrayfields['p.project_ref']['checked'])) {
-				print_liste_field_titre($arrayfields['p.project_ref']['label'], $_SERVER['PHP_SELF'], 'p.ref', '', $param, '', $sortfield, $sortorder);
+				print_liste_field_titre("Project", $_SERVER['PHP_SELF'], 'p.ref', '', $param, '', $sortfield, $sortorder);
 				$totalarray['nbfield']++;
 			}
 			if (!empty($arrayfields['p.project_label']['checked'])) {
-				print_liste_field_titre($arrayfields['p.project_label']['label'], $_SERVER['PHP_SELF'], 'p.title', '', $param, '', $sortfield, $sortorder);
+				print_liste_field_titre("ProjectLabel", $_SERVER['PHP_SELF'], 'p.title', '', $param, '', $sortfield, $sortorder);
 				$totalarray['nbfield']++;
 			}
 		}
@@ -2263,9 +2260,10 @@
 				}
 			}
 
+			// Project ref & label
 			if (!empty($allprojectforuser)) {
-				// Project ref
 				if (!empty($arrayfields['p.project_ref']['checked'])) {
+					print '<td class="nowraponall">';
 					if (empty($conf->cache['project'][$task_time->fk_projet])) {
 						$tmpproject = new Project($db);
 						$tmpproject->fetch($task_time->fk_projet);
@@ -2273,14 +2271,12 @@
 					} else {
 						$tmpproject = $conf->cache['project'][$task_time->fk_projet];
 					}
-					print '<td class="nowraponall">';
 					print $tmpproject->getNomUrl(1);
 					print '</td>';
 					if (!$i) {
 						$totalarray['nbfield']++;
 					}
 				}
-				// Project label
 				if (!empty($arrayfields['p.project_label']['checked'])) {
 					if (empty($conf->cache['project'][$task_time->fk_projet])) {
 						$tmpproject = new Project($db);
@@ -2289,12 +2285,8 @@
 					} else {
 						$tmpproject = $conf->cache['project'][$task_time->fk_projet];
 					}
-					print '<td class="tdoverflowmax250" title="'.dolPrintHTMLForAttribute($tmpproject->title).'">';
-					if (!empty($arrayfields['p.project_ref']['checked'])) {
-						print dolPrintHTML($tmpproject->title);
-					} else {
-						print $tmpproject->getNomUrl(1, '', -1);
-					}
+					print '<td class="tdoverflowmax250" title="'.dol_escape_htmltag($tmpproject->title).'">';
+					print dol_escape_htmltag($tmpproject->title);
 					print '</td>';
 					if (!$i) {
 						$totalarray['nbfield']++;
@@ -2326,15 +2318,8 @@
 			// Task label
 			if (!empty($arrayfields['t.element_label']['checked'])) {
 				if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) {	// Not a dedicated task
-					print '<td class="tdoverflowmax250" title="'.dolPrintHTMLForAttribute($task_time->label).'">';
-					if (!empty($arrayfields['t.element_ref']['checked'])) {
-						print dolPrintHTML($task_time->label);
-					} else {
-						$tasktmp->id = $task_time->fk_element;
-						$tasktmp->ref = $task_time->ref;
-						$tasktmp->label = $task_time->label;
-						print $tasktmp->getNomUrl(1, 'withproject', 'time', -1);
-					}
+					print '<td class="tdoverflowmax250" title="'.dol_escape_htmltag($task_time->label).'">';
+					print dol_escape_htmltag($task_time->label);
 					print '</td>';
 					if (!$i) {
 						$totalarray['nbfield']++;
@@ -2342,9 +2327,9 @@
 				}
 			}
 
-			// User
+			// By User
 			if (!empty($arrayfields['author']['checked'])) {
-				print '<td class="tdoverflowmax100">';
+				print '<td class="minwidth100 tdoverflowmax125">';
 				if ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) {
 					// Here $object is task. TODO Add a cache
 					if (empty($object->id)) {
@@ -2430,7 +2415,7 @@
 				print '<td class="nowraponall">';
 				if ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) {
 					print img_picto('', 'service');
-					print $form->select_produits($task_time->fk_product, 'fk_product', 1, 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500', 0, '', null, 1);
+					print $form->select_produits($task_time->fk_product, 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500', 0, '', null, 1);
 				} elseif (!empty($task_time->fk_product)) {
 					$product = new Product($db);
 					$resultFetch = $product->fetch($task_time->fk_product);
@@ -2759,7 +2744,7 @@
 
 				// Date
 				if (!empty($arrayfields['t.element_date']['checked'])) {
-					print '<td class="nowraponall">';
+					print '<td class="nowrap">';
 					if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
 						if (empty($task_time->element_date_withhour)) {
 							print $form->selectDate(($date2 ? $date2 : $date1), 'timeline_2', 3, 3, 2, "timespent_date", 1, 0);
@@ -2774,20 +2759,20 @@
 
 				// Thirdparty
 				if (!empty($arrayfields['p.fk_soc']['checked'])) {
-					print '<td>';
+					print '<td class="nowrap">';
 					print '</td>';
 				}
 
 				// Thirdparty alias
 				if (!empty($arrayfields['s.name_alias']['checked'])) {
-					print '<td>';
+					print '<td class="nowrap">';
 					print '</td>';
 				}
 
 				// Project ref
 				if (!empty($allprojectforuser)) {
 					if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) {    // Not a dedicated task
-						print '<td>';
+						print '<td class="nowrap">';
 						print '</td>';
 					}
 				}
@@ -2795,7 +2780,7 @@
 				// Task ref
 				if (!empty($arrayfields['t.element_ref']['checked'])) {
 					if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) {	// Not a dedicated task
-						print '<td class="nowraponall">';
+						print '<td class="nowrap">';
 						$tasktmp->id = $task_time->fk_element;
 						$tasktmp->ref = $task_time->ref;
 						$tasktmp->label = $task_time->label;
@@ -2807,7 +2792,7 @@
 				// Task label
 				if (!empty($arrayfields['t.element_label']['checked'])) {
 					if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) {	// Not a dedicated task
-						print '<td class="tdoverflowmax125" title="'.dol_escape_htmltag($task_time->label).'">';
+						print '<td class="nowrap">';
 						print dol_escape_htmltag($task_time->label);
 						print '</td>';
 					}
@@ -2876,7 +2861,7 @@
 				// Value spent
 				if (!empty($arrayfields['value']['checked'])) {
 					print '<td class="right">';
-					print '<span class="amount nowraponall">';
+					print '<span class="amount">';
 					$value = 0;
 					print price($value, 1, $langs, 1, -1, -1, $conf->currency);
 					print '</span>';
@@ -2888,7 +2873,7 @@
 					print '<td class="right">';
 					$valuebilled = price2num($task_time->total_ht, '', 1);
 					if (isset($task_time->total_ht)) {
-						print '<span class="amount nowraponall">';
+						print '<span class="amount">';
 						print price($valuebilled, 1, $langs, 1, -1, -1, $conf->currency);
 						print '</span>';
 					}

########## projet/tasks.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/projet/tasks.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/projet/tasks.php	2025-06-27 11:43:57.763828000 +0000
@@ -527,7 +527,7 @@
 		$param .= '&search_date_start_startday='.urlencode((string) ($search_date_start_startday));
 	}
 	if ($search_date_start_start) {
-		$param .= '&search_date_start_start='.urlencode((string) $search_date_start_start);
+		$param .= '&search_date_start_start='.urlencode($search_date_start_start);
 	}
 	if ($search_date_start_endmonth) {
 		$param .= '&search_date_start_endmonth='.urlencode((string) ($search_date_start_endmonth));
@@ -539,7 +539,7 @@
 		$param .= '&search_date_start_endday='.urlencode((string) ($search_date_start_endday));
 	}
 	if ($search_date_start_end) {
-		$param .= '&search_date_start_end='.urlencode((string) $search_date_start_end);
+		$param .= '&search_date_start_end='.urlencode($search_date_start_end);
 	}
 	if ($search_date_end_startmonth) {
 		$param .= '&search_date_end_startmonth='.urlencode((string) ($search_date_end_startmonth));
@@ -551,7 +551,7 @@
 		$param .= '&search_date_end_startday='.urlencode((string) ($search_date_end_startday));
 	}
 	if ($search_date_end_start) {
-		$param .= '&search_date_end_start='.urlencode((string) $search_date_end_start);
+		$param .= '&search_date_end_start='.urlencode($search_date_end_start);
 	}
 	if ($search_date_end_endmonth) {
 		$param .= '&search_date_end_endmonth='.urlencode((string) ($search_date_end_endmonth));
@@ -563,7 +563,7 @@
 		$param .= '&search_date_end_endday='.urlencode((string) ($search_date_end_endday));
 	}
 	if ($search_date_end_end) {
-		$param .= '&search_date_end_end=' . urlencode((string) $search_date_end_end);
+		$param .= '&search_date_end_end=' . urlencode($search_date_end_end);
 	}
 	if ($search_planedworkload) {
 		$param .= '&search_planedworkload='.urlencode($search_planedworkload);

########## public/demo/index.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/public/demo/index.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/public/demo/index.php	2025-06-27 11:43:57.814989000 +0000
@@ -295,10 +295,8 @@
 print '</div>';
 
 print '<div class="demobantext" style="max-width: 1024px;">';
-print '<div style="font-size: 0.8em; padding: 40px;">';
-print '<div class="hideonsmartphone" style="text-align: justify;">'.$langs->trans("DemoDesc").'<br>';
-print $langs->trans("DemoDesc2", 'https://www.dolibarr.org/onlinedemo');
-print '</div><br>';
+print '<div style="font-size: 20px; padding: 40px;">';
+print '<div class="hideonsmartphone" style="text-align: justify;">'.$langs->trans("DemoDesc").'</div><br>';
 print '<div class="titre"><span style="font-size: 20px">'.$langs->trans("ChooseYourDemoProfil").'</span></div>';
 print '</div>';
 print '</div>';

########## public/payment/newpayment.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/public/payment/newpayment.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/public/payment/newpayment.php	2025-06-27 11:43:57.804206000 +0000
@@ -608,7 +608,7 @@
 
 				$service = 'StripeTest';
 				$servicestatus = 0;
-				if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOSTINT('forcesandbox') */) {
+				if (getDolGlobalString('STRIPE_LIVE') && !GETPOSTINT('forcesandbox')) {
 					$service = 'StripeLive';
 					$servicestatus = 1;
 				}
@@ -818,7 +818,7 @@
 	if (getDolGlobalInt('STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION')) {
 		$service = 'StripeTest';
 		$servicestatus = 0;
-		if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOSTINT('forcesandbox') */) {
+		if (getDolGlobalString('STRIPE_LIVE') && !GETPOSTINT('forcesandbox')) {
 			$service = 'StripeLive';
 			$servicestatus = 1;
 		}
@@ -970,10 +970,10 @@
 
 
 // Show sandbox warning
-if ((empty($paymentmethod) || $paymentmethod == 'paypal') && isModEnabled('paypal') && (getDolGlobalString('PAYPAL_API_SANDBOX')/* || GETPOSTINT('forcesandbox')*/)) {		// We can force sand box with param 'forcesandbox'
+if ((empty($paymentmethod) || $paymentmethod == 'paypal') && isModEnabled('paypal') && (getDolGlobalString('PAYPAL_API_SANDBOX') || GETPOSTINT('forcesandbox'))) {		// We can force sand box with param 'forcesandbox'
 	dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Paypal'), array(), 'warning');
 }
-if ((empty($paymentmethod) || $paymentmethod == 'stripe') && isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE')/* || GETPOSTINT('forcesandbox')*/)) {
+if ((empty($paymentmethod) || $paymentmethod == 'stripe') && isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE') || GETPOSTINT('forcesandbox'))) {
 	dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), array(), 'warning');
 }
 
@@ -987,7 +987,7 @@
 print '<input type="hidden" name="suffix" value="'.dol_escape_htmltag($suffix).'">'."\n";
 print '<input type="hidden" name="securekey" value="'.dol_escape_htmltag($SECUREKEY).'">'."\n";
 print '<input type="hidden" name="e" value="'.$entity.'" />';
-//print '<input type="hidden" name="forcesandbox" value="'.GETPOSTINT('forcesandbox').'" />';
+print '<input type="hidden" name="forcesandbox" value="'.GETPOSTINT('forcesandbox').'" />';
 print '<input type="hidden" name="lang" value="'.$getpostlang.'">';
 print '<input type="hidden" name="ws" value="'.$ws.'">';
 print "\n";
@@ -2425,7 +2425,7 @@
 		print '<input type="hidden" name="e" value="'.$entity.'" />'."\n";
 		print '<input type="hidden" name="amount" value="'.$amount.'">'."\n";
 		print '<input type="hidden" name="currency" value="'.$currency.'">'."\n";
-		//print '<input type="hidden" name="forcesandbox" value="'.GETPOSTINT('forcesandbox').'" />';
+		print '<input type="hidden" name="forcesandbox" value="'.GETPOSTINT('forcesandbox').'" />';
 		print '<input type="hidden" name="email" value="'.GETPOST('email', 'alpha').'" />';
 		print '<input type="hidden" name="thirdparty_id" value="'.GETPOSTINT('thirdparty_id').'" />';
 		print '<input type="hidden" name="lang" value="'.$getpostlang.'">';
@@ -2456,7 +2456,7 @@
 
 			$service = 'StripeLive';
 			$servicestatus = 1;
-			if (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */) {
+			if (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha')) {
 				$service = 'StripeTest';
 				$servicestatus = 0;
 			}

########## public/payment/paymentok.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/public/payment/paymentok.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/public/payment/paymentok.php	2025-06-27 11:43:57.808204000 +0000
@@ -290,12 +290,11 @@
 
 
 // Add steps to validate payment is complete when we enter this page
-$service = $paymentmethod;	// to have a default value. We may change it later for 'StripeLive' or 'StripeTest'...
+
 
 // For Paypal: validate the payment (Paypal need another step after the callback return to validate the payment).
 if (isModEnabled('paypal') && $paymentmethod === 'paypal') {	// We call this page only if payment is ok on payment system
 	if (!empty($PAYPALTOKEN)) {
-		// TODO: Move this block to the top to ensure all session variables (e.g., TRANSACTIONID, FinalPaymentAmt, currencyCodeType, etc.) are loaded before executing checks for any payment module.
 		// Get on url call
 		$onlinetoken        = $PAYPALTOKEN;
 		$fulltag            = $FULLTAG;
@@ -372,98 +371,23 @@
 }
 
 // For Paybox
-if (isModEnabled('paybox') && $paymentmethod === 'paybox') {
-	// TODO Add a check to validate that payment is ok.
-	$ispaymentok = true; // We will do the rest of code
+if (isModEnabled('paybox')) {
+	if ($paymentmethod === 'paybox') {
+		// TODO Add a check to validate that payment is ok.
+		$ispaymentok = true; // We call this page only if payment is ok on payment system
+	}
 }
 
 // For Stripe
-if (isModEnabled('stripe') && $paymentmethod === 'stripe') {
-	// TODO: Move this block to the top to ensure all session variables (e.g., TRANSACTIONID, FinalPaymentAmt, currencyCodeType, etc.) are loaded before executing checks for any payment module.
-	if (empty($TRANSACTIONID)) {
-		$TRANSACTIONID = empty($_SESSION['TRANSACTIONID']) ? '' : $_SESSION['TRANSACTIONID'];	// pi_... or ch_...
-		if (empty($TRANSACTIONID) && GETPOST('payment_intent', 'alphanohtml')) {
-			// For the case we use STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 2
-			$TRANSACTIONID = GETPOST('payment_intent', 'alphanohtml');
-		}
-	}
-	$FinalPaymentAmt = empty($_SESSION["FinalPaymentAmt"]) ? '' : $_SESSION["FinalPaymentAmt"];
-	$currencyCodeType = empty($_SESSION['currencyCodeType']) ? '' : $_SESSION['currencyCodeType'];
-
-	$service = 'StripeTest';
-	$servicestatus = 0;
-	if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOSTINT('forcesandbox') */) {
-		$service = 'StripeLive';
-		$servicestatus = 1;
-	}
-
-	// Check we are coming from the newpaymentpage
-	if (GETPOST('paymentoksessioncode') !== $_SESSION['paymentoksessioncode']) {
-		$error++;
-		$errmsg = 'Attempted direct access to the paymentok page without a valid session.';
-		dol_syslog($errmsg, LOG_ERR, 0, '_payment');
-	}
-
-	// Check on payment platform that the payment has been really validated
-	if (!$error && $TRANSACTIONID) {
-		// Stripe payment verification via Stripe API
-		try {
-			include_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php';
-			$stripe = new Stripe($db);
-			$stripeacc = $stripe->getStripeAccount($service);
-
-			// Use the correct Stripe API key
-			global $stripearrayofkeysbyenv;
-			\Stripe\Stripe::setApiKey($stripearrayofkeysbyenv[$servicestatus]['secret_key']);
-
-			try {
-				if (empty($stripeacc)) {
-					$paymentIntent = \Stripe\PaymentIntent::retrieve($TRANSACTIONID);
-				} else {
-					$paymentIntent = \Stripe\PaymentIntent::retrieve($TRANSACTIONID, array("stripe_account" => $stripeacc));
-				}
-
-				// Check amount and currency
-				$expectedAmount = (int) round($FinalPaymentAmt * 100); // Stripe uses cents
-				$expectedCurrency = strtolower($currencyCodeType);
-
-				if ((int) $paymentIntent->amount !== $expectedAmount || strtolower($paymentIntent->currency) !== $expectedCurrency) {
-					$error++;
-					$errmsg = 'Stripe payment information mismatch: expected amount ' . $expectedAmount . ' and currency ' . $expectedCurrency . ', got amount ' . $paymentIntent->amount . ' and currency ' . $paymentIntent->currency;
-					dol_syslog($errmsg, LOG_ERR, 0, '_payment');
-				}
-				if ($paymentIntent->status !== 'succeeded') {
-					$error++;
-					$errmsg = 'Stripe payment not succeeded. Status: ' . $paymentIntent->status;
-					dol_syslog($errmsg, LOG_ERR, 0, '_payment');
-				}
-			} catch (\Stripe\Exception\ApiErrorException $e) {
-				$error++;
-				$errormessage = "Stripe API error: ".$e->getMessage();
-				dol_syslog($errormessage, LOG_ERR, 0, '_payment');
-				setEventMessages($e->getMessage(), null, 'errors');
-			} catch (Exception $e) {
-				$error++;
-				$errormessage = "CantRetrievePaymentIntent: ".$e->getMessage();
-				dol_syslog($errormessage, LOG_ERR, 0, '_payment');
-				setEventMessages($e->getMessage(), null, 'errors');
-			}
-		} catch (Exception $e) {
-			$error++;
-			$errmsg = 'Stripe API error: ' . $e->getMessage();
-			dol_syslog($errmsg, LOG_ERR, 0, '_payment');
+if (isModEnabled('stripe')) {
+	if ($paymentmethod === 'stripe') {
+		// Check we are coming from the newpaymentpage
+		if (GETPOST('paymentoksessionkey') == $_SESSION['paymentoksessionkey']) {
+			// We can also request Stripe with payment_intent and payment_intent_client_secret the sameway we do in newpayment after comment "// Get here amount and currency used for payment".
+			$ispaymentok = true; // We call this page only if payment is ok on payment system
+		} else {
+			$ispaymentok = false; // We call this page only if payment is ok on payment system
 		}
-	} else {
-		$error++;
-		$errmsg = 'Stripe payment verification failed: TRANSACTIONID is not set or session key does not match.';
-		dol_syslog($errmsg, LOG_ERR, 0, '_payment');
-		setEventMessages($errmsg, null, 'errors');
-	}
-
-	if (!$error) {
-		$ispaymentok = true; // We will do the rest of code
-	} else {
-		$ispaymentok = false; // We won't do the rest of code
 	}
 }
 
@@ -483,7 +407,6 @@
 	}
 }
 
-// TODO: Move this block to the top to ensure all session variables (e.g., TRANSACTIONID, FinalPaymentAmt, currencyCodeType, etc.) are loaded before executing checks for any payment module.
 // Get variable into the session env
 if (empty($ipaddress)) {
 	$ipaddress = $_SESSION['ipaddress'];
@@ -793,7 +716,7 @@
 				}
 
 				if (!$error) {
-					// If payment using Stripe, save the Stripe payment info into societe_account
+					// If payment using Strip, save the Stripe payment info into societe_account
 					if ($paymentmethod == 'stripe' && $autocreatethirdparty && $option == 'bankviainvoice') {
 						$thirdparty_id = ($object->socid ? $object->socid : $object->fk_soc);
 
@@ -801,7 +724,7 @@
 
 						$service = 'StripeTest';
 						$servicestatus = 0;
-						if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha') */) {
+						if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
 							$service = 'StripeLive';
 							$servicestatus = 1;
 						}
@@ -1194,7 +1117,7 @@
 						$paiement->paiementid = $paymentTypeId;
 						$paiement->num_payment = '';
 						$paiement->note_public = 'Online payment ' . dol_print_date($now, 'standard') . ' from ' . $ipaddress;
-						$paiement->ext_payment_id = $TRANSACTIONID;		// 'pi_...' for Stripe, ... TODO Use 'pi_...:cus_...@pk_...'
+						$paiement->ext_payment_id = $TRANSACTIONID;		// pi_... for Stripe, ...
 						$paiement->ext_payment_site = $service;			// 'StripeLive' or 'Stripe', or ...
 
 						if (!$error) {
@@ -1328,8 +1251,8 @@
 				$paiement->paymenttype = $paymentTypeId;
 				$paiement->num_payment = '';
 				$paiement->note_public  = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress;
-				$paiement->ext_payment_id = $TRANSACTIONID;		// 'pi_...' for Stripe, ... TODO Use 'pi_...:cus_...@pk_...'
-				$paiement->ext_payment_site = $service;			// 'StripeLive' or 'Stripe', or ...
+				$paiement->ext_payment_id = $TRANSACTIONID;
+				$paiement->ext_payment_site = $service;
 
 				if (!$error) {
 					$paiement_id = $paiement->create($user, 1);
@@ -1463,8 +1386,8 @@
 					$paiement->paiementid   = $paymentTypeId;
 					$paiement->num_payment = '';
 					$paiement->note_public  = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress.' for event registration';
-					$paiement->ext_payment_id = $TRANSACTIONID;		// 'pi_...' for Stripe, ... TODO Use 'pi_...:cus_...@pk_...'
-					$paiement->ext_payment_site = $service;			// 'StripeLive' or 'Stripe', or ...
+					$paiement->ext_payment_id = $TRANSACTIONID;
+					$paiement->ext_payment_site = $service;
 
 					if (!$error) {
 						$paiement_id = $paiement->create($user, 1); // This include closing invoices and regenerating documents

########## public/project/index.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/public/project/index.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/public/project/index.php	2025-06-27 11:43:57.866368000 +0000
@@ -235,7 +235,7 @@
 print '<input type="hidden" name="id" value="'.dol_escape_htmltag((string) $id).'">'."\n";
 print '<input type="hidden" name="securekey" value="'.dol_escape_htmltag($securekeyreceived).'">'."\n";
 print '<input type="hidden" name="e" value="'.$entity.'" />';
-//print '<input type="hidden" name="forcesandbox" value="'.GETPOSTINT('forcesandbox').'" />';
+print '<input type="hidden" name="forcesandbox" value="'.GETPOSTINT('forcesandbox').'" />';
 print "\n";
 
 

########## public/project/viewandvote.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/public/project/viewandvote.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/public/project/viewandvote.php	2025-06-27 11:43:57.870521000 +0000
@@ -239,7 +239,7 @@
 print '<input type="hidden" name="id" value="'.dol_escape_htmltag($id).'">'."\n";
 print '<input type="hidden" name="securekey" value="'.dol_escape_htmltag($securekeyreceived).'">'."\n";
 print '<input type="hidden" name="e" value="'.$entity.'" />';
-//print '<input type="hidden" name="forcesandbox" value="'.GETPOSTINT('forcesandbox').'" />';
+print '<input type="hidden" name="forcesandbox" value="'.GETPOSTINT('forcesandbox').'" />';
 print "\n";
 
 

########## public/stripe/ipn.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/public/stripe/ipn.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/public/stripe/ipn.php	2025-06-27 11:43:57.881274000 +0000
@@ -133,16 +133,10 @@
 	$event = \Stripe\Webhook::constructEvent($payload, $sig_header, $endpoint_secret);
 } catch (UnexpectedValueException $e) {
 	// Invalid payload
-	dol_syslog("***** Stripe IPN was called with UnexpectedValueException (invalid payload) service=".$service);
-	dol_syslog("***** Stripe IPN was called with UnexpectedValueException (invalid payload) service=".$service, LOG_DEBUG, 0, '_payment');
 	httponly_accessforbidden('Invalid payload', 400);
 } catch (\Stripe\Exception\SignatureVerificationException $e) {
-	dol_syslog("***** Stripe IPN was called with SignatureVerificationException service=".$service);
-	dol_syslog("***** Stripe IPN was called with SignatureVerificationException service=".$service, LOG_DEBUG, 0, '_payment');
-	httponly_accessforbidden('Invalid signature. May be a hook for an event created by another Stripe env or a hack attempt ? Check setup of your keys whsec_...', 400);
+	httponly_accessforbidden('Invalid signature. May be a hook for an event created by another Stripe env ? Check setup of your keys whsec_...', 400);
 } catch (Exception $e) {
-	dol_syslog("***** Stripe IPN was called with Exception (".$e->getMessage().") service=".$service);
-	dol_syslog("***** Stripe IPN was called with Exception (".$e->getMessage().") service=".$service, LOG_DEBUG, 0, '_payment');
 	httponly_accessforbidden('Error '.$e->getMessage(), 400);
 }
 
@@ -366,14 +360,14 @@
 	global $stripearrayofkeysbyenv;
 	$error = 0;
 	$object = $event->data->object;
-	$TRANSACTIONID = $object->id;	// Example 'pi_123456789...'
+	$TRANSACTIONID = $object->id;	// Example pi_123456789...
 	$ipaddress = $object->metadata->ipaddress;
 	$now = dol_now();
 	$currencyCodeType = strtoupper($object->currency);
 	$paymentmethodstripeid = $object->payment_method;
 	$customer_id = $object->customer;
 	$invoice_id = "";
-	$paymentTypeCode = "";				// payment type according to Stripe
+	$paymentTypeCode = "";			// payment type according to Stripe
 	$paymentTypeCodeInDolibarr = "";	// payment type according to Dolibarr
 	$payment_amount = 0;
 	$payment_amountInDolibarr = 0;
@@ -455,9 +449,7 @@
 		}
 
 		$payment_amount = $payment_amountInDolibarr;
-		// TODO Add this checks ? May not be required because the message is already decoded with $event = \Stripe\Webhook::constructEvent($payload, $sig_header, $endpoint_secret);
-		// - Check payment_amount in Stripe (received) is same than the one in Dolibarr
-		// - Check that payment intent is succeed (to avoid forged json webhook sent by malicious users)
+		// TODO Check payment_amount in Stripe (received) is same than the one in Dolibarr
 
 		$postactionmessages = array();
 

########## reception/class/api_receptions.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/reception/class/api_receptions.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/reception/class/api_receptions.class.php	2025-06-27 11:43:59.812337000 +0000
@@ -112,7 +112,7 @@
 		$obj_ret = array();
 
 		// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
-		$socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids;
+		$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
 
 		// If the internal user must only see his customers, force searching by him
 		$search_sale = 0;

########## reception/class/reception.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/reception/class/reception.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/reception/class/reception.class.php	2025-06-27 11:43:59.814016000 +0000
@@ -631,7 +631,7 @@
 					if ($qty == 0 || ($qty < 0 && !getDolGlobalInt('RECEPTION_ALLOW_NEGATIVE_QTY'))) {
 						continue;
 					}
-					dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid);
+					dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid);
 
 					//var_dump($this->lines[$i]);
 					$mouvS = new MouvementStock($this->db);
@@ -2038,7 +2038,11 @@
 
 						$qty = $obj->qty;
 
-						dol_syslog(get_class($this)."::reopen reception movement index ".$i." ed.rowid=".$obj->rowid);
+
+						if ($qty <= 0) {
+							continue;
+						}
+						dol_syslog(get_class($this)."::reopen reception movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid);
 
 						//var_dump($this->lines[$i]);
 						$mouvS = new MouvementStock($this->db);

########## recruitment/class/api_recruitments.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/recruitment/class/api_recruitments.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/recruitment/class/api_recruitments.class.php	2025-06-27 11:43:57.612671000 +0000
@@ -152,7 +152,7 @@
 			throw new RestException(403);
 		}
 
-		$socid = DolibarrApiAccess::$user->socid ?: 0;
+		$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : 0;
 
 		$restrictonsocid = 0; // Set to 1 if there is a field socid in table of object
 
@@ -268,7 +268,7 @@
 			throw new RestException(403);
 		}
 
-		$socid = DolibarrApiAccess::$user->socid ?: 0;
+		$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : 0;
 
 		$restrictonsocid = 0; // Set to 1 if there is a field socid in table of object
 

########## recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php	2025-06-27 11:43:57.618137000 +0000
@@ -97,7 +97,7 @@
 		$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
 		if ($object->ismultientitymanaged == 1) {
 			$sql .= " AND entity = ".$conf->entity;
-		} elseif (!is_numeric($object->ismultientitymanaged)) {
+		} elseif ($object->ismultientitymanaged == 2) {
 			// TODO
 		}
 
@@ -135,7 +135,7 @@
 		$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
 		if ($object->ismultientitymanaged == 1) {
 			$sql .= " AND entity = ".$conf->entity;
-		} elseif (!is_numeric($object->ismultientitymanaged)) {
+		} elseif ($object->ismultientitymanaged == 2) {
 			// TODO
 		}
 

########## recruitment/core/modules/recruitment/mod_recruitmentjobposition_standard.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_standard.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_standard.php	2025-06-27 11:43:57.627623000 +0000
@@ -97,7 +97,7 @@
 		$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
 		if ($object->ismultientitymanaged == 1) {
 			$sql .= " AND entity = ".$conf->entity;
-		} elseif (!is_numeric($object->ismultientitymanaged)) {
+		} elseif ($object->ismultientitymanaged == 2) {
 			// TODO
 		}
 
@@ -135,7 +135,7 @@
 		$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
 		if ($object->ismultientitymanaged == 1) {
 			$sql .= " AND entity = ".$conf->entity;
-		} elseif (!is_numeric($object->ismultientitymanaged)) {
+		} elseif ($object->ismultientitymanaged == 2) {
 			// TODO
 		}
 

########## resource/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/resource/card.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/resource/card.php	2025-06-27 11:43:57.649400000 +0000
@@ -46,11 +46,9 @@
 $langs->loadLangs(array('resource', 'companies', 'other', 'main'));
 
 // Get parameters
+$id						= GETPOSTINT('id');
 $action					= GETPOST('action', 'aZ09');
 $cancel					= GETPOST('cancel', 'alpha');
-$backtopage				= GETPOST('backtopage', 'alpha');
-
-$id						= GETPOSTINT('id');
 $ref					= GETPOST('ref', 'alpha');
 $address				= GETPOST('address', 'alpha');
 $zip					= GETPOST('zipcode', 'alpha');
@@ -166,8 +164,6 @@
 		if (!$error) {
 			$res = $object->fetch($id);
 			if ($res > 0) {
-				$oldref = $object->ref;
-
 				$object->ref          			= $ref;
 				$object->address				= $address;
 				$object->zip					= $zip;
@@ -189,14 +185,6 @@
 
 				$result = $object->update($user);
 				if ($result > 0) {
-					if ($oldref != $ref) {
-						// We renamed the ref so we must change the directory too
-						include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
-						$srcdir = $conf->resource->dir_output.'/'.dol_sanitizeFileName($oldref);
-						$destdir = $conf->resource->dir_output.'/'.dol_sanitizeFileName($ref);
-						dol_move_dir($srcdir, $destdir);
-					}
-
 					header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
 					exit;
 				} else {
@@ -281,7 +269,7 @@
 
 		// Ref
 		print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("ResourceFormLabel_ref").'</td>';
-		print '<td><input class="minwidth200" name="ref" value="'.($ref ?: $object->ref).'" autofocus="autofocus" spellcheck="false"></td></tr>';
+		print '<td><input class="minwidth200" name="ref" value="'.($ref ?: $object->ref).'" autofocus="autofocus"></td></tr>';
 
 		// Type
 		print '<tr><td>'.$langs->trans("ResourceType").'</td>';
@@ -355,21 +343,21 @@
 		print '<tr><td>'.$form->editfieldkey('EMail', 'email', '', $object, 0).'</td>';
 		print '<td>';
 		print img_picto('', 'object_email', 'class="pictofixedwidth"');
-		print '<input type="email" name="email" id="email" value="'.(GETPOSTISSET('email') ? GETPOST('email', 'alpha') : $object->email).'" spellcheck="false"></td>';
+		print '<input type="email" name="email" id="email" value="'.(GETPOSTISSET('email') ? GETPOST('email', 'alpha') : $object->email).'"></td>';
 		print '</tr>';
 
 		// Max users
-		print '<tr><td>'.$form->editfieldkey('MaxUsers', 'max_users', '', $object, 0, 'string', '', 0, 0, 'id', $langs->trans('MaxUsersResourceDesc')).'</td>';
+		print '<tr><td>'.$form->editfieldkey('MaxUsers', 'max_users', '', $object, 0).'</td>';
 		print '<td>';
 		print img_picto('', 'object_user', 'class="pictofixedwidth"');
-		print '<input type="text" class="width75 right" name="max_users" id="max_users" value="'.(GETPOSTISSET('max_users') ? GETPOST('max_users', 'int') : ($object->max_users > 0 ? $object->max_users : '')).'"></td>';
+		print '<input type="text" class="width75 right" name="max_users" id="max_users" value="'.(GETPOSTISSET('max_users') ? GETPOST('max_users', 'int') : $object->max_users).'"></td>';
 		print '</tr>';
 
 		// URL
 		print '<tr><td>'.$form->editfieldkey('URL', 'url', '', $object, 0).'</td>';
 		print '<td>';
 		print img_picto('', 'object_url', 'class="pictofixedwidth"');
-		print '<input type="url" class="minwidth300" name="url" id="url" value="'.(GETPOSTISSET('url') ? GETPOST('url', 'alpha') : $object->url).'" spellcheck="false"></td>';
+		print '<input type="url" name="url" id="url" value="'.(GETPOSTISSET('url') ? GETPOST('url', 'alpha') : $object->url).'"></td>';
 		print '</tr>';
 
 		// Other attributes
@@ -402,7 +390,7 @@
 		print $formconfirm;
 
 
-		$linkback = '<a href="'.DOL_URL_ROOT.'/resource/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
+		$linkback = '<a href="'.DOL_URL_ROOT.'/resource/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&id='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
 
 		dol_banner_tab($object, 'ref', $linkback, 1, 'ref');
 
@@ -432,7 +420,7 @@
 		print '<tr>';
 		print '<td>'.$langs->trans("MaxUsers").'</td>';
 		print '<td>';
-		print $object->max_users > 0 ? $object->max_users : '';
+		print $object->max_users;
 		print '</td>';
 		print '</tr>';
 

########## salaries/class/api_salaries.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/salaries/class/api_salaries.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/salaries/class/api_salaries.class.php	2025-06-27 11:43:57.377409000 +0000
@@ -363,7 +363,7 @@
 	 * @phpstan-param ?array<string,string> $request_data
 	 * @return 	Object					PaymentSalary object
 	 *
-	 * @url     PUT {id}/payments
+	 * @url     POST {id}/payments
 	 *
 	 * @throws RestException
 	 */

########## salaries/class/salary.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/salaries/class/salary.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/salaries/class/salary.class.php	2025-06-27 11:43:57.375367000 +0000
@@ -146,20 +146,19 @@
 	public $user;
 
 	/**
-	 * @var		int<0,1> 	1 if salary paid COMPLETELY, 0 otherwise (Note ->paye is still used for salary, the couple statut/close_code that replace it is for invoices only)
+	 * @var int<0,1> 1 if salary paid COMPLETELY, 0 otherwise (do not use it anymore, use statut and close_code)
+	 * @deprecated Use $status and $close_code
 	 */
 	public $paye;
 
+	const STATUS_UNPAID = 0;
+	const STATUS_PAID = 1;
+
 	/**
 	 * @var float amount remain to pay
 	 */
 	public $resteapayer;
 
-
-	const STATUS_UNPAID = 0;
-	const STATUS_PAID = 1;
-
-
 	public $fields = array(
 		'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'),
 		'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 10, 'visible' => 1, 'index' => 1, 'comment' => "Reference of object"),

########## societe/admin/societe.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/societe/admin/societe.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/societe/admin/societe.php	2025-06-27 11:43:59.843029000 +0000
@@ -206,6 +206,21 @@
 		setEventMessages($langs->trans("Error"), null, 'errors');
 	}
 }
+/* This code is not needed anymore as we can use the setprofid functions instead with key = 'VAT_INTRA'
+//Activate Set vat id unique
+if ($action == "setvatintraunique") {
+	$setvatintraunique = GETPOSTINT('value');
+	$res = dolibarr_set_const($db, "SOCIETE_VAT_INTRA_UNIQUE", $setvatintraunique, 'yesno', 0, '', $conf->entity);
+	if (!($res > 0)) {
+		$error++;
+	}
+	if (!$error) {
+		setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
+	} else {
+		setEventMessages($langs->trans("Error"), null, 'errors');
+	}
+}
+*/
 
 //Activate Set ref in list
 if ($action == "setaddrefinlist") {
@@ -612,15 +627,22 @@
 
 					// Activate / Disable
 					if (in_array($name, $def)) {
-						print '<td class="center">'."\n";
+						print "<td class=\"center\">\n";
+						//if ($conf->global->COMPANY_ADDON_PDF != "$name")
+						//{
 						print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&token='.newToken().'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
 						print img_picto($langs->trans("Enabled"), 'switch_on');
 						print '</a>';
+						//}
+						//else
+						//{
+						//	print img_picto($langs->trans("Enabled"),'on');
+						//}
 						print "</td>";
 					} else {
 						if (versioncompare($module->phpmin, versionphparray()) > 0) {
 							print '<td class="center">'."\n";
-							print img_picto(dol_escape_htmltag($langs->trans("ErrorModuleRequirePHPVersion", implode('.', $module->phpmin))), 'switch_off', 'class="opacitymedium"');
+							print img_picto(dol_escape_htmltag($langs->trans("ErrorModuleRequirePHPVersion", implode('.', $module->phpmin))), 'switch_off');
 							print "</td>";
 						} else {
 							print '<td class="center">'."\n";
@@ -964,7 +986,7 @@
 if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTSCUSTOMERS')) {
 	// Default Prospect/Customer thirdparty type on customer création
 	print '<tr class="oddeven">';
-	print '<td>'.$langs->trans("DefaultCustomerType", $langs->transnoentitiesnoconv("MenuNewThirdParty"), $langs->transnoentitiesnoconv("MenuNewCustomer")).'</td>';
+	print '<td>'.$langs->trans("DefaultCustomerType").'</td>';
 	print '<td>';
 	print $formcompany->selectProspectCustomerType(getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT'), 'defaultcustomertype', 'defaultcustomertype', 'admin');
 	print '</td>';

########## societe/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/societe/card.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/societe/card.php	2025-06-27 11:43:59.909252000 +0000
@@ -994,7 +994,7 @@
 			$private = 0;
 		}
 
-		// Load object modCodeClient
+		// Load object modCodeTiers
 		$module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard');
 		if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
 			$module = substr($module, 0, dol_strlen($module) - 4);
@@ -1008,7 +1008,6 @@
 		}
 		$modCodeClient = new $module($db);
 		'@phan-var-force ModeleThirdPartyCode $modCodeClient';
-
 		// Load object modCodeFournisseur
 		$module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard');
 		if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
@@ -1450,8 +1449,8 @@
 
 			// Prospect/Customer/Supplier
 			$selected = $object->client;
-			$selectedcustomer = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==1 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==3 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') ? 1 : 0);
-			$selectedprospect = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==2 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==3 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') ? 1 : 0);
+			$selectedcustomer = 0;
+			$selectedprospect = 0;
 			switch ($selected) {
 				case 1:
 					$selectedcustomer = 1;
@@ -1587,7 +1586,8 @@
 				print '</td></tr>';
 			}
 
-			print '<tr><td colspan="4">&nbsp;</td></tr>';
+			$colspan = ($conf->browser->layout == 'phone' ? 2 : 4);
+			print '<tr><td'.($colspan ? ' colspan="'.$colspan.'"' : '').'>&nbsp;</td></tr>';
 
 			// Address
 			print '<tr><td class="tdtop">';

########## societe/class/api_contacts.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/societe/class/api_contacts.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/societe/class/api_contacts.class.php	2025-06-27 11:43:59.871938000 +0000
@@ -193,7 +193,7 @@
 		}
 
 		// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
-		$socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids;
+		$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
 
 		// If the internal user must only see his customers, force searching by him
 		$search_sale = 0;

########## societe/document.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/societe/document.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/societe/document.php	2025-06-27 11:43:59.884673000 +0000
@@ -192,11 +192,10 @@
 
 print dol_get_fiche_end();
 
-$modulepart = 'company';
+$modulepart = 'societe';
 $permissiontoadd = $user->hasRight('societe', 'creer');
 $permtoedit = $user->hasRight('societe', 'creer');
 $param = '&id='.$object->id;
-$relativepathwithnofile = $object->id . '/';
 include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
 
 // End of page

########## societe/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/societe/list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/societe/list.php	2025-06-27 11:43:59.900571000 +0000
@@ -1117,7 +1117,7 @@
 	$param .= '&search_date_creation_startday='.urlencode((string) ($search_date_creation_startday));
 }
 if ($search_date_creation_start) {
-	$param .= '&search_date_creation_start='.urlencode((string) $search_date_creation_start);
+	$param .= '&search_date_creation_start='.urlencode($search_date_creation_start);
 }
 if ($search_date_creation_endmonth) {
 	$param .= '&search_date_creation_endmonth='.urlencode((string) ($search_date_creation_endmonth));
@@ -1129,7 +1129,7 @@
 	$param .= '&search_date_creation_endday='.urlencode((string) ($search_date_creation_endday));
 }
 if ($search_date_creation_end) {
-	$param .= '&search_date_creation_end='.urlencode((string) $search_date_creation_end);
+	$param .= '&search_date_creation_end='.urlencode($search_date_creation_end);
 }
 if ($search_date_modif_startmonth) {
 	$param .= '&search_date_modif_startmonth='.urlencode((string) ($search_date_modif_startmonth));
@@ -1141,7 +1141,7 @@
 	$param .= '&search_date_modif_startday='.urlencode((string) ($search_date_modif_startday));
 }
 if ($search_date_modif_start) {
-	$param .= '&search_date_modif_start='.urlencode((string) $search_date_modif_start);
+	$param .= '&search_date_modif_start='.urlencode($search_date_modif_start);
 }
 if ($search_date_modif_endmonth) {
 	$param .= '&search_date_modif_endmonth='.urlencode((string) ($search_date_modif_endmonth));
@@ -1153,7 +1153,7 @@
 	$param .= '&search_date_modif_endday='.urlencode((string) ($search_date_modif_endday));
 }
 if ($search_date_modif_end) {
-	$param .= '&search_date_modif_end=' . urlencode((string) $search_date_modif_end);
+	$param .= '&search_date_modif_end=' . urlencode($search_date_modif_end);
 }
 
 // Add $param from extra fields
@@ -2325,7 +2325,7 @@
 		// Note public
 		if (!empty($arrayfields['s.note_public']['checked'])) {
 			print '<td class="flat maxwidth250imp">';
-			print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'</div>';
+			print '<div class="small lineheightsmall">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public), 5).'</div>';
 			print '</td>';
 			if (!$i) {
 				$totalarray['nbfield']++;
@@ -2334,7 +2334,7 @@
 		// Note private
 		if (!empty($arrayfields['s.note_private']['checked'])) {
 			print '<td class="flat maxwidth250imp">';
-			print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'</div>';
+			print '<div class="small lineheightsmall">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private), 5).'</div>';
 			print '</td>';
 			if (!$i) {
 				$totalarray['nbfield']++;

########## societe/paymentmodes.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/societe/paymentmodes.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/societe/paymentmodes.php	2025-06-27 11:43:59.913054000 +0000
@@ -107,7 +107,7 @@
 // Init Stripe objects
 if (isModEnabled('stripe')) {
 	$service = 'StripeTest';
-	if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha') */) {
+	if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
 		$service = 'StripeLive';
 		$servicestatus = 1;
 	}
@@ -906,10 +906,11 @@
 $head = societe_prepare_head($object);
 
 // Show sandbox warning
-//if (isModEnabled('paypal') && (getDolGlobalString('PAYPAL_API_SANDBOX')/* || GETPOST('forcesandbox','alpha') */))	{
-//	dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Paypal'), [], 'warning');
-//}
-if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */)) {
+/*if (isModEnabled('paypal') && (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox','alpha')))		// We can force sand box with param 'forcesandbox'
+{
+	dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Paypal'), [], 'warning');
+}*/
+if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha'))) {
 	dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), [], 'warning');
 }
 
@@ -1166,7 +1167,7 @@
 				} else {
 					$service = 'StripeTest';
 					$servicestatus = 0;
-					if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha') */) {
+					if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
 						$service = 'StripeLive';
 						$servicestatus = 1;
 					}

########## stripe/admin/stripe.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/stripe/admin/stripe.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/stripe/admin/stripe.php	2025-06-27 11:43:58.077610000 +0000
@@ -443,7 +443,7 @@
 	print $langs->trans("TERMINAL_LOCATION").'</td><td>';
 	$service = 'StripeTest';
 	$servicestatus = 0;
-	if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha') */) {
+	if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
 		$service = 'StripeLive';
 		$servicestatus = 1;
 	}
@@ -454,7 +454,7 @@
 		if (!empty($site_account)) {
 			\Stripe\Stripe::setApiKey($site_account);
 		}
-		if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */)) {
+		if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha'))) {
 			$service = 'StripeTest';
 			$servicestatus = '0';
 			dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), [], 'warning');

########## stripe/charge.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/stripe/charge.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/stripe/charge.php	2025-06-27 11:43:58.082345000 +0000
@@ -77,7 +77,7 @@
 
 llxHeader('', $langs->trans("StripeChargeList"));
 
-if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */)) {
+if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha'))) {
 	$service = 'StripeTest';
 	$servicestatus = '0';
 	dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), [], 'warning');

########## stripe/class/actions_stripe.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/stripe/class/actions_stripe.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/stripe/class/actions_stripe.class.php	2025-06-27 11:43:58.072645000 +0000
@@ -66,9 +66,9 @@
 	 */
 	public function formObjectOptions($parameters, &$object, &$action)
 	{
-		global $langs;
+		global $conf, $langs;
 
-		if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */)) {
+		if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha'))) {
 			$service = 'StripeTest';
 			dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), [], 'warning');
 		} else {
@@ -196,7 +196,7 @@
 			if ($object->statut > Facture::STATUS_DRAFT && $object->statut < Facture::STATUS_ABANDONED && $object->paye == 0) {
 				$stripe = new Stripe($this->db);
 				if ($resteapayer > 0) {
-					if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */)) {
+					if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha'))) {
 						$service = 'StripeTest';
 						dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), [], 'warning');
 					} else {

########## stripe/class/stripe.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/stripe/class/stripe.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/stripe/class/stripe.class.php	2025-06-27 11:43:58.074143000 +0000
@@ -345,22 +345,22 @@
 	 * Note: This is used when option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION is on when making a payment from the public/payment/newpayment.php page
 	 * but not when using the STRIPE_USE_NEW_CHECKOUT.
 	 *
-	 * @param   float			$amount                             Amount
-	 * @param   string			$currency_code                      Currency code
-	 * @param   string			$tag                                Tag
-	 * @param   string			$description                        Description
-	 * @param	?CommonObject	$object						    	Object to pay with Stripe
-	 * @param	?string			$customer							Stripe customer ref 'cus_xxxxxxxxxxxxx' via customerStripe()
-	 * @param	?string			$key							    ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect
-	 * @param	int<0,1>		$status							    Status (0=test, 1=live)
-	 * @param	int<0,1>		$usethirdpartyemailforreceiptemail	1=use thirdparty email for receipt
-	 * @param	'automatic'|'manual'|'terminal'		$mode			Automatic=automatic confirmation/payment when conditions are ok, manual=need to call confirm() on intent, terminal=manual
-	 * @param   bool			$confirmnow                     	False=default, true=try to confirm immediately after create (if conditions are ok)
-	 * @param   ?string			$payment_method                 	'pm_....' (if known)
-	 * @param   int<0,1>		$off_session                    	If we use an already known payment method to pay when customer is not available during the checkout flow.
-	 * @param	int<0,1>		$noidempotency_key					Do not use the idempotency_key when creating the PaymentIntent
-	 * @param	int				$did								ID of an existing line into llx_prelevement_demande (Dolibarr intent). If provided, no new line will be created.
-	 * @return 	?\Stripe\PaymentIntent				        		Stripe PaymentIntent or null if not found and failed to create
+	 * @param   float		$amount                             Amount
+	 * @param   string		$currency_code                      Currency code
+	 * @param   string		$tag                                Tag
+	 * @param   string		$description                        Description
+	 * @param	?CommonObject	$object						    Object to pay with Stripe
+	 * @param	?string		$customer							Stripe customer ref 'cus_xxxxxxxxxxxxx' via customerStripe()
+	 * @param	?string		$key							    ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect
+	 * @param	int<0,1>	$status							    Status (0=test, 1=live)
+	 * @param	int<0,1>	$usethirdpartyemailforreceiptemail	1=use thirdparty email for receipt
+	 * @param	'automatic'|'manual'	$mode		                        automatic=automatic confirmation/payment when conditions are ok, manual=need to call confirm() on intent
+	 * @param   bool		$confirmnow                         false=default, true=try to confirm immediately after create (if conditions are ok)
+	 * @param   ?string		$payment_method                     'pm_....' (if known)
+	 * @param   int<0,1>	$off_session                        If we use an already known payment method to pay when customer is not available during the checkout flow.
+	 * @param	int<0,1>	$noidempotency_key					Do not use the idempotency_key when creating the PaymentIntent
+	 * @param	int			$did								ID of an existing line into llx_prelevement_demande (Dolibarr intent). If provided, no new line will be created.
+	 * @return 	?\Stripe\PaymentIntent				        Stripe PaymentIntent or null if not found and failed to create
 	 */
 	public function getPaymentIntent($amount, $currency_code, $tag, $description = '', $object = null, $customer = null, $key = null, $status = 0, $usethirdpartyemailforreceiptemail = 0, $mode = 'automatic', $confirmnow = false, $payment_method = null, $off_session = 0, $noidempotency_key = 1, $did = 0)
 	{
@@ -454,8 +454,6 @@
 				}
 			}
 
-			$stripemode = $mode;
-
 			// list of payment method types
 			$paymentmethodtypes = array("card");
 			$descriptor = dol_trunc($tag, 10, 'right', 'UTF-8', 1);
@@ -478,11 +476,8 @@
 			if (getDolGlobalInt('STRIPE_SOFORT')) {
 				$paymentmethodtypes[] = "sofort";
 			}
-			if ($mode == 'terminal') {
-				if (getDolGlobalInt('STRIPE_CARD_PRESENT')) {
-					$paymentmethodtypes = array("card_present");
-				}
-				$stripemode = 'manual';
+			if (getDolGlobalInt('STRIPE_CARD_PRESENT') && $mode == 'terminal') {
+				$paymentmethodtypes = array("card_present");
 			}
 
 			global $dolibarr_main_url_root;
@@ -491,7 +486,7 @@
 
 			$dataforintent = array(
 				"confirm" => $confirmnow, // try to confirm immediately after create (if conditions are ok)
-				"confirmation_method" => $stripemode,
+				"confirmation_method" => $mode,
 				"amount" => $stripeamount,
 				"currency" => $currency_code,
 				"payment_method_types" => $paymentmethodtypes,	// When payment_method_types is set, return_url is not required but payment mode can't be managed from dashboard
@@ -1080,7 +1075,7 @@
 
 						$service = 'StripeTest';
 						$servicestatus = 0;
-						if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha') */) {
+						if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
 							$service = 'StripeLive';
 							$servicestatus = 1;
 						}

########## stripe/config.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/stripe/config.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/stripe/config.php	2025-06-27 11:43:58.083359000 +0000
@@ -44,7 +44,7 @@
 );
 
 $stripearrayofkeys = array();
-if (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */) {
+if (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha')) {
 	$stripearrayofkeys = $stripearrayofkeysbyenv[0]; // Test
 } else {
 	$stripearrayofkeys = $stripearrayofkeysbyenv[1]; // Live

########## stripe/payout.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/stripe/payout.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/stripe/payout.php	2025-06-27 11:43:58.084402000 +0000
@@ -78,7 +78,7 @@
 
 llxHeader('', $langs->trans("StripePayoutList"));
 
-if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */)) {
+if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha'))) {
 	$service = 'StripeTest';
 	$servicestatus = '0';
 	dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), [], 'warning');

########## stripe/transaction.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/stripe/transaction.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/stripe/transaction.php	2025-06-27 11:43:58.075548000 +0000
@@ -76,7 +76,7 @@
 
 llxHeader('', $langs->trans("StripeTransactionList"));
 
-if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */)) {
+if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha'))) {
 	$service = 'StripeTest';
 	$servicestatus = '0';
 	dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), [], 'warning');

########## supplier_proposal/class/api_supplier_proposals.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/supplier_proposal/class/api_supplier_proposals.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/supplier_proposal/class/api_supplier_proposals.class.php	2025-06-27 11:43:59.820866000 +0000
@@ -238,7 +238,7 @@
 		$obj_ret = array();
 
 		// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
-		$socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids;
+		$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
 
 		// If the internal user must only see his customers, force searching by him
 		$search_sale = 0;

########## takepos/admin/terminal.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/takepos/admin/terminal.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/takepos/admin/terminal.php	2025-06-27 11:43:58.013385000 +0000
@@ -251,14 +251,14 @@
 		print '<td>';
 		$service = 'StripeTest';
 		$servicestatus = 0;
-		if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha') */) {
+		if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
 			$service = 'StripeLive';
 			$servicestatus = 1;
 		}
 		global $stripearrayofkeysbyenv;
 		$site_account = $stripearrayofkeysbyenv[$servicestatus]['secret_key'];
 		\Stripe\Stripe::setApiKey($site_account);
-		if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */)) {
+		if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha'))) {
 			$service = 'StripeTest';
 			$servicestatus = '0';
 			dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), [], 'warning');

########## takepos/index.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/takepos/index.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/takepos/index.php	2025-06-27 11:43:57.959221000 +0000
@@ -711,15 +711,7 @@
  * return   void
  */
 function Search2(keyCodeForEnter, moreorless) {
-	var eventKeyCode = null;
-
-	if (window.event && window.event.keyCode) {
-		eventKeyCode = window.event.keyCode;
-	}
-	if (eventKeyCode === null && keyCodeForEnter !== '') {
-		// No key code available, exit early if a key code is required
-		return;
-	}
+	var eventKeyCode = window.event.keyCode;
 
 	console.log("Search2 Call ajax search to replace products keyCodeForEnter="+keyCodeForEnter+", eventKeyCode="+eventKeyCode);
 

########## takepos/pay.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/takepos/pay.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/takepos/pay.php	2025-06-27 11:43:57.960926000 +0000
@@ -99,7 +99,7 @@
 if (isModEnabled('stripe')) {
 	$service = 'StripeTest';
 
-	if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha') */) {
+	if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
 		$service = 'StripeLive';
 		$servicestatus = 1;
 	}
@@ -158,7 +158,7 @@
 	}
 }
 
-if (isModEnabled('stripe') && isset($keyforstripeterminalbank) && (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */)) {
+if (isModEnabled('stripe') && isset($keyforstripeterminalbank) && (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha'))) {
 	dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), [], 'warning', 1);
 }
 

########## takepos/receipt.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/takepos/receipt.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/takepos/receipt.php	2025-06-27 11:43:57.966009000 +0000
@@ -79,7 +79,7 @@
 
 top_htmlhead('', '', 1);
 
-if ((string) $place != '' && !empty($_SESSION["takeposterminal"])) {
+if ((string) $place != '') {
 	$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture";
 	$sql .= " WHERE ref = '(PROV-POS".$db->escape($_SESSION["takeposterminal"]."-".$place).")'";
 	$sql .= " AND entity IN (".getEntity('invoice').")";

########## ticket/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/ticket/card.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/ticket/card.php	2025-06-27 11:44:00.066618000 +0000
@@ -707,7 +707,7 @@
 
 $help_url = 'EN:Module_Ticket|FR:DocumentationModuleTicket';
 
-$title = $actionobject->getTitle($action, $object);
+$title = $actionobject->getTitle($action);
 
 llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-ticket page-card');
 

########## ticket/class/actions_ticket.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/ticket/class/actions_ticket.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/ticket/class/actions_ticket.class.php	2025-06-27 11:44:00.068949000 +0000
@@ -169,11 +169,10 @@
 	/**
 	 * Get action title
 	 *
-	 * @param 	string 			$action    	Type of action
-	 * @param	Ticket|null		$object		Object ticket
-	 * @return 	string						Title of action
+	 * @param string 	$action    	Type of action
+	 * @return string			Title of action
 	 */
-	public function getTitle($action = '', $object = null)
+	public function getTitle($action = '')
 	{
 		global $langs;
 
@@ -182,11 +181,11 @@
 		} elseif ($action == 'edit') {
 			return $langs->trans("EditTicket");
 		} elseif ($action == 'view') {
-			return $langs->trans("Ticket").(is_null($object) ? '' : ' '.$object->ref);
+			return $langs->trans("TicketCard");
 		} elseif ($action == 'add_message') {
 			return $langs->trans("TicketAddMessage");
 		} else {
-			return $langs->trans("Ticket");
+			return $langs->trans("TicketsManagement");
 		}
 	}
 

########## ticket/class/api_tickets.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/ticket/class/api_tickets.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/ticket/class/api_tickets.class.php	2025-06-27 11:44:00.073625000 +0000
@@ -213,7 +213,7 @@
 
 		$obj_ret = array();
 
-		$socid = DolibarrApiAccess::$user->socid ?: $socid;
+		$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $socid;
 
 		$search_sale = null;
 		// If the internal user must only see his customers, force searching by him

########## ticket/class/ticket.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/ticket/class/ticket.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/ticket/class/ticket.class.php	2025-06-27 11:44:00.071989000 +0000
@@ -2823,10 +2823,8 @@
 
 							$from = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM');
 
-							$replyto = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_REPLYTO');
-
 							// don't try to send email if no recipient
-							$this->sendTicketMessageByEmail($subject, $message, 0, $sendto, $listofpaths, $listofmimes, $listofnames, array(), $from, $replyto);
+							$this->sendTicketMessageByEmail($subject, $message, 0, $sendto, $listofpaths, $listofmimes, $listofnames, array(), $from);
 						}
 					}
 				} else {
@@ -2904,11 +2902,9 @@
 
 							$from = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM');
 
-							$replyto = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_REPLYTO');
-
 							// don't try to send email if no recipient
 							if (!empty($sendto)) {
-								$this->sendTicketMessageByEmail($subject, $message, 0, $sendto, $listofpaths, $listofmimes, $listofnames, $sendtocc, $from, $replyto);
+								$this->sendTicketMessageByEmail($subject, $message, 0, $sendto, $listofpaths, $listofmimes, $listofnames, $sendtocc, $from);
 							}
 						}
 
@@ -2979,7 +2975,7 @@
 								$url_public_ticket = (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE') ?
 										(getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') !== '' ? getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') . '/view.php' : dol_buildpath('/public/ticket/view.php', 2)) : dol_buildpath('/ticket/card.php', 2)).'?track_id='.urlencode($object->track_id);
 
-								if (getDolGlobalInt('TICKET_INCLUDE_LINK_TO_PUBLIC_INTERFACE_IN_MESSAGE')) {
+								if (!getDolGlobalInt('TICKET_DO_NOT_INCLUDE_LINK_TO_CUSTOMER')) {
 									$message .= '<br>' . $langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : <a href="' . $url_public_ticket . '">' . $object->track_id . '</a><br>';
 								}
 
@@ -3019,9 +3015,7 @@
 								if (!empty($sendto)) {
 									$from = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM');
 
-									$replyto = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_REPLYTO');
-
-									$result = $this->sendTicketMessageByEmail($subject, $message, 0, $sendto, $listofpaths, $listofmimes, $listofnames, $sendtocc, $from, $replyto);
+									$result = $this->sendTicketMessageByEmail($subject, $message, 0, $sendto, $listofpaths, $listofmimes, $listofnames, $sendtocc, $from);
 									if ($result) {
 										// update last_msg_sent date of ticket (for last message sent to external users)
 										$this->date_last_msg_sent = dol_now();
@@ -3034,8 +3028,7 @@
 										$sql .= " email_subject = '".$this->db->escape($subject)."',";
 										$sql .= " email_from = '".$this->db->escape($from)."',";
 										$sql .= " email_to = '".$this->db->escape(implode(',', $sendto))."',";
-										$sql .= " email_tocc = '".$this->db->escape(implode(',', $sendtocc))."',";
-										$sql .= " reply_to = '".$this->db->escape($replyto)."'";
+										$sql .= " email_tocc = '".$this->db->escape(implode(',', $sendtocc))."'";
 										$sql .= " WHERE id = ".((int) $id);
 
 										$resql = $this->db->query($sql);
@@ -3082,10 +3075,9 @@
 	 * @param string[]		$mimefilename_list  List of attached file name in message
 	 * @param array<string>	$array_receiver_cc	Array of receiver in CC. Example array('john@doe.com')
 	 * @param string		$from				Email from
-	 * @param string		$replyto			Reply to
 	 * @return boolean     						True if mail sent to at least one receiver, false otherwise
 	 */
-	public function sendTicketMessageByEmail($subject, $message, $send_internal_cc = 0, $array_receiver = array(), $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $array_receiver_cc = array(), $from = '', $replyto = '')
+	public function sendTicketMessageByEmail($subject, $message, $send_internal_cc = 0, $array_receiver = array(), $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $array_receiver_cc = array(), $from = '')
 	{
 		global $conf, $langs, $user;
 
@@ -3125,34 +3117,34 @@
 
 		if (is_array($array_receiver) && count($array_receiver) > 0) {
 			//foreach ($array_receiver as $key => $receiver) {
-			$deliveryreceipt = 0;
-			$filepath = $filename_list;
-			$filename = $mimefilename_list;
-			$mimetype = $mimetype_list;
+				$deliveryreceipt = 0;
+				$filepath = $filename_list;
+				$filename = $mimefilename_list;
+				$mimetype = $mimetype_list;
 
-			// Send email
+				// Send email
 
-			$old_MAIN_MAIL_AUTOCOPY_TO = getDolGlobalString('MAIN_MAIL_AUTOCOPY_TO');
+				$old_MAIN_MAIL_AUTOCOPY_TO = getDolGlobalString('MAIN_MAIL_AUTOCOPY_TO');
 			if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) {
 				$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
 			}
 
-			$upload_dir_tmp = $conf->user->dir_output."/".$user->id.'/temp';
+				$upload_dir_tmp = $conf->user->dir_output."/".$user->id.'/temp';
 
-			include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
-			$trackid = "tic".$this->id;
+				include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
+				$trackid = "tic".$this->id;
 
-			$moreinheader = 'X-Dolibarr-Info: sendTicketMessageByEmail'."\r\n";
+				$moreinheader = 'X-Dolibarr-Info: sendTicketMessageByEmail'."\r\n";
 			if (!empty($this->email_msgid)) {
 				// We must also add 1 entry In-Reply-To: <$this->email_msgid> with Message-ID we respond from (See RFC5322).
 				$moreinheader .= 'In-Reply-To: <'.$this->email_msgid.'>'."\r\n";
 				// TODO We should now be able to give the in_reply_to as a dedicated parameter of new CMailFile() instead of into $moreinheader.
 			}
 
-			// We should add here also a header 'References:'
-			// According to RFC5322, we should add here all the References fields of the initial message concatenated with
-			// the Message-ID of the message we respond from (but each ID must be once).
-			$references = '';
+				// We should add here also a header 'References:'
+				// According to RFC5322, we should add here all the References fields of the initial message concatenated with
+				// the Message-ID of the message we respond from (but each ID must be once).
+				$references = '';
 			if (!empty($this->origin_references)) {		// $this->origin_references should be '<'.$this->origin_references.'>'
 				$references .= (empty($references) ? '' : ' ').$this->origin_references;
 			}
@@ -3164,15 +3156,11 @@
 				// TODO We should now be able to give the references as a dedicated parameter of new CMailFile() instead of into $moreinheader.
 			}
 
-			$receiverstring = '';
+				$receiverstring = '';
 			foreach ($array_receiver as $key => $receiver) {
 				$receiverstring .= ($receiverstring ? ',' : '').$receiver;
 			}
-
-			$sendcontext = 'ticket';
-
-			// Send email
-			$mailfile = new CMailFile($subject, $receiverstring, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', $trackid, $moreinheader, $sendcontext, $replyto, $upload_dir_tmp);
+				$mailfile = new CMailFile($subject, $receiverstring, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', $trackid, $moreinheader, 'ticket', '', $upload_dir_tmp);
 
 
 			if ($mailfile->error) {

########## user/bank.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/user/bank.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/user/bank.php	2025-06-27 11:43:58.027218000 +0000
@@ -63,6 +63,16 @@
  * @var User $user
  */
 
+// $moreparam is used, but it is unclear how it is set, keeping the variable and ensuring it exists.
+// $countrynotdefined is used, but it is unclear how it is set.
+'
+@phan-var-force ?string $moreparam
+@phan-var-force ?string $countrynotdefined
+';
+if (!isset($moreparam)) {
+	$moreparam = null;
+}
+
 // Load translation files required by page
 $langs->loadLangs(array('accountancy', 'companies', 'commercial', 'banks', 'bills', 'trips', 'holiday', 'salaries'));
 
@@ -218,8 +228,8 @@
 	$action = '';
 }
 
-// update birth (pure personal information)
-if ($action == 'setbirth' && $permissiontowritehr && !$cancel) {
+// update birth
+if ($action == 'setbirth' && $usercanadd && !$cancel) {
 	$object->birth = dol_mktime(0, 0, 0, GETPOSTINT('birthmonth'), GETPOSTINT('birthday'), GETPOSTINT('birthyear'));
 	$result = $object->update($user);
 	if ($result < 0) {
@@ -273,8 +283,8 @@
 	}
 }
 
-// update national_registration_number (pure personal information)
-if ($action == 'setnational_registration_number' && $permissiontowritehr && !$cancel) {
+// update national_registration_number
+if ($action == 'setnational_registration_number' && $usercanadd && !$cancel) {
 	$object->national_registration_number = (string) GETPOST('national_registration_number', 'alphanohtml');
 	$result = $object->update($user);
 	if ($result < 0) {
@@ -516,8 +526,8 @@
 	print '</td>';
 	print "</tr>\n";
 
-	// Date of birth (pure personal information)
-	if ($permissiontoreadhr) {
+	// Date of birth
+	if ($user->hasRight('hrm', 'read_personal_information', 'read') || $user->hasRight('hrm', 'write_personal_information', 'write')) {
 		print '<tr>';
 		print '<td>';
 		print $form->editfieldkey("DateOfBirth", 'birth', $object->birth, $object, $user->hasRight('user', 'user', 'creer'));
@@ -528,23 +538,23 @@
 	}
 
 	// Personal email
-	if ($permissiontoreadhr || $permissiontosimpleedit) {
+	if ($user->hasRight('hrm', 'read_personal_information', 'read') || $user->hasRight('hrm', 'write_personal_information', 'write') || $permissiontosimpleedit) {
 		print '<tr class="nowrap">';
 		print '<td>';
-		print $form->editfieldkey("UserPersonalEmail", 'personal_email', $object->personal_email, $object, $user->hasRight('user', 'user', 'creer') || $permissiontowritehr);
+		print $form->editfieldkey("UserPersonalEmail", 'personal_email', $object->personal_email, $object, (int) ($user->hasRight('user', 'user', 'creer') || $user->hasRight('hrm', 'write_personal_information', 'write')));
 		print '</td><td>';
-		print $form->editfieldval("UserPersonalEmail", 'personal_email', $object->personal_email, $object, $user->hasRight('user', 'user', 'creer') || $permissiontowritehr, 'email', '', null, null, '', 0, '');
+		print $form->editfieldval("UserPersonalEmail", 'personal_email', $object->personal_email, $object, $user->hasRight('user', 'user', 'creer') || $user->hasRight('hrm', 'write_personal_information', 'write'), 'email', '', null, null, '', 0, '');
 		print '</td>';
 		print '</tr>';
 	}
 
 	// Personal phone
-	if ($permissiontoreadhr || $permissiontosimpleedit) {
+	if ($user->hasRight('hrm', 'read_personal_information', 'read') || $user->hasRight('hrm', 'write_personal_information', 'write') || $permissiontosimpleedit) {
 		print '<tr class="nowrap">';
 		print '<td>';
-		print $form->editfieldkey("UserPersonalMobile", 'personal_mobile', $object->personal_mobile, $object, $user->hasRight('user', 'user', 'creer') || $permissiontowritehr);
+		print $form->editfieldkey("UserPersonalMobile", 'personal_mobile', $object->personal_mobile, $object, (int) ($user->hasRight('user', 'user', 'creer') || $user->hasRight('hrm', 'write_personal_information', 'write')));
 		print '</td><td>';
-		print $form->editfieldval("UserPersonalMobile", 'personal_mobile', $object->personal_mobile, $object, $user->hasRight('user', 'user', 'creer') || $permissiontowritehr, 'phone', '', null, null, '', 0, '');
+		print $form->editfieldval("UserPersonalMobile", 'personal_mobile', $object->personal_mobile, $object, $user->hasRight('user', 'user', 'creer') || $user->hasRight('hrm', 'write_personal_information', 'write'), 'phone', '', null, null, '', 0, '');
 		print '</td>';
 		print '</tr>';
 	}
@@ -555,7 +565,7 @@
 		print $form->editfieldkey("DefaultCategoryCar", 'default_c_exp_tax_cat', (string) $object->default_c_exp_tax_cat, $object, $user->hasRight('user', 'user', 'creer'));
 		print '</td><td>';
 		if ($action == 'editdefault_c_exp_tax_cat') {
-			$ret = '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
+			$ret = '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">';
 			$ret .= '<input type="hidden" name="action" value="setdefault_c_exp_tax_cat">';
 			$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
 			$ret .= '<input type="hidden" name="id" value="'.$object->id.'">';
@@ -577,7 +587,7 @@
 		print $form->editfieldkey("DefaultRangeNumber", 'default_range', (string) $object->default_range, $object, $user->hasRight('user', 'user', 'creer'));
 		print '</td><td>';
 		if ($action == 'editdefault_range') {
-			$ret = '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
+			$ret = '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">';
 			$ret .= '<input type="hidden" name="action" value="setdefault_range">';
 			$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
 			$ret .= '<input type="hidden" name="id" value="'.$object->id.'">';
@@ -598,17 +608,17 @@
 	}
 
 	// Employee Number
-	if ($permissiontoreadhr || $permissiontosimpleedit) {
+	if ($permissiontoreadhr) {
 		print '<tr class="nowrap">';
 		print '<td>';
-		print $form->editfieldkey("RefEmployee", 'ref_employee', $object->ref_employee, $object, $permissiontowritehr || $permissiontosimpleedit);
+		print $form->editfieldkey("RefEmployee", 'ref_employee', $object->ref_employee, $object, $permissiontowritehr);
 		print '</td><td>';
-		print $form->editfieldval("RefEmployee", 'ref_employee', $object->ref_employee, $object, $permissiontowritehr || $permissiontosimpleedit, 'string', $object->ref_employee);
+		print $form->editfieldval("RefEmployee", 'ref_employee', $object->ref_employee, $object, $permissiontowritehr, 'string', $object->ref_employee);
 		print '</td>';
 		print '</tr>';
 	}
 
-	// National registration number (pure personal information)
+	// National registration number
 	if ($permissiontoreadhr) {
 		print '<tr class="nowrap">';
 		print '<td>';
@@ -722,7 +732,7 @@
 			$db->free($resql);
 
 			if ($num <= 0) {
-				print '<td colspan="5"><span class="opacitymedium">'.$langs->trans("None").'</span></td>';
+				print '<td colspan="5"><span class="opacitymedium">'.$langs->trans("None").'</span></a>';
 			}
 			print "</table>";
 			print "</div>";
@@ -1013,6 +1023,8 @@
 	if ($selectedcode) {
 		print img_picto('', 'state', 'class="pictofixedwidth"');
 		print $formcompany->select_state(GETPOSTISSET("account_state_id") ? GETPOST("account_state_id") : $account->state_id, $selectedcode, 'account_state_id');
+	} else {
+		print $countrynotdefined;
 	}
 	print '</td></tr>';
 

########## user/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/user/card.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/user/card.php	2025-06-27 11:43:58.050808000 +0000
@@ -2061,11 +2061,6 @@
 					print showValueWithClipboardCPButton($object->api_key, 1, $langs->transnoentities("Hidden"));		// TODO Add an option to also reveal the hash, not only copy paste
 					print '</span>';
 				}
-
-				if (getDolGlobalString('API_ENABLE_COUNT_CALLS')) {
-					print ' &nbsp; <span class="badge badge-info" title="'.$langs->trans("TotalAPICall").'">'.getDolUserInt('API_COUNT_CALL').'</span>';
-				}
-
 				print '</td></tr>';
 			}
 			if ((getDolGlobalInt('MAIN_ENABLE_LOGINS_PRIVACY') == 0) || (getDolGlobalInt('MAIN_ENABLE_LOGINS_PRIVACY') == 1 && $object->id == $user->id)) {

########## user/class/api_users.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/user/class/api_users.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/user/class/api_users.class.php	2025-06-27 11:43:58.030186000 +0000
@@ -90,7 +90,7 @@
 		$obj_ret = array();
 
 		// case of external user, $societe param is ignored and replaced by user's socid
-		//$socid = DolibarrApiAccess::$user->socid ?: $societe;
+		//$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $societe;
 
 		$sql = "SELECT t.rowid";
 		$sql .= " FROM ".MAIN_DB_PREFIX."user AS t LEFT JOIN ".MAIN_DB_PREFIX."user_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields
@@ -645,7 +645,7 @@
 		}
 
 		// case of external user, $societe param is ignored and replaced by user's socid
-		//$socid = DolibarrApiAccess::$user->socid ?: $societe;
+		//$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $societe;
 
 		$sql = "SELECT t.rowid";
 		$sql .= " FROM ".MAIN_DB_PREFIX."usergroup AS t LEFT JOIN ".MAIN_DB_PREFIX."usergroup_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields

########## user/class/user.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/user/class/user.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/user/class/user.class.php	2025-06-27 11:43:58.033998000 +0000
@@ -590,25 +590,21 @@
 		$sql .= " LEFT JOIN ".$this->db->prefix()."c_departements as d ON u.fk_state = d.rowid";
 		$sql .= " LEFT JOIN ".$this->db->prefix()."establishment as s ON u.fk_establishment = s.rowid";
 
-		if ($id > 0) {
-			$sql .= " WHERE u.rowid = ".((int) $id);
+		if ($entity < 0) {
+			if ((!isModEnabled('multicompany') || !getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) && (!empty($user->entity))) {
+				$sql .= " WHERE u.entity IN (0, ".((int) $conf->entity).")";
+			} else {
+				$sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database
+			}
 		} else {
-			if ($entity < 0) {
-				if ((! isModEnabled('multicompany') || ! getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) && (! empty($user->entity))) {
-					$sql .= " WHERE u.entity IN (0, " . ((int) $conf->entity) . ")";
-				} else {
-					$sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database
-				}
+			// The fetch was forced on an entity
+			if (isModEnabled('multicompany') && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) {
+				$sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database
 			} else {
-				// The fetch was forced on an entity
-				if (isModEnabled('multicompany') && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) {
-					$sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database
-				} else {
-					if ($entity != '' && $entity == 0) {    // If $entity = 0
-						$sql .= " WHERE u.entity = 0";
-					} else {                                // if $entity is -1 or > 0
-						$sql .= " WHERE u.entity IN (0, " . ((int) ($entity > 0 ? $entity : $conf->entity)) . ")";
-					}
+				if ($entity != '' && $entity == 0) {	// If $entity = 0
+					$sql .= " WHERE u.entity = 0";
+				} else {								// if $entity is -1 or > 0
+					$sql .= " WHERE u.entity IN (0, ".((int) ($entity > 0 ? $entity : $conf->entity)).")";
 				}
 			}
 		}
@@ -626,8 +622,9 @@
 			$sql .= ")";
 		} elseif ($fk_socpeople > 0) {
 			$sql .= " AND u.fk_socpeople = ".((int) $fk_socpeople);
+		} else {
+			$sql .= " AND u.rowid = ".((int) $id);
 		}
-
 		$sql .= " ORDER BY u.entity ASC"; // Avoid random result when there is 2 login in 2 different entities
 
 		if ($sid) {
@@ -3879,12 +3876,13 @@
 	 *				fullpath = Full path composed of the ids: "_grandparentid_parentid_id"
 	 *
 	 *  @param      int		$deleteafterid      Removed all users including the leaf $deleteafterid (and all its child) in user tree.
-	 *  @param		string	$filter				SQL filter on users. This parameter must NOT come from user input.
+	 *  @param		string	$filter				SQL filter on users. This parameter must not come from user input.
 	 *	@return		int<-1,-1>|array<int,array{rowid:int,id:int,fk_user:int,fk_soc:int,firstname:string,lastname:string,login:string,statut:int,entity:int,email:string,gender:string|int<-1,-1>,admin:int<0,1>,photo:string,fullpath:string,fullname:string,level:int}>  Array of user information (also: $this->users). Note: $this->parentof is also set.
 	 */
 	public function get_full_tree($deleteafterid = 0, $filter = '')
 	{
 		// phpcs:enable
+		global $conf, $user;
 		global $hookmanager;
 
 		// Actions hooked (by external module)
@@ -3907,7 +3905,7 @@
 			$sql .= " WHERE u.entity IN (".getEntity('user').")";
 		}
 		if ($filter) {
-			$sql .= " AND ".$filter;	// already sanitized
+			$sql .= " AND ".$filter;
 		}
 
 		dol_syslog(get_class($this)."::get_full_tree get user list", LOG_DEBUG);

########## user/group/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/user/group/list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/user/group/list.php	2025-06-27 11:43:58.057513000 +0000
@@ -371,23 +371,25 @@
 print '<tr class="liste_titre_filter">';
 // Action column
 if ($conf->main_checkbox_left_column) {
-	print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
-	$totalarray['nbfield']++;
+	print '<td class="liste_titre center maxwidthsearch">';
+	$searchpicto = $form->showFilterButtons('left');
+	print $searchpicto;
+	print '</td>';
 }
-print_liste_field_titre("Group", $_SERVER["PHP_SELF"], "g.nom", '', $param, "", $sortfield, $sortorder);
+print_liste_field_titre("Group", $_SERVER["PHP_SELF"], "g.nom", $param, "", "", $sortfield, $sortorder);
 $totalarray['nbfield']++;
 //multicompany
 if (isModEnabled('multicompany') && !getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) {
-	print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], "g.entity", '', $param, '', $sortfield, $sortorder, 'center ');
+	print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], "g.entity", $param, "", '', $sortfield, $sortorder, 'center ');
 	$totalarray['nbfield']++;
 }
-print_liste_field_titre("NbOfUsers", $_SERVER["PHP_SELF"], "nb", '', $param, '', $sortfield, $sortorder, 'center ');
+print_liste_field_titre("NbOfUsers", $_SERVER["PHP_SELF"], "nb", $param, "", '', $sortfield, $sortorder, 'center ');
 $totalarray['nbfield']++;
-print_liste_field_titre("NbOfPermissions", $_SERVER["PHP_SELF"], "nbpermissions", '', $param, '', $sortfield, $sortorder, 'center ');
+print_liste_field_titre("NbOfPermissions", $_SERVER["PHP_SELF"], "nbpermissions", $param, "", '', $sortfield, $sortorder, 'center ');
 $totalarray['nbfield']++;
-print_liste_field_titre("DateCreationShort", $_SERVER["PHP_SELF"], "g.datec", '', $param, '', $sortfield, $sortorder, 'center ');
+print_liste_field_titre("DateCreationShort", $_SERVER["PHP_SELF"], "g.datec", $param, "", '', $sortfield, $sortorder, 'center ');
 $totalarray['nbfield']++;
-print_liste_field_titre("DateLastModification", $_SERVER["PHP_SELF"], "g.tms", '', $param, '', $sortfield, $sortorder, 'center ');
+print_liste_field_titre("DateLastModification", $_SERVER["PHP_SELF"], "g.tms", $param, "", '', $sortfield, $sortorder, 'center ');
 $totalarray['nbfield']++;
 // Extra fields
 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
@@ -401,7 +403,7 @@
  }*/
 // Action column
 if (!$conf->main_checkbox_left_column) {
-	print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
+	print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
 	$totalarray['nbfield']++;
 }
 print '</tr>'."\n";

########## user/group/perms.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/user/group/perms.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/user/group/perms.php	2025-06-27 11:43:58.059157000 +0000
@@ -54,7 +54,6 @@
 $confirm = GETPOST('confirm', 'alpha');
 $module = GETPOST('module', 'alpha');
 $rights = GETPOSTINT('rights');
-$updatedmodulename = GETPOST('updatedmodulename', 'alpha');
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'groupperms'; // To manage different context of search
 
 if (!isset($id) || empty($id)) {
@@ -225,7 +224,6 @@
 
 	dol_banner_tab($object, 'id', $linkback, $user->hasRight("user", "user", "read") || $user->admin);
 
-
 	print '<div class="fichehalfleft">';
 
 	print '<div class="underbanner clearboth"></div>';
@@ -266,7 +264,6 @@
 
 	print '<br>';
 
-
 	if ($user->admin) {
 		print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"));
 		print '<br>';
@@ -285,14 +282,16 @@
 	print '<td>'.$langs->trans("Module").'</td>';
 	if ($permissiontoedit) {
 		print '<td class="center nowrap">';
-		print '<a class="reposition commonlink addexpandedmodulesinparamlist" title="'.dol_escape_htmltag($langs->trans("All")).'" alt="'.dol_escape_htmltag($langs->trans("All")).'" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addrights&token='.newToken().'&entity='.$entity.'&module=allmodules&confirm=yes">'.$langs->trans("All")."</a>";
+		print '<a class="reposition commonlink" title="'.dol_escape_htmltag($langs->trans("All")).'" alt="'.dol_escape_htmltag($langs->trans("All")).'" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addrights&token='.newToken().'&entity='.$entity.'&module=allmodules&confirm=yes">'.$langs->trans("All")."</a>";
 		print '/';
-		print '<a class="reposition commonlink addexpandedmodulesinparamlist" title="'.dol_escape_htmltag($langs->trans("None")).'" alt="'.dol_escape_htmltag($langs->trans("None")).'" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delrights&&token='.newToken().'&entity='.$entity.'&module=allmodules&confirm=yes">'.$langs->trans("None")."</a>";
+		print '<a class="reposition commonlink" title="'.dol_escape_htmltag($langs->trans("None")).'" alt="'.dol_escape_htmltag($langs->trans("None")).'" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delrights&&token='.newToken().'&entity='.$entity.'&module=allmodules&confirm=yes">'.$langs->trans("None")."</a>";
 		print '</td>';
 	} else {
 		print '<td></td>';
 	}
 	print '<td class="center" width="24"></td>';
+	//print '<td>'.$langs->trans("Permissions").'</td>';
+
 	print '<td class="right nowrap" colspan="2">';
 	print '<a class="showallperms" title="'.dol_escape_htmltag($langs->trans("ShowAllPerms")).'" alt="'.dol_escape_htmltag($langs->trans("ShowAllPerms")).'" href="#">'.img_picto('', 'folder-open', 'class="paddingright"').'<span class="hideonsmartphone">'.$langs->trans("ExpandAll").'</span></a>';
 	print ' | ';
@@ -305,7 +304,7 @@
 	$sql .= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous"
 	$sql .= " AND r.entity = ".((int) $entity);
 	if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) {
-		$sql .= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is not enabled
+		$sql .= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is disable
 	}
 	$sql .= " ORDER BY r.family_position, r.module_position, r.module, r.id";
 
@@ -408,12 +407,10 @@
 				if (in_array($obj->id, $permsgroupbyentity[$entity])) {
 					// Own permission by group
 					if ($permissiontoedit) {
-						print '<td class="center nowrap">';
-						print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&updatedmodulename='.$obj->module.'">';
+						print '<td class="center nowrap"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes">';
 						//print img_edit_remove($langs->trans("Remove"));
 						print img_picto($langs->trans("Remove"), 'switch_on');
-						print '</a>';
-						print '</td>';
+						print '</a></td>';
 					}
 					print '<td class="center nowrap">';
 					print img_picto($langs->trans("Active"), 'tick');
@@ -421,20 +418,17 @@
 				} else {
 					// Do not own permission
 					if ($permissiontoedit) {
-						print '<td class="center nowrap">';
-						print '<a class="reposition addexpandedmodulesinparamlist" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&updatedmodulename='.$obj->module.'">';
+						print '<td class="center nowrap"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes">';
 						//print img_edit_add($langs->trans("Add"));
 						print img_picto($langs->trans("Add"), 'switch_off');
-						print '</a>';
-						print '</td>';
+						print '</a></td>';
 					}
 					print '<td></td>';
 				}
 			} else {
 				// Do not own permission
 				if ($permissiontoedit) {
-					print '<td class="center nowrap">';
-					print '<a class="reposition addexpandedmodulesinparamlist" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&updatedmodulename='.$obj->module.'">';
+					print '<td class="center nowrap"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'">';
 					//print img_edit_add($langs->trans("Add"));
 					print img_picto($langs->trans("Add"), 'switch_off');
 					print '</a></td>';
@@ -444,7 +438,7 @@
 				print '<td></td>';
 			}
 
-			// Description of permission (1 column)
+			// Description of permission (2 columns)
 			print '<td>';
 			print $permlabel;
 			$idtouse = $obj->id;
@@ -468,8 +462,8 @@
 			if ($user->admin) {
 				print '<td class="right">';
 				$htmltext = $langs->trans("ID").': '.$obj->id;
-				$htmltext .= '<br>'.$langs->trans("Permission").': user->hasRight(\''.dol_escape_htmltag($obj->module).'\', \''.dol_escape_htmltag($obj->perms).'\''.($obj->subperms ? ', \''.dol_escape_htmltag($obj->subperms).'\'' : '').')';
-				print $form->textwithpicto('', $htmltext, 1, 'help', 'inline-block marginrightonly');
+				$htmltext .= '<br>'.$langs->trans("Permission").': user->hasRight(\''.$obj->module.'\', \''.$obj->perms.'\''.($obj->subperms ? ', \''.$obj->subperms.'\'' : '').')';
+				print $form->textwithpicto('', $htmltext, 1, 'help', 'marginrightonly');
 				//print '<span class="opacitymedium">'.$obj->id.'</span>';
 				print '</td>';
 			} else {
@@ -490,15 +484,15 @@
 		moduletohide = $(this).data("hide-perms");
 		j = $(this).data("j");
 		if ($("#idforbreakperms_"+moduletohide).val() == 1) {
-			console.log("idforbreakperms_"+moduletohide+" has value hidden=1, so we show all lines");
+			console.log("idforbreakperms_"+moduletohide+" has value hidden=1");
 			$(".trtohide_"+moduletohide).show();
 			$(".permtoshow_"+moduletohide).hide();
 			$(".permtohide_"+moduletohide).show();
 			$(".folderperms_"+moduletohide).hide();
 			$(".folderopenperms_"+moduletohide).show();
 			$("#idforbreakperms_"+moduletohide).val("0");
-		} else if (! $(this).hasClass("tdforbreakpermsifnotempty")) {
-			console.log("idforbreakperms_"+moduletohide+" has value hidden=0, so we hide all lines");
+		} else {
+			console.log("idforbreakperms_"+moduletohide+" has value hidden=0");
 			$(".trtohide_"+moduletohide).hide();
 			$(".folderopenperms_"+moduletohide).hide();
 			$(".folderperms_"+moduletohide).show();
@@ -525,7 +519,6 @@
 			document.cookie = "DOLUSER_PERMS_HIDE_GRP=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/ ";
 		}
 	});';
-	print "\n";
 
 	// Button expand / collapse all
 	print '$(".showallperms").on("click", function(){
@@ -561,6 +554,7 @@
 		cursor: pointer;
 	}';
 	print '</style>';
+	print '</div>';
 
 	$parameters = array();
 	$reshook = $hookmanager->executeHooks('insertExtraFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks

########## user/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/user/list.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/user/list.php	2025-06-27 11:43:58.062983000 +0000
@@ -305,6 +305,7 @@
 	$uploaddir = $conf->user->dir_output;
 
 	global $error;
+	include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
 
 	// Disable or Enable records
 	if (!$error && ($massaction == 'disable' || $massaction == 'reactivate') && $permissiontoadd) {
@@ -315,7 +316,7 @@
 		$nbok = 0;
 		foreach ($toselect as $toselectid) {
 			if ($toselectid == $user->id) {
-				setEventMessages($langs->trans($massaction == 'disable' ? 'CantDisableYourself' : 'CanEnableYourself'), null, 'errors');
+				setEventMessages($langs->trans($massaction == 0 ? 'CantDisableYourself' : 'CanEnableYourself'), null, 'errors');
 				$error++;
 				break;
 			}
@@ -323,7 +324,7 @@
 			$result = $objecttmp->fetch($toselectid);
 			if ($result > 0) {
 				if ($objecttmp->admin) {
-					setEventMessages($langs->trans($massaction == 'disable' ? 'CantDisableAnAdminUserWithMassActions' : 'CantEnableAnAdminUserWithMassActions', $objecttmp->login), null, 'errors');
+					setEventMessages($langs->trans($massaction == 0 ? 'CantDisableAnAdminUserWithMassActions' : 'CantEnableAnAdminUserWithMassActions', $objecttmp->login), null, 'errors');
 					$error++;
 					break;
 				}
@@ -359,12 +360,7 @@
 		} else {
 			$db->rollback();
 		}
-
-		$massaction = '';
 	}
-
-	// Generic mass actions
-	include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
 }
 
 

########## user/passwordforgotten.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/user/passwordforgotten.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/user/passwordforgotten.php	2025-06-27 11:43:58.065345000 +0000
@@ -190,16 +190,11 @@
 
 $dol_url_root = DOL_URL_ROOT;
 
-$appli = constant('DOL_APPLICATION_TITLE');
-$applicustom = getDolGlobalString('MAIN_APPLICATION_TITLE');
-if ($applicustom) {
-	$appli = (preg_match('/^\+/', $applicustom) ? $appli : '').$applicustom;
-} else {
-	$appli .= " ".DOL_VERSION;
-}
-
 // Title
-$title = $appli;	// $title is used in .tpl file
+$title = 'Dolibarr '.DOL_VERSION;
+if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
+	$title = getDolGlobalString('MAIN_APPLICATION_TITLE');
+}
 
 // Select templates dir
 $template_dir = '';

########## user/perms.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/user/perms.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/user/perms.php	2025-06-27 11:43:58.067233000 +0000
@@ -332,7 +332,6 @@
 print '</div>';
 print '<br>';
 
-
 if ($user->admin) {
 	print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"));
 }
@@ -348,6 +347,9 @@
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
 }
 
+//$listofexpandedmodules = array();
+
+
 print "\n";
 print '<div class="div-table-responsive-no-min">';
 print '<table class="noborder centpercent">';
@@ -364,6 +366,7 @@
 	print '<td></td>';
 }
 print '<td></td>';
+//print '<td></td>';
 print '<td class="right nowrap" colspan="2">';
 print '<a class="showallperms" title="'.dol_escape_htmltag($langs->trans("ShowAllPerms")).'" alt="'.dol_escape_htmltag($langs->trans("ShowAllPerms")).'" href="#">'.img_picto('', 'folder-open', 'class="paddingright"').'<span class="hideonsmartphone">'.$langs->trans("ExpandAll").'</span></a>';
 print ' | ';
@@ -629,7 +632,7 @@
 				// Do not own permission
 				if ($caneditperms) {
 					print '<td class="center nowrap">';
-					print '<a class="reposition addexpandedmodulesinparamlist" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&updatedmodulename='.$obj->module.'">';
+					print '<a class="reposition addexpandedmodulesinparamlist" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'&updatedmodulename='.$obj->module.'">';
 					//print img_edit_add($langs->trans("Add"));
 					print img_picto($langs->trans("Add"), 'switch_off');
 					print '</a>';
@@ -647,7 +650,7 @@
 			print '<!-- do not own permission -->';
 			if ($caneditperms) {
 				print '<td class="center nowrap">';
-				print '<a class="reposition addexpandedmodulesinparamlist" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&updatedmodulename='.$obj->module.'">';
+				print '<a class="reposition addexpandedmodulesinparamlist" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'&updatedmodulename='.$obj->module.'">';
 				//print img_edit_add($langs->trans("Add"));
 				print img_picto($langs->trans("Add"), 'switch_off');
 				print '</a>';

########## variants/class/ProductCombination.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/variants/class/ProductCombination.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/variants/class/ProductCombination.class.php	2025-06-27 11:43:59.934774000 +0000
@@ -4,7 +4,6 @@
  * Copyright (C) 2022   	Open-Dsi				<support@open-dsi.fr>
  * Copyright (C) 2024-2025	MDW						<mdeweerd@users.noreply.github.com>
  * Copyright (C) 2024-2025  Frédéric France         <frederic.france@free.fr>
- * Copyright (C) 2025       William Mead            <william@m34d.com>
  *
  * 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
@@ -468,36 +467,34 @@
 	/**
 	 * Deletes all product combinations of a parent product
 	 *
-	 * @param User		$user 				Object user
-	 * @param int 		$fk_product_parent 	Rowid of parent product
-	 * @return int 							Return integer <0 if KO, >0 if OK
+	 * @param User		$user Object user
+	 * @param int 		$fk_product_parent Rowid of parent product
+	 * @return int Return integer <0 KO >0 OK
 	 */
 	public function deleteByFkProductParent($user, $fk_product_parent)
 	{
-		$arrayofparent = $this->fetchAllByFkProductParent($fk_product_parent);
-
-		if (!is_array($arrayofparent)) { // No combinations found, return success
-			return 1;
-		}
-
 		$this->db->begin();
 
-		foreach ($arrayofparent as $prodcomb) {
-			$prodstatic = new Product($this->db);
+		$arrayofparent = $this->fetchAllByFkProductParent($fk_product_parent);
 
-			$res = $prodstatic->fetch($prodcomb->fk_product_child);
+		if (is_array($arrayofparent)) {
+			foreach ($arrayofparent as $prodcomb) {
+				$prodstatic = new Product($this->db);
 
-			if ($res > 0) {
-				$res = $prodcomb->delete($user);
-			}
+				$res = $prodstatic->fetch($prodcomb->fk_product_child);
 
-			if ($res > 0 && !$prodstatic->isObjectUsed($prodstatic->id)) {
-				$res = $prodstatic->delete($user);
-			}
+				if ($res > 0) {
+					$res = $prodcomb->delete($user);
+				}
 
-			if ($res < 0) {
-				$this->db->rollback();
-				return -1;
+				if ($res > 0 && !$prodstatic->isObjectUsed($prodstatic->id)) {
+					$res = $prodstatic->delete($user);
+				}
+
+				if ($res < 0) {
+					$this->db->rollback();
+					return -1;
+				}
 			}
 		}
 

########## waf.inc.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/waf.inc.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/waf.inc.php	2025-06-27 11:43:57.339048000 +0000
@@ -92,9 +92,9 @@
 }
 
 /**
- * Security: WAF layer for SQL Injection and XSS Injection (scripts) protection (Filters on GET, POST, SERVER['PHP_SELF']).
- * Warning: Such a protection seems enough for SERVER['PHP_SELF'] but can't be enough for GET and POST. It is not reliable as it will always be possible
- * to bypass this. Good protection can only be guaranteed by escaping data during output.
+ * Security: WAF layer for SQL Injection and XSS Injection (scripts) protection (Filters on GET, POST, PHP_SELF).
+ * Warning: Such a protection can't be enough. It is not reliable as it will always be possible to bypass this. Good protection can
+ * only be guaranteed by escaping data during output.
  *
  * @param		string		$val		Brute value found into $_GET, $_POST or PHP_SELF
  * @param		int<0, 3>	$type		0=POST, 1=GET, 2=PHP_SELF, 3=GET without sql reserved keywords (the less tolerant test)
@@ -235,7 +235,7 @@
 		}
 	}
 	if ($type == 2) {
-		$inj += preg_match('/[:;"\'<>\?\(\){}\$%#]/', $val); // PHP_SELF is a file system (or url path without parameters). It can contains spaces.
+		$inj += preg_match('/[:;"\'<>\?\(\){}\$%]/', $val); // PHP_SELF is a file system (or url path without parameters). It can contains spaces.
 	}
 
 	return $inj;
@@ -264,7 +264,7 @@
 			} else {
 				http_response_code(403);
 
-				// Get remote IP: PS: We do not use getUserRemoteIP(), function is not yet loaded and we need a value that can't be spoofed
+				// Get remote IP: PS: We do not use getRemoteIP(), function is not yet loaded and we need a value that can't be spoofed
 				$ip = (empty($_SERVER['REMOTE_ADDR']) ? 'unknown' : $_SERVER['REMOTE_ADDR']);
 
 				if ($stopcode) {

########## webservices/server_user.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/webservices/server_user.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/webservices/server_user.php	2025-06-27 11:44:00.048952000 +0000
@@ -561,7 +561,7 @@
 					$sql = "SELECT rowid";
 					$sql .= " FROM ".MAIN_DB_PREFIX."c_country";
 					$sql .= " WHERE active = 1";
-					$sql .= " AND code = '".$db->escape($thirdparty->country_code)."'";
+					$sql .= " AND code='".$db->escape($thirdparty->country_code)."'";
 
 					$resql = $db->query($sql);
 					if ($resql) {
@@ -575,12 +575,13 @@
 					$thirdparty->fax = $thirdpartywithuser['fax'];
 					$thirdparty->email = $thirdpartywithuser['email'];
 					$thirdparty->url = $thirdpartywithuser['url'];
-					$thirdparty->idprof1 = $thirdpartywithuser['profid1'];
-					$thirdparty->idprof2 = $thirdpartywithuser['profid2'];
-					$thirdparty->idprof3 = $thirdpartywithuser['profid3'];
-					$thirdparty->idprof4 = $thirdpartywithuser['profid4'];
-					$thirdparty->idprof5 = $thirdpartywithuser['profid5'];
-					$thirdparty->idprof6 = $thirdpartywithuser['profid6'];
+					$thirdparty->ape = $thirdpartywithuser['ape'];
+					$thirdparty->idprof1 = $thirdpartywithuser['prof1'];
+					$thirdparty->idprof2 = $thirdpartywithuser['prof2'];
+					$thirdparty->idprof3 = $thirdpartywithuser['prof3'];
+					$thirdparty->idprof4 = $thirdpartywithuser['prof4'];
+					$thirdparty->idprof5 = $thirdpartywithuser['prof5'];
+					$thirdparty->idprof6 = $thirdpartywithuser['prof6'];
 
 					$thirdparty->client = (int) $thirdpartywithuser['client'];
 					$thirdparty->fournisseur = (int) $thirdpartywithuser['fournisseur'];

########## website/index.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/website/index.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/website/index.php	2025-06-27 11:44:00.003022000 +0000
@@ -834,7 +834,6 @@
 		}
 
 		if (!$error) {
-			// Download URL to grab
 			$tmp = getURLContent($urltograb, 'GET', '', 1, array(), array('http', 'https'), 0);
 
 			// Test charset of result and convert it into UTF-8 if not in this encoding charset
@@ -923,7 +922,7 @@
 				}
 				if (preg_match('/<html\s+lang="([^"]+)"/ims', $tmp['content'], $regtmp)) {
 					$tmplang = explode('-', $regtmp[1]);
-					$objectpage->lang = $tmplang[0].(empty($tmplang[1]) ? '' : '_'.strtoupper($tmplang[1]));
+					$objectpage->lang = $tmplang[0].($tmplang[1] ? '_'.strtoupper($tmplang[1]) : '');
 				}
 
 				$tmp['content'] = preg_replace('/\s*<meta name="generator"[^"]+content="([^"]+)"\s*\/?>/ims', '', $tmp['content']);
@@ -1082,7 +1081,7 @@
 						//dolChmod($file);
 
 						//	$filename = 'image/'.$object->ref.'/'.$objectpage->pageurl.(preg_match('/^\//', $linkwithoutdomain)?'':'/').$linkwithoutdomain;
-						$pagecsscontent .= "\n".'/* Content of file '.$urltograbbis.' */'."\n";
+						$pagecsscontent .= '/* Content of file '.$urltograbbis.' */'."\n";
 
 						getAllImages($object, $objectpage, $urltograbbis, $tmpgeturl['content'], $action, 1, $grabimages, $grabimagesinto);
 
@@ -4733,8 +4732,6 @@
 		print '<hr class="tablecheckboxcreatemanually'.$hiddenmanuallyafterload.'">';
 	}
 
-
-
 	print '<table class="border tableforfield nobackground centpercent tablecheckboxcreatemanually'.$hiddenmanuallyafterload.'">';
 
 	if ($action != 'createcontainer') {
@@ -5187,8 +5184,6 @@
 	print '</table>';
 
 	if ($action == 'createcontainer') {
-		$langs->load("website");
-
 		print '<div class="center tablecheckboxcreatemanually'.$hiddenmanuallyafterload.'">';
 
 		print '<input type="submit" class="button small" name="addcontainer" value="'.$langs->trans("Create").'">';
@@ -5196,17 +5191,14 @@
 
 		print '</div>';
 
+
 		print '<br>';
 
 		if (!empty($conf->use_javascript_ajax)) {
 			print '<input type="radio" name="radiocreatefrom" id="checkboxcreatefromfetching" value="checkboxcreatefromfetching"'.(GETPOST('radiocreatefrom') == 'checkboxcreatefromfetching' ? ' checked' : '').'> ';
 		}
-		print '<label for="checkboxcreatefromfetching"><span class="opacitymediumxx">'.$langs->trans("CreateByFetchingExternalPage").'</span> <span class="small opacitymedium">('.$langs->trans("ForAdvancedWebmastersOnly").')</small></label><br>';
+		print '<label for="checkboxcreatefromfetching"><span class="opacitymediumxx">'.$langs->trans("CreateByFetchingExternalPage").'</span></label><br>';
 		print '<hr class="tablecheckboxcreatefromfetching'.$hiddenfromfetchingafterload.'">';
-
-		print info_admin($langs->trans("OnlyEditionOfSourceForGrabbedContentFuture"), 0, 0, 'warning tablecheckboxcreatefromfetching'.$hiddenfromfetchingafterload);
-		print '<br>';
-
 		print '<table class="tableforfield centpercent tablecheckboxcreatefromfetching'.$hiddenfromfetchingafterload.'">';
 		print '<tr><td class="titlefield tdtop">';
 		print $langs->trans("URL");
@@ -5226,6 +5218,10 @@
 		print '<input class="button small" style="margin-top: 5px" type="submit" name="fetchexternalurl" value="'.dol_escape_htmltag($langs->trans("FetchAndCreate")).'">';
 		print '<input class="button button-cancel small" type="submit" name="preview" value="'.$langs->trans("Cancel").'">';
 
+		print '<br><br>';
+
+		print info_admin($langs->trans("OnlyEditionOfSourceForGrabbedContentFuture"), 0, 0, 'warning');
+
 		print '</td></tr>';
 		print '</table>';
 	}
@@ -5292,6 +5288,9 @@
 			});
 			</script>';
 	}
+	//print '</div>';
+
+	//print dol_get_fiche_end();
 
 	print '</div>';
 

########## workstation/class/api_workstations.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/workstation/class/api_workstations.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/workstation/class/api_workstations.class.php	2025-06-27 11:44:00.017861000 +0000
@@ -117,7 +117,7 @@
 
 		$obj_ret = array();
 
-		$socid = DolibarrApiAccess::$user->socid ?: '';
+		$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : '';
 
 		$sql = "SELECT t.rowid, t.ref";
 		$sql .= " FROM ".$this->db->prefix()."workstation_workstation as t";

########## zapier/class/api_zapier.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/zapier/class/api_zapier.class.php	2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/zapier/class/api_zapier.class.php	2025-06-27 11:44:00.107639000 +0000
@@ -155,7 +155,7 @@
 
 		$obj_ret = array();
 
-		$socid = DolibarrApiAccess::$user->socid ?: 0;
+		$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : 0;
 
 		// Set to 1 if there is a field socid in table of object
 		$restrictonsocid = 0;
