64 global $user, $langs,
$conf;
66 include_once DOL_DOCUMENT_ROOT.
'/accountancy/class/bookkeeping.class.php';
70 $this->info_box_head = array(
'text' => $langs->trans(
"BoxTitleLastManualEntries", $max));
72 if ($user->hasRight(
'accounting',
'mouvements',
'lire')) {
73 $sql =
"SELECT DISTINCT b.piece_num";
74 $sql .=
", b.doc_date as date_movement";
75 $sql .=
", b.label_operation";
76 $sql .=
", b.montant as amount";
77 $sql .=
", b.code_journal";
78 $sql .=
" FROM ".MAIN_DB_PREFIX.
"accounting_bookkeeping as b";
79 $sql .=
" WHERE b.fk_doc = 0";
80 $sql .=
" AND b.entity = ".$conf->entity;
81 $sql .=
" ORDER BY b.piece_num DESC ";
82 $sql .= $this->db->plimit($max, 0);
84 $result = $this->db->query($sql);
86 $num = $this->db->num_rows($result);
90 while ($line < $num) {
91 $objp = $this->db->fetch_object($result);
92 $date = $this->db->jdate($objp->date_movement);
93 $journal = $objp->code_journal;
94 $label = $objp->label_operation;
95 $amount = $objp->amount;
100 $bookkeepingstatic->piece_num = $objp->piece_num;
102 $this->info_box_contents[$line][] = array(
104 'text' => $bookkeepingstatic->getNomUrl(1),
108 $this->info_box_contents[$line][] = array(
109 'td' =>
'class="center nowraponall"',
114 $this->info_box_contents[$line][] = array(
115 'td' =>
'class="center"',
120 $this->info_box_contents[$line][] = array(
121 'td' =>
'class="tdoverflowmax150 maxwidth150onsmartphone"',
126 $this->info_box_contents[$line][] = array(
127 'td' =>
'class="nowraponall right amount"',
128 'text' =>
price($amount, 0, $langs, 0, -1, -1,
$conf->currency),
135 $this->info_box_contents[$line][0] = array(
136 'td' =>
'class="center"',
137 'text' =>
'<span class="opacitymedium">'.$langs->trans(
"NoRecordedManualEntries").
'</span>'
141 $this->db->free($result);
143 $this->info_box_contents[0][0] = array(
146 'text' => ($this->db->error().
' sql='.$sql),
150 $this->info_box_contents[0][0] = array(
151 'td' =>
'class="nohover left"',
152 'text' =>
'<span class="opacitymedium">'.$langs->trans(
"ReadPermissionNotAllowed").
'</span>'