diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index d9fd2154bed..243898641a1 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -23,6 +23,11 @@ require("./pre.inc.php"); $user->getrights('propale'); +if ($user->societe_id > 0) +{ + $socidp = $user->societe_id; +} + llxHeader(); function valeur($sql) @@ -105,6 +110,10 @@ if ( $db->query($sql) ) $sql = "SELECT p.rowid, p.ref"; $sql .= " FROM llx_propal as p"; $sql .= " WHERE p.fk_statut = 1"; +if ($socidp) +{ + $sql .= " AND p.fk_soc = $socidp"; +} if ( $db->query($sql) ) { @@ -205,8 +214,7 @@ else */ $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid"; -$sql .= " FROM llx_societe as s, llx_propal as p, c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND p.fk_statut > 0"; - +$sql .= " FROM llx_societe as s, llx_propal as p, c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND p.fk_statut > 1"; if ($socidp) { $sql .= " AND s.idp = $socidp"; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 0f25f7dee9d..b9938489b42 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -682,7 +682,7 @@ else print "
"; - if ($fac->brouillon == 1) + if ($fac->brouillon == 1 && $user->rights->facture->creer) { print '
'; print ''; @@ -743,7 +743,7 @@ else print ' '; } print ''.price($objp->subprice)."\n"; - if ($fac->statut == 0) + if ($fac->statut == 0 && $user->rights->facture->creer) { print 'del'; print 'edit'; @@ -785,7 +785,7 @@ else * Ajouter une ligne * */ - if ($fac->statut == 0) + if ($fac->statut == 0 && $user->rights->facture->creer) { print ""; // echo ''; diff --git a/htdocs/includes/boxes/box_clients.php b/htdocs/includes/boxes/box_clients.php index b8550631e38..888b7d4ec16 100644 --- a/htdocs/includes/boxes/box_clients.php +++ b/htdocs/includes/boxes/box_clients.php @@ -27,6 +27,10 @@ $info_box_contents = array(); $sql = "SELECT s.nom,s.idp"; $sql .= " FROM llx_societe as s WHERE s.client = 1"; +if ($user->societe_id > 0) +{ + $sql .= " AND s.idp = $user->societe_id"; +} $sql .= " ORDER BY s.datec DESC "; $sql .= $db->plimit(5, 0);