diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 9ad675780cac5bf26b0cd610cd0fb9e694e96f16..0c639ffdcc9299089903029fb075d20827ae2edd 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -1,6 +1,6 @@ <?php /* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> - * Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> + * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr> @@ -172,11 +172,6 @@ if ($_POST["action"] == 'setforcedate') dolibarr_set_const($db, "FAC_FORCE_DATE_VALIDATION",$_POST["forcedate"],'chaine',0,'',$conf->entity); } -if ($_POST["action"] == 'set_enable_editdelete') -{ - dolibarr_set_const($db, "FACTURE_ENABLE_EDITDELETE",$_POST["enable_editdelete"],'chaine',0,'',$conf->entity); -} - if ($_POST["action"] == 'update' || $_POST["action"] == 'add') { if (! dolibarr_set_const($db, $_POST["constname"],$_POST["constvalue"],$typeconst[$_POST["consttype"]],0,isset($_POST["constnote"])?$_POST["constnote"]:'',$conf->entity)); @@ -594,20 +589,6 @@ print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">' print "</td></tr>\n"; print '</form>'; -// Active la possibilite d'editer/supprimer une facture validee sans paiement -$var=! $var; -print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'; -print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; -print '<input type="hidden" name="action" value="set_enable_editdelete">'; -print '<tr '.$bc[$var].'><td>'; -print $langs->trans("EnableEditDeleteValidInvoice"); -print '</td><td width="60" align="center">'; -print $html->selectyesno("enable_editdelete",$conf->global->FACTURE_ENABLE_EDITDELETE,1); -print '</td><td align="right">'; -print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; -print "</td></tr>\n"; -print '</form>'; - $var=! $var; print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 8b108aa88855fe844cad04361b0d7c7d6f4909d4..bd5a8147f1fd546064ed69910b768b27dc781385 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -321,7 +321,7 @@ if ($_REQUEST['action'] == 'confirm_valid' && $_REQUEST['confirm'] == 'yes' && $ } // Repasse la facture en mode brouillon -if ($_GET['action'] == 'modif' && $user->rights->facture->modifier && $conf->global->FACTURE_ENABLE_EDITDELETE) +if ($_GET['action'] == 'modif' && $user->rights->facture->modifier) { $fac = new Facture($db); $fac->fetch($_GET['facid']); @@ -3244,7 +3244,7 @@ else // On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees $ventilExportCompta = $fac->getVentilExportCompta(); - if ($conf->global->FACTURE_ENABLE_EDITDELETE && $user->rights->facture->modifier + if ($user->rights->facture->modifier && ($resteapayer == $fac->total_ttc && $fac->paye == 0 && $ventilExportCompta == 0)) { if (! $facidnext) diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index 786b3e656d5b98e9fa6ad32425bebb2f51cbbedb..00e7f55fdad8894e85c6c807c8d21a0cb3e84753 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -2377,7 +2377,7 @@ class Facture extends CommonObject $facref = substr($this->ref, 1, 4); // Si facture non brouillon et non provisoire - if ($facref != 'PROV' && $conf->global->FACTURE_ENABLE_EDITDELETE) + if ($facref != 'PROV') { // On ne peut supprimer que la derniere facture validee // pour ne pas avoir de trou dans la numerotation