From c48231935b0133fc29573a0237e9bf7913621761 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sat, 30 Aug 2003 11:45:47 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20formulaire=20d'ajout=20de=20produit=20g?= =?UTF-8?q?=E9n=E9rique=20Les=20utilisateurs=20l'attendent=20;-)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/propal.php3 | 68 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 65 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal.php3 b/htdocs/comm/propal.php3 index e00527c4c68..2a1d54f86ba 100644 --- a/htdocs/comm/propal.php3 +++ b/htdocs/comm/propal.php3 @@ -128,6 +128,20 @@ if ($HTTP_POST_VARS["action"] == 'addligne' && $user->rights->propale->creer) } } +if ($HTTP_POST_VARS["action"] == 'addproduct' && $user->rights->propale->creer) +{ + /* + * Ajout d'une ligne produit dans la propale + */ + $propal = new Propal($db); + $propal->id = $propalid; + $propal->insert_product_generic($HTTP_POST_VARS["np_desc"], + $HTTP_POST_VARS["np_price"], + $HTTP_POST_VARS["np_qty"], + $HTTP_POST_VARS["np_tva_tx"]); +} + + if ($action == 'del_ligne' && $user->rights->propale->creer) { /* @@ -334,6 +348,36 @@ if ($propalid) } } + + $sql = "SELECT pt.rowid, pt.description, pt.price, pt.qty"; + $sql .= " FROM llx_propaldet as pt WHERE pt.fk_propal = $propalid AND pt.fk_product = 0"; + + $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 ''.$objp->description.''; + print "".price($objp->price)."".$objp->qty."\n"; + if ($obj->statut == 0 && $user->rights->propale->creer) + { + print 'Supprimer'; + } + else + { + print '-'; + } + print ""; + $i++; + } + } + if ($obj->statut == 0 && $user->rights->propale->creer) { @@ -357,14 +401,32 @@ if ($propalid) { print $db->error(); } + + /* + * Produits génériques + * + */ + $var=!$var; + print '
'; + print ''; + print ''; + print ' '; + print ''; + print ''; + print ''; + print ''; + print '
'; + + $var=!$var; print '
'; print ''; - print ""; - print ''; - print ''; + print " "; + print ''; + print ''; print "\n"; print '
'; + } print "";