Fix some regressions
This commit is contained in:
parent
52bacbd914
commit
9ba998e3ba
@ -3018,16 +3018,12 @@ class CommandeFournisseur extends CommonOrder
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
$clause = " WHERE";
|
||||
|
||||
$sql = "SELECT c.rowid, c.date_creation as datec, c.date_commande, c.fk_statut, c.date_livraison as delivery_date, c.total_ht";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c";
|
||||
if (empty($user->rights->societe->client->voir) && !$user->socid) {
|
||||
$sql .= " JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON c.fk_soc = sc.fk_soc";
|
||||
$sql .= " WHERE sc.fk_user = ".((int) $user->id);
|
||||
$clause = " AND";
|
||||
$sql .= " JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
$sql .= $clause." c.entity = ".$conf->entity;
|
||||
$sql .= " WHERE c.entity = ".$conf->entity;
|
||||
if ($mode === 'awaiting') {
|
||||
$sql .= " AND c.fk_statut IN (".self::STATUS_ORDERSENT.", ".self::STATUS_RECEIVED_PARTIALLY.")";
|
||||
} else {
|
||||
|
||||
@ -2631,17 +2631,13 @@ class FactureFournisseur extends CommonInvoice
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
$clause = " WHERE";
|
||||
|
||||
$sql = 'SELECT ff.rowid, ff.date_lim_reglement as datefin, ff.fk_statut, ff.total_ht';
|
||||
$sql = 'SELECT ff.rowid, ff.date_lim_reglement as datefin, ff.fk_statut';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as ff';
|
||||
if (empty($user->rights->societe->client->voir) && !$user->socid) {
|
||||
$sql .= " JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ff.fk_soc = sc.fk_soc";
|
||||
$sql .= " WHERE sc.fk_user = ".((int) $user->id);
|
||||
$clause = " AND";
|
||||
$sql .= " JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ff.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
$sql .= $clause.' ff.paye=0';
|
||||
$sql .= ' AND ff.fk_statut = '.self::STATUS_VALIDATED;
|
||||
$sql .= ' WHERE ff.paye = 0';
|
||||
$sql .= ' AND ff.fk_statut > 0';
|
||||
$sql .= " AND ff.entity = ".$conf->entity;
|
||||
if ($user->socid) {
|
||||
$sql .= ' AND ff.fk_soc = '.((int) $user->socid);
|
||||
@ -3625,8 +3621,8 @@ class SupplierInvoiceLine extends CommonObjectLine
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det SET";
|
||||
$sql .= ' description ="'.$this->db->escape($this->description).'"';
|
||||
$sql .= ", ref ='".$this->db->escape($this->ref_supplier ? $this->ref_supplier : $this->ref)."'";
|
||||
$sql .= " description = '".$this->db->escape($this->description)."'";
|
||||
$sql .= ", ref = '".$this->db->escape($this->ref_supplier ? $this->ref_supplier : $this->ref)."'";
|
||||
$sql .= ", date_start = ".($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : "null");
|
||||
$sql .= ", date_end = ".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : "null");
|
||||
$sql .= ", pu_ht = ".price2num($this->pu_ht);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user