diff --git a/htdocs/compta/ventilation/index.php b/htdocs/compta/ventilation/index.php index 16b8ce5c6b3..d7e338b7d87 100644 --- a/htdocs/compta/ventilation/index.php +++ b/htdocs/compta/ventilation/index.php @@ -30,7 +30,77 @@ require("./pre.inc.php"); -Header("Location: liste.php?".$_SERVER["QUERY_STRING"]); + +llxHeader('','Compta - Ventilation'); + +print_titre("Ventilation Comptable"); + +print ''; + +print '
'; + + + +$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."facturedet"; +$sql .= " WHERE fk_export_compta = 0"; +$result = $db->query($sql); +if ($result) +{ + $row = $db->fetch_row($result); + $nbfac = $row[0]; + + $db->free($result); +} + +$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."paiement"; +$sql .= " WHERE fk_export_compta = 0"; + +$result = $db->query($sql); +if ($result) +{ + $row = $db->fetch_row($result); + $nbp = $row[0]; + + $db->free($result); +} + +print ''; +print ''; +print ''; +print ''; +print ''; +print "
Lignes a ventiler
TypeNb
Factures'.$nbfac.'
Paiements'.$nbp.'
\n"; + +print '
'; + +print ''; +print ''; + +$sql = "SELECT count(*), ccg.intitule FROM ".MAIN_DB_PREFIX."facturedet as fd"; +$sql .= " ,".MAIN_DB_PREFIX."compta_compte_generaux as ccg"; +$sql .= " WHERE fd.fk_code_ventilation = ccg.rowid"; +$sql .= " GROUP BY ccg.rowid"; + +$resql = $db->query($sql); +if ($resql) +{ + $i = 0; + $num = $db->num_rows($resql); + + while ($i < $num) + { + + $row = $db->fetch_row($resql); + + print ''; + $i++; + } + $db->free($result); +} +print "
TypeNb de lignes
'.$row[1].''.$row[0].'
\n"; + +print '
'; llxFooter("Dernière modification $Date$ révision $Revision$"); + ?>