From 93b7fef267c71e6c5a95b765f7626c4d4a4b5f15 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 6 Sep 2005 10:19:46 +0000 Subject: [PATCH] Modif lien vers les factures --- htdocs/telephonie/client/factures.php | 36 ++++++--------------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/htdocs/telephonie/client/factures.php b/htdocs/telephonie/client/factures.php index 18caf491d88..2ce1f57145f 100644 --- a/htdocs/telephonie/client/factures.php +++ b/htdocs/telephonie/client/factures.php @@ -99,14 +99,15 @@ if ($_GET["id"]) $pageprev = $page - 1; $pagenext = $page + 1; - $sql = "SELECT f.rowid, f.date, f.ligne, f.fourn_montant, f.cout_vente, f.cout_vente_remise, f.gain, f.fk_facture"; + $sql = "SELECT f.rowid, f.date, sum(f.cout_vente) as cout_vente, f.fk_facture"; $sql .= " ,s.nom, s.idp"; $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_facture as f"; $sql .= " , ".MAIN_DB_PREFIX."societe as s"; $sql .= " , ".MAIN_DB_PREFIX."telephonie_societe_ligne as l"; $sql .= " WHERE s.idp = l.fk_soc_facture AND l.rowid = f.fk_ligne"; - $sql .= " AND s.idp = ".$soc->id; + $sql .= " AND s.idp = ".$soc->id; + $sql .= " GROUP BY f.fk_facture"; $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); $resql = $db->query($sql); @@ -116,10 +117,9 @@ if ($_GET["id"]) $i = 0; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print "\n"; $var=True; @@ -131,32 +131,10 @@ if ($_GET["id"]) print ""; - print '\n"; print '\n"; - print '\n"; - print '\n"; - - print '\n"; + print '\n"; - print '\n"; - - - print '\n"; + print '\n"; print "\n"; $i++; }
Ligne
DateMontant HTCoût fournisseur HT'; - print 'GainMargeFactureFacture
'.dolibarr_print_phone($obj->ligne)."'.$obj->date."'.sprintf("%01.4f",$obj->cout_vente_remise)."'.sprintf("%01.4f",$obj->fourn_montant)."'; - if ($obj->gain < 0 && $obj->cout_vente_remise) - { - print ''; - print sprintf("%01.2f",$obj->gain); - print ""; - } - else - { - print sprintf("%01.2f",$obj->gain); - } - print "'.sprintf("%01.4f",$obj->cout_vente)."'; - - print sprintf("%01.2f %%",($obj->gain / $obj->cout_vente_remise * 100)); - - print "'.$obj->fk_facture."'.$obj->fk_facture."