diff --git a/htdocs/telephonie/client/fiche.php b/htdocs/telephonie/client/fiche.php index 612ffa3ceb9..717f75b3273 100644 --- a/htdocs/telephonie/client/fiche.php +++ b/htdocs/telephonie/client/fiche.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2005 Rodolphe Quiedeville * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -46,10 +46,14 @@ if ($_GET["id"]) { $h=0; $head[$h][0] = DOL_URL_ROOT."/telephonie/client/fiche.php?id=".$soc->id; - $head[$h][1] = $langs->trans("Lignes"); + $head[$h][1] = $langs->trans("Contrats"); $hselected = $h; $h++; + $head[$h][0] = DOL_URL_ROOT."/telephonie/client/lignes.php?id=".$soc->id; + $head[$h][1] = $langs->trans("Lignes"); + $h++; + $head[$h][0] = DOL_URL_ROOT."/telephonie/client/factures.php?id=".$soc->id; $head[$h][1] = $langs->trans("Factures"); $h++; @@ -81,18 +85,16 @@ if ($_GET["id"]) print ''; - //print ''; - //print ''; - /* Lignes */ - $sql = "SELECT s.idp as socidp, s.nom, l.ligne, f.nom as fournisseur, l.statut, l.rowid, l.remise, ss.nom as agence"; - $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."telephonie_societe_ligne as l"; + $sql = "SELECT count(l.rowid) as cc, c.rowid, c.ref, ss.nom as agence"; + $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne as l"; + $sql .= " , ".MAIN_DB_PREFIX."telephonie_contrat as c"; $sql .= " , ".MAIN_DB_PREFIX."societe as ss"; - $sql .= " , ".MAIN_DB_PREFIX."telephonie_fournisseur as f"; - $sql .= " WHERE l.fk_client_comm = s.idp AND l.fk_fournisseur = f.rowid"; - $sql .= " AND l.fk_soc = ss.idp "; - $sql .= " AND s.idp = ".$soc->id; + $sql .= " WHERE c.fk_client_comm = ".$soc->id; + $sql .= " AND c.fk_soc = ss.idp "; + $sql .= " AND l.fk_contrat = c.rowid"; + $sql .= " GROUP BY c.rowid"; if ( $db->query( $sql) ) { @@ -103,10 +105,8 @@ if ($_GET["id"]) $ligne = new LigneTel($db); - print ''; - + print ''; print "\n"; while ($i < $num) @@ -116,20 +116,17 @@ if ($_GET["id"]) print "\n"; + print ''.$obj->ref."\n"; print '\n"; - print '\n"; - print '\n"; - print "\n"; + print '\n"; + print "\n"; $i++; }
Numéro'.dolibarr_print_phone($ligne->numero).'Facturée : '.$ligne->facturable.'
Ligne'; - print 'Agence/FilialeStatutRemise LMN'; - print 'Fournisseur
Contrat'; + print 'Agence/FilialeNb Lignes
"; - print ' '; - - print ''; + print ''; print img_file(); print ' '; - print ''.dolibarr_print_phone($obj->ligne)."'.$obj->agence."'.$ligne->statuts[$obj->statut]."'.$obj->remise." %".$obj->fournisseur."'.$obj->cc."