diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index d059e47d55558..14ad67badcaaf 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2805,6 +2805,7 @@ $formquestion=array( //'text' => $langs->trans("ConfirmClone"), //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1) + array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company('','socid','(s.client=1 OR s.client=2 OR s.client=3)',1)) ); // Paiement incomplet. On demande si motif = escompte ou autre $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$object->ref),'confirm_clone',$formquestion,'yes',1); diff --git a/htdocs/fourn/class/fournisseur.class.php b/htdocs/fourn/class/fournisseur.class.php index 5440b11e874f1..58f6bae505214 100644 --- a/htdocs/fourn/class/fournisseur.class.php +++ b/htdocs/fourn/class/fournisseur.class.php @@ -180,15 +180,16 @@ function CreateCategory($user, $name) function ListArray() { global $conf; + global $user; $arr = array(); $sql = "SELECT s.rowid, s.nom"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - if (!$this->user->rights->societe->client->voir && !$this->user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.fournisseur = 1"; $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; - if (!$this->user->rights->societe->client->voir && !$this->user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$this->user->id; + if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $resql=$this->db->query($sql);