use $this->db in box
This commit is contained in:
parent
16eeeecb9a
commit
c68de09ba9
@ -71,13 +71,11 @@ class box_accountancy_last_manual_entries extends ModeleBoxes
|
|||||||
*/
|
*/
|
||||||
public function loadBox($max = 5)
|
public function loadBox($max = 5)
|
||||||
{
|
{
|
||||||
global $user, $langs, $db, $conf;
|
global $user, $langs, $conf;
|
||||||
|
|
||||||
$this->max = $max;
|
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||||
|
|
||||||
$bookkeepingstatic = new BookKeeping($db);
|
$bookkeepingstatic = new BookKeeping($this->db);
|
||||||
|
|
||||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastManualEntries", $max));
|
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastManualEntries", $max));
|
||||||
|
|
||||||
@ -92,17 +90,17 @@ class box_accountancy_last_manual_entries extends ModeleBoxes
|
|||||||
$sql.= " WHERE b.fk_doc = 0";
|
$sql.= " WHERE b.fk_doc = 0";
|
||||||
$sql.= " AND b.entity = ".$conf->entity;
|
$sql.= " AND b.entity = ".$conf->entity;
|
||||||
$sql.= " ORDER BY b.piece_num DESC ";
|
$sql.= " ORDER BY b.piece_num DESC ";
|
||||||
$sql.= $db->plimit($max, 0);
|
$sql.= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$num = $db->num_rows($result);
|
$num = $this->db->num_rows($result);
|
||||||
|
|
||||||
$line = 0;
|
$line = 0;
|
||||||
|
|
||||||
while ($line < $num) {
|
while ($line < $num) {
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $this->db->fetch_object($result);
|
||||||
$date = $db->jdate($objp->date_movement);
|
$date = $this->db->jdate($objp->date_movement);
|
||||||
$journal = $objp->code_journal;
|
$journal = $objp->code_journal;
|
||||||
$label = $objp->label_operation;
|
$label = $objp->label_operation;
|
||||||
$amount = $objp->montant;
|
$amount = $objp->montant;
|
||||||
@ -144,12 +142,12 @@ class box_accountancy_last_manual_entries extends ModeleBoxes
|
|||||||
|
|
||||||
if ($num==0) $this->info_box_contents[$line][0] = array('td' => 'class="center"','text'=>$langs->trans("NoRecordedManualEntries"));
|
if ($num==0) $this->info_box_contents[$line][0] = array('td' => 'class="center"','text'=>$langs->trans("NoRecordedManualEntries"));
|
||||||
|
|
||||||
$db->free($result);
|
$this->db->free($result);
|
||||||
} else {
|
} else {
|
||||||
$this->info_box_contents[0][0] = array(
|
$this->info_box_contents[0][0] = array(
|
||||||
'td' => '',
|
'td' => '',
|
||||||
'maxlength'=>500,
|
'maxlength'=>500,
|
||||||
'text' => ($db->error().' sql='.$sql),
|
'text' => ($this->db->error().' sql='.$sql),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -70,11 +70,11 @@ class box_accountancy_suspense_account extends ModeleBoxes
|
|||||||
*/
|
*/
|
||||||
public function loadBox()
|
public function loadBox()
|
||||||
{
|
{
|
||||||
global $user, $langs, $db, $conf;
|
global $user, $langs, $conf;
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||||
|
|
||||||
$bookkeepingstatic = new BookKeeping($db);
|
$bookkeepingstatic = new BookKeeping($this->db);
|
||||||
|
|
||||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleSuspenseAccount"));
|
$this->info_box_head = array('text' => $langs->trans("BoxTitleSuspenseAccount"));
|
||||||
|
|
||||||
@ -88,10 +88,11 @@ class box_accountancy_suspense_account extends ModeleBoxes
|
|||||||
$sql .= " WHERE b.numero_compte = ". $suspenseAccount;
|
$sql .= " WHERE b.numero_compte = ". $suspenseAccount;
|
||||||
$sql .= " AND b.entity = " . $conf->entity;
|
$sql .= " AND b.entity = " . $conf->entity;
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
$nbSuspenseAccount = 0;
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$obj=$db->fetch_object($result);
|
$obj=$this->db->fetch_object($result);
|
||||||
$nbSuspenseAccount = $obj->nb_suspense_account;
|
$nbSuspenseAccount = $obj->nb_suspense_account;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user