Fix code syntax
This commit is contained in:
parent
201e46f34b
commit
5756f0cfdf
@ -981,12 +981,12 @@ class ExpenseReport extends CommonObject
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
$num = $this->db->num_rows($result);
|
$num = $this->db->num_rows($result);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num) :
|
while ($i < $num) {
|
||||||
$objp = $this->db->fetch_object($result);
|
$objp = $this->db->fetch_object($result);
|
||||||
$total_ht += $objp->total_ht;
|
$total_ht += $objp->total_ht;
|
||||||
$total_tva += $objp->total_tva;
|
$total_tva += $objp->total_tva;
|
||||||
$i++;
|
$i++;
|
||||||
endwhile;
|
}
|
||||||
|
|
||||||
$total_ttc = $total_ht + $total_tva;
|
$total_ttc = $total_ht + $total_tva;
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET";
|
||||||
@ -995,14 +995,14 @@ class ExpenseReport extends CommonObject
|
|||||||
$sql .= " , total_tva = ".price2num($total_tva, 'MT');
|
$sql .= " , total_tva = ".price2num($total_tva, 'MT');
|
||||||
$sql .= " WHERE rowid = ".((int) $id);
|
$sql .= " WHERE rowid = ".((int) $id);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) :
|
if ($result) {
|
||||||
$this->db->free($result);
|
$this->db->free($result);
|
||||||
return 1;
|
return 1;
|
||||||
else :
|
} else {
|
||||||
$this->error = $this->db->lasterror();
|
$this->error = $this->db->lasterror();
|
||||||
dol_syslog(get_class($this)."::recalculer: Error ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::recalculer: Error ".$this->error, LOG_ERR);
|
||||||
return -3;
|
return -3;
|
||||||
endif;
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->error = $this->db->lasterror();
|
$this->error = $this->db->lasterror();
|
||||||
dol_syslog(get_class($this)."::recalculer: Error ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::recalculer: Error ".$this->error, LOG_ERR);
|
||||||
@ -1749,12 +1749,12 @@ class ExpenseReport extends CommonObject
|
|||||||
$sql .= " WHERE rowid = ".$this->id;
|
$sql .= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) :
|
if ($result) {
|
||||||
return 1;
|
return 1;
|
||||||
else :
|
} else {
|
||||||
$this->error = $this->db->error();
|
$this->error = $this->db->error();
|
||||||
return -1;
|
return -1;
|
||||||
endif;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
@ -1779,12 +1779,12 @@ class ExpenseReport extends CommonObject
|
|||||||
$sql .= " WHERE rowid = ".$this->id;
|
$sql .= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) :
|
if ($result) {
|
||||||
return 1;
|
return 1;
|
||||||
else :
|
} else {
|
||||||
$this->error = $this->db->error();
|
$this->error = $this->db->error();
|
||||||
return -1;
|
return -1;
|
||||||
endif;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user