From 5441b1998badc23d4c76c8aeec791e338c81d029 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 May 2023 16:43:50 +0200 Subject: [PATCH] Fix add a bank account to its categoy --- htdocs/categories/viewcat.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 476e4212413..a262e8d8885 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -1,4 +1,6 @@ * Copyright (C) 2006-2020 Laurent Destailleur * Copyright (C) 2007 Patrick Raguin @@ -215,12 +217,14 @@ if ($elemid && $action == 'addintocategory' && $elementtype = 'user'; } elseif ($type == Categorie::TYPE_ACCOUNT) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - $newobject = new User($db); + $newobject = new Account($db); $elementtype = 'bank_account'; + } else { + dol_print_error("Not supported value of type = ".$type); } $result = $newobject->fetch($elemid); - // TODO Add into categ + // Add into categ $result = $object->add_type($newobject, $elementtype); if ($result >= 0) { setEventMessages($langs->trans("WasAddedSuccessfully", $newobject->ref), null, 'mesgs');