diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index a5c603c2504..e084bdcfc5b 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -197,7 +197,7 @@ $sql .= " AND f.fk_statut > 0"; if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_SITUATION.")"; } else { - $sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_STANDARD.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_DEPOSIT.",".Facture::TYPE_SITUATION.")"; + $sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_DEPOSIT.",".Facture::TYPE_SITUATION.")"; } // Add search filter like if ($search_societe) { diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 9d18dd1dd85..f8bde1ce489 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -374,6 +374,9 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f } elseif ($feature == 'salaries') { if (!$user->rights->salaries->delete) $deleteok = 0; + } elseif ($feature == 'payment_supplier') + { + if (!$user->rights->fournisseur->facture->creer) { $deleteok = 0; } } elseif (!empty($feature2)) // This is for permissions on 2 levels { foreach ($feature2 as $subfeature) diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index accdfae89f6..2553b55e5d3 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -335,6 +335,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode if ($type == 1) $sql .= " WHERE code_fournisseur = '".$db->escape($code)."'"; else $sql .= " WHERE code_client = '".$db->escape($code)."'"; if ($soc->id > 0) $sql .= " AND rowid <> ".$soc->id; + $sql .= " AND entity IN (".getEntity('societe').")"; $resql = $db->query($sql); if ($resql)