Merge pull request #22242 from fboitel/fboitel-dev-scrutinizer-12/09/2022
Fix scrutinizer 3
This commit is contained in:
commit
821d22e94d
@ -973,7 +973,7 @@ class Delivery extends CommonObject
|
|||||||
$sqlSourceLine .= ", p.ref, p.label";
|
$sqlSourceLine .= ", p.ref, p.label";
|
||||||
$sqlSourceLine .= " FROM ".MAIN_DB_PREFIX.$this->linkedObjectsIds[0]['type']."det as st";
|
$sqlSourceLine .= " FROM ".MAIN_DB_PREFIX.$this->linkedObjectsIds[0]['type']."det as st";
|
||||||
$sqlSourceLine .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON st.fk_product = p.rowid";
|
$sqlSourceLine .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON st.fk_product = p.rowid";
|
||||||
$sqlSourceLine .= " WHERE fk_".$this->linked_object[0]['type']." = ".((int) $this->linked_object[0]['linkid']);
|
$sqlSourceLine .= " WHERE fk_".$this->linked_objects[0]['type']." = ".((int) $this->linked_objects[0]['linkid']);
|
||||||
|
|
||||||
$resultSourceLine = $this->db->query($sqlSourceLine);
|
$resultSourceLine = $this->db->query($sqlSourceLine);
|
||||||
if ($resultSourceLine) {
|
if ($resultSourceLine) {
|
||||||
@ -986,12 +986,12 @@ class Delivery extends CommonObject
|
|||||||
// Get lines of sources alread delivered
|
// Get lines of sources alread delivered
|
||||||
$sql = "SELECT ld.fk_origin_line, sum(ld.qty) as qty";
|
$sql = "SELECT ld.fk_origin_line, sum(ld.qty) as qty";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."deliverydet as ld, ".MAIN_DB_PREFIX."delivery as l,";
|
$sql .= " FROM ".MAIN_DB_PREFIX."deliverydet as ld, ".MAIN_DB_PREFIX."delivery as l,";
|
||||||
$sql .= " ".MAIN_DB_PREFIX.$this->linked_object[0]['type']." as c";
|
$sql .= " ".MAIN_DB_PREFIX.$this->linked_objects[0]['type']." as c";
|
||||||
$sql .= ", ".MAIN_DB_PREFIX.$this->linked_object[0]['type']."det as cd";
|
$sql .= ", ".MAIN_DB_PREFIX.$this->linked_objects[0]['type']."det as cd";
|
||||||
$sql .= " WHERE ld.fk_delivery = l.rowid";
|
$sql .= " WHERE ld.fk_delivery = l.rowid";
|
||||||
$sql .= " AND ld.fk_origin_line = cd.rowid";
|
$sql .= " AND ld.fk_origin_line = cd.rowid";
|
||||||
$sql .= " AND cd.fk_".$this->linked_object[0]['type']." = c.rowid";
|
$sql .= " AND cd.fk_".$this->linked_objects[0]['type']." = c.rowid";
|
||||||
$sql .= " AND cd.fk_".$this->linked_object[0]['type']." = ".((int) $this->linked_object[0]['linkid']);
|
$sql .= " AND cd.fk_".$this->linked_objects[0]['type']." = ".((int) $this->linked_objects[0]['linkid']);
|
||||||
$sql .= " AND ld.fk_origin_line = ".((int) $objSourceLine->rowid);
|
$sql .= " AND ld.fk_origin_line = ".((int) $objSourceLine->rowid);
|
||||||
$sql .= " GROUP BY ld.fk_origin_line";
|
$sql .= " GROUP BY ld.fk_origin_line";
|
||||||
|
|
||||||
|
|||||||
@ -120,13 +120,12 @@ class ExpenseReportIk extends CommonObject
|
|||||||
public function fetch($id, $ref = null)
|
public function fetch($id, $ref = null)
|
||||||
{
|
{
|
||||||
$result = $this->fetchCommon($id, $ref);
|
$result = $this->fetchCommon($id, $ref);
|
||||||
if ($result > 0 && !empty($this->table_element_line)) {
|
|
||||||
$this->fetchLines();
|
|
||||||
}
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update object into database
|
* Update object into database
|
||||||
*
|
*
|
||||||
|
|||||||
@ -171,6 +171,19 @@ class ExpenseReportRule extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load object lines in memory from the database
|
||||||
|
*
|
||||||
|
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||||
|
*/
|
||||||
|
public function fetchLines()
|
||||||
|
{
|
||||||
|
$this->lines = array();
|
||||||
|
|
||||||
|
$result = $this->fetchLinesCommon();
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update object into database
|
* Update object into database
|
||||||
*
|
*
|
||||||
|
|||||||
@ -198,15 +198,15 @@ if ($action=='downfield' || $action=='upfield')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
if ($action == 'builddoc') {
|
// if ($action == 'builddoc') {
|
||||||
// Build import file
|
// // Build import file
|
||||||
$result = $objimport->build_file($user, GETPOST('model', 'alpha'), $datatoimport, $array_match_file_to_database);
|
// $result = $objimport->build_file($user, GETPOST('model', 'alpha'), $datatoimport, $array_match_file_to_database);
|
||||||
if ($result < 0) {
|
// if ($result < 0) {
|
||||||
setEventMessages($objimport->error, $objimport->errors, 'errors');
|
// setEventMessages($objimport->error, $objimport->errors, 'errors');
|
||||||
} else {
|
// } else {
|
||||||
setEventMessages($langs->trans("FileSuccessfullyBuilt"), null, 'mesgs');
|
// setEventMessages($langs->trans("FileSuccessfullyBuilt"), null, 'mesgs');
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if ($action == 'deleteprof') {
|
if ($action == 'deleteprof') {
|
||||||
if (GETPOST("id", 'int')) {
|
if (GETPOST("id", 'int')) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user