diff --git a/htdocs/fourn/commande/liste.php b/htdocs/fourn/commande/liste.php index a7dd5c9cda6..54148f2c1c3 100644 --- a/htdocs/fourn/commande/liste.php +++ b/htdocs/fourn/commande/liste.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -21,7 +21,7 @@ /** * \file htdocs/fourn/commande/liste.php * \ingroup fournisseur - * \brief Liste des commandes fournisseurs + * \brief List of suppliers orders * \version $Id$ */ @@ -47,15 +47,15 @@ $result = restrictedArea($user, 'commande_fournisseur', $orderid,''); /* -* View -*/ + * View + */ $title = $langs->trans("SuppliersOrders"); if ($socid > 0) { - $fourn = new Fournisseur($db); - $fourn->fetch($socid); - $title .= ' ('.$fourn->nom.')'; + $fourn = new Fournisseur($db); + $fourn->fetch($socid); + $title .= ' ('.$fourn->nom.')'; } llxHeader('',$title); @@ -97,7 +97,7 @@ if ($suser) } if ($sttc) { - $sql .= " AND total_ttc = ".price2num($sttc); + $sql .= " AND total_ttc = ".price2num($sttc); } if ($sall) { @@ -107,7 +107,7 @@ if ($socid) $sql.= " AND s.rowid = ".$socid; if (strlen($_GET["statut"])) { - $sql .= " AND fk_statut =".$_GET["statut"]; + $sql .= " AND fk_statut =".$_GET["statut"]; } $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); @@ -116,88 +116,88 @@ $resql = $db->query($sql); if ($resql) { - $num = $db->num_rows($resql); - $i = 0; + $num = $db->num_rows($resql); + $i = 0; - print_barre_liste($title, $page, "liste.php", "", $sortfield, $sortorder, '', $num); - print '
'; - print ''; - print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cf.ref","","",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Author"),$_SERVER["PHP_SELF"],"u.login","","",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"total_ttc","","",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("OrderDate"),$_SERVER["PHP_SELF"],"dc","","",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cf.fk_statut","","",'align="right"',$sortfield,$sortorder); - print "\n"; + print_barre_liste($title, $page, "liste.php", "", $sortfield, $sortorder, '', $num); + print ''; + print '
'; + print ''; + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cf.ref","","",'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","",'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Author"),$_SERVER["PHP_SELF"],"u.login","","",'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"total_ttc","","",'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("OrderDate"),$_SERVER["PHP_SELF"],"dc","","",'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cf.fk_statut","","",'align="right"',$sortfield,$sortorder); + print "\n"; - print ''; + print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; - $var=true; + $var=true; - $userstatic = new User($db); + $userstatic = new User($db); - while ($i < min($num,$conf->liste_limit)) - { - $obj = $db->fetch_object($resql); - $var=!$var; + while ($i < min($num,$conf->liste_limit)) + { + $obj = $db->fetch_object($resql); + $var=!$var; - print ""; + print ""; - // Ref - print ''."\n"; + // Ref + print ''."\n"; - // Company - print ''."\n"; + // Company + print ''."\n"; - // Author - $userstatic->id=$obj->fk_user_author; - $userstatic->login=$obj->login; - print ""; + // Author + $userstatic->id=$obj->fk_user_author; + $userstatic->login=$obj->login; + print ""; - // Amount - print '"; + // Amount + print '"; - // Date - print "'; + // Date + print "'; - // Statut - print ''; + // Statut + print ''; - print "\n"; - $i++; - } - print "
'; - print ''; - print '
'; + print ''; + print '
'.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.''.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.''.img_object($langs->trans("ShowCompany"),"company").' '; - print $obj->nom.''.img_object($langs->trans("ShowCompany"),"company").' '; + print $obj->nom.'"; - if ($userstatic->id) print $userstatic->getLoginUrl(1); - else print " "; - print ""; + if ($userstatic->id) print $userstatic->getLoginUrl(1); + else print " "; + print "'.price($obj->total_ttc)."'.price($obj->total_ttc).""; - if ($obj->dc) - { - print dol_print_date($obj->dc,"day"); - } - else - { - print "-"; - } - print '"; + if ($obj->dc) + { + print dol_print_date($obj->dc,"day"); + } + else + { + print "-"; + } + print ''.$commandestatic->LibStatut($obj->fk_statut, 5).''.$commandestatic->LibStatut($obj->fk_statut, 5).'
\n"; - print "
\n"; + print "\n"; + $i++; + } + print "\n"; + print "\n"; - $db->free($resql); + $db->free($resql); } else { - dol_print_error($db); + dol_print_error($db); } $db->close(); diff --git a/htdocs/fourn/fiche-stats.php b/htdocs/fourn/fiche-stats.php deleted file mode 100644 index 6e1bb3807ea..00000000000 --- a/htdocs/fourn/fiche-stats.php +++ /dev/null @@ -1,119 +0,0 @@ - - * Copyright (C) 2003 Eric Seigne - * Copyright (C) 2004-2008 Laurent Destailleur - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -/** - * \file htdocs/fourn/fiche-stats.php - * \ingroup fournisseur, facture - * \brief Page de fiche fournisseur - * \version $Id$ - */ - -require('./pre.inc.php'); -require_once(DOL_DOCUMENT_ROOT."/contact.class.php"); -require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); - -$langs->load('suppliers'); -$langs->load('products'); -$langs->load('bills'); -$langs->load('orders'); -$langs->load('companies'); -$langs->load('commercial'); - -// Security check -$socid = isset($_GET["socid"])?$_GET["socid"]:''; -if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'societe',$socid,''); - - -/* - * Actions - */ - - - -/* - * View - */ -$societe = new Fournisseur($db); - -if ( $societe->fetch($socid) ) -{ - llxHeader('',$langs->trans('SupplierCard')); - - /* - * Affichage onglets - */ - $head = societe_prepare_head($societe); - - dol_fiche_head($head, 'supplierstat', $langs->trans("ThirdParty"),0,'company'); - - - print ''; - print ''; - - print ''; - - print ''; - - print "
'.$langs->trans("Name").''.$societe->nom.'
'.$langs->trans('Prefix').''.$societe->prefix_comm.'
'; - print $langs->trans('SupplierCode').''; - print $societe->code_fournisseur; - if ($societe->check_codefournisseur() <> 0) print ' '.$langs->trans("WrongSupplierCode"); - print '

"; - - print ''; - print ''; - print '
'; - - $file = get_exdir($societe->id, 3) . "ca_genere-".$societe->id.".png"; - if (file_exists($conf->fournisseur->dir_temp.'/'.$file)) - { - $url=DOL_URL_ROOT.'/viewimage.php?modulepart=graph_fourn&file='.$file; - print 'CA genere'; - } - else - { - print $langs->trans("NoneOrBatchFileNeverRan",'batch_fournisseur_updateturnover.php, batch_fournisseur_buildgraph.php'); - } - - print ''; - - $file = get_exdir($societe->id, 3) . "ca_achat-".$societe->id.".png"; - if (file_exists($conf->fournisseur->dir_temp.'/'.$file)) - { - $url=DOL_URL_ROOT.'/viewimage.php?modulepart=graph_fourn&file='.$file; - print 'CA'; - } - else - { - print $langs->trans("NoneOrBatchFileNeverRan",'batch_fournisseur_updateturnover.php, batch_fournisseur_buildgraph.php'); - } - - print '
' . "\n"; - print ''; -} -else -{ - dol_print_error($db); -} -$db->close(); - -llxFooter('$Date$ - $Revision$'); -?> diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index a47d921987a..82e577c4022 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -265,9 +265,7 @@ if ( $societe->fetch($socid) ) /* - * * Barre d'actions - * */ print '
'; @@ -314,6 +312,40 @@ if ( $societe->fetch($socid) ) */ show_actions_done($conf,$langs,$db,$societe); } + + + // deprecated + /* + print ''; + print ''; + print '
'; + + $file = get_exdir($societe->id, 3) . "ca_genere-".$societe->id.".png"; + if (file_exists($conf->fournisseur->dir_temp.'/'.$file)) + { + $url=DOL_URL_ROOT.'/viewimage.php?modulepart=graph_fourn&file='.$file; + print 'CA genere'; + } + else + { + print $langs->trans("NoneOrBatchFileNeverRan",'batch_fournisseur_updateturnover.php, batch_fournisseur_buildgraph.php'); + } + + print ''; + + $file = get_exdir($societe->id, 3) . "ca_achat-".$societe->id.".png"; + if (file_exists($conf->fournisseur->dir_temp.'/'.$file)) + { + $url=DOL_URL_ROOT.'/viewimage.php?modulepart=graph_fourn&file='.$file; + print 'CA'; + } + else + { + print $langs->trans("NoneOrBatchFileNeverRan",'batch_fournisseur_updateturnover.php, batch_fournisseur_buildgraph.php'); + } + + print '
' . "\n"; + */ } else { diff --git a/htdocs/lib/company.lib.php b/htdocs/lib/company.lib.php index 34819cfaf83..769b83c20fc 100644 --- a/htdocs/lib/company.lib.php +++ b/htdocs/lib/company.lib.php @@ -111,14 +111,6 @@ function societe_prepare_head($objsoc) $h++; } - if ($objsoc->fournisseur) - { - $head[$h][0] = DOL_URL_ROOT.'/fourn/fiche-stats.php?socid='.$objsoc->id; - $head[$h][1] = $langs->trans("Statistics"); - $head[$h][2] = 'supplierstat'; - $h++; - } - if ($user->societe_id == 0) { $head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$objsoc->id;