diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 32cd68f99cf..771ef7741c4 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -36,6 +36,7 @@ if (!$user->rights->facture->lire) $langs->load("bills"); $langs->load("banks"); +$langs->load("withdrawals"); require_once(DOL_DOCUMENT_ROOT."/facture.class.php"); @@ -53,15 +54,19 @@ if ($user->societe_id > 0) if ($_GET["action"] == "new") { - $fact = new Facture($db); - if ($fact->fetch($_GET["facid"])) - { - $result = $fact->demande_prelevement($user); - if ($result == 0) - { - Header("Location: prelevement.php?facid=".$fact->id); - } - } + $fact = new Facture($db); + if ($fact->fetch($_GET["facid"])) + { + $result = $fact->demande_prelevement($user); + if ($result > 0) + { + Header("Location: prelevement.php?facid=".$fact->id); + } + else + { + $mesg='