* Copyright (C) 2004-2005 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ /** * \file htdocs/compta/ventilation/index.php * \ingroup compta * \brief Page accueil ventilation */ require '../../main.inc.php'; $langs->load("compta"); $langs->load("bills"); llxHeader('','Compta - Ventilation'); print_fiche_titre("Ventilation Comptable"); //print ''; //print '
'; print '
'; $sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."facturedet as fd"; $sql.= " , ".MAIN_DB_PREFIX."facture as f"; $sql.= " WHERE fd.fk_code_ventilation = 0"; $sql.= " AND f.rowid = fd.fk_facture AND f.fk_statut = 1"; $result = $db->query($sql); if ($result) { $row = $db->fetch_row($result); $nbfac = $row[0]; $db->free($result); } $var=true; print ''; print ''; print ''; $var=!$var; print "".''; $var=!$var; print "
'.$langs->trans("Lines").'
'.$langs->trans("Type").''.$langs->trans("Nb").'
'.$langs->trans("Invoices").''.$nbfac.'
\n"; //print '
'; print '
'; print ''; print ''; $sql = "SELECT count(*), ccg.intitule, ccg.rowid,ccg.numero 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); $var=true; while ($i < $num) { $row = $db->fetch_row($resql); $var=!$var; print ''; print ''; $i++; } $db->free($resql); } print "
'.$langs->trans("Type").''.$langs->trans("NbOfLines").''.$langs->trans("AccountNumber").''.$langs->trans("TransID").'
'.$row[1].''.$row[0].''.$row[3].''.$row[2].'
\n"; //print '
'; print ''; llxFooter(); $db->close(); ?>