diff --git a/htdocs/compta/dons/card.php b/htdocs/compta/dons/card.php index 7bf909378b4..41b129a4cc6 100644 --- a/htdocs/compta/dons/card.php +++ b/htdocs/compta/dons/card.php @@ -554,7 +554,15 @@ if (! empty($id) && $action != 'edit') if ($user->rights->don->supprimer) { - print '
'.$langs->trans("Delete")."
"; + if ($don->statut == -1 || $don->statut == 0) + { + print '
'.$langs->trans("Delete")."
"; + } + else + { + print '
'.$langs->trans("Delete")."
"; + } + } else { diff --git a/htdocs/compta/dons/class/don.class.php b/htdocs/compta/dons/class/don.class.php index a8f7c11d92b..06d383e1c50 100644 --- a/htdocs/compta/dons/class/don.class.php +++ b/htdocs/compta/dons/class/don.class.php @@ -449,10 +449,11 @@ class Don extends CommonObject */ function delete($rowid) { - + global $user; + $this->db->begin(); - $sql = "DELETE FROM ".MAIN_DB_PREFIX."don WHERE rowid = $rowid AND fk_statut = 0;"; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."don WHERE rowid = $rowid AND fk_statut = 0 OR fk_statut = -1"; $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index c8480d6e65a..decbba143da 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -190,7 +190,7 @@ if ($resql) $texte.=' ('.$langs->trans("Stocks").')'; - llxHeader("",$title,$helpurl,$texte); + llxHeader("",$texte,$helpurl); if ($sref || $snom || $sall || GETPOST('search')) {