From be328dc2212af91697656cd722b00a1a2a9435ab Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sat, 28 Jun 2003 19:33:33 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20liens=20et=20modif=20titres=20de=20la?= =?UTF-8?q?=20boite=20Factures=20=E0=20payer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/index.php3 | 50 ++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/htdocs/compta/index.php3 b/htdocs/compta/index.php3 index c55368290ee..1adf061c6fa 100644 --- a/htdocs/compta/index.php3 +++ b/htdocs/compta/index.php3 @@ -50,14 +50,22 @@ function valeur($sql) { $db = new Db(); -if ($action == 'add_bookmark') { +if ($action == 'add_bookmark') +{ + $sql = "DELETE FROM llx_bookmark WHERE fk_soc = ".$socidp." AND fk_user=".$user->id; + if (! $db->query($sql) ) + { + print $db->error(); + } $sql = "INSERT INTO llx_bookmark (fk_soc, dateb, fk_user) VALUES ($socidp, now(),".$user->id.");"; - if (! $db->query($sql) ) { - print $db->error(); - } + if (! $db->query($sql) ) + { + print $db->error(); + } } -if ($action == 'del_bookmark') { +if ($action == 'del_bookmark') +{ $sql = "DELETE FROM llx_bookmark WHERE rowid=$bid"; $result = $db->query($sql); } @@ -176,7 +184,8 @@ $sql .= " FROM llx_societe as s, llx_bookmark as b"; $sql .= " WHERE b.fk_soc = s.idp AND b.fk_user = ".$user->id; $sql .= " ORDER BY lower(s.nom) ASC"; -if ( $db->query($sql) ) { +if ( $db->query($sql) ) +{ $num = $db->num_rows(); $i = 0; @@ -185,16 +194,17 @@ if ( $db->query($sql) ) { print "Bookmark"; print "\n"; - while ($i < $num) { - $obj = $db->fetch_object( $i); - $var = !$var; - print ""; - print ''.$obj->nom.''; - print ''; - print ''; - print ''; - $i++; - } + while ($i < $num) + { + $obj = $db->fetch_object( $i); + $var = !$var; + print ""; + print ''.$obj->nom.''; + print ''; + print ''; + print ''; + $i++; + } print ''; } /* @@ -233,12 +243,12 @@ if ( $result ) { /* - * Charges a payer + * Factures a payer * */ if ($user->societe_id == 0) { - $sql = "SELECT ff.amount, ff.libelle"; + $sql = "SELECT ff.total_ttc as amount, ff.libelle, ff.rowid"; $sql .= " FROM llx_facture_fourn as ff"; $sql .= " WHERE ff.paye=0"; @@ -249,7 +259,7 @@ if ($user->societe_id == 0) { print ''; print ''; - print ''; + print ''; print "\n"; $i = 0; @@ -258,7 +268,7 @@ if ($user->societe_id == 0) $obj = $db->fetch_object( $i); $var = !$var; print ""; - print ''; + print ''; print ''; print ''; $i++;
Charges à payerFactures à payer
'.$obj->libelle.''.$obj->libelle.''.price($obj->amount).'