From c71788ef03907a0cd1fad83766581156b2515e07 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 1 Sep 2003 12:15:10 +0000 Subject: [PATCH] Ajout la liste des produits --- htdocs/compta/propal.php3 | 101 ++++++++++++++++++++++++++------------ 1 file changed, 69 insertions(+), 32 deletions(-) diff --git a/htdocs/compta/propal.php3 b/htdocs/compta/propal.php3 index 3237b8426cd..0879f36c90f 100644 --- a/htdocs/compta/propal.php3 +++ b/htdocs/compta/propal.php3 @@ -198,10 +198,10 @@ if ($propalid) $result = $db->query($sql); if ($result) { - $num = $db->num_rows(); + $num_fac_asso = $db->num_rows(); $i = 0; $total = 0; print "
"; - if ($num > 1) + if ($num_fac_asso > 1) { print_titre("Factures associées"); } @@ -211,14 +211,14 @@ if ($propalid) } print ''; print ""; - print ""; + print ""; print ""; print ""; print ''; print "\n"; $var=True; - while ($i < $num) + while ($i < $num_fac_asso) { $objp = $db->fetch_object( $i); $var=!$var; @@ -267,17 +267,16 @@ if ($propalid) print ''; } - print ""; - print ""; + print ''; + print ''; - - if ($obj->statut == 2) + if ($obj->statut == 2 && $num_fac_asso) { print ""; } else { - print ""; + print ''; } print "
NumNuméroDateAuteurPrix
-----[Facturée]--
"; } @@ -289,39 +288,77 @@ if ($propalid) print "Num rows = " . $db->num_rows(); print "

$sql"; } + + /* + * Produits + */ + print_titre("Produits"); + + print ''; + print ""; + print ""; + print ''; + + $sql = "SELECT pt.rowid, p.label as product, p.ref, pt.price, pt.qty, p.rowid as prodid"; + $sql .= " FROM llx_propaldet as pt, llx_product as p WHERE pt.fk_product = p.rowid AND pt.fk_propal = $propalid"; + + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows(); + $i = 0; + $var=True; + while ($i < $num) + { + $objp = $db->fetch_object($i); + $var=!$var; + print "\n"; + print ''; + print ""; + print ''; + print "\n"; + $i++; + } + } + print '
RéfProduitPrix Qté.
[$objp->ref]'.$objp->product.'".price($objp->price)." ".$objp->qty."
'; + + /* * Voir le suivi des actions * * * */ - if ($suivi) { - $validor = new User($db, $obj->fk_user_valid); - $validor->fetch(''); - $cloturor = new User($db, $obj->fk_user_cloture); - $cloturor->fetch(''); - - print '

Cacher le suivi des actions '; - print ''; - print ''; - print ''; - print ''; - - print ''; - print ''; - - print ''; - print ''; - print '
 NomDate
Création'.$author->fullname.''.$obj->datec.'
Validation'.$validor->fullname.' '.$obj->date_valid.' 
Cloture'.$cloturor->fullname.' '.$obj->date_cloture.' 
'; - } else { - print '

Voir le suivi des actions '; - } - + if ($suivi) + { + $validor = new User($db, $obj->fk_user_valid); + $validor->fetch(''); + $cloturor = new User($db, $obj->fk_user_cloture); + $cloturor->fetch(''); + + print '

Cacher le suivi des actions '; + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + + print ''; + print ''; + print '
 NomDate
Création'.$author->fullname.''.$obj->datec.'
Validation'.$validor->fullname.' '.$obj->date_valid.' 
Cloture'.$cloturor->fullname.' '.$obj->date_cloture.' 
'; + } + else + { + print '

Voir le suivi des actions '; + } + } else { print $db->error(); print "

$sql"; } - + /* *