63 global $user, $langs, $conf;
65 include_once DOL_DOCUMENT_ROOT.
'/accountancy/class/bookkeeping.class.php';
69 $this->info_box_head = array(
'text' => $langs->trans(
"BoxTitleLastManualEntries", $max));
71 if ($user->hasRight(
'accounting',
'mouvements',
'lire')) {
72 $sql =
"SELECT DISTINCT b.piece_num";
73 $sql .=
", b.doc_date as date_movement";
74 $sql .=
", b.label_operation";
75 $sql .=
", b.montant as amount";
76 $sql .=
", b.code_journal";
77 $sql .=
" FROM ".MAIN_DB_PREFIX.
"accounting_bookkeeping as b";
78 $sql .=
" WHERE b.fk_doc = 0";
79 $sql .=
" AND b.entity = ".$conf->entity;
80 $sql .=
" ORDER BY b.piece_num DESC ";
81 $sql .= $this->db->plimit($max, 0);
83 $result = $this->db->query($sql);
85 $num = $this->db->num_rows($result);
89 while ($line < $num) {
90 $objp = $this->db->fetch_object($result);
91 $date = $this->db->jdate($objp->date_movement);
92 $journal = $objp->code_journal;
93 $label = $objp->label_operation;
94 $amount = $objp->amount;
99 $bookkeepingstatic->piece_num = $objp->piece_num;
101 $this->info_box_contents[$line][] = array(
103 'text' => $bookkeepingstatic->getNomUrl(1),
107 $this->info_box_contents[$line][] = array(
108 'td' =>
'class="center nowraponall"',
113 $this->info_box_contents[$line][] = array(
114 'td' =>
'class="center"',
119 $this->info_box_contents[$line][] = array(
120 'td' =>
'class="tdoverflowmax150 maxwidth150onsmartphone"',
125 $this->info_box_contents[$line][] = array(
126 'td' =>
'class="nowraponall right amount"',
127 'text' =>
price($amount, 0, $langs, 0, -1, -1, $conf->currency),
134 $this->info_box_contents[$line][0] = array(
135 'td' =>
'class="center"',
136 'text'=>
'<span class="opacitymedium">'.$langs->trans(
"NoRecordedManualEntries").
'</span>'
140 $this->db->free($result);
142 $this->info_box_contents[0][0] = array(
145 'text' => ($this->db->error().
' sql='.$sql),
149 $this->info_box_contents[0][0] = array(
150 'td' =>
'class="nohover left"',
151 'text' =>
'<span class="opacitymedium">'.$langs->trans(
"ReadPermissionNotAllowed").
'</span>'