From 745036a5867affa0e67193dce4bffe229eff0b3f Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 4 Apr 2005 14:03:21 +0000 Subject: [PATCH] Nouveau fichier --- htdocs/fourn/commande/note.php | 169 +++++++++++++++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 htdocs/fourn/commande/note.php diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php new file mode 100644 index 00000000000..e86deb7a1cd --- /dev/null +++ b/htdocs/fourn/commande/note.php @@ -0,0 +1,169 @@ + + * 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/fourn/commande/fiche.php + \ingroup commande + \brief Fiche commande + \version $Revision$ + +*/ + +require("./pre.inc.php"); + +$langs->load("orders"); +$langs->load("suppliers"); +$langs->load("companies"); + +$user->getrights('fournisseur'); + +if (!$user->rights->fournisseur->commande->lire) accessforbidden(); + +require_once DOL_DOCUMENT_ROOT."/project.class.php"; +require_once DOL_DOCUMENT_ROOT."/propal.class.php"; +require_once DOL_DOCUMENT_ROOT."/fournisseur.class.php"; + +/* + * + */ + +if ($_POST["action"] == 'updatenote' && $user->rights->fournisseur->commande->creer) +{ + $commande = new CommandeFournisseur($db); + $commande->fetch($_GET["id"]); + + $result = $commande->UpdateNote($user, $_POST["note"]); + if ($result == 0) + { + Header("Location: note.php?id=".$_GET["id"]); + } +} + +llxHeader('',$langs->trans("OrderCard"),"Commande"); + +$html = new Form($db); + +/* *************************************************************************** */ +/* */ +/* Mode vue et edition */ +/* */ +/* *************************************************************************** */ + +if ($_GET["id"] > 0) +{ + $commande = new CommandeFournisseur($db); + if ( $commande->fetch($_GET["id"]) == 0) + { + $soc = new Societe($db); + $soc->fetch($commande->soc_id); + $author = new User($db); + $author->id = $commande->user_author_id; + $author->fetch(); + + $h = 0; + $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$commande->id; + $head[$h][1] = $langs->trans("Order").": $commande->ref"; + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/note.php?id='.$commande->id; + $head[$h][1] = $langs->trans("Note"); + $a = $h; + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/history.php?id='.$commande->id; + $head[$h][1] = $langs->trans("History"); + $h++; + + dolibarr_fiche_head($head, $a, $soc->nom); + + + /* + * Commande + */ + print '
'; + print ''; + + print ''; + print ""; + print ''; + + print '"; + + print ''; + print '"; + print ''; + print '"; + + // Ligne de 3 colonnes + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + print ''; + + + if ($user->rights->fournisseur->commande->creer) + { + print '"; + print ''; + } + else + { + print '"; + } + + print "
".$langs->trans("Supplier")."'; + print ''.$soc->nom.''; + print ' '; + print $commande->statuts[$commande->statut]; + print "
'.$langs->trans("Date").''; + + if ($commande->date_commande) + { + print strftime("%A %d %B %Y",$commande->date_commande)."\n"; + } + + print ' '; + if ($commande->methode_commande) + { + print "Méthode : " .$commande->methode_commande; + } + print "
'.$langs->trans("Author").''.$author->fullname.''; + print " 
'.$langs->trans("AmountHT").''.price($commande->total_ht).''.$conf->monnaie.' 
'.$langs->trans("VAT").''.price($commande->total_tva).''.$conf->monnaie.'
'.$langs->trans("TotalTTC").''.price($commande->total_ttc).''.$conf->monnaie.'
Note
Note'.nl2br($commande->note)."
"; + } + else + { + /* Commande non trouvée */ + print "Commande inexistante"; + } +} + + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?>