Fix: erreur sql si pas d'entrept
This commit is contained in:
parent
73af29ffd7
commit
fd8f8c63c5
@ -1334,21 +1334,24 @@ class Product
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
$row = $this->db->fetch_row(0);
|
||||
if ($row[0] > 0)
|
||||
{
|
||||
return $this->ajust_stock($user, $id_entrepot, $nbpiece, $mouvement);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->create_stock($id_entrepot, $nbpiece);
|
||||
}
|
||||
$row = $this->db->fetch_row(0);
|
||||
if ($id_entrepot)
|
||||
{
|
||||
if ($row[0] > 0)
|
||||
{
|
||||
return $this->ajust_stock($user, $id_entrepot, $nbpiece, $mouvement);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->create_stock($id_entrepot, $nbpiece);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($this->db);
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
dolibarr_print_error($this->db);
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user