* Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2012 Marcos GarcĂ­a * * 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 3 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, see . */ /** * \file htdocs/fourn/commande/note.php * \ingroup commande * \brief Fiche note commande */ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; $langs->load("orders"); $langs->load("suppliers"); $langs->load("companies"); $langs->load('stocks'); $id = GETPOST('facid','int')?GETPOST('facid','int'):GETPOST('id','int'); $ref = GETPOST('ref'); $action = GETPOST('action'); // Security check if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'fournisseur', $id, '', 'commande'); $object = new CommandeFournisseur($db); $object->fetch($id, $ref); $permissionnote=$user->rights->fournisseur->commande->creer; // Used by the include of actions_setnotes.inc.php /* * Actions */ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once /* * View */ llxHeader('',$langs->trans("OrderCard"),"CommandeFournisseur"); $form = new Form($db); /* *************************************************************************** */ /* */ /* Mode vue et edition */ /* */ /* *************************************************************************** */ $now=dol_now(); if ($id > 0 || ! empty($ref)) { if ($result >= 0) { $soc = new Societe($db); $soc->fetch($object->socid); $author = new User($db); $author->fetch($object->user_author_id); $head = ordersupplier_prepare_head($object); $title=$langs->trans("SupplierOrder"); dol_fiche_head($head, 'note', $title, 0, 'order'); /* * Commande */ print ''; $linkback = ''.$langs->trans("BackToList").''; // Ref print ''; print ''; print ''; // Fournisseur print '"; print ''; print ''; // Statut print ''; print ''; print '"; // Date if ($object->methode_commande_id > 0) { print '"; if ($object->methode_commande) { print ''; } } // Author print ''; print ''; print ''; print "
'.$langs->trans("Ref").''; print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); print '
'.$langs->trans("Supplier")."'.$soc->getNomUrl(1,'supplier').'
'.$langs->trans("Status").''; print $object->getLibStatut(4); print "
'.$langs->trans("Date").''; if ($object->date_commande) { print dol_print_date($object->date_commande,"dayhourtext")."\n"; } print "
'.$langs->trans("Method").''.$object->getInputMethod().'
'.$langs->trans("AuthorRequest").''.$author->getNomUrl(1).'
"; print '
'; $colwidth=20; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; dol_fiche_end(); } else { /* Order not found */ $langs->load("errors"); print $langs->trans("ErrorRecordNotFound"); } } llxFooter(); $db->close();