2004-10-20 22:06:49 +02:00
|
|
|
|
<?php
|
2004-02-09 17:58:42 +01:00
|
|
|
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
2005-01-14 21:30:49 +01:00
|
|
|
|
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
2004-02-09 17:58:42 +01:00
|
|
|
|
*
|
|
|
|
|
|
* 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$
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
2004-08-14 15:16:01 +02:00
|
|
|
|
|
2005-01-14 21:30:49 +01:00
|
|
|
|
/** \file htdocs/projet/commandes.php
|
2004-08-14 15:16:01 +02:00
|
|
|
|
\ingroup projet commande
|
|
|
|
|
|
\brief Page des commandes par projet
|
|
|
|
|
|
\version $Revision$
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
2004-02-09 17:58:42 +01:00
|
|
|
|
require("./pre.inc.php");
|
|
|
|
|
|
require("../propal.class.php");
|
|
|
|
|
|
require("../facture.class.php");
|
|
|
|
|
|
require("../commande/commande.class.php");
|
|
|
|
|
|
|
2004-11-12 02:17:41 +01:00
|
|
|
|
$langs->load("projects");
|
|
|
|
|
|
$langs->load("companies");
|
2005-01-14 21:30:49 +01:00
|
|
|
|
$langs->load("orders");
|
|
|
|
|
|
|
2004-11-12 02:17:41 +01:00
|
|
|
|
|
2004-02-09 17:58:42 +01:00
|
|
|
|
llxHeader("","../");
|
|
|
|
|
|
|
|
|
|
|
|
$projet = new Project($db);
|
2004-07-13 17:19:11 +02:00
|
|
|
|
$projet->fetch($_GET["id"]);
|
2004-02-09 17:58:42 +01:00
|
|
|
|
|
2004-11-12 02:17:41 +01:00
|
|
|
|
$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");
|
2004-08-07 03:25:00 +02:00
|
|
|
|
$h++;
|
2004-11-12 02:17:41 +01:00
|
|
|
|
}
|
2004-02-09 17:58:42 +01:00
|
|
|
|
|
2004-11-12 02:17:41 +01:00
|
|
|
|
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++;
|
|
|
|
|
|
}
|
2004-08-07 03:25:00 +02:00
|
|
|
|
|
2005-01-14 21:30:49 +01:00
|
|
|
|
dolibarr_fiche_head($head, $hselected, $langs->trans("Project").": ".$projet->ref);
|
|
|
|
|
|
|
2004-11-12 02:17:41 +01:00
|
|
|
|
|
2004-02-09 17:58:42 +01:00
|
|
|
|
$projet->societe->fetch($projet->societe->id);
|
|
|
|
|
|
|
2004-11-12 02:17:41 +01:00
|
|
|
|
print '<table class="border" width="100%">';
|
2005-01-14 21:30:49 +01:00
|
|
|
|
print '<tr><td>'.$langs->trans("Company").'</td><td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$projet->societe->id.'">'.$projet->societe->nom.'</a></td></tr>';
|
|
|
|
|
|
print '<tr><td>'.$langs->trans("Ref").'</td><td>'.$projet->ref.'</td></tr>';
|
|
|
|
|
|
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$projet->title.'</td></tr>';
|
2004-02-09 17:58:42 +01:00
|
|
|
|
print '</table><br>';
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* Commandes
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
$commandes = $projet->get_commande_list();
|
|
|
|
|
|
$total = 0 ;
|
|
|
|
|
|
if (sizeof($commandes)>0 && is_array($commandes))
|
|
|
|
|
|
{
|
|
|
|
|
|
print_titre('Listes des commandes associ<63>es au projet');
|
2005-01-14 21:30:49 +01:00
|
|
|
|
print '<table class="noborder" width="100%">';
|
2004-02-09 17:58:42 +01:00
|
|
|
|
|
2004-11-12 02:17:41 +01:00
|
|
|
|
print '<tr class="liste_titre">';
|
|
|
|
|
|
print '<td width="15%">'.$langs->trans("Ref").'</td><td width="25%">Date</td><td align="right">'.$langs->trans("Amount").'</td><td> </td></tr>';
|
2004-02-09 17:58:42 +01:00
|
|
|
|
|
|
|
|
|
|
for ($i = 0; $i<sizeof($commandes);$i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
$commande = new Commande($db);
|
|
|
|
|
|
$commande->fetch($commandes[$i]);
|
|
|
|
|
|
|
|
|
|
|
|
$var=!$var;
|
2004-11-12 02:17:41 +01:00
|
|
|
|
print "<tr $bc[$var]>";
|
|
|
|
|
|
print "<td><a href=\"../commande/fiche.php?id=$commande->id\">$commande->ref</a></td>\n";
|
2004-02-09 17:58:42 +01:00
|
|
|
|
print '<td>'.strftime("%d %B %Y",$commande->date).'</td>';
|
2004-11-12 02:17:41 +01:00
|
|
|
|
print '<td align="right">'.price($commande->total_ht).'</td><td> </td></tr>';
|
2004-02-09 17:58:42 +01:00
|
|
|
|
|
|
|
|
|
|
$total = $total + $commande->total_ht;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2005-01-14 21:30:49 +01:00
|
|
|
|
print '<tr><td colspan="2">'.$i.' '.$langs->trans("Orders").'</td>';
|
2004-07-31 15:34:32 +02:00
|
|
|
|
print '<td align="right">'.$langs->trans("TotalHT").': '.price($total).'</td>';
|
2005-01-14 21:30:49 +01:00
|
|
|
|
print '<td align="left">'.$conf->monnaie.'</td></tr>';
|
2004-02-09 17:58:42 +01:00
|
|
|
|
print "</table>";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$db->close();
|
|
|
|
|
|
|
|
|
|
|
|
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
|
|
|
|
|
?>
|