diff --git a/htdocs/compta/index.php3 b/htdocs/compta/index.php3
index 6bc006b4e1d..f79786d8126 100644
--- a/htdocs/compta/index.php3
+++ b/htdocs/compta/index.php3
@@ -121,7 +121,7 @@ if ($user->societe_id == 0)
}
}
/*
- * Propales
+ * Propales à facturer
*/
if ($user->comm > 0 && $conf->commercial )
{
@@ -144,12 +144,8 @@ if ($user->comm > 0 && $conf->commercial )
print "
";
}
/*
- * Factures
+ * Factures impayées
*/
-print '
';
-print "";
-print '| Factures impayées | ';
-print "
\n";
$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)
@@ -162,19 +158,28 @@ if ( $db->query($sql) )
$num = $db->num_rows();
$i = 0;
- while ($i < $num)
+ if ($num)
{
- $obj = $db->fetch_object( $i);
- $var=!$var;
- print '| '.$obj->facnumber." | ".$obj->nom." |
";
- $i++;
- }
+ print '';
+ print "";
+ print '| Factures impayées |
';
+
+ while ($i < $num)
+ {
+ $obj = $db->fetch_object( $i);
+ $var=!$var;
+ print '| '.$obj->facnumber." | ".$obj->nom." |
";
+ $i++;
+ }
+ print "
";
+ }
+ $db->free();
}
else
{
print $sql;
}
-print "
";
+
/*
* Bookmark
*
@@ -241,6 +246,38 @@ 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";
+
+if ( $db->query($sql) )
+{
+ $num = $db->num_rows();
+ $i = 0;
+
+ if ($num)
+ {
+ print '';
+ print '';
+ print '| Factures brouillons |
';
+
+ while ($i < $num)
+ {
+ $obj = $db->fetch_object( $i);
+ $var=!$var;
+ print '| '.$obj->facnumber." | ".$obj->nom." |
";
+ $i++;
+ }
+
+ print "
";
+ }
+}
+else
+{
+ print $sql;
+}
/*
* Factures a payer