From: vincent@cubedesigners.com Date: Thu, 16 Sep 2010 11:58:24 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=f4fb74a0622372d4bcacdab431f1caf262dc2376;p=cubeextranet.git --- diff --git a/inc/extranet/Controlleur/class.extranet.core.php b/inc/extranet/Controlleur/class.extranet.core.php index d5cecedd6..59a07ed90 100644 --- a/inc/extranet/Controlleur/class.extranet.core.php +++ b/inc/extranet/Controlleur/class.extranet.core.php @@ -392,6 +392,8 @@ class extranetCore extends cubeCore { . ' FROM entreprises_inter e LEFT JOIN impayes_entreprises i ON e.entreprise_id=i.entreprise'); $this->views->createView('clients_entreprise', 'SELECT u.*,e.nom AS rs, e.adresse_facturation AS adresse_facturation ' . 'FROM entreprises e LEFT JOIN utilisateurs u ON u.entreprise=e.entreprise_id AND u.grade=0'); + $this->views->createView('utilisateurs_entreprise', 'SELECT u.*,e.nom AS rs, e.adresse_facturation AS adresse_facturation ' + . 'FROM entreprises e LEFT JOIN utilisateurs u ON u.entreprise=e.entreprise_id'); $this->views->createView('clients', 'SELECT u.*,e.nom AS rs, e.adresse_facturation AS adresse_facturation, i.impaye, ' . 'SUM(f.total_ht) AS ca ' . 'FROM entreprises e LEFT JOIN impayes_entreprises i ON e.entreprise_id=i.entreprise LEFT JOIN utilisateurs u ON u.entreprise=e.entreprise_id AND u.grade=0 LEFT JOIN projets p ON p.client=u.utilisateur_id LEFT JOIN factures f ON f.projet=p.projet_id AND f.status IN(1,2) ' @@ -418,14 +420,14 @@ class extranetCore extends cubeCore { . 'IF(YEAR(FROM_UNIXTIME(projets.date_fin))=1970,YEAR(NOW()),YEAR(FROM_UNIXTIME(projets.date_fin))) AS annee_fin,' . 'clients.rs AS client,equipiers.prenom AS chef,equipiers.utilisateur_id AS chef_id,clients.utilisateur_id AS client_id ' . 'FROM projets,clients_entreprise clients,equipiers ' - . 'WHERE clients.utilisateur_id=projets.client AND equipiers.utilisateur_id=projets.chef','TEMPTABLE'); + . 'WHERE clients.utilisateur_id=projets.client AND equipiers.utilisateur_id=projets.chef', 'TEMPTABLE'); $this->views->createView('projets_inter1', 'SELECT projets.*,taches.jours_prevus,taches.jours_consommes,taches.progression,taches.budget AS budget, ' . 'IF(taches.budget>0,SUM(factures_valides.total_ht)/taches.budget,1) AS rapport_facturation, ' . 'SUM(factures_valides.total_ht) AS montant_facture ' . 'FROM projets_inter projets ' . 'LEFT JOIN taches_projet taches ON taches.projet=projets.projet_id ' . 'LEFT JOIN factures_valides ON factures_valides.projet=projets.projet_id ' - . 'GROUP BY projets.projet_id,factures_valides.projet','TEMPTABLE'); + . 'GROUP BY projets.projet_id,factures_valides.projet', 'TEMPTABLE'); $this->views->createView('projets_vue', 'SELECT p.*,SUM(f.total_ht) AS montant_paye, ' . 'IF(p.budget>0,SUM(f.total_ht)/p.budget,1) AS rapport_paiement ' . 'FROM projets_inter1 p ' @@ -450,7 +452,7 @@ class extranetCore extends cubeCore { . 'WHERE t.projet=p.projet_id ' . 'GROUP BY t.categorie,p.annee_fin'); $this->views->createView('books_vue', 'SELECT b.*,b.proprietaire AS proprietaire_id,c.rs AS proprietaire_nom,c.ws_admin ' - . 'FROM books b, clients_entreprise c WHERE b.proprietaire=c.utilisateur_id', 'TEMPTABLE'); + . 'FROM books b, utilisateurs_entreprise c WHERE b.proprietaire=c.utilisateur_id', 'TEMPTABLE'); $this->views->createView('themes_vue', 'SELECT t.*,COUNT(*) AS nb_books,GROUP_CONCAT(DISTINCT b.book_id) AS books ' . 'FROM themes t ' . 'LEFT JOIN books b ON t.theme_id=b.theme '