Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 10.0
This commit is contained in:
commit
efb506ba7f
@ -222,7 +222,7 @@ if ($socid > 0)
|
|||||||
$sql.= " u.login, u.rowid as user_id";
|
$sql.= " u.login, u.rowid as user_id";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe_remise as rc, ".MAIN_DB_PREFIX."user as u";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe_remise as rc, ".MAIN_DB_PREFIX."user as u";
|
||||||
$sql.= " WHERE rc.fk_soc = " . $object->id;
|
$sql.= " WHERE rc.fk_soc = " . $object->id;
|
||||||
$sql.= " AND rc.entity = " . $conf->entity;
|
$sql.= " AND rc.entity IN (".getEntity('discount').")";
|
||||||
$sql.= " AND u.rowid = rc.fk_user_author";
|
$sql.= " AND u.rowid = rc.fk_user_author";
|
||||||
$sql.= " ORDER BY rc.datec DESC";
|
$sql.= " ORDER BY rc.datec DESC";
|
||||||
|
|
||||||
@ -281,7 +281,7 @@ if ($socid > 0)
|
|||||||
$sql.= " u.login, u.rowid as user_id";
|
$sql.= " u.login, u.rowid as user_id";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_supplier as rc, ".MAIN_DB_PREFIX."user as u";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_supplier as rc, ".MAIN_DB_PREFIX."user as u";
|
||||||
$sql.= " WHERE rc.fk_soc = " . $object->id;
|
$sql.= " WHERE rc.fk_soc = " . $object->id;
|
||||||
$sql.= " AND rc.entity = " . $conf->entity;
|
$sql.= " AND rc.entity IN (".getEntity('discount').")";
|
||||||
$sql.= " AND u.rowid = rc.fk_user_author";
|
$sql.= " AND u.rowid = rc.fk_user_author";
|
||||||
$sql.= " ORDER BY rc.datec DESC";
|
$sql.= " ORDER BY rc.datec DESC";
|
||||||
|
|
||||||
|
|||||||
@ -79,7 +79,7 @@ class FactureStats extends Stats
|
|||||||
$this->field_line='total_ht';
|
$this->field_line='total_ht';
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->where = " f.fk_statut > 0";
|
$this->where = " f.fk_statut >= 0";
|
||||||
$this->where.= " AND f.entity IN (".getEntity('invoice').")";
|
$this->where.= " AND f.entity IN (".getEntity('invoice').")";
|
||||||
if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
if ($mode == 'customer') $this->where.=" AND (f.fk_statut <> 3 OR f.close_code <> 'replaced')"; // Exclude replaced invoices as they are duplicated (we count closed invoices for other reasons)
|
if ($mode == 'customer') $this->where.=" AND (f.fk_statut <> 3 OR f.close_code <> 'replaced')"; // Exclude replaced invoices as they are duplicated (we count closed invoices for other reasons)
|
||||||
|
|||||||
@ -1287,7 +1287,7 @@ class Societe extends CommonObject
|
|||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid';
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid';
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as te ON s.fk_typent = te.id';
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as te ON s.fk_typent = te.id';
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON s.fk_incoterms = i.rowid';
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON s.fk_incoterms = i.rowid';
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_remise as sr ON sr.rowid = (SELECT MAX(rowid) FROM '.MAIN_DB_PREFIX.'societe_remise WHERE fk_soc = s.rowid AND entity = '.$conf->entity.')';
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_remise as sr ON sr.rowid = (SELECT MAX(rowid) FROM '.MAIN_DB_PREFIX.'societe_remise WHERE fk_soc = s.rowid AND entity IN ('.getEntity('discount').'))';
|
||||||
|
|
||||||
$sql .= ' WHERE s.entity IN ('.getEntity($this->element).')';
|
$sql .= ' WHERE s.entity IN ('.getEntity($this->element).')';
|
||||||
if ($rowid) $sql .= ' AND s.rowid = '.$rowid;
|
if ($rowid) $sql .= ' AND s.rowid = '.$rowid;
|
||||||
|
|||||||
@ -168,12 +168,15 @@ if ($_POST) {
|
|||||||
$bulkaction = $massaction;
|
$bulkaction = $massaction;
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$prodstatic = new Product($db);
|
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
foreach ($toselect as $prodid) {
|
foreach ($toselect as $prodid) {
|
||||||
|
|
||||||
|
// need create new of Product to prevent rename dir behavior
|
||||||
|
$prodstatic = new Product($db);
|
||||||
|
|
||||||
if ($prodstatic->fetch($prodid) < 0) {
|
if ($prodstatic->fetch($prodid) < 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user