diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index edb212820dd..9cd64c7ca4c 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -19,11 +19,11 @@ */ /** - \file htdocs/expedition/index.php - \ingroup expedition - \brief Page accueil du module expedition - \version $Id$ -*/ + * \file htdocs/expedition/index.php + * \ingroup expedition + * \brief Page accueil du module expedition + * \version $Id$ + */ require("./pre.inc.php"); @@ -31,10 +31,11 @@ $langs->load("sendings"); /* -* View -*/ + * View + */ -llxHeader('',$langs->trans("Sendings"),'ch-expedition.html',$form_search); +$helpurl='EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones'; +llxHeader('',$langs->trans("Sendings"),$helpurl); print_fiche_titre($langs->trans("SendingsArea")); @@ -51,7 +52,7 @@ print $langs->trans("Ref").':
\n"; /* - * Expeditions à valider + * Shipments to validate */ $clause = " WHERE "; @@ -60,7 +61,7 @@ $sql.= ", s.nom, s.rowid as socid"; $sql.= ", c.ref as commande_ref, c.rowid as commande_id"; $sql.= " FROM ".MAIN_DB_PREFIX."expedition as e"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."co_exp as ce ON e.rowid = ce.fk_expedition"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON ce.fk_commande = c.rowid"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON ce.fk_commande = c.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc"; if (!$user->rights->societe->client->voir && !$socid) { @@ -76,30 +77,30 @@ if ($socid) $sql.= " AND c.fk_soc = ".$socid; $resql=$db->query($sql); if ($resql) { - $num = $db->num_rows($resql); - if ($num) - { - print ''; - print ''; - print ''; - $i = 0; - $var = True; - while ($i < $num) - { - $var=!$var; - $obj = $db->fetch_object($resql); - print ""; - print ''; - print ''; - $i++; - } - print "
'.$langs->trans("SendingsToValidate").'
rowid."\">".$obj->ref."'.$obj->nom.''.$obj->commande_ref.'

"; - } + $num = $db->num_rows($resql); + if ($num) + { + print ''; + print ''; + print ''; + $i = 0; + $var = True; + while ($i < $num) + { + $var=!$var; + $obj = $db->fetch_object($resql); + print ""; + print ''; + print ''; + $i++; + } + print "
'.$langs->trans("SendingsToValidate").'
rowid."\">".$obj->ref."'.$obj->nom.''.$obj->commande_ref.'

"; + } } /* - * Commandes à traiter + * Commandes a traiter */ $sql = "SELECT c.rowid, c.ref, s.nom, s.rowid as socid"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; @@ -112,20 +113,20 @@ if ($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.= " ORDER BY c.rowid ASC"; -if ( $db->query($sql) ) +if ( $db->query($sql) ) { - $num = $db->num_rows(); - if ($num) - { - $langs->load("orders"); - - $i = 0; - print ''; - print ''; - print ''; - $var = True; - while ($i < $num) + $num = $db->num_rows(); + if ($num) { + $langs->load("orders"); + + $i = 0; + print '
'.$langs->trans("OrdersToProcess").'
'; + print ''; + print ''; + $var = True; + while ($i < $num) + { $var=!$var; $obj = $db->fetch_object(); print ""; @@ -133,9 +134,9 @@ if ( $db->query($sql) ) print "rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.''; print ''; $i++; + } + print "
'.$langs->trans("OrdersToProcess").'
'.dol_trunc($obj->nom,20).'

"; } - print "
"; - } } @@ -159,34 +160,34 @@ if ($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 ) +if ( $resql ) { - $langs->load("orders"); - - $num = $db->num_rows($resql); - if ($num) - { - $i = 0; - print ''; - print ''; - print ''; - $var = True; - while ($i < $num) + $langs->load("orders"); + + $num = $db->num_rows($resql); + if ($num) { + $i = 0; + print '
'.$langs->trans("OrdersInProcess").'
'; + print ''; + print ''; + $var = True; + while ($i < $num) + { $var=!$var; $obj = $db->fetch_object($resql); print "'; print ''; $i++; + } + print "
'.$langs->trans("OrdersInProcess").'
rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '; print $obj->ref.''.$obj->nom.'

"; } - print "
"; - } } /* - * Expeditions à valider + * Last shipments */ $clause = " WHERE "; $sql = "SELECT e.rowid, e.ref"; @@ -194,7 +195,7 @@ $sql.= ", s.nom, s.rowid as socid"; $sql.= ", c.ref as commande_ref, c.rowid as commande_id"; $sql.= " FROM ".MAIN_DB_PREFIX."expedition as e"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."co_exp as ce ON e.rowid = ce.fk_expedition"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON ce.fk_commande = c.rowid"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON ce.fk_commande = c.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc"; if (!$user->rights->societe->client->voir && !$socid) { @@ -209,29 +210,35 @@ $sql.= " ORDER BY e.date_expedition DESC"; $sql.= $db->plimit(5, 0); $resql = $db->query($sql); -if ($resql) +if ($resql) { - $num = $db->num_rows($resql); - if ($num) - { - $i = 0; - print ''; - print ''; - print ''; - $var = True; - while ($i < $num) - { - $var=!$var; - $obj = $db->fetch_object($resql); - print "'; - print ''; - print ''; - $i++; - } - print "
'.$langs->trans("LastSendings",$num).'
rowid\">".img_object($langs->trans("ShowSending"),"sending").' '; - print $obj->ref.''.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.''.img_object($langs->trans("ShowOrder"),"order").' '.$obj->commande_ref.'

