Merge pull request #5903 from atm-gauthier/FIX_thirdparty_margin

FIX : margin tab on customer card must filter on current entity invoices
This commit is contained in:
Laurent Destailleur 2016-10-24 03:18:37 +02:00 committed by GitHub
commit e4da87d31c

View File

@ -152,7 +152,7 @@ if ($socid > 0)
$sql.= ", ".MAIN_DB_PREFIX."facturedet as d";
$sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " AND f.fk_statut > 0";
$sql.= " AND s.entity = ".$conf->entity;
$sql.= " AND f.entity = ".$conf->entity;
$sql.= " AND d.fk_facture = f.rowid";
$sql.= " AND f.fk_soc = $socid";
$sql.= " AND d.buy_price_ht IS NOT NULL";