Fix scrutinizer

This commit is contained in:
Laurent Destailleur 2022-05-17 20:08:59 +02:00
parent 9c00e087fe
commit 2a34d6354f
5 changed files with 12 additions and 12 deletions

View File

@ -4033,12 +4033,12 @@ class Form
* @param string $deposit_percent < 0 : deposit_percent input makes no sense (for example, in list filters) * @param string $deposit_percent < 0 : deposit_percent input makes no sense (for example, in list filters)
* 0 : use default deposit percentage from entry * 0 : use default deposit percentage from entry
* > 0 : force deposit percentage (for example, from company object) * > 0 : force deposit percentage (for example, from company object)
* @return string * @return string String for the HTML select component
*/ */
public function getSelectConditionsPaiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1) public function getSelectConditionsPaiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1)
{ {
global $langs, $user, $conf; global $langs, $user, $conf;
$out = ''; $out = '';
dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
@ -4125,7 +4125,7 @@ class Form
* @param int $active Active or not, -1 = all * @param int $active Active or not, -1 = all
* @param string $morecss Add more CSS on select tag * @param string $morecss Add more CSS on select tag
* @param int $nooutput 1=Return string, do not send to output * @param int $nooutput 1=Return string, do not send to output
* @return void * @return string|void String for the HTML select component
*/ */
public function select_types_paiements($selected = '', $htmlname = 'paiementtype', $filtertype = '', $format = 0, $empty = 1, $noadmininfo = 0, $maxlength = 0, $active = 1, $morecss = '', $nooutput = 0) public function select_types_paiements($selected = '', $htmlname = 'paiementtype', $filtertype = '', $format = 0, $empty = 1, $noadmininfo = 0, $maxlength = 0, $active = 1, $morecss = '', $nooutput = 0)
{ {

View File

@ -1593,7 +1593,7 @@ function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $di
$url .= '?dol_hide_topmenu=1&dol_hide_leftmenu=1&dol_openinpopup='.urlencode($name); $url .= '?dol_hide_topmenu=1&dol_hide_leftmenu=1&dol_openinpopup='.urlencode($name);
} }
$out .= ''; $out = '';
$backtopagejsfieldsid = ''; $backtopagejsfieldslabel = ''; $backtopagejsfieldsid = ''; $backtopagejsfieldslabel = '';
if ($backtopagejsfields) { if ($backtopagejsfields) {

View File

@ -770,7 +770,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
* Menu COMPTA-FINANCIAL * Menu COMPTA-FINANCIAL
*/ */
if ($mainmenu == 'accountancy') { if ($mainmenu == 'accountancy') {
get_left_menu_accountancy($mainmenu, $newmenu, $usemenuhider, $leftmenu, $type_user, $db); get_left_menu_accountancy($mainmenu, $newmenu, $usemenuhider, $leftmenu, $type_user);
} }
/* /*

View File

@ -3491,6 +3491,8 @@ class CommandeFournisseur extends CommonOrder
{ {
$this->receptions = array(); $this->receptions = array();
dol_syslog(get_class($this)."::loadReceptions", LOG_DEBUG);
$sql = 'SELECT cd.rowid, cd.fk_product,'; $sql = 'SELECT cd.rowid, cd.fk_product,';
$sql .= ' sum(cfd.qty) as qty'; $sql .= ' sum(cfd.qty) as qty';
$sql .= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseur_dispatch as cfd,'; $sql .= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseur_dispatch as cfd,';
@ -3512,14 +3514,12 @@ class CommandeFournisseur extends CommonOrder
} }
$sql .= ' GROUP BY cd.rowid, cd.fk_product'; $sql .= ' GROUP BY cd.rowid, cd.fk_product';
$resql = $this->db->query($sql);
dol_syslog(get_class($this)."::loadReceptions", LOG_DEBUG); if ($resql) {
$result = $this->db->query($sql); $num = $this->db->num_rows($resql);
if ($result) {
$num = $this->db->num_rows($result);
$i = 0; $i = 0;
while ($i < $num) { while ($i < $num) {
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($resql);
empty($this->receptions[$obj->rowid]) ? $this->receptions[$obj->rowid] = $obj->qty : $this->receptions[$obj->rowid] += $obj->qty; empty($this->receptions[$obj->rowid]) ? $this->receptions[$obj->rowid] = $obj->qty : $this->receptions[$obj->rowid] += $obj->qty;
$i++; $i++;
} }

View File

@ -450,7 +450,7 @@ if ($jobposition->id > 0 && (empty($action) || ($action != 'edit' && $action !=
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref .= '<input type="hidden" name="action" value="classin">'; $morehtmlref .= '<input type="hidden" name="action" value="classin">';
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">'; $morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; $morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref .= '</form>'; $morehtmlref .= '</form>';
} else { } else {