lint(stickler)
This commit is contained in:
parent
14269ab8ee
commit
1d162cc62c
@ -2189,7 +2189,6 @@ class Product extends CommonObject
|
||||
$separatedEntityPMP = true;
|
||||
}
|
||||
}
|
||||
|
||||
//For MultiCompany Stocks Sharings stock_reel includes only stocks shared with this entity
|
||||
$separatedStock = false;
|
||||
if (!empty($conf->global->MULTICOMPANY_STOCK_SHARING_ENABLED)) {
|
||||
@ -2206,7 +2205,6 @@ class Product extends CommonObject
|
||||
else {
|
||||
$sql .= " p.stock,";
|
||||
}
|
||||
|
||||
if ($separatedEntityPMP) {
|
||||
$sql .= " ppe.pmp, p.datec, p.tms, p.import_key, p.entity, p.desiredstock, p.tobatch, p.batch_mask, p.fk_unit,";
|
||||
}
|
||||
@ -2218,15 +2216,12 @@ class Product extends CommonObject
|
||||
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as pa ON pa.fk_product = p.rowid AND pa.entity = " . ((int) $conf->entity);
|
||||
}
|
||||
|
||||
if ($separatedEntityPMP) {
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "entity_product_pmp as ppe ON ppe.fk_product = p.rowid";
|
||||
}
|
||||
|
||||
if ($separatedStock) {
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_stock as sp ON sp.fk_product = p.rowid";
|
||||
}
|
||||
|
||||
if ($id) {
|
||||
$sql .= " WHERE p.rowid = ".((int) $id);
|
||||
} else {
|
||||
@ -2239,11 +2234,9 @@ class Product extends CommonObject
|
||||
$sql .= " AND p.barcode = '".$this->db->escape($barcode)."'";
|
||||
}
|
||||
}
|
||||
|
||||
if ($separatedEntityPMP) {
|
||||
$sql .= " AND ppe.entity = " . (int) $conf->entity;
|
||||
}
|
||||
|
||||
if ($separatedStock) {
|
||||
$sql .= " AND sp.fk_entrepot IN (
|
||||
SELECT rowid
|
||||
|
||||
@ -633,15 +633,11 @@ class Entrepot extends CommonObject
|
||||
if ($separatedPMP) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."entity_product_pmp as ppe";
|
||||
}
|
||||
|
||||
$sql .= " WHERE ps.fk_entrepot = ".$this->id;
|
||||
|
||||
if ($separatedPMP) {
|
||||
$sql .= " AND ppe.fk_product = p.rowid AND ppe.entity = ". (int) $conf->entity;
|
||||
}
|
||||
|
||||
$sql .= " AND ps.fk_product = p.rowid";
|
||||
|
||||
//print $sql;
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user