74 global $user, $langs, $conf;
76 include_once DOL_DOCUMENT_ROOT.
'/accountancy/class/bookkeeping.class.php';
80 $this->info_box_head = array(
'text' => $langs->trans(
"BoxTitleLastManualEntries", $max));
82 if ($user->hasRight(
'accounting',
'mouvements',
'lire')) {
83 $sql =
"SELECT DISTINCT b.piece_num";
84 $sql .=
", b.doc_date as date_movement";
85 $sql .=
", b.label_operation";
86 $sql .=
", b.montant as amount";
87 $sql .=
", b.code_journal";
88 $sql .=
" FROM ".MAIN_DB_PREFIX.
"accounting_bookkeeping as b";
89 $sql .=
" WHERE b.fk_doc = 0";
90 $sql .=
" AND b.entity = ".$conf->entity;
91 $sql .=
" ORDER BY b.piece_num DESC ";
92 $sql .= $this->db->plimit($max, 0);
94 $result = $this->db->query($sql);
96 $num = $this->db->num_rows($result);
100 while ($line < $num) {
101 $objp = $this->db->fetch_object($result);
102 $date = $this->db->jdate($objp->date_movement);
103 $journal = $objp->code_journal;
104 $label = $objp->label_operation;
105 $amount = $objp->amount;
110 $bookkeepingstatic->piece_num = $objp->piece_num;
112 $this->info_box_contents[$line][] = array(
114 'text' => $bookkeepingstatic->getNomUrl(1),
118 $this->info_box_contents[$line][] = array(
119 'td' =>
'class="center nowraponall"',
124 $this->info_box_contents[$line][] = array(
125 'td' =>
'class="center"',
130 $this->info_box_contents[$line][] = array(
131 'td' =>
'class="tdoverflowmax150 maxwidth150onsmartphone"',
136 $this->info_box_contents[$line][] = array(
137 'td' =>
'class="nowraponall right amount"',
138 'text' =>
price($amount, 0, $langs, 0, -1, -1, $conf->currency),
145 $this->info_box_contents[$line][0] = array(
146 'td' =>
'class="center"',
147 'text'=>
'<span class="opacitymedium">'.$langs->trans(
"NoRecordedManualEntries").
'</span>'
151 $this->db->free($result);
153 $this->info_box_contents[0][0] = array(
156 'text' => ($this->db->error().
' sql='.$sql),
160 $this->info_box_contents[0][0] = array(
161 'td' =>
'class="nohover left"',
162 'text' =>
'<span class="opacitymedium">'.$langs->trans(
"ReadPermissionNotAllowed").
'</span>'