diff --git a/htdocs/compta/index.php3 b/htdocs/compta/index.php3 index 76b425f82b1..8bee0c2be82 100644 --- a/htdocs/compta/index.php3 +++ b/htdocs/compta/index.php3 @@ -32,22 +32,9 @@ if ($user->societe_id > 0) llxHeader(); -$db = new Db(); - -function valeur($sql) { - global $db; - if ( $db->query($sql) ) { - if ( $db->num_rows() ) { - $valeur = $db->result(0,0); - } - $db->free(); - } - return $valeur; -} /* * */ -$db = new Db(); if ($action == 'add_bookmark') @@ -130,7 +117,7 @@ if ($user->societe_id == 0) $num = $db->num_rows(); if ($num) { - print ""; + print "
"; print ""; print ""; print "\n"; @@ -158,7 +145,7 @@ if ($user->societe_id == 0) * Factures impayées */ -$sql = "SELECT f.facnumber, f.rowid, s.nom FROM llx_facture as f, llx_societe as s WHERE s.idp = f.fk_soc AND f.paye = 0 AND f.fk_statut > 0"; +$sql = "SELECT f.facnumber, f.rowid, s.nom, s.idp FROM llx_facture as f, llx_societe as s WHERE s.idp = f.fk_soc AND f.paye = 0 AND f.fk_statut > 0"; if ($socidp) { $sql .= " AND f.fk_soc = $socidp"; @@ -179,7 +166,8 @@ if ( $db->query($sql) ) { $obj = $db->fetch_object( $i); $var=!$var; - print '"; + print ''; + print ''; $i++; } print "
Charges à payer
'.$obj->facnumber."".$obj->nom."
'.$obj->facnumber.''.$obj->nom.'

"; @@ -261,7 +249,7 @@ if ( $result ) { * Factures brouillons */ -$sql = "SELECT f.facnumber, f.rowid, s.nom FROM llx_facture as f, llx_societe as s WHERE s.idp = f.fk_soc AND f.fk_statut = 0"; +$sql = "SELECT f.facnumber, f.rowid, s.nom, s.idp FROM llx_facture as f, llx_societe as s WHERE s.idp = f.fk_soc AND f.fk_statut = 0"; if ( $db->query($sql) ) { @@ -278,7 +266,8 @@ if ( $db->query($sql) ) { $obj = $db->fetch_object( $i); $var=!$var; - print ''.$obj->facnumber."".$obj->nom.""; + print ''.$obj->facnumber.''; + print ''.$obj->nom.''; $i++; }