Fix : scrutinizer errors

This commit is contained in:
Lucas Marcouiller 2021-10-23 11:10:58 +02:00
parent ad2d411793
commit d1ec71197a
2 changed files with 2 additions and 3 deletions

View File

@ -981,6 +981,7 @@ class Orders extends DolibarrApi
if (!DolibarrApiAccess::$user->rights->expedition->lire) { if (!DolibarrApiAccess::$user->rights->expedition->lire) {
throw new RestException(401); throw new RestException(401);
} }
$obj_ret = array();
$sql = "SELECT e.rowid"; $sql = "SELECT e.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."expedition as e"; $sql .= " FROM ".MAIN_DB_PREFIX."expedition as e";
$sql .= " JOIN ".MAIN_DB_PREFIX."expeditiondet as edet"; $sql .= " JOIN ".MAIN_DB_PREFIX."expeditiondet as edet";
@ -1054,7 +1055,6 @@ class Orders extends DolibarrApi
if ($result <= 0) { if ($result <= 0) {
throw new RestException(500, 'Error on creating expedition lines:'.$this->db->lasterror()); throw new RestException(500, 'Error on creating expedition lines:'.$this->db->lasterror());
} }
$i++;
} }
return $shipment->id; return $shipment->id;
} }

View File

@ -65,7 +65,7 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
public function loadBox($max = 5) public function loadBox($max = 5)
{ {
global $conf, $user, $langs; global $conf, $user, $langs;
$dataseries = ""; $dataseries = array();
$graphtoshow = ""; $graphtoshow = "";
$badgeStatus0 = '#cbd3d3'; // draft $badgeStatus0 = '#cbd3d3'; // draft
@ -118,7 +118,6 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
if ($resql) { if ($resql) {
$num = $this->db->num_rows($resql); $num = $this->db->num_rows($resql);
$i = 0; $i = 0;
$dataseries = array();
while ($i < $num) { while ($i < $num) {
$objp = $this->db->fetch_object($resql); $objp = $this->db->fetch_object($resql);
while ($minimumdatecformated < $objp->datec) { while ($minimumdatecformated < $objp->datec) {