diff --git a/htdocs/admin/system/update.php b/htdocs/admin/system/update.php index a759b02ed29..ba7071ecff3 100644 --- a/htdocs/admin/system/update.php +++ b/htdocs/admin/system/update.php @@ -22,6 +22,9 @@ require("./pre.inc.php"); $user->getrights('facture'); + +print "user " . $user->rights->facture->lire . " !"; + if (!$user->rights->facture->lire) accessforbidden(); diff --git a/htdocs/comm/addpropal.php b/htdocs/comm/addpropal.php index e57948556cd..5b346fb6f17 100644 --- a/htdocs/comm/addpropal.php +++ b/htdocs/comm/addpropal.php @@ -170,7 +170,7 @@ if ($action == 'create') */ $sql = "SELECT p.rowid,p.label,p.ref,p.price FROM llx_product as p "; $sql .= " WHERE envente = 1"; - $sql .= " ORDER BY p.nbvente DESC LIMIT 20"; + $sql .= " ORDER BY ref DESC"; if ( $db->query($sql) ) { $opt = ""; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 4b5b50e1f15..10c4cb489c8 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -431,8 +431,8 @@ if ($_GET["propalid"]) if ($obj->statut == 0 && $user->rights->propale->creer) { - $sql = "SELECT p.rowid,p.label,p.ref,p.price FROM llx_product as p WHERE p.envente=1 ORDER BY p.nbvente DESC LIMIT 20"; + // RyXéo on a ORDER BY p.ref et pas de limit if ( $db->query($sql) ) { $opt = ""; @@ -607,14 +607,15 @@ if ($_GET["propalid"]) { $subject = "Notre proposition commerciale $obj->ref"; - $message = "Veuillez trouver ci-joint notre proposition commerciale $obj->ref\n\nCordialement\n\n"; - $filepath = $file ; - $filename = "$obj->ref.pdf"; - $mimetype = "application/pdf"; - + $filepath[0] = $file ; + $filename[0] = "$obj->ref.pdf"; + $mimetype[0] = "application/pdf"; + $filepath[1] = $_FILES['addedfile']['tmp_name']; + $filename[1] = $_FILES['addedfile']['name']; + $mimetype[1] = $_FILES['addedfile']['type']; $replyto = "$replytoname <$replytomail>"; - $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filepath,$mimetype, $filename); + $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filepath,$mimetype, $filename,$sendtocc); if (! $mailfile->sendfile() ) { @@ -750,17 +751,24 @@ if ($_GET["propalid"]) $from_name = $user->fullname ; //$conf->propal->fromtoname; $from_mail = $user->email; //conf->propal->fromtomail; - print "