From b93f1b8d837692fd596fb39b5d8269e4aeb9a33e Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 9 Feb 2004 16:58:42 +0000 Subject: [PATCH] Nouveaux fichiers --- htdocs/projet/commandes.php | 98 ++++++++++++++++++++++++++++++++++++ htdocs/projet/facture.php | 99 +++++++++++++++++++++++++++++++++++++ htdocs/projet/propal.php | 96 +++++++++++++++++++++++++++++++++++ 3 files changed, 293 insertions(+) create mode 100644 htdocs/projet/commandes.php create mode 100644 htdocs/projet/facture.php create mode 100644 htdocs/projet/propal.php diff --git a/htdocs/projet/commandes.php b/htdocs/projet/commandes.php new file mode 100644 index 00000000000..39143818853 --- /dev/null +++ b/htdocs/projet/commandes.php @@ -0,0 +1,98 @@ + + * + * 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$ + * + */ +require("./pre.inc.php"); +require("./project.class.php"); +require("../propal.class.php"); +require("../facture.class.php"); +require("../commande/commande.class.php"); + + +llxHeader("","../"); + +$projet = new Project($db); +$projet->fetch($id); + +$h=0; +$head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id; +$head[$h][1] = 'Fiche projet'; + +$head[$h+1][0] = DOL_URL_ROOT.'/projet/propal.php?id='.$projet->id; +$head[$h+1][1] = 'Prop. Commerciales'; + +$head[$h+2][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id; +$head[$h+2][1] = 'Commandes'; + +$head[$h+3][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id; +$head[$h+3][1] = 'Factures'; + +dolibarr_fiche_head($head, 2); +/* + * + * + * + */ +$projet->societe->fetch($projet->societe->id); + +print ''; +print ''; +print ''; +print ''; +print '
Titre'.$projet->title.'Réf'.$projet->ref.'
Société'.$projet->societe->nom.'

'; + +/* + * 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 "
RéfDateMontant 
id\">$commande->ref'.strftime("%d %B %Y",$commande->date).''.price($commande->total_ht).' 
'.$i.' commandes Total : '.price($total).''.MAIN_MONNAIE.' HT
"; +} + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/projet/facture.php b/htdocs/projet/facture.php new file mode 100644 index 00000000000..c9b003d51b7 --- /dev/null +++ b/htdocs/projet/facture.php @@ -0,0 +1,99 @@ + + * + * 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$ + * + */ +require("./pre.inc.php"); +require("./project.class.php"); +require("../propal.class.php"); +require("../facture.class.php"); +require("../commande/commande.class.php"); + + +llxHeader("","../"); + +$projet = new Project($db); +$projet->fetch($id); + +$h=0; +$head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id; +$head[$h][1] = 'Fiche projet'; + +$head[$h+1][0] = DOL_URL_ROOT.'/projet/propal.php?id='.$projet->id; +$head[$h+1][1] = 'Prop. Commerciales'; + +$head[$h+2][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id; +$head[$h+2][1] = 'Commandes'; + +$head[$h+3][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id; +$head[$h+3][1] = 'Factures'; + +dolibarr_fiche_head($head, 3); +/* + * + * + * + */ +$projet->societe->fetch($projet->societe->id); + +print ''; +print ''; +print ''; +print ''; +print '
Titre'.$projet->title.'Réf'.$projet->ref.'
Société'.$projet->societe->nom.'

'; + + + /* + * Factures + * + */ + $factures = $projet->get_facture_list(); + $total = 0; + if (sizeof($factures)>0 && is_array($factures)) + { + print_titre('Listes des factures associées au projet'); + print ''; + + print ''; + print ''; + + for ($i = 0; $ifetch($factures[$i]); + + $var=!$var; + print ""; + print "\n"; + print ''; + print ''; + + $total = $total + $facture->total_ht; + } + + print ''; + print ''; + print ''; + print "
RéfDateMontant 
id\">$facture->ref'.strftime("%d %B %Y",$facture->date).''.price($facture->total_ht).' 
'.$i.' factures Total : '.price($total).''.MAIN_MONNAIE.' HT
"; + } + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/projet/propal.php b/htdocs/projet/propal.php new file mode 100644 index 00000000000..71546a3ed56 --- /dev/null +++ b/htdocs/projet/propal.php @@ -0,0 +1,96 @@ + + * + * 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$ + * + */ +require("./pre.inc.php"); +require("./project.class.php"); +require("../propal.class.php"); +require("../facture.class.php"); +require("../commande/commande.class.php"); + + +llxHeader("","../"); + +$projet = new Project($db); +$projet->fetch($id); + +$h=0; +$head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id; +$head[$h][1] = 'Fiche projet'; + +$head[$h+1][0] = DOL_URL_ROOT.'/projet/propal.php?id='.$projet->id; +$head[$h+1][1] = 'Prop. Commerciales'; + +$head[$h+2][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id; +$head[$h+2][1] = 'Commandes'; + +$head[$h+3][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id; +$head[$h+3][1] = 'Factures'; + +dolibarr_fiche_head($head, 1); +/* + * + * + * + */ +$propales = array(); + +$projet->societe->fetch($projet->societe->id); + +print ''; +print ''; +print ''; +print ''; +print '
Titre'.$projet->title.'Réf'.$projet->ref.'
Société'.$projet->societe->nom.'

'; + +$propales = $projet->get_propal_list(); + +if (sizeof($propales)>0 && is_array($propales)) +{ + print_titre('Listes des propositions commerciales associées au projet'); + print ''; + + print ''; + print ''; + + for ($i = 0; $ifetch($propales[$i]); + + $var=!$var; + print ""; + print "\n"; + + print ''; + + print ''; + $total = $total + $propale->price; + } + + print ''; + print ''; + print '
RéfDateMontant 
id\">$propale->ref'.strftime("%d %B %Y",$propale->datep).''.price($propale->price).' 
'.$i.' propales Total : '.price($total).''.MAIN_MONNAIE.' HT
'; +} + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?>