Uniformisation du code

This commit is contained in:
Laurent Destailleur 2005-10-19 05:12:45 +00:00
parent 47b1e6f5a2
commit 847186d9a1
8 changed files with 147 additions and 135 deletions

View File

@ -91,6 +91,7 @@ print '<tr><td valign="top" width="30%" class="notopnoleft">';
if ($conf->facture->enabled)
{
print '<form method="post" action="facture.php">';
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">";
print '<td colspan="3">'.$langs->trans("SearchABill").'</td></tr>';

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -18,16 +18,14 @@
*
* $Id$
* $Source$
*
*/
/*!
\file htdocs/product/fiche.php
\ingroup product
\brief Page de la fiche produit
\version $Revision$
/**
\file htdocs/compta/param/comptes/fiche.php
\ingroup compta
\brief Page de la fiche des comptes comptables
\version $Revision$
*/
require("./pre.inc.php");
@ -66,7 +64,7 @@ if ($_POST["action"] == 'add' && $user->rights->compta->ventilation->parametrer)
}
}
llxHeader("","Comptes Généraux");
llxHeader("","Nouveau compte");
/*
* Création d'un compte
@ -74,35 +72,35 @@ llxHeader("","Comptes G
*/
if ($_GET["action"] == 'create' && $user->rights->compta->ventilation->parametrer)
{
$html = new Form($db);
$nbligne=0;
$html = new Form($db);
$nbligne=0;
print_fiche_titre('Comptes Généraux');
print_fiche_titre($langs->trans("NewAccount"));
print '<form action="fiche.php" method="post">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="type" value="'.$_GET["type"].'">'."\n";
print '<table class="border" width="100%">';
print '<tr>';
print '<td>Numéro de compte</td><td><input name="numero" size="20" value="'.$compte->numero.'">';
if ($_error == 1)
print '<form action="fiche.php" method="post">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="type" value="'.$_GET["type"].'">'."\n";
print '<table class="border" width="100%">';
print '<tr>';
print '<td>'.$langs->trans("AccountNumber").'</td><td><input name="numero" size="20" value="'.$compte->numero.'">';
if ($_error == 1)
{
print "Ce numéro de compte existe déjà";
print "Ce numéro de compte existe déjà";
}
if ($_error == 2)
if ($_error == 2)
{
print "Valeur(s) manquante(s)";
print "Valeur(s) manquante(s)";
}
print '</td></tr>';
print '<tr><td>Intitulé</td><td><input name="intitule" size="40" value="'.$compte->intitule.'"></td></tr>';
print '</td></tr>';
print '<tr><td>'.$langs->trans("Label").'</td><td><input name="intitule" size="40" value="'.$compte->intitule.'"></td></tr>';
print '<tr><td>&nbsp;</td><td><input type="submit" value="'.$langs->trans("Create").'"></td></tr>';
print '</table>';
print '</form>';
print '<tr><td>&nbsp;</td><td><input type="submit" class="button" value="'.$langs->trans("Create").'"></td></tr>';
print '</table>';
print '</form>';
}
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
llxFooter('$Date$ - $Revision$');
?>

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -18,10 +18,9 @@
*
* $Id$
* $Source$
*
*/
/*!
/**
\file htdocs/compta/param/comptes/index.php
\ingroup compta
\brief Page acceuil zone parametrages
@ -33,6 +32,7 @@ require("./pre.inc.php");
$user->getrights('banque');
$langs->load("compta");
$langs->load("bills");
/*
* Sécurité accés client
@ -49,26 +49,27 @@ llxHeader("","Accueil Compta");
* Affichage page
*
*/
print_titre("Paramétrage comptabilité");
print_fiche_titre($langs->trans("AccountancySetup"));
print '<table border="0" width="100%">';
print '<table border="0" width="100%" class="notopnoleftnoright">';
print '<tr><td valign="top" width="30%">';
print '<tr><td valign="top" width="30%" class="notopnoleft">';
/*
* Zone recherche facture
*/
print '<form method="post" action="facture.php">';
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">";
print '<td colspan="2">'.$langs->trans("SearchABill").'</td></tr>';
print "<tr $bc[0]><td>";
print $langs->trans("Ref").' : <input type="text" name="sf_ref">&nbsp;<input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print '<td colspan="3">'.$langs->trans("SearchABill").'</td></tr>';
print "<tr $bc[0]>";
print '<td>'.$langs->trans("Ref").':</td><td><input type="text" class="flat" size="18" name="sf_ref"></td><td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print "</table></form><br>";
print '</td><td valign="top" width="70%">';
print '</td><td valign="top" width="70%" class="notopnoleft">';
@ -78,5 +79,5 @@ print '</table>';
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
llxFooter('$Date$ - $Revision$');
?>

View File

