62 global $user, $langs, $conf;
64 include_once DOL_DOCUMENT_ROOT.
'/accountancy/class/bookkeeping.class.php';
68 $this->info_box_head = array(
'text' => $langs->trans(
"BoxTitleSuspenseAccount"));
70 if ($user->hasRight(
'accounting',
'mouvements',
'lire')) {
72 if (!empty($suspenseAccount) && $suspenseAccount > 0) {
73 $sql =
"SELECT COUNT(*) as nb_suspense_account";
74 $sql .=
" FROM ".MAIN_DB_PREFIX.
"accounting_bookkeeping as b";
75 $sql .=
" WHERE b.numero_compte = '".$this->db->escape($suspenseAccount).
"'";
76 $sql .=
" AND b.entity = ".$conf->entity;
78 $result = $this->db->query($sql);
79 $nbSuspenseAccount = 0;
81 $obj = $this->db->fetch_object($result);
82 $nbSuspenseAccount = $obj->nb_suspense_account;
85 $this->info_box_contents[0][0] = array(
87 'text' => $langs->trans(
"NumberOfLinesInSuspenseAccount")
90 $this->info_box_contents[0][1] = array(
91 'td' =>
'class="right"',
92 'text' =>
'<a href="'.DOL_URL_ROOT.
'/accountancy/bookkeeping/list.php?search_accountancy_code_start='.urlencode($suspenseAccount).
'&search_accountancy_code_end='.urlencode($suspenseAccount).
'">'.$nbSuspenseAccount.
'</a>',
96 $this->info_box_contents[0][0] = array(
97 'td' =>
'class="nohover"',
98 'text' =>
'<span class="opacitymedium">'.$langs->trans(
"SuspenseAccountNotDefined").
'</span>'
102 $this->info_box_contents[0][0] = array(
103 'td' =>
'class="nohover"',
104 'text' =>
'<span class="opacitymedium">'.$langs->trans(
"ReadPermissionNotAllowed").
'</span>'