Fix: delete bank account

This commit is contained in:
Laurent Destailleur 2014-08-01 14:48:48 +02:00
parent a5a7fb4967
commit 07cf09536d

View File

@ -35,6 +35,7 @@ $langs->load("bills");
$action=GETPOST('action');
$id=GETPOST('id');
$ref=GETPOST('ref');
// Security check
if (isset($_GET["id"]) || isset($_GET["ref"]))
@ -88,8 +89,9 @@ if ($action == 'update' && ! $_POST["cancel"])
if ($action == 'confirm_delete' && $_POST["confirm"] == "yes" && $user->rights->banque->configurer)
{
// Modification
$account = new Account($db, $_GET["id"]);
$account->delete($_GET["id"]);
$account = new Account($db);
$account->fetch($id);
$account->delete();
header("Location: ".DOL_URL_ROOT."/compta/bank/index.php");
exit;