* * 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/compta/sociales/charges.php \ingroup tax \brief Fiche d'une charge sociale \version $Revision$ */ require("./pre.inc.php"); require(DOL_DOCUMENT_ROOT."/chargesociales.class.php"); $langs->load("compta"); $langs->load("bills"); // Protection $user->getrights('compta'); if (!$user->admin && !$user->rights->tax->charges) accessforbidden(); $chid=isset($_GET["id"])?$_GET["id"]:$_POST["id"]; /* *************************************************************************** */ /* */ /* Actions */ /* */ /* *************************************************************************** */ /* * Classer payé */ if ($_POST["action"] == 'confirm_payed') { if ($_POST["confirm"] == 'yes') { $chargesociales = new ChargeSociales($db); $result = $chargesociales->set_payed($chid); } else { $_GET["action"]=''; } } /* * Suppression d'une charge sociale */ if ($_POST["action"] == 'confirm_delete') { if ($_POST["confirm"] == 'yes') { $chargesociales=new ChargeSociales($db); $chargesociales->id=$_GET["id"]; $result=$chargesociales->delete($user); if ($result > 0) { Header("Location: index.php"); exit; } else { $mesg='