@ -1,5 +1,6 @@
<?PHP
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -17,10 +18,11 @@
*
* $Id$
* $Source$
*
*/
require("./pre.inc.php");
llxHeader('','Compta - Liste des comptes');
$page = $_GET["page"];
@ -74,16 +76,18 @@ if ($resql)
print '<table class="liste">';
print '<tr class="liste_titre">';
print_liste_field_titre("N° compte","liste.php","cg.numero");
print_liste_field_titre("Intitulé compte","liste.php","cg.intitule");
print '<td align="right">Date création</td>';
print_liste_field_titre($langs->trans("AccountNumberShort"),"liste.php","cg.numero");
print_liste_field_titre($langs->trans("Label"),"liste.php","cg.intitule");
print_liste_field_titre($langs->trans("DateCreation"),"liste.php","cg.date_creation");
print "</tr>\n";
print '<tr class="liste_titre">';
print '<form action="liste.php" method="GET">';
print '<td><input type="text" name="search_numero" value="'.$_GET["search_numero"].'"></td>';
print '<td><input type="text" name="search_intitule" value="'.$_GET["search_intitule"].'"><input type="submit"></td>';
print '<td>&nbsp;</td>';
print '<td><input type="text" name="search_intitule" value="'.$_GET["search_intitule"].'"></td>';
print '<td align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">';
print '</td>';
print '</form>';
print '</tr>';

View File

