diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php new file mode 100644 index 00000000000..b6c021ed4ca --- /dev/null +++ b/htdocs/compta/facture/info.php @@ -0,0 +1,65 @@ + + * Copyright (C) 2004 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$ + * + */ +require("./pre.inc.php"); + +/* + * + * + */ +llxHeader(); + +/* + * Visualisation de la fiche + * + */ + +$facture = new Facture($db); +$facture->fetch($_GET["facid"]); +$facture->info($_GET["facid"]); +$soc = new Societe($db, $facture->socidp); +$soc->fetch($facture->socidp); + +$head[0][0] = DOL_URL_ROOT.'/compta/facture.php?facid='.$facture->id; +$head[0][1] = "Facture : $facture->ref"; +$h = 1; +$head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$facture->id; +$head[$h][1] = "Note"; +$h++; +$head[$h][0] = DOL_URL_ROOT.'/compta/facture/info.php?facid='.$facture->id; +$head[$h][1] = "Info"; +$a = 2; + +dolibarr_fiche_head($head, $a, $soc->nom); + + + + + +dolibarr_print_object_info($facture); + +print "
"; + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php new file mode 100644 index 00000000000..b2b2a6ab339 --- /dev/null +++ b/htdocs/compta/facture/note.php @@ -0,0 +1,148 @@ + + * + * 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$ + * + */ + +/** +* Gestion d'une proposition commerciale +* @package propale +*/ + +require("./pre.inc.php"); + +$user->getrights('facture'); +if (!$user->rights->facture->lire) + accessforbidden(); + +/* + * Modules optionnels + */ + +/* + * Sécurité accés client + */ +if ($user->societe_id > 0) +{ + unset($_GET["action"]); + $socidp = $user->societe_id; +} + +/******************************************************************************/ +/* Actions */ +/******************************************************************************/ + +if ($_POST["action"] == 'update' && $user->rights->facture->creer) +{ + $facture = new Facture($db); + $facture->fetch($_GET["facid"]); + $facture->update_note($_POST["note"]); + +} + +llxHeader(); +$html = new Form($db); +/******************************************************************************/ +/* Fin des Actions */ +/******************************************************************************/ + +if ($_GET["facid"]) +{ + $facture = new Facture($db); + if ( $facture->fetch($_GET["facid"]) ) + { + + $soc = new Societe($db, $facture->socidp); + $soc->fetch($facture->socidp); + + $head[0][0] = DOL_URL_ROOT.'/compta/facture.php?facid='.$facture->id; + $head[0][1] = "Facture : $facture->ref"; + $h = 1; + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$facture->id; + $head[$h][1] = "Note"; + $a = 1; + $h++; + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/info.php?facid='.$facture->id; + $head[$h][1] = "Info"; + + + dolibarr_fiche_head($head, $a, $soc->nom); + + + print ''; + + print ''; + print ''; + + print ''; + + print ''; + + print '"; + + if ($_GET["action"] == 'edit') + { + print ''; + print ''; + print '"; + print ''; + print ''; + } + + + print "
Société'; + if ($societe->client == 1) + { + $url ='fiche.php?socid='.$societe->id; + } + else + { + $url = DOL_URL_ROOT.'/comm/prospect/fiche.php?socid='.$societe->id; + } + print ''.$societe->nom.'Statut'.$facture->statut_libelle.'
Date'.strftime("%A %d %B %Y",$facture->date); + if ($facture->fin_validite) + { + print " (".strftime("%d %B %Y",$facture->fin_validite).")"; + } + print 'Auteur'; + $author = new User($db, $facture->user_author); + $author->fetch(''); + print $author->fullname.'
Note :
'. nl2br($facture->note)."
"; + + + /* + * Actions + */ + print ''; + print '

'; + + if ($user->rights->facture->creer && $_GET["action"] <> 'edit') + { + print "id&action=edit\">Editer"; + } + + print "
"; + + + } + +} +$db->close(); +llxFooter("Dernière modification $Date$ révision $Revision$"); +?>