Merge pull request #9959 from hregis/8.0_bug

FIX export only prices of the current entity !
This commit is contained in:
Laurent Destailleur 2018-11-08 19:26:09 +01:00 committed by GitHub
commit 01baddb096
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -229,7 +229,7 @@ class modProduct extends DolibarrModules
'pr.date_price'=>"product");
$this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_price as pr ON p.rowid = pr.fk_product';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_price as pr ON p.rowid = pr.fk_product AND pr.entity = '.$conf->entity; // export prices only for the current entity
$this->export_sql_end[$r] .=' WHERE p.fk_product_type = 0 AND p.entity IN ('.getEntity('product').')';
}