2005-04-04 16:03:21 +02:00
|
|
|
|
<?php
|
|
|
|
|
|
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
2006-05-06 17:30:34 +02:00
|
|
|
|
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
2005-04-04 16:03:21 +02: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$
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2005-07-10 22:08:27 +02:00
|
|
|
|
\file htdocs/fourn/commande/note.php
|
|
|
|
|
|
\ingroup commande
|
|
|
|
|
|
\brief Fiche commande
|
|
|
|
|
|
\version $Revision$
|
2005-04-04 16:03:21 +02:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
require("./pre.inc.php");
|
|
|
|
|
|
|
|
|
|
|
|
$langs->load("orders");
|
|
|
|
|
|
$langs->load("suppliers");
|
|
|
|
|
|
$langs->load("companies");
|
|
|
|
|
|
|
|
|
|
|
|
$user->getrights('fournisseur');
|
|
|
|
|
|
|
|
|
|
|
|
if (!$user->rights->fournisseur->commande->lire) accessforbidden();
|
|
|
|
|
|
|
2006-03-18 19:03:01 +01:00
|
|
|
|
|
2005-04-04 16:03:21 +02:00
|
|
|
|
/*
|
2006-03-18 19:03:01 +01:00
|
|
|
|
* Actions
|
2005-04-04 16:03:21 +02:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
if ($_POST["action"] == 'updatenote' && $user->rights->fournisseur->commande->creer)
|
|
|
|
|
|
{
|
2006-03-18 19:03:01 +01:00
|
|
|
|
$commande = new CommandeFournisseur($db);
|
|
|
|
|
|
$commande->fetch($_GET["id"]);
|
|
|
|
|
|
|
|
|
|
|
|
$result = $commande->UpdateNote($user, $_POST["note"], $_POST["note_public"]);
|
|
|
|
|
|
if ($result >= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
Header("Location: note.php?id=".$_GET["id"]);
|
|
|
|
|
|
exit;
|
|
|
|
|
|
}
|
2005-04-04 16:03:21 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2006-03-18 19:03:01 +01:00
|
|
|
|
|
|
|
|
|
|
|
2005-04-11 17:31:26 +02:00
|
|
|
|
llxHeader('',$langs->trans("OrderCard"),"CommandeFournisseur");
|
2005-04-04 16:03:21 +02:00
|
|
|
|
|
|
|
|
|
|
$html = new Form($db);
|
|
|
|
|
|
|
|
|
|
|
|
/* *************************************************************************** */
|
|
|
|
|
|
/* */
|
|
|
|
|
|
/* Mode vue et edition */
|
|
|
|
|
|
/* */
|
|
|
|
|
|
/* *************************************************************************** */
|
|
|
|
|
|
|
|
|
|
|
|
if ($_GET["id"] > 0)
|
|
|
|
|
|
{
|
2006-05-06 17:30:34 +02:00
|
|
|
|
$commande = new CommandeFournisseur($db);
|
|
|
|
|
|
if ( $commande->fetch($_GET["id"]) == 0)
|
2005-04-04 16:03:21 +02:00
|
|
|
|
{
|
2006-05-06 17:30:34 +02:00
|
|
|
|
$soc = new Societe($db);
|
2006-06-19 22:35:22 +02:00
|
|
|
|
$soc->fetch($commande->socidp);
|
2006-05-06 17:30:34 +02:00
|
|
|
|
$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("OrderCard");
|
|
|
|
|
|
$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("OrderFollow");
|
|
|
|
|
|
$h++;
|
|
|
|
|
|
|
|
|
|
|
|
$title=$langs->trans("SupplierOrder");
|
|
|
|
|
|
dolibarr_fiche_head($head, $a, $title);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* Commande
|
|
|
|
|
|
*/
|
|
|
|
|
|
print '<form action="note.php?id='.$commande->id.'" method="post">';
|
|
|
|
|
|
print '<input type="hidden" name="action" value="updatenote">';
|
|
|
|
|
|
|
|
|
|
|
|
print '<table class="border" width="100%">';
|
|
|
|
|
|
|
|
|
|
|
|
// Ref
|
|
|
|
|
|
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
|
|
|
|
|
|
print '<td colspan="3">'.$commande->ref.'</td>';
|
|
|
|
|
|
print '</tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Fournisseur
|
|
|
|
|
|
print '<tr><td width="20%">'.$langs->trans("Supplier").'</td>';
|
|
|
|
|
|
print '<td colspan="3">';
|
|
|
|
|
|
print '<a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$soc->id.'">'.img_object($langs->trans("ShowSupplier"),'company').' '.$soc->nom.'</a></td>';
|
|
|
|
|
|
print '</tr>';
|
|
|
|
|
|
|
|
|
|
|
|
print '<tr>';
|
|
|
|
|
|
print '<td>'.$langs->trans("Status").'</td>';
|
|
|
|
|
|
print '<td colspan="3">';
|
|
|
|
|
|
print $commande->getLibStatut(4);
|
|
|
|
|
|
print "</td></tr>";
|
|
|
|
|
|
|
|
|
|
|
|
if ($commande->methode_commande_id > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
print '<tr><td>'.$langs->trans("Date").'</td>';
|
|
|
|
|
|
print '<td colspan="2">';
|
|
|
|
|
|
|
|
|
|
|
|
if ($commande->date_commande)
|
|
|
|
|
|
{
|
|
|
|
|
|
print strftime("%A %d %B %Y",$commande->date_commande)."\n";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
print ' </td><td width="50%">';
|
|
|
|
|
|
if ($commande->methode_commande)
|
|
|
|
|
|
{
|
|
|
|
|
|
print "M<EFBFBD>thode : " .$commande->methode_commande;
|
|
|
|
|
|
}
|
|
|
|
|
|
print "</td></tr>";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2006-03-18 19:03:01 +01:00
|
|
|
|
// Auteur
|
2006-05-06 17:30:34 +02:00
|
|
|
|
print '<tr><td>'.$langs->trans("Author").'</td><td colspan="2">'.$author->fullname.'</td>';
|
2006-03-18 19:03:01 +01:00
|
|
|
|
print '<td width="50%">';
|
|
|
|
|
|
print " </td></tr>";
|
2006-05-06 17:30:34 +02:00
|
|
|
|
|
2006-03-18 19:03:01 +01:00
|
|
|
|
// Ligne de 3 colonnes
|
|
|
|
|
|
print '<tr><td>'.$langs->trans("AmountHT").'</td>';
|
|
|
|
|
|
print '<td align="right"><b>'.price($commande->total_ht).'</b></td>';
|
|
|
|
|
|
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td>';
|
|
|
|
|
|
print '<td valign="top"> </td></tr>';
|
2006-05-06 17:30:34 +02:00
|
|
|
|
|
2006-03-18 19:03:01 +01:00
|
|
|
|
print '<tr><td>'.$langs->trans("AmountVAT").'</td><td align="right">'.price($commande->total_tva).'</td>';
|
|
|
|
|
|
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td><td> </td></tr>';
|
|
|
|
|
|
print '<tr><td>'.$langs->trans("AmountTTC").'</td><td align="right">'.price($commande->total_ttc).'</td>';
|
|
|
|
|
|
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td><td> </td></tr>';
|
2006-05-06 17:30:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
2006-03-18 19:03:01 +01:00
|
|
|
|
print '<tr><td valign="top">'.$langs->trans("NotePrivate").'</td>';
|
|
|
|
|
|
print '<td colspan="3">';
|
|
|
|
|
|
if ($user->rights->fournisseur->commande->creer) print '<textarea cols="60" rows="'.ROWS_4.'" name="note">';
|
|
|
|
|
|
print nl2br($commande->note);
|
|
|
|
|
|
if ($user->rights->fournisseur->commande->creer) print '</textarea>';
|
|
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
print '<tr><td valign="top">'.$langs->trans("NotePublic").'</td>';
|
|
|
|
|
|
print '<td colspan="3">';
|
|
|
|
|
|
if ($user->rights->fournisseur->commande->creer) print '<textarea cols="60" rows="'.ROWS_4.'" name="note_public">';
|
|
|
|
|
|
print nl2br($commande->note_public);
|
|
|
|
|
|
if ($user->rights->fournisseur->commande->creer) print '</textarea>';
|
|
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
if ($user->rights->fournisseur->commande->creer)
|
|
|
|
|
|
{
|
2006-05-06 17:30:34 +02:00
|
|
|
|
print '<tr><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>';
|
2006-03-18 19:03:01 +01:00
|
|
|
|
}
|
2006-05-06 17:30:34 +02:00
|
|
|
|
|
2006-03-18 19:03:01 +01:00
|
|
|
|
print "</table></form>";
|
2006-05-06 17:30:34 +02:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
/* Commande non trouv<75>e */
|
|
|
|
|
|
print "Commande inexistante";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2005-04-04 16:03:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$db->close();
|
|
|
|
|
|
|
2005-08-31 23:56:05 +02:00
|
|
|
|
llxFooter('$Date$ - $Revision$');
|
2005-04-04 16:03:21 +02:00
|
|
|
|
?>
|