FIX avoid travis error use double quote instead simple quote
This commit is contained in:
parent
b537e888e9
commit
64119917a4
@ -1484,8 +1484,8 @@ class Products extends DolibarrApi
|
||||
|
||||
$return = array();
|
||||
|
||||
$sql = 'SELECT ';
|
||||
$sql .= 'v.fk_product_attribute, v.rowid, v.ref, v.value FROM '.$this->db->prefix().'product_attribute_value as v';
|
||||
$sql = "SELECT ";
|
||||
$sql .= "v.fk_product_attribute, v.rowid, v.ref, v.value FROM ".$this->db->prefix()."product_attribute_value as v";
|
||||
$sql .= " WHERE v.fk_product_attribute IN (SELECT rowid FROM ".$this->db->prefix()."product_attribute WHERE ref LIKE '".$this->db->escape($ref)."')";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
@ -316,11 +316,11 @@ class ProductFournisseurPrice extends CommonObject
|
||||
|
||||
$records = array();
|
||||
|
||||
$sql = 'SELECT ';
|
||||
$sql = "SELECT ";
|
||||
$sql .= $this->getFieldList();
|
||||
$sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t';
|
||||
if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) $sql .= ' WHERE t.entity IN ('.getEntity($this->element).')';
|
||||
else $sql .= ' WHERE 1 = 1';
|
||||
$sql .= " FROM ".$this->db->prefix().$this->table_element." as t";
|
||||
if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) $sql .= " WHERE t.entity IN (".getEntity($this->element).")";
|
||||
else $sql .= " WHERE 1 = 1";
|
||||
// Manage filter
|
||||
$sqlwhere = array();
|
||||
if (count($filter) > 0) {
|
||||
@ -698,10 +698,10 @@ class ProductFournisseurPrice extends CommonObject
|
||||
*/
|
||||
public function info($id)
|
||||
{
|
||||
$sql = 'SELECT rowid, date_creation as datec, tms as datem,';
|
||||
$sql .= ' fk_user_creat, fk_user_modif';
|
||||
$sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t';
|
||||
$sql .= ' WHERE t.rowid = '.((int) $id);
|
||||
$sql = "SELECT rowid, date_creation as datec, tms as datem,";
|
||||
$sql .= " fk_user_creat, fk_user_modif";
|
||||
$sql .= " FROM ".$this->db->prefix().$this->table_element." as t";
|
||||
$sql .= " WHERE t.rowid = ".((int) $id);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
if ($this->db->num_rows($result)) {
|
||||
|
||||
@ -275,21 +275,21 @@ class Inventory extends CommonObject
|
||||
}
|
||||
|
||||
// Scan existing stock to prefill the inventory
|
||||
$sql = 'SELECT ps.rowid, ps.fk_entrepot as fk_warehouse, ps.fk_product, ps.reel,';
|
||||
$sql .= ' pb.batch, pb.qty';
|
||||
$sql .= ' FROM '.$this->db->prefix().'product_stock as ps';
|
||||
$sql .= ' LEFT JOIN '.$this->db->prefix().'product_batch as pb ON pb.fk_product_stock = ps.rowid,';
|
||||
$sql .= ' '.$this->db->prefix().'product as p, '.$this->db->prefix().'entrepot as e';
|
||||
$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
|
||||
$sql .= ' AND ps.fk_product = p.rowid AND ps.fk_entrepot = e.rowid';
|
||||
$sql = "SELECT ps.rowid, ps.fk_entrepot as fk_warehouse, ps.fk_product, ps.reel,";
|
||||
$sql .= " pb.batch, pb.qty";
|
||||
$sql .= " FROM ".$this->db->prefix()."product_stock as ps";
|
||||
$sql .= " LEFT JOIN ".$this->db->prefix()."product_batch as pb ON pb.fk_product_stock = ps.rowid,";
|
||||
$sql .= " ".$this->db->prefix()."product as p, ".$this->db->prefix()."entrepot as e";
|
||||
$sql .= " WHERE p.entity IN (".getEntity('product').")";
|
||||
$sql .= " AND ps.fk_product = p.rowid AND ps.fk_entrepot = e.rowid";
|
||||
if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
|
||||
$sql .= " AND p.fk_product_type = 0";
|
||||
}
|
||||
if ($this->fk_product > 0) {
|
||||
$sql .= ' AND ps.fk_product = '.((int) $this->fk_product);
|
||||
$sql .= " AND ps.fk_product = ".((int) $this->fk_product);
|
||||
}
|
||||
if ($this->fk_warehouse > 0) {
|
||||
$sql .= ' AND ps.fk_entrepot = '.((int) $this->fk_warehouse);
|
||||
$sql .= " AND ps.fk_entrepot = ".((int) $this->fk_warehouse);
|
||||
}
|
||||
|
||||
$inventoryline = new InventoryLine($this->db);
|
||||
@ -640,10 +640,10 @@ class Inventory extends CommonObject
|
||||
*/
|
||||
public function info($id)
|
||||
{
|
||||
$sql = 'SELECT rowid, date_creation as datec, tms as datem, date_validation as datev,';
|
||||
$sql .= ' fk_user_creat, fk_user_modif, fk_user_valid';
|
||||
$sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t';
|
||||
$sql .= ' WHERE t.rowid = '.((int) $id);
|
||||
$sql = "SELECT rowid, date_creation as datec, tms as datem, date_validation as datev,";
|
||||
$sql .= " fk_user_creat, fk_user_modif, fk_user_valid";
|
||||
$sql .= " FROM ".$this->db->prefix().$this->table_element." as t";
|
||||
$sql .= " WHERE t.rowid = ".((int) $id);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
if ($this->db->num_rows($result)) {
|
||||
|
||||
@ -852,9 +852,9 @@ class Entrepot extends CommonObject
|
||||
{
|
||||
// phpcs:enable
|
||||
|
||||
$sql = 'SELECT rowid
|
||||
FROM '.$this->db->prefix().'entrepot
|
||||
WHERE fk_parent = '.((int) $id);
|
||||
$sql = "SELECT rowid
|
||||
FROM ".$this->db->prefix()."entrepot
|
||||
WHERE fk_parent = ".((int) $id);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
|
||||
@ -626,8 +626,8 @@ class MouvementStock extends CommonObject
|
||||
{
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
$sql = 'SELECT';
|
||||
$sql .= ' t.rowid,';
|
||||
$sql = "SELECT";
|
||||
$sql .= " t.rowid,";
|
||||
$sql .= " t.tms,";
|
||||
$sql .= " t.datem,";
|
||||
$sql .= " t.fk_product,";
|
||||
@ -644,8 +644,8 @@ class MouvementStock extends CommonObject
|
||||
$sql .= " t.eatby,";
|
||||
$sql .= " t.sellby,";
|
||||
$sql .= " t.fk_projet as fk_project";
|
||||
$sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t';
|
||||
$sql .= ' WHERE t.rowid = '.((int) $id);
|
||||
$sql .= " FROM ".$this->db->prefix().$this->table_element." as t";
|
||||
$sql .= " WHERE t.rowid = ".((int) $id);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
@ -824,8 +824,8 @@ class MouvementStock extends CommonObject
|
||||
{
|
||||
$nb = 0;
|
||||
|
||||
$sql = 'SELECT SUM(value) as nb from '.$this->db->prefix().'stock_mouvement';
|
||||
$sql .= ' WHERE fk_product = '.((int) $productidselected);
|
||||
$sql = "SELECT SUM(value) as nb from ".$this->db->prefix()."stock_mouvement";
|
||||
$sql .= " WHERE fk_product = ".((int) $productidselected);
|
||||
$sql .= " AND datem < '".$this->db->idate($datebefore)."'";
|
||||
|
||||
dol_syslog(get_class($this).__METHOD__.'', LOG_DEBUG);
|
||||
|
||||
@ -279,8 +279,8 @@ class Productlot extends CommonObject
|
||||
global $conf;
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
$sql = 'SELECT';
|
||||
$sql .= ' t.rowid,';
|
||||
$sql = "SELECT";
|
||||
$sql .= " t.rowid,";
|
||||
$sql .= " t.entity,";
|
||||
$sql .= " t.fk_product,";
|
||||
$sql .= " t.batch,";
|
||||
@ -296,11 +296,11 @@ class Productlot extends CommonObject
|
||||
$sql .= " t.fk_user_creat,";
|
||||
$sql .= " t.fk_user_modif,";
|
||||
$sql .= " t.import_key";
|
||||
$sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t';
|
||||
$sql .= " FROM ".$this->db->prefix().$this->table_element." as t";
|
||||
if ($product_id > 0 && $batch != '') {
|
||||
$sql .= " WHERE t.batch = '".$this->db->escape($batch)."' AND t.fk_product = ".((int) $product_id);
|
||||
} else {
|
||||
$sql .= ' WHERE t.rowid = '.((int) $id);
|
||||
$sql .= " WHERE t.rowid = ".((int) $id);
|
||||
}
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
@ -184,19 +184,19 @@ class ProductStockEntrepot extends CommonObject
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
$sql = 'SELECT';
|
||||
$sql .= ' t.rowid,';
|
||||
$sql = "SELECT";
|
||||
$sql .= " t.rowid,";
|
||||
$sql .= " t.tms,";
|
||||
$sql .= " t.fk_product,";
|
||||
$sql .= " t.fk_entrepot,";
|
||||
$sql .= " t.seuil_stock_alerte,";
|
||||
$sql .= " t.desiredstock,";
|
||||
$sql .= " t.import_key";
|
||||
$sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t';
|
||||
$sql .= " FROM ".$this->db->prefix().$this->table_element." as t";
|
||||
if (!empty($id)) {
|
||||
$sql .= ' WHERE t.rowid = '.((int) $id);
|
||||
$sql .= " WHERE t.rowid = ".((int) $id);
|
||||
} else {
|
||||
$sql .= ' WHERE t.fk_product = '.((int) $fk_product).' AND t.fk_entrepot = '.((int) $fk_entrepot);
|
||||
$sql .= " WHERE t.fk_product = ".((int) $fk_product)." AND t.fk_entrepot = ".((int) $fk_entrepot);
|
||||
}
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
@ -254,8 +254,8 @@ class ProductStockEntrepot extends CommonObject
|
||||
{
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
$sql = 'SELECT';
|
||||
$sql .= ' t.rowid,';
|
||||
$sql = "SELECT";
|
||||
$sql .= " t.rowid,";
|
||||
|
||||
$sql .= " t.tms,";
|
||||
$sql .= " t.fk_product,";
|
||||
@ -265,9 +265,9 @@ class ProductStockEntrepot extends CommonObject
|
||||
$sql .= " t.import_key";
|
||||
|
||||
|
||||
$sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t';
|
||||
$sql .= " FROM ".$this->db->prefix().$this->table_element." as t";
|
||||
|
||||
$sql .= ' WHERE 1=1';
|
||||
$sql .= " WHERE 1=1";
|
||||
|
||||
// Manage filter
|
||||
$sqlwhere = array();
|
||||
@ -277,13 +277,13 @@ class ProductStockEntrepot extends CommonObject
|
||||
}
|
||||
}
|
||||
if (count($sqlwhere) > 0) {
|
||||
$sql .= ' AND '.implode(' '.$this->db->escape($filtermode).' ', $sqlwhere);
|
||||
$sql .= " AND ".implode(' '.$this->db->escape($filtermode).' ', $sqlwhere);
|
||||
}
|
||||
|
||||
if (!empty($fk_product) && $fk_product > 0) {
|
||||
$sql .= ' AND fk_product = '.((int) $fk_product);
|
||||
$sql .= " AND fk_product = ".((int) $fk_product);
|
||||
} elseif (!empty($fk_entrepot) && $fk_entrepot > 0) {
|
||||
$sql .= ' AND fk_entrepot = '.((int) $fk_entrepot);
|
||||
$sql .= " AND fk_entrepot = ".((int) $fk_entrepot);
|
||||
}
|
||||
// "elseif" used instead of "if" because getting list with specified fk_product and specified fk_entrepot would be the same as doing a fetch
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user