From 48b14a7548f7f0e56ec65f5e89f7488ddc14edc3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Feb 2010 19:15:07 +0000 Subject: [PATCH] Qual: Removed a deadlock option. Option is always on now as it is more opened. --- htdocs/admin/facture.php | 21 +-------------------- htdocs/compta/facture.php | 4 ++-- htdocs/facture.class.php | 2 +- 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 9ad675780ca..0c639ffdcc9 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) @@ -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 '' print "\n"; print ''; -// Active la possibilite d'editer/supprimer une facture validee sans paiement -$var=! $var; -print '
'; -print ''; -print ''; -print ''; -print $langs->trans("EnableEditDeleteValidInvoice"); -print ''; -print $html->selectyesno("enable_editdelete",$conf->global->FACTURE_ENABLE_EDITDELETE,1); -print ''; -print ''; -print "\n"; -print '
'; - $var=! $var; print '
'; print ''; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 8b108aa8885..bd5a8147f1f 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 786b3e656d5..00e7f55fdad 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