diff --git a/htdocs/compta/index.php3 b/htdocs/compta/index.php3 index 8f3fb33f9d7..c55368290ee 100644 --- a/htdocs/compta/index.php3 +++ b/htdocs/compta/index.php3 @@ -140,14 +140,15 @@ if ($user->comm > 0 && $conf->commercial ) */ print ''; print ""; -print ''; +print ''; print "\n"; -$sql = "SELECT facnumber, rowid FROM llx_facture WHERE paye = 0"; +$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"; if ($socidp) { - $sql .= " AND fk_soc = $socidp"; + $sql .= " AND f.fk_soc = $socidp"; } + if ( $db->query($sql) ) { $num = $db->num_rows(); @@ -157,11 +158,14 @@ if ( $db->query($sql) ) { $obj = $db->fetch_object( $i); $var=!$var; - print '"; + print '"; $i++; } } - +else +{ + print $sql; +} print "
'.translate("Factures").'Factures impayées
'.$obj->facnumber."
'.$obj->facnumber."".$obj->nom."

"; /* * Bookmark