@ -50,11 +50,11 @@ llxHeader("",$langs->trans("AccountancySetup"));
* Affichage page
*
*/
print_titre($langs->trans("AccountancySetup"));
print_fiche_titre($langs->trans("AccountancySetup"));
print '<table border="0" width="100%">';
print '<table border="0" width="100%" class="notopnoleftnoright">';
print '<tr><td valign="top" width="30%">';
print '<tr><td valign="top" width="30%" class="notopnoleft">';
/*
* Zone recherche facture
@ -62,14 +62,14 @@ print '<tr><td valign="top" width="30%">';
print '<form method="post" action="facture.php">';
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">";
print '<td colspan="2">'.$langs->trans("SearchABill").'</td></tr>';
print '<td colspan="3">'.$langs->trans("SearchABill").'</td></tr>';
print "<tr $bc[0]><td>";
print $langs->trans("Ref").'</td><td><input type="text" class="button" name="sf_ref">&nbsp;<input type="submit" class="button" value="'.$langs->trans("Search").'"></td></tr>';
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sf_ref"></td><td><input type="submit" class="button" value="'.$langs->trans("Search").'"></td></tr>';
print "</table></form><br>";
print '</td><td valign="top" width="70%">';
print '</td><td valign="top" width="70%" class="notopnoleft">';

View File

@ -1,5 +1,6 @@
<?PHP
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -17,7 +18,6 @@
*
* $Id$
* $Source$
*
*/
/**
@ -29,6 +29,9 @@
require("./pre.inc.php");
$langs->load("bills");
$mesg = '';
if (!$user->rights->compta->ventilation->creer) accessforbidden();
@ -79,72 +82,72 @@ $form = new Form($db);
if($_GET["id"])
{
$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_taux, l.remise_percent, l.subprice, ".$db->pdate("l.date_start")." as date_start, ".$db->pdate("l.date_end")." as date_end, l.fk_code_ventilation ";
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as l";
$sql .= " , ".MAIN_DB_PREFIX."facture as f";
$sql .= " WHERE f.rowid = l.fk_facture AND f.fk_statut = 1 AND l.rowid = ".$_GET["id"];
$result = $db->query($sql);
$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_taux, l.remise_percent, l.subprice, ".$db->pdate("l.date_start")." as date_start, ".$db->pdate("l.date_end")." as date_end, l.fk_code_ventilation ";
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as l";
$sql .= " , ".MAIN_DB_PREFIX."facture as f";
$sql .= " WHERE f.rowid = l.fk_facture AND f.fk_statut = 1 AND l.rowid = ".$_GET["id"];
if ($result)
$result = $db->query($sql);
if ($result)
{
$num_lignes = $db->num_rows($result);
$i = 0;
if ($num_lignes)
{
$objp = $db->fetch_object($result);
$num_lignes = $db->num_rows($result);
$i = 0;
if ($num_lignes)
{
$objp = $db->fetch_object($result);
if($objp->fk_code_ventilation == 0)
{
print '<form action="fiche.php?id='.$_GET["id"].'" method="post">'."\n";
print '<input type="hidden" name="action" value="ventil">';
}
if($objp->fk_code_ventilation == 0)
{
print '<form action="fiche.php?id='.$_GET["id"].'" method="post">'."\n";
print '<input type="hidden" name="action" value="ventil">';
}
print_titre("Ventilation");
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
print '<tr><td>Facture</td>';
print '<td><a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$objp->facid.'">'.$objp->facnumber.'</a></td></tr>';
print '<tr><td width="20%">Ligne</td>';
print '<td>'.stripslashes(nl2br($objp->description)).'</td></tr>';
print '<tr><td width="20%">Ventiler dans le compte :</td><td>';
print_titre("Ventilation");
if($objp->fk_code_ventilation == 0)
{
print $form->select_array("codeventil",$cgs, $objp->fk_code_ventilation);
}
else
{
print $cgs[$objp->fk_code_ventilation];
}
print '<table class="border" width="100%">';
print '<tr><td>'.$langs->trans("Bill").'</td>';
print '<td><a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$objp->facid.'">'.$objp->facnumber.'</a></td></tr>';
print '</td></tr>';
if($objp->fk_code_ventilation == 0)
{
print '<tr><td>&nbsp;</td><td><input type="submit" value="'.$langs->trans("Ventiler").'"></td></tr>';
}
print '</table>';
print '</form>';
}
else
{
print "Error";
}
print '<tr><td width="20%">Ligne</td>';
print '<td>'.stripslashes(nl2br($objp->description)).'</td></tr>';
print '<tr><td width="20%">Ventiler dans le compte :</td><td>';
if($objp->fk_code_ventilation == 0)
{
print $form->select_array("codeventil",$cgs, $objp->fk_code_ventilation);
}
else
{
print $cgs[$objp->fk_code_ventilation];
}
print '</td></tr>';
if($objp->fk_code_ventilation == 0)
{
print '<tr><td>&nbsp;</td><td><input type="submit" class="button" value="'.$langs->trans("Ventiler").'"></td></tr>';
}
print '</table>';
print '</form>';
}
else
{
print "Error";
}
}
else
else
{
print "Error";
print "Error";
}
}
else
{
print "Error ID incorrect";
print "Error ID incorrect";
}
$db->close();

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -18,7 +18,6 @@
*
* $Id$
* $Source$
*
*/
/**
@ -33,12 +32,12 @@ require("./pre.inc.php");
llxHeader('','Compta - Ventilation');
print_titre("Ventilation Comptable");
print '<table border="0" width="100%">';
print_fiche_titre("Ventilation Comptable");
print '<tr><td valign="top" width="30%">';
print '<table border="0" width="100%" class="notopnoleftnoright">';
print '<tr><td valign="top" width="30%" class="notopnoleft">';
$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."facturedet";
@ -64,43 +63,48 @@ if ($result)
$db->free($result);
}
$var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">Lignes a ventiler</tr>';
print '<tr class="liste_titre"><td>Type</td><td align="center">Nb</td></tr>';
print '<tr><td>Factures</td><td align="center">'.$nbfac.'</td></tr>';
print '<tr><td>Paiements</td><td align="center">'.$nbp.'</td></tr>';
$var=!$var;
print "<tr $bc[$var]>".'<td>Factures</td><td align="center">'.$nbfac.'</td></tr>';
$var=!$var;
print "<tr $bc[$var]>".'<td>Paiements</td><td align="center">'.$nbp.'</td></tr>';
print "</table>\n";
print '</td><td valign="top">';
print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>Type</td><td align="center">Nb de lignes</td></tr>';
$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";
$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)
$i = 0;
$num = $db->num_rows($resql);
$var=true;
while ($i < $num)
{
$row = $db->fetch_row($resql);
print '<tr><td>'.$row[1].'</td><td align="center">'.$row[0].'</td></tr>';
$i++;
$row = $db->fetch_row($resql);
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$row[1].'</td><td align="center">'.$row[0].'</td></tr>';
$i++;
}
$db->free($resql);
$db->free($resql);
}
print "</table>\n";
print '</td></tr></table>';
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
llxFooter('$Date$ - $Revision$');
?>

View File

@ -17,14 +17,13 @@
*
* $Id$
* $Source$
*
*/
/*!
\file htdocs/compta/ventilation/lignes.php
\ingroup facture
\brief Page de detail des lignes de ventilation d'une facture
\version $Revision$
/**
\file htdocs/compta/ventilation/lignes.php
\ingroup facture
\brief Page de detail des lignes de ventilation d'une facture
\version $Revision$
*/
require("./pre.inc.php");
@ -85,10 +84,12 @@ if ($result)
print "</tr>\n";
print '<tr class="liste_titre"><td><input name="search_facture" size="8" value="'.$_GET["search_facture"].'"></td>';
print '<td><input type="submit"></td>';
print '<td>&nbsp;</td>';
print '<td align="right">&nbsp;</td>';
print '<td align="center">&nbsp;</td>';
print '<td align="center">&nbsp;</td>';
print '<td align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">';
print '</td>';
print "</tr>\n";
$var=True;
@ -118,5 +119,5 @@ print "</table></form>";
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
llxFooter('$Date$ - $Revision$');
?>