* Copyright (C) 2004-2005 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. * * $Id$ * $Source$ * */ /** \file htdocs/projet/commandes.php \ingroup projet commande \brief Page des commandes par projet \version $Revision$ */ require("./pre.inc.php"); require("../propal.class.php"); require("../facture.class.php"); require("../commande/commande.class.php"); $langs->load("projects"); $langs->load("companies"); $langs->load("orders"); llxHeader("","../"); $projet = new Project($db); $projet->fetch($_GET["id"]); $h=0; $head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id; $head[$h][1] = $langs->trans("Project"); $h++; if ($conf->propal->enabled) { $langs->load("propal"); $head[$h][0] = DOL_URL_ROOT.'/projet/propal.php?id='.$projet->id; $head[$h][1] = $langs->trans("Proposals"); $h++; } if ($conf->commande->enabled) { $langs->load("orders"); $head[$h][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id; $head[$h][1] = $langs->trans("Orders"); $hselected=$h; $h++; } if ($conf->facture->enabled) { $langs->load("bills"); $head[$h][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id; $head[$h][1] = $langs->trans("Bills"); $h++; } dolibarr_fiche_head($head, $hselected, $langs->trans("Project").": ".$projet->ref); $projet->societe->fetch($projet->societe->id); print ''; print ''; print ''; print ''; print '
'.$langs->trans("Company").''.$projet->societe->nom.'
'.$langs->trans("Ref").''.$projet->ref.'
'.$langs->trans("Label").''.$projet->title.'

'; /* * Commandes * */ $commandes = $projet->get_commande_list(); $total = 0 ; if (sizeof($commandes)>0 && is_array($commandes)) { print_titre('Listes des commandes associées au projet'); print ''; print ''; print ''; for ($i = 0; $ifetch($commandes[$i]); $var=!$var; print ""; print "\n"; print ''; print ''; $total = $total + $commande->total_ht; } print ''; print ''; print ''; print "
'.$langs->trans("Ref").'Date'.$langs->trans("Amount").' 
id\">$commande->ref'.strftime("%d %B %Y",$commande->date).''.price($commande->total_ht).' 
'.$i.' '.$langs->trans("Orders").''.$langs->trans("TotalHT").': '.price($total).''.$conf->monnaie.'
"; } $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); ?>