From 9c8b4cfeeddc1d0edd5ef48dbc75e7ca31ea3e2c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 11 Sep 2006 19:05:49 +0000 Subject: [PATCH] =?UTF-8?q?Ajout:=20manquait=20la=20ref=20et=20le=20libell?= =?UTF-8?q?=E9=20du=20produit=20dans=20les=20listes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/ventilation/lignes.php | 28 +++++++++++++++++----------- htdocs/compta/ventilation/liste.php | 16 +++++++++++----- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/htdocs/compta/ventilation/lignes.php b/htdocs/compta/ventilation/lignes.php index 2026981484b..ff78392a98d 100644 --- a/htdocs/compta/ventilation/lignes.php +++ b/htdocs/compta/ventilation/lignes.php @@ -50,11 +50,12 @@ if ($page < 0) $page = 0; $limit = $conf->liste_limit; $offset = $limit * $page ; -$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_taux, l.fk_code_ventilation, c.intitule, c.numero "; -$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as l"; +$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_taux, l.fk_code_ventilation, c.intitule, c.numero"; +$sql .= ",p.rowid as product_id, p.ref as product_ref, p.label as product_label"; +$sql .= " FROM (".MAIN_DB_PREFIX."facturedet as l"; $sql .= " , ".MAIN_DB_PREFIX."facture as f"; -$sql .= " , ".MAIN_DB_PREFIX."compta_compte_generaux as c"; - +$sql .= " , ".MAIN_DB_PREFIX."compta_compte_generaux as c)"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON (p.rowid = l.fk_product)"; $sql .= " WHERE f.rowid = l.fk_facture AND f.fk_statut = 1 AND l.fk_code_ventilation <> 0 "; $sql .= " AND c.rowid = l.fk_code_ventilation"; @@ -77,15 +78,18 @@ if ($result) print '
'; print ''; - print ""; + print ''; + print ''; + print ''; print ''; - print ''; - print ''; + print ''; + print ''; print "\n"; print ''; print ''; print ''; + print ''; print ''; print '"; print ''; - + print ''; + print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; print ""; $i++; diff --git a/htdocs/compta/ventilation/liste.php b/htdocs/compta/ventilation/liste.php index b848955352c..2d4e2d9189d 100644 --- a/htdocs/compta/ventilation/liste.php +++ b/htdocs/compta/ventilation/liste.php @@ -53,9 +53,11 @@ if ($page < 0) $page = 0; $limit = $conf->liste_limit; $offset = $limit * $page ; -$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price, l.rowid, l.fk_code_ventilation "; -$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as l"; -$sql .= " , ".MAIN_DB_PREFIX."facture as f"; +$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price, l.rowid, l.fk_code_ventilation"; +$sql .= ",p.rowid as product_id, p.ref as product_ref, p.label as product_label"; +$sql .= " FROM (".MAIN_DB_PREFIX."facturedet as l"; +$sql .= " , ".MAIN_DB_PREFIX."facture as f)"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON (p.rowid = l.fk_product)"; $sql .= " WHERE f.rowid = l.fk_facture AND f.fk_statut = 1 AND fk_code_ventilation = 0"; $sql .= " ORDER BY l.rowid DESC ".$db->plimit($limit+1,$offset); @@ -68,9 +70,11 @@ if ($result) print_barre_liste("Lignes de facture à ventiler",$page,"liste.php","",$sortfield,$sortorder,'',$num_lignes); print '
Facture
'.$langs->trans("Invoice").''.$langs->trans("Ref").''.$langs->trans("Label").''.$langs->trans("Description").''.$langs->trans("Montant").''.$langs->trans("Compte").''.$langs->trans("Montant").''.$langs->trans("Compte").'
    '; print ''; @@ -97,14 +101,16 @@ if ($result) { $objp = $db->fetch_object($result); $var=!$var; + $codeCompta = $objp->numero.' '.stripslashes($objp->intitule); + print "
'.$objp->facnumber.''.stripslashes($objp->product_ref).''.stripslashes($objp->product_label).''.stripslashes(nl2br($objp->description)).''.price($objp->price).''.$objp->numero.''.stripslashes($objp->intitule).''.price($objp->price).''.$codeCompta.'
'; - print ''; + print ''; + print ''; + print ''; print ''; - print ''; + print ''; print ''; print "\n"; @@ -82,6 +86,8 @@ if ($result) print ""; print ''; + print ''; + print ''; print ''; print '
Facture
'.$langs->trans("Invoice").''.$langs->trans("Ref").''.$langs->trans("Label").''.$langs->trans("Description").' '.$langs->trans("Montant").' 
'.$objp->facnumber.''.stripslashes($objp->product_ref).''.stripslashes($objp->product_label).''.stripslashes(nl2br($objp->description)).'';