Fix compatibility account->bank_account

This commit is contained in:
Laurent Destailleur 2020-02-29 12:46:52 +01:00
parent a6c7463c27
commit 9def29054d
2 changed files with 7 additions and 10 deletions

View File

@ -167,8 +167,9 @@ class Categorie extends CommonObject
'member' => 'adherent',
'contact' => 'socpeople',
'user' => 'user',
'account' => 'bank_account',
'project' => 'projet',
'account' => 'bank_account', // old for bank account
'bank_account' => 'bank_account',
'project' => 'projet',
'warehouse'=> 'entrepot',
'actioncomm' => 'actioncomm',
);
@ -774,7 +775,7 @@ class Categorie extends CommonObject
/**
* Return list of fetched instance of elements having this category
*
* @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member')
* @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member', ...)
* @param int $onlyids Return only ids of objects (consume less memory)
* @param int $limit Limit
* @param int $offset Offset

View File

@ -182,17 +182,13 @@ foreach ($fulltree as $key => $val)
$li = $categstatic->getNomUrl(1, '', 60);
$desc = dol_htmlcleanlastbr($val['description']);
$counter = "";
$counter = '';
if($conf->global->CATEGORY_SHOW_COUNTS)
{
// we need only a count of the elements, so it is enough to consume only the id's from the database
$elements = $type == Categorie::TYPE_ACCOUNT
? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account"
: $categstatic->getObjectsInCateg($type, 1);
$counter = "<td class='left' width='40px;'>".(is_countable($elements) ? count($elements) : "0")."</td>";
$elements = $categstatic->getObjectsInCateg($type, 1);
$counter = "<td class='left' width='40px;'>".(is_countable($elements) ? count($elements) : '0')."</td>";
}
$data[] = array(