From c215764627616bf16d8b23782e6fc13bf2bc89cc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 Dec 2020 15:45:19 +0100 Subject: [PATCH 1/2] Fix phpcs --- htdocs/takepos/invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 9dbbbb44f1d..db6745e8885 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -583,7 +583,7 @@ if ($action == "delete") { // We delete the lines $resdeletelines = 1; - foreach($invoice->lines as $line) { + foreach ($invoice->lines as $line) { $tmpres = $invoice->deleteline($line->id); if ($tmpres < 0) { $resdeletelines = 0; From 3632a7a02ac65df5ea95fd08e8a4356fc2b23245 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 Dec 2020 15:50:59 +0100 Subject: [PATCH 2/2] Fix warning --- htdocs/societe/class/societe.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 6b1ca1ad3a6..38c6479d0f2 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3115,10 +3115,10 @@ class Societe extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Returns if a profid sould be verified + * Returns if a profid sould be verified to be unique * - * @param int $idprof 1,2,3,4,5,6 (Exemple: 1=siren,2=siret,3=naf,4=rcs/rm,5=idprof5,6=idprof6) - * @return boolean true , false + * @param int $idprof 1,2,3,4,5,6 (Example: 1=siren, 2=siret, 3=naf, 4=rcs/rm, 5=eori, 6=idprof6) + * @return boolean true if the ID must be unique */ public function id_prof_verifiable($idprof) { @@ -3128,22 +3128,22 @@ class Societe extends CommonObject switch ($idprof) { case 1: - $ret = (!$conf->global->SOCIETE_IDPROF1_UNIQUE ?false:true); + $ret = (empty($conf->global->SOCIETE_IDPROF1_UNIQUE) ? false : true); break; case 2: - $ret = (!$conf->global->SOCIETE_IDPROF2_UNIQUE ?false:true); + $ret = (empty($conf->global->SOCIETE_IDPROF2_UNIQUE) ? false : true); break; case 3: - $ret = (!$conf->global->SOCIETE_IDPROF3_UNIQUE ?false:true); + $ret = (empty($conf->global->SOCIETE_IDPROF3_UNIQUE) ? false : true); break; case 4: - $ret = (!$conf->global->SOCIETE_IDPROF4_UNIQUE ?false:true); + $ret = (empty($conf->global->SOCIETE_IDPROF4_UNIQUE) ? false : true); break; case 5: - $ret = (!$conf->global->SOCIETE_IDPROF5_UNIQUE ?false:true); + $ret = (empty($conf->global->SOCIETE_IDPROF5_UNIQUE) ? false : true); break; case 6: - $ret = (!$conf->global->SOCIETE_IDPROF6_UNIQUE ?false:true); + $ret = (empty($conf->global->SOCIETE_IDPROF6_UNIQUE) ? false : true); break; default: $ret = false;