Merge pull request #18475 from OPEN-DSI/v14-fix-invoice-fetch-not-found-syslog-level
FIX invoice fetch not found syslog debug level instead of error
This commit is contained in:
commit
8870662200
@ -1625,10 +1625,10 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
if ($this->db->num_rows($result)) {
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if ($this->db->num_rows($resql)) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->entity = $obj->entity;
|
||||
@ -1730,14 +1730,16 @@ class Facture extends CommonInvoice
|
||||
$this->error = $this->db->error();
|
||||
return -3;
|
||||
}
|
||||
|
||||
$this->db->free($resql);
|
||||
|
||||
return 1;
|
||||
} else {
|
||||
$this->error = 'Invoice with id='.$rowid.' or ref='.$ref.' or ref_ext='.$ref_ext.' not found';
|
||||
dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR);
|
||||
dol_syslog(__METHOD__ . ' Invoice with id=' . $rowid . ' or ref=' . $ref . ' or ref_ext=' . $ref_ext . ' not found', LOG_WARNING);
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
$this->error = $this->db->error();
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user