Fix scrutinizer
This commit is contained in:
parent
2693e5db6d
commit
682afe8918
@ -223,8 +223,10 @@ class lettering extends BookKeeping
|
|||||||
* @param boolean $notrigger no trigger
|
* @param boolean $notrigger no trigger
|
||||||
* @return number
|
* @return number
|
||||||
*/
|
*/
|
||||||
public function updateLettrage($ids = array(), $notrigger = false) {
|
public function updateLettrage($ids = array(), $notrigger = false)
|
||||||
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
$lettre = 'AAA';
|
||||||
|
|
||||||
dol_syslog(get_class($this) . "::" . __METHOD__, LOG_DEBUG);
|
dol_syslog(get_class($this) . "::" . __METHOD__, LOG_DEBUG);
|
||||||
|
|
||||||
@ -236,11 +238,10 @@ class lettering extends BookKeeping
|
|||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
$lettre = (empty($obj->lettering_code) ? 'AAA' : $obj->lettering_code);
|
$lettre = (empty($obj->lettering_code) ? 'AAA' : $obj->lettering_code);
|
||||||
if (! empty($obj->lettering_code))
|
if (! empty($obj->lettering_code))
|
||||||
$lettre ++;
|
$lettre++;
|
||||||
} else {
|
} else {
|
||||||
$this->errors[] = 'Error' . $this->db->lasterror();
|
$this->errors[] = 'Error' . $this->db->lasterror();
|
||||||
;
|
$error++;
|
||||||
$error ++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT SUM(ABS(debit)) as deb, SUM(ABS(credit)) as cred FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE ";
|
$sql = "SELECT SUM(ABS(debit)) as deb, SUM(ABS(credit)) as cred FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE ";
|
||||||
@ -250,18 +251,19 @@ class lettering extends BookKeeping
|
|||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
if (! (round(abs($obj->deb), 2) === round(abs($obj->cred), 2))) {
|
if (! (round(abs($obj->deb), 2) === round(abs($obj->cred), 2))) {
|
||||||
$this->errors[] = 'Total not exacts ' . round(abs($obj->deb), 2) . ' vs ' . round(abs($obj->cred), 2);
|
$this->errors[] = 'Total not exacts ' . round(abs($obj->deb), 2) . ' vs ' . round(abs($obj->cred), 2);
|
||||||
$error ++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->errors[] = 'Erreur sql' . $this->db->lasterror();
|
$this->errors[] = 'Erreur sql' . $this->db->lasterror();
|
||||||
;
|
$error++;
|
||||||
$error ++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update request
|
// Update request
|
||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_bookkeeping SET";
|
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_bookkeeping SET";
|
||||||
$sql .= " lettering_code='" . $lettre . "'";
|
$sql .= " lettering_code='" . $lettre . "'";
|
||||||
$sql .= " , date_lettering = '" . $this->db->idate($now) . "'"; // todo correct date it's false
|
$sql .= " , date_lettering = '" . $this->db->idate($now) . "'"; // todo correct date it's false
|
||||||
@ -271,9 +273,10 @@ class lettering extends BookKeeping
|
|||||||
dol_syslog(get_class($this) . "::update sql=" . $sql, LOG_DEBUG);
|
dol_syslog(get_class($this) . "::update sql=" . $sql, LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (! $resql) {
|
if (! $resql) {
|
||||||
$error ++;
|
$error++;
|
||||||
$this->errors[] = "Error " . $this->db->lasterror();
|
$this->errors[] = "Error " . $this->db->lasterror();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
if (! $notrigger) {
|
if (! $notrigger) {
|
||||||
|
|||||||
@ -1215,7 +1215,7 @@ class ActionComm extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto=0, $notooltip=0)
|
function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto=0, $notooltip=0)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $user, $hookmanager;
|
global $conf, $langs, $user, $hookmanager, $action;
|
||||||
|
|
||||||
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
|
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
|
||||||
|
|
||||||
@ -1231,7 +1231,7 @@ class ActionComm extends CommonObject
|
|||||||
if ($this->type_code != 'AC_OTH_AUTO') $labeltype = $langs->trans('ActionAC_MANUAL');
|
if ($this->type_code != 'AC_OTH_AUTO') $labeltype = $langs->trans('ActionAC_MANUAL');
|
||||||
}
|
}
|
||||||
|
|
||||||
$tooltip = '<u>' . $langs->trans('ShowAction'.$objp->code) . '</u>';
|
$tooltip = '<u>' . $langs->trans('ShowAction') . '</u>';
|
||||||
if (! empty($this->ref))
|
if (! empty($this->ref))
|
||||||
$tooltip .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
|
$tooltip .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
|
||||||
if (! empty($label))
|
if (! empty($label))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user