* * 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"); require("./facture-rec.class.php"); $user->getrights('facture'); if (!$user->rights->facture->lire) accessforbidden(); require("../../facture.class.php"); require("../../project.class.php"); llxHeader('','Facture récurrente','ch-facture.html#s-fac-facture-rec'); /* * Sécurité accés client */ if ($user->societe_id > 0) { $action = ''; $socidp = $user->societe_id; } /* * */ if ($HTTP_POST_VARS["action"] == 'add') { $facturerec = new FactureRec($db, $facid); $facturerec->titre = $HTTP_POST_VARS["titre"]; if ($facturerec->create($user) > 0) { $facid = $facturerec->id; $action = ''; } else { $action = "create"; } } /* * */ if ($action == 'delete' && $user->rights->facture->supprimer) { $fac = new FactureRec($db); $fac->delete($facid); $facid = 0 ; } /* * */ $html = new Form($db); /********************************************************************* * * Mode creation * * * ************************************************************************/ if ($action == 'create') { print_titre("Créer une facture récurrente"); $facture = new Facture($db); if ($facture->fetch($facid) > 0) { print '