73 global $user, $langs, $conf;
75 include_once DOL_DOCUMENT_ROOT.
'/accountancy/class/bookkeeping.class.php';
79 $this->info_box_head = array(
'text' => $langs->trans(
"BoxTitleSuspenseAccount"));
81 if ($user->hasRight(
'accounting',
'mouvements',
'lire')) {
82 $suspenseAccount = $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE;
83 if (!empty($suspenseAccount) && $suspenseAccount > 0) {
84 $sql =
"SELECT COUNT(*) as nb_suspense_account";
85 $sql .=
" FROM ".MAIN_DB_PREFIX.
"accounting_bookkeeping as b";
86 $sql .=
" WHERE b.numero_compte = '".$this->db->escape($suspenseAccount).
"'";
87 $sql .=
" AND b.entity = ".$conf->entity;
89 $result = $this->db->query($sql);
90 $nbSuspenseAccount = 0;
92 $obj = $this->db->fetch_object($result);
93 $nbSuspenseAccount = $obj->nb_suspense_account;
96 $this->info_box_contents[0][0] = array(
98 'text' => $langs->trans(
"NumberOfLinesInSuspenseAccount").
':'
101 $this->info_box_contents[0][1] = array(
102 'td' =>
'class="right"',
103 'text' =>
'<a href="'.DOL_URL_ROOT.
'/accountancy/bookkeeping/list.php?search_accountancy_code_start='.urlencode($suspenseAccount).
'&search_accountancy_code_end='.urlencode($suspenseAccount).
'">'.$nbSuspenseAccount.
'</a>',
107 $this->info_box_contents[0][0] = array(
108 'td' =>
'class="nohover"',
109 'text' =>
'<span class="opacitymedium">'.$langs->trans(
"SuspenseAccountNotDefined").
'</span>'
113 $this->info_box_contents[0][0] = array(
114 'td' =>
'class="nohover"',
115 'text' =>
'<span class="opacitymedium">'.$langs->trans(
"ReadPermissionNotAllowed").
'</span>'