diff --git a/htdocs/includes/modules/modCommande.class.php b/htdocs/includes/modules/modCommande.class.php index 0c9b276ffcf..9f7cc1f38ea 100644 --- a/htdocs/includes/modules/modCommande.class.php +++ b/htdocs/includes/modules/modCommande.class.php @@ -175,7 +175,7 @@ class modCommande extends DolibarrModules $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'commande as c, '.MAIN_DB_PREFIX.'commandedet as cd, '.MAIN_DB_PREFIX.'societe as s)'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (cd.fk_product = p.rowid)'; $this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_commande'; - $this->export_sql_end[$r] .=' AND s.entity = '.$conf->entity; + $this->export_sql_end[$r] .=' AND c.entity = '.$conf->entity; } diff --git a/htdocs/includes/modules/modFacture.class.php b/htdocs/includes/modules/modFacture.class.php index 64388b5a006..ed30ef841fc 100644 --- a/htdocs/includes/modules/modFacture.class.php +++ b/htdocs/includes/modules/modFacture.class.php @@ -196,7 +196,7 @@ class modFacture extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement as p ON pf.fk_paiement = p.rowid'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid'; - $this->export_sql_end[$r] .=' AND s.entity = '.$conf->entity; + $this->export_sql_end[$r] .=' AND f.entity = '.$conf->entity; $r++; } diff --git a/htdocs/includes/modules/modFicheinter.class.php b/htdocs/includes/modules/modFicheinter.class.php index 94d80f20644..b65ac94fa39 100644 --- a/htdocs/includes/modules/modFicheinter.class.php +++ b/htdocs/includes/modules/modFicheinter.class.php @@ -141,7 +141,7 @@ class modFicheinter extends DolibarrModules $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'fichinter as f, '.MAIN_DB_PREFIX.'fichinterdet as fd, '.MAIN_DB_PREFIX.'societe as s)'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_fichinter'; - $this->export_sql_end[$r] .=' AND s.entity = '.$conf->entity; + $this->export_sql_end[$r] .=' AND f.entity = '.$conf->entity; $r++; } diff --git a/htdocs/includes/modules/modFournisseur.class.php b/htdocs/includes/modules/modFournisseur.class.php index b4ad72d6b2d..d6b08b43ae3 100644 --- a/htdocs/includes/modules/modFournisseur.class.php +++ b/htdocs/includes/modules/modFournisseur.class.php @@ -263,7 +263,7 @@ class modFournisseur extends DolibarrModules $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'facture_fourn as f, '.MAIN_DB_PREFIX.'facture_fourn_det as fd, '.MAIN_DB_PREFIX.'societe as s)'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture_fourn'; - $this->export_sql_end[$r] .=' AND s.entity = '.$conf->entity; + $this->export_sql_end[$r] .=' AND f.entity = '.$conf->entity; $r++; $this->export_code[$r]=$this->rights_class.'_'.$r; @@ -279,7 +279,7 @@ class modFournisseur extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn as p ON pf.fk_paiementfourn = p.rowid'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid'; - $this->export_sql_end[$r] .=' AND s.entity = '.$conf->entity; + $this->export_sql_end[$r] .=' AND f.entity = '.$conf->entity; } diff --git a/htdocs/includes/modules/modPropale.class.php b/htdocs/includes/modules/modPropale.class.php index 30c20e62bf9..82ddcddb903 100644 --- a/htdocs/includes/modules/modPropale.class.php +++ b/htdocs/includes/modules/modPropale.class.php @@ -153,7 +153,7 @@ class modPropale extends DolibarrModules $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'propal as c, '.MAIN_DB_PREFIX.'propaldet as cd, '.MAIN_DB_PREFIX.'societe as s)'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (cd.fk_product = p.rowid)'; $this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_propal'; - $this->export_sql_end[$r] .=' AND s.entity = '.$conf->entity; + $this->export_sql_end[$r] .=' AND c.entity = '.$conf->entity; }