diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index a797bc19fdc..fe702b5838b 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -19,9 +19,9 @@ */ /** - * \file htdocs/fourn/commande/index.php - * \ingroup commande fournisseur - * \brief Home page of supplier's orders area + * \file htdocs/fourn/commande/index.php + * \ingroup commande fournisseur + * \brief Home page of supplier's orders area */ require '../../main.inc.php'; @@ -50,8 +50,7 @@ $formfile = new FormFile($db); print load_fiche_titre($langs->trans("SuppliersOrdersArea")); -print '
| ';
+print ' ';
/*
@@ -84,72 +83,72 @@ $sql.= " GROUP BY cf.fk_statut";
$resql = $db->query($sql);
if ($resql)
{
- $num = $db->num_rows($resql);
- $i = 0;
+ $num = $db->num_rows($resql);
+ $i = 0;
- $var=True;
+ $var=True;
- $total=0;
- $totalinprocess=0;
- $dataseries=array();
- $vals=array();
- // 0=Draft -> 1=Validated -> 2=Approved -> 3=Process runing -> 4=Received partially -> 5=Received totally -> (reopen) 4=Received partially
- // -> 7=Canceled/Never received -> (reopen) 3=Process runing
- // -> 6=Canceled -> (reopen) 2=Approved
- while ($i < $num)
- {
- $row = $db->fetch_row($resql);
- if ($row)
- {
- if ($row[1]!=7 && $row[1]!=6 && $row[1]!=5)
- {
- $vals[$row[1]]=$row[0];
- $totalinprocess+=$row[0];
- }
- $total+=$row[0];
- }
- $i++;
- }
- $db->free($resql);
+ $total=0;
+ $totalinprocess=0;
+ $dataseries=array();
+ $vals=array();
+ // 0=Draft -> 1=Validated -> 2=Approved -> 3=Process runing -> 4=Received partially -> 5=Received totally -> (reopen) 4=Received partially
+ // -> 7=Canceled/Never received -> (reopen) 3=Process runing
+ // -> 6=Canceled -> (reopen) 2=Approved
+ while ($i < $num)
+ {
+ $row = $db->fetch_row($resql);
+ if ($row)
+ {
+ if ($row[1]!=7 && $row[1]!=6 && $row[1]!=5)
+ {
+ $vals[$row[1]]=$row[0];
+ $totalinprocess+=$row[0];
+ }
+ $total+=$row[0];
+ }
+ $i++;
+ }
+ $db->free($resql);
- print '
"; + print " "; } else { - dol_print_error($db); + dol_print_error($db); } /* * Legends / Status * - * Motivo: Mostrar todos os Status e dar a possibilidade de filtrar apenas um deles - * Reason: Show all Status and give the possibility to filter only one + * Motivo: Mostrar todos os Status e dar a possibilidade de filtrar apenas um deles + * Reason: Show all Status and give the possibility to filter only one */ $sql = "SELECT count(cf.rowid), fk_statut"; @@ -165,34 +164,34 @@ $sql.= " GROUP BY cf.fk_statut"; $resql = $db->query($sql); if ($resql) { - $num = $db->num_rows($resql); - $i = 0; + $num = $db->num_rows($resql); + $i = 0; - print '
"; - $db->free($resql); + print "\n"; + $i++; + } + print " "; + $db->free($resql); } else { - dol_print_error($db); + dol_print_error($db); } @@ -202,41 +201,41 @@ else if (! empty($conf->fournisseur->enabled)) { - $sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid"; - $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; - $sql.= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE c.fk_soc = s.rowid"; - $sql.= " AND c.entity = ".$conf->entity; - $sql.= " AND c.fk_statut = 0"; - if (! empty($socid)) $sql.= " AND c.fk_soc = ".$socid; - if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + $sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid"; + $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; + $sql.= ", ".MAIN_DB_PREFIX."societe as s"; + if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE c.fk_soc = s.rowid"; + $sql.= " AND c.entity = ".$conf->entity; + $sql.= " AND c.fk_statut = 0"; + if (! empty($socid)) $sql.= " AND c.fk_soc = ".$socid; + if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - $resql=$db->query($sql); - if ($resql) - { - print '
"; - } + $resql=$db->query($sql); + if ($resql) + { + print '
"; + } } @@ -258,40 +257,40 @@ $sql.= " AND subperms = 'approuver'"; $resql = $db->query($sql); if ($resql) { - $num = $db->num_rows($resql); - $i = 0; + $num = $db->num_rows($resql); + $i = 0; - print '
"; - $db->free($resql); + print " ';
+ $userstatic->id=$obj->rowid;
+ $userstatic->lastname=$obj->lastname;
+ $userstatic->firstname=$obj->firstname;
+ $userstatic->email=$obj->email;
+ print $userstatic->getNomUrl(1);
+ print ' | ';
+ print ""; + $db->free($resql); } else { - dol_print_error($db); + dol_print_error($db); } -print ' | ';
+print ' ';
/*
@@ -314,52 +313,52 @@ $sql.= $db->plimit($max, 0);
$resql=$db->query($sql);
if ($resql)
{
- print '
"; + print ' '.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.' | ';
+ print ''.dol_print_date($db->jdate($obj->tms),'day').' | ';
+ print ''.$commandestatic->LibStatut($obj->fk_statut,5).' | ';
+ print '';
+ $i++;
+ }
+ }
+ print ""; } else dol_print_error($db); @@ -433,7 +432,7 @@ print " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||