fix for travis and sticker
This commit is contained in:
parent
83350cde8f
commit
1d2372b9ef
@ -1219,6 +1219,8 @@ class MouvementStock extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Retrieve number of equipments for a product batch
|
* Retrieve number of equipments for a product batch
|
||||||
*
|
*
|
||||||
|
* @param int $fk_product Product id
|
||||||
|
* @param varchar $batch batch number
|
||||||
* @return int <0 if KO, number of equipments if OK
|
* @return int <0 if KO, number of equipments if OK
|
||||||
*/
|
*/
|
||||||
private function getBatchCount($fk_product, $batch)
|
private function getBatchCount($fk_product, $batch)
|
||||||
@ -1231,7 +1233,7 @@ class MouvementStock extends CommonObject
|
|||||||
$sql .= " FROM ".MAIN_DB_PREFIX."product_batch as pb";
|
$sql .= " FROM ".MAIN_DB_PREFIX."product_batch as pb";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON ps.rowid = pb.fk_product_stock";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON ps.rowid = pb.fk_product_stock";
|
||||||
$sql .= " WHERE ps.fk_product = " . $fk_product;
|
$sql .= " WHERE ps.fk_product = " . $fk_product;
|
||||||
$sql .= " AND pb.batch = '" . $batch . "'";
|
$sql .= " AND pb.batch = '" . $this->db->escape($batch) . "'";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
@ -1245,8 +1247,7 @@ class MouvementStock extends CommonObject
|
|||||||
|
|
||||||
$this->db->free($result);
|
$this->db->free($result);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user