"; - } - $db->free($resql); + $num = $db->num_rows($resql); + if ($num) + { + $i = 0; + print ''; + print ''; + print ''; + $var = True; + while ($i < $num) + { + $var=!$var; + $obj = $db->fetch_object($resql); + print "'; + print ''; + print ''; + $i++; + } + print "
'.$langs->trans("LastSendings",$num).'
rowid\">".img_object($langs->trans("ShowSending"),"sending").' '; + print $obj->ref.''.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.''; + if ($obj->commande_id) + { + print ''; + print img_object($langs->trans("ShowOrder"),"order").' '.$obj->commande_ref.''; + } else print ' '; + print '

"; + } + $db->free($resql); } print ''; diff --git a/htdocs/expedition/liste.php b/htdocs/expedition/liste.php index def6bca5b0a..04b9bd901eb 100644 --- a/htdocs/expedition/liste.php +++ b/htdocs/expedition/liste.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -19,11 +19,11 @@ */ /** - \file htdocs/expedition/liste.php - \ingroup expedition - \brief Page de la liste des expéditions/livraisons - \version $Id$ -*/ + * \file htdocs/expedition/liste.php + * \ingroup expedition + * \brief Page de la liste des exp�ditions/livraisons + * \version $Id$ + */ require("./pre.inc.php"); @@ -44,15 +44,12 @@ $limit = $conf->liste_limit; $offset = $limit * $_GET["page"] ; +/* + * View + */ -/******************************************************************************/ -/* */ -/* Fin des Actions */ -/* */ -/******************************************************************************/ - - -llxHeader('',$langs->trans('ListOfSendings')); +$helpurl='EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones'; +llxHeader('',$langs->trans('ListOfSendings'),$helpurl); $sql = "SELECT e.rowid, e.ref,".$db->pdate("e.date_expedition")." as date_expedition, e.fk_statut"; $sql.= ", s.nom as socname, s.rowid as socid"; @@ -61,7 +58,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."expedition as e"; if ($conf->commande->enabled) { $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."co_exp as ce ON e.rowid = ce.fk_expedition"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande as ori ON ce.fk_commande = ori.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande as ori ON ce.fk_commande = ori.rowid"; } else { @@ -76,8 +73,8 @@ if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND sc.fk_user = " .$user->id; } if ($socid) -{ - $sql.= " AND e.fk_soc = ".$socid; +{ + $sql.= " AND e.fk_soc = ".$socid; } if ($_POST["sf_ref"]) { @@ -91,14 +88,14 @@ $resql=$db->query($sql); if ($resql) { $num = $db->num_rows($resql); - + $expedition = new Expedition($db); - + print_barre_liste($langs->trans('ListOfSendings'), $_GET["page"], "liste.php","&socid=$socid",$sortfield,$sortorder,'',$num); - + $i = 0; print ''; - + print ''; print_liste_field_titre($langs->trans("Ref"),"liste.php","e.ref","","&socid=$socid",'width="15%"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"),"liste.php","s.nom", "", "&socid=$socid",'width="25%" align="left"',$sortfield,$sortorder); @@ -114,11 +111,11 @@ if ($resql) print_liste_field_titre($langs->trans("Status"),"liste.php","e.fk_statut","","&socid=$socid",'width="10%" align="right"',$sortfield,$sortorder); print "\n"; $var=True; - + while ($i < min($num,$limit)) { $objp = $db->fetch_object($resql); - + $var=!$var; print ""; print ""; @@ -144,7 +141,7 @@ if ($resql) { print ""; } - + print "\n"; - + print $y."\n"; + print ''; print "\n"; - + $i++; } - + print "
rowid."\">".img_object($langs->trans("ShowSending"),"sending").' '; @@ -135,7 +132,7 @@ if ($resql) $now = time(); $lim = 3600 * 24 * 15 ; - + if ( ($now - $objp->date_expedition) > $lim && $objp->statutid == 1 ) { print " > 15 jours "; $y = dol_print_date($objp->date_expedition,"%Y"); $m = dol_print_date($objp->date_expedition,"%m"); @@ -154,14 +151,14 @@ if ($resql) print " "; print $b."\n"; print " "; - print $y."'.$expedition->LibStatut($objp->fk_statut,5).'
"; $db->free($resql); }