diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index 99b3531c757..c0e07cbb44b 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -20,11 +20,6 @@ * */ -/** -* Gestion d'une proposition commerciale -* @package propale -*/ - require("./pre.inc.php"); $user->getrights('commande'); @@ -40,22 +35,8 @@ if ($user->societe_id > 0) $socidp = $user->societe_id; } - - llxHeader(); -/******************************************************************************/ -/* Fin des Actions */ -/******************************************************************************/ - -/**************************************************************************** - * * - * * - * Mode Liste des propales * - * * - * * - ****************************************************************************/ - if ($sortfield == "") { $sortfield="c.rowid"; @@ -72,7 +53,7 @@ $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; -$sql = "SELECT s.nom, s.idp, c.rowid, c.ref, c.total_ht,".$db->pdate("c.date_commande")." as date_commande" ; +$sql = "SELECT s.nom, s.idp, c.rowid, c.ref, c.total_ht,".$db->pdate("c.date_commande")." as date_commande, c.fk_statut" ; $sql .= " FROM llx_societe as s, llx_commande as c WHERE c.fk_soc = s.idp"; if ($socidp) @@ -80,6 +61,14 @@ if ($socidp) $sql .= " AND s.idp = $socidp"; } +if ($_GET["month"] > 0) +{ + $sql .= " AND date_format(c.date_commande, '%Y-%m') = '$year-$month'"; +} +if ($_GET["year"] > 0) +{ + $sql .= " AND date_format(c.date_commande, '%Y') = $year"; +} if (strlen($HTTP_POST_VARS["sf_ref"]) > 0) { @@ -93,32 +82,32 @@ if ( $db->query($sql) ) { $num = $db->num_rows(); print_barre_liste("Commandes", $page, $PHP_SELF,"&socidp=$socidp",$sortfield,$sortorder,'',$num); - - + $i = 0; print '
| rowid\">$objp->ref | \n"; - print "idp\">$objp->nom | \n"; + print "|||||
| rowid\">$objp->ref | \n"; + print "idp\">$objp->nom | \n"; $now = time(); $lim = 3600 * 24 * 15 ; @@ -132,19 +121,18 @@ if ( $db->query($sql) ) print ""; } - print " | "; + print " | "; $y = strftime("%Y",$objp->date_commande); $m = strftime("%m",$objp->date_commande); print strftime("%d",$objp->date_commande)."\n"; - print " "; + print " "; print strftime("%B",$objp->date_commande)."\n"; - print " "; + print " "; print strftime("%Y",$objp->date_commande)." | \n"; - - print "".price($objp->total_ht)." | \n"; - print "$objp->statut | \n"; - print "'.$generic_commande->statuts[$objp->fk_statut].' | '; + print "\n"; $total = $total + $objp->price; $subtotal = $subtotal + $objp->price;