diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index 68170bd19df..a95e9c3b95f 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -128,7 +128,7 @@ if ($id > 0 || ! empty($ref)) if ($user->rights->commande->lire) { - $sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client, c.rowid, c.total_ht as total_ht, c.ref,"; + $sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client, c.rowid, d.total_ht as total_ht, c.ref,"; $sql .= " c.ref_client,"; $sql.= " c.date_commande, c.fk_statut as statut, c.facture, c.rowid as commandeid, d.qty"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index f5b362d5423..3ab51e75701 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -136,7 +136,7 @@ if ($id > 0 || ! empty($ref)) { if ($user->rights->fournisseur->commande->lire) { $sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client,"; - $sql .= " c.rowid, c.total_ht as total_ht, c.ref,"; + $sql .= " c.rowid, d.total_ht as total_ht, c.ref,"; $sql .= " c.date_commande, c.fk_statut as statut, c.rowid as commandeid, d.qty"; if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user "; diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index 8269a7f57da..7f1be2a4621 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -130,7 +130,7 @@ if ($id > 0 || ! empty($ref)) if ($user->rights->facture->lire) { $sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client,"; - $sql.= " f.facnumber, f.total as total_ht,"; + $sql.= " f.facnumber, d.total_ht as total_ht,"; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid, d.qty"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 362e3e1427e..81f23e8fa4c 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -130,7 +130,7 @@ if ($id > 0 || ! empty($ref)) if ($user->rights->fournisseur->facture->lire) { - $sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client, f.ref, f.total_ht as total_ht,"; + $sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client, f.ref, d.total_ht as total_ht,"; $sql .= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid, d.qty"; if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user "; diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index e8fc8e6ee27..ee717890123 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -127,7 +127,7 @@ if ($id > 0 || ! empty($ref)) print ''; if ($user->rights->propale->lire) { - $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, p.total_ht as amount,"; + $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, d.total_ht as amount,"; $sql .= " p.ref_client,"; $sql .= "p.datep, p.fk_statut as statut, d.qty"; if (! $user->rights->societe->client->voir && ! $socid)