From d2aff439360b91dcd04499c0b764eb0d1f7450b1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@users.sourceforge.net> Date: Sat, 27 Mar 2010 14:40:39 +0000 Subject: [PATCH] Remove pre.inc.php --- htdocs/compta/clients.php | 2 +- htdocs/compta/comptacompte.class.php | 22 +-- htdocs/compta/facture.php | 2 +- htdocs/compta/fiche.php | 2 +- htdocs/compta/index.php | 2 +- htdocs/compta/paiement.php | 2 +- htdocs/compta/paiement_charge.php | 2 +- htdocs/compta/payment_sc/fiche.php | 2 +- htdocs/compta/payment_sc/pre.inc.php | 50 ------- htdocs/compta/pre.inc.php | 135 ------------------ .../prelevement/bon-prelevement.class.php | 2 +- htdocs/compta/prelevement/bon.php | 4 +- htdocs/compta/prelevement/bons.php | 10 +- htdocs/compta/prelevement/config.php | 2 +- htdocs/compta/prelevement/create.php | 8 +- htdocs/compta/prelevement/demandes.php | 4 +- htdocs/compta/prelevement/factures.php | 26 ++-- htdocs/compta/prelevement/facturesrejets.php | 27 ++-- htdocs/compta/prelevement/fiche-rejet.php | 24 ++-- htdocs/compta/prelevement/fiche-stat.php | 48 +++---- htdocs/compta/prelevement/fiche.php | 2 +- htdocs/compta/prelevement/index.php | 2 +- .../prelevement/ligne-prelevement.class.php | 16 +-- htdocs/compta/prelevement/ligne.php | 2 +- htdocs/compta/prelevement/lignes.php | 9 +- htdocs/compta/prelevement/liste.php | 2 +- htdocs/compta/prelevement/liste_factures.php | 10 +- htdocs/compta/prelevement/pre.inc.php | 76 ---------- .../prelevement/rejet-prelevement.class.php | 69 +++++---- htdocs/compta/prelevement/rejets.php | 16 +-- htdocs/compta/prelevement/stats.php | 2 +- htdocs/compta/propal.php | 2 +- htdocs/compta/recap-compta.php | 2 +- htdocs/compta/resultat/bilan.php | 2 +- htdocs/compta/resultat/clientfourn.php | 2 +- htdocs/compta/resultat/compteres.php | 4 +- htdocs/compta/resultat/index.php | 2 +- htdocs/compta/resultat/pre.inc.php | 59 -------- htdocs/compta/sociales/charges.php | 2 +- htdocs/compta/sociales/index.php | 2 +- htdocs/compta/sociales/pre.inc.php | 48 ------- htdocs/compta/stats/cabyuser.php | 2 +- htdocs/compta/stats/casoc.php | 2 +- htdocs/compta/stats/comp.php | 25 ++-- htdocs/compta/stats/cumul.php | 20 +-- htdocs/compta/stats/exercices.php | 49 ++++--- htdocs/compta/stats/index.php | 2 +- htdocs/compta/stats/pre.inc.php | 59 -------- htdocs/compta/stats/prev.php | 35 +++-- htdocs/compta/tva.php | 23 ++- htdocs/compta/tva/clients.php | 2 +- htdocs/compta/tva/fiche.php | 2 +- htdocs/compta/tva/index.php | 2 +- htdocs/compta/tva/pre.inc.php | 44 ------ htdocs/compta/tva/quadri.php | 32 ++--- htdocs/compta/tva/quadri_detail.php | 2 +- htdocs/compta/tva/reglement.php | 2 +- htdocs/compta/ventilation/fiche.php | 7 +- .../compta/ventilation/fournisseur/fiche.php | 22 ++- .../compta/ventilation/fournisseur/index.php | 4 +- .../compta/ventilation/fournisseur/lignes.php | 12 +- .../compta/ventilation/fournisseur/liste.php | 26 ++-- .../ventilation/fournisseur/pre.inc.php | 55 ------- htdocs/compta/ventilation/index.php | 5 +- htdocs/compta/ventilation/lignes.php | 3 +- htdocs/compta/ventilation/liste.php | 3 +- htdocs/compta/ventilation/pre.inc.php | 53 ------- 67 files changed, 303 insertions(+), 897 deletions(-) delete mode 100644 htdocs/compta/payment_sc/pre.inc.php delete mode 100644 htdocs/compta/pre.inc.php delete mode 100644 htdocs/compta/prelevement/pre.inc.php delete mode 100644 htdocs/compta/resultat/pre.inc.php delete mode 100644 htdocs/compta/sociales/pre.inc.php delete mode 100644 htdocs/compta/stats/pre.inc.php delete mode 100644 htdocs/compta/tva/pre.inc.php delete mode 100644 htdocs/compta/ventilation/fournisseur/pre.inc.php delete mode 100644 htdocs/compta/ventilation/pre.inc.php diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 81019a51cae..753bf92a278 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require_once("./pre.inc.php"); +require('../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/contact/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php"); diff --git a/htdocs/compta/comptacompte.class.php b/htdocs/compta/comptacompte.class.php index a9f550d711c..fd66b2f9bae 100644 --- a/htdocs/compta/comptacompte.class.php +++ b/htdocs/compta/comptacompte.class.php @@ -24,9 +24,9 @@ */ -/*! \class ComptaCompte - \brief Classe permettant la gestion des comptes generaux de compta -*/ +/** \class ComptaCompte + * \brief Classe permettant la gestion des comptes generaux de compta + */ class ComptaCompte { @@ -41,28 +41,28 @@ class ComptaCompte * \param DB handler acces base de donnees * \param id id compte (0 par defaut) */ - + function ComptaCompte($DB, $id=0) { $this->db = $DB; $this->id = $id ; - } + } /** * \brief Insere le produit en base * \param user utilisateur qui effectue l'insertion */ - - function create($user) + + function create($user) { if (strlen(trim($this->numero)) && strlen(trim($this->intitule))) { $sql = "SELECT count(*)"; $sql .= " FROM ".MAIN_DB_PREFIX."compta_compte_generaux "; $sql .= " WHERE numero = '" .trim($this->numero)."'"; - + $resql = $this->db->query($sql) ; - + if ( $resql ) { $row = $this->db->fetch_array($resql); @@ -70,12 +70,12 @@ class ComptaCompte { $sql = "INSERT INTO ".MAIN_DB_PREFIX."compta_compte_generaux (date_creation, fk_user_author, numero,intitule)"; $sql .= " VALUES (".$this->db->idate(mktime()).",".$user->id.",'".$this->numero."','".$this->intitule."')"; - + $resql = $this->db->query($sql); if ( $resql ) { $id = $this->db->last_insert_id(MAIN_DB_PREFIX."compta_compte_generaux"); - + if ($id > 0) { $this->id = $id; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 662ae73b0da..8a38b8367a2 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -28,7 +28,7 @@ * \version $Id$ */ -require('./pre.inc.php'); +require('../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT.'/includes/modules/facture/modules_facture.php'); require_once(DOL_DOCUMENT_ROOT.'/compta/facture/facture.class.php'); diff --git a/htdocs/compta/fiche.php b/htdocs/compta/fiche.php index c59357d794a..a59b0fcf7c5 100644 --- a/htdocs/compta/fiche.php +++ b/htdocs/compta/fiche.php @@ -26,7 +26,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); require_once(DOL_DOCUMENT_ROOT."/contact/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/compta/facture/facture.class.php"); diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 3578a304d1d..542c5d9ed95 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT.'/compta/facture/facture.class.php'); require_once(DOL_DOCUMENT_ROOT.'/fourn/fournisseur.facture.class.php'); diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 121b9f0acf5..400591806d2 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -26,7 +26,7 @@ * \version $Id$ */ -include_once('./pre.inc.php'); +require('../main.inc.php'); require_once(DOL_DOCUMENT_ROOT.'/paiement.class.php'); include_once(DOL_DOCUMENT_ROOT.'/compta/facture/facture.class.php'); include_once(DOL_DOCUMENT_ROOT.'/compta/bank/account.class.php'); diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index b8e515c7dff..fc91268936e 100755 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -23,7 +23,7 @@ * \version $Id$ */ -include_once("./pre.inc.php"); +require('../main.inc.php'); include_once(DOL_DOCUMENT_ROOT."/compta/chargesociales.class.php"); include_once(DOL_DOCUMENT_ROOT."/compta/bank/account.class.php"); diff --git a/htdocs/compta/payment_sc/fiche.php b/htdocs/compta/payment_sc/fiche.php index c7f664feb2a..fb26b5759a1 100644 --- a/htdocs/compta/payment_sc/fiche.php +++ b/htdocs/compta/payment_sc/fiche.php @@ -27,7 +27,7 @@ * \version $Id$ */ -require('./pre.inc.php'); +require('../../main.inc.php'); include_once(DOL_DOCUMENT_ROOT."/compta/chargesociales.class.php"); require_once(DOL_DOCUMENT_ROOT.'/compta/facture/facture.class.php'); require_once(DOL_DOCUMENT_ROOT."/includes/modules/facture/modules_facture.php"); diff --git a/htdocs/compta/payment_sc/pre.inc.php b/htdocs/compta/payment_sc/pre.inc.php deleted file mode 100644 index f623b981737..00000000000 --- a/htdocs/compta/payment_sc/pre.inc.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php -/* Copyright (C) 2003-2006 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 - * the Free Software Foundation; either version 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -/** - * \file htdocs/compta/paiement/pre.inc.php - * \ingroup compta - * \brief Fichier gestionnaire du menu compta paiement - * \version $Id$ - */ - -require("../../main.inc.php"); - -$langs->load("bills"); -$langs->load("compta"); -$langs->load("propal"); - -function llxHeader($head = '', $title='', $help_url='') -{ - global $user, $conf, $langs; - $langs->load("compta"); - $langs->load("propal"); - - top_menu($head, $title, $target); - - $menu = new Menu(); - - $menu->add("index.php",$langs->trans("Contributions")); - - $menu->add_submenu(DOL_URL_ROOT."/compta/sociales/index.php",$langs->trans("SocialContributions")); - - left_menu($menu->liste); -} - -?> diff --git a/htdocs/compta/pre.inc.php b/htdocs/compta/pre.inc.php deleted file mode 100644 index 6f0fd12d9d1..00000000000 --- a/htdocs/compta/pre.inc.php +++ /dev/null @@ -1,135 +0,0 @@ -<?php -/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> - * 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 - * the Free Software Foundation; either version 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -/** - * \file htdocs/compta/pre.inc.php - * \ingroup compta - * \brief Fichier gestionnaire du menu compta - * \version $Id$ - */ - -require("../main.inc.php"); - - -function llxHeader($head = '', $title='', $help_url='') -{ - global $user, $conf, $langs; - - top_menu($head, $title); - - $menu = new Menu(); - - // Les recettes - if ($conf->societe->enabled) - { - $langs->load("commercial"); - $menu->add(DOL_URL_ROOT."/compta/clients.php", $langs->trans("Customers")); - } - - if ($conf->propal->enabled) - { - $langs->load("propal"); - $menu->add(DOL_URL_ROOT."/compta/propal.php",$langs->trans("Prop")); - } - - if ($conf->contrat->enabled) - { - $langs->load("contracts"); - $menu->add(DOL_URL_ROOT."/contrat/",$langs->trans("Contracts")); - } - - if ($conf->don->enabled) - { - $langs->load("donations"); - $menu->add(DOL_URL_ROOT."/compta/dons/",$langs->trans("Donations")); - } - - if ($conf->facture->enabled) - { - $langs->load("bills"); - $menu->add(DOL_URL_ROOT."/compta/facture.php",$langs->trans("Bills")); - $menu->add_submenu(DOL_URL_ROOT."/compta/facture/impayees.php",$langs->trans("Unpaid")); - $menu->add_submenu(DOL_URL_ROOT."/compta/paiement/liste.php",$langs->trans("Payments")); - $menu->add_submenu(DOL_URL_ROOT."/compta/facture/fiche-rec.php", $langs->trans("Repeatable")); - - $menu->add_submenu(DOL_URL_ROOT."/compta/facture/stats/", $langs->trans("Statistics")); - } - - - if ($conf->commande->enabled && $conf->facture->enabled) - { - $langs->load("orders"); - $menu->add(DOL_URL_ROOT."/compta/commande/liste.php?leftmenu=orders&afacturer=1", $langs->trans("MenuOrdersToBill")); - } - - // Les depenses - if ($conf->fournisseur->enabled) - { - $langs->load("suppliers"); - $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers")); - } - - if ($conf->deplacement->enabled) - { - $langs->load("trips"); - $menu->add(DOL_URL_ROOT."/compta/deplacement/", $langs->trans("Trips")); - } - - if ($conf->tax->enabled && $conf->compta->tva && $user->societe_id == 0) - { - $menu->add(DOL_URL_ROOT."/compta/tva/index.php",$langs->trans("VAT")); - } - - if ($conf->tax->enabled) - { - $menu->add(DOL_URL_ROOT."/compta/charges/index.php",$langs->trans("Charges")); - } - - - // Vision des recettes-depenses - if ($conf->banque->enabled && $user->rights->banque->lire) - { - $langs->load("banks"); - $menu->add(DOL_URL_ROOT."/compta/bank/",$langs->trans("Bank")); - } - - $menu->add(DOL_URL_ROOT."/compta/stats/",$langs->trans("Reportings")); - - if ($conf->prelevement->enabled) - { - $menu->add(DOL_URL_ROOT."/compta/prelevement/",$langs->trans("StandingOrders")); - } - - if ($conf->compta->enabled) - { - if ($user->rights->compta->ventilation->creer) - { - $menu->add(DOL_URL_ROOT."/compta/ventilation/",$langs->trans("Ventilation")); - } - - if ($user->rights->compta->ventilation->parametrer) - { - $menu->add(DOL_URL_ROOT."/compta/param/",$langs->trans("Param")); - } - } - - left_menu($menu->liste, $help_url); -} - -?> diff --git a/htdocs/compta/prelevement/bon-prelevement.class.php b/htdocs/compta/prelevement/bon-prelevement.class.php index 8a53bfcfcb8..7ab30bcdfc7 100644 --- a/htdocs/compta/prelevement/bon-prelevement.class.php +++ b/htdocs/compta/prelevement/bon-prelevement.class.php @@ -24,7 +24,7 @@ \version $Id$ */ -require_once(DOL_DOCUMENT_ROOT ."/commonobject.class.php"); +require_once(DOL_DOCUMENT_ROOT."/commonobject.class.php"); require_once(DOL_DOCUMENT_ROOT."/compta/facture/facture.class.php"); require_once(DOL_DOCUMENT_ROOT."/societe.class.php"); diff --git a/htdocs/compta/prelevement/bon.php b/htdocs/compta/prelevement/bon.php index b55ca9e8a3e..bbff3271573 100644 --- a/htdocs/compta/prelevement/bon.php +++ b/htdocs/compta/prelevement/bon.php @@ -20,11 +20,11 @@ /** \file htdocs/compta/prelevement/bon.php \ingroup prelevement - \brief Fiche aper�u du bon de prelevement + \brief Fiche apercu du bon de prelevement \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); $langs->load("bills"); diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index 7c8a6e9cc2a..32870cebbaa 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -25,7 +25,7 @@ \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); $langs->load("widthdrawals"); @@ -66,7 +66,7 @@ if ($result) { $num = $db->num_rows($result); $i = 0; - + $urladd= "&statut=".$_GET["statut"]; print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, "bons.php", $urladd, $sortfield, $sortorder, '', $num); @@ -79,10 +79,10 @@ if ($result) print_liste_field_titre($langs->trans("Date"),"bons.php","p.datec","","",'class="liste_titre" align="center"'); print '<td class="liste_titre" align="right">'.$langs->trans("Amount").'</td>'; print '</tr>'; - + print '<tr class="liste_titre">'; print '<form action="bons.php" method="GET">'; - print '<td class="liste_titre"><input type="text" class="flat" name="search_ligne" value="'. $_GET["search_ligne"].'" size="10"></td>'; + print '<td class="liste_titre"><input type="text" class="flat" name="search_ligne" value="'. $_GET["search_ligne"].'" size="10"></td>'; print '<td class="liste_titre"> </td>'; print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" name="button_search" alt="'.$langs->trans("Search").'"></td>'; print '</form>'; @@ -110,7 +110,7 @@ if ($result) print "</table>"; $db->free($result); } -else +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/config.php b/htdocs/compta/prelevement/config.php index cde8b15431b..bbe1289d8e8 100644 --- a/htdocs/compta/prelevement/config.php +++ b/htdocs/compta/prelevement/config.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); // Security check diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index b4e22a764e5..b6a4b19aa34 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -18,12 +18,12 @@ */ /** - \file htdocs/compta/prelevement/create.php - \brief Prelevement - \version $Id$ + * \file htdocs/compta/prelevement/create.php + * \brief Prelevement + * \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/includes/modules/modPrelevement.class.php"); require_once DOL_DOCUMENT_ROOT."/compta/facture/facture.class.php"; require_once DOL_DOCUMENT_ROOT."/societe.class.php"; diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 4eba108c3b0..dff8d00c0bb 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -20,11 +20,11 @@ /** \file htdocs/compta/prelevement/demandes.php - \brief Page de la liste des demandes de pr�l�vements + \brief Page de la liste des demandes de prelevements \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT."/includes/modules/modPrelevement.class.php"; require_once DOL_DOCUMENT_ROOT."/compta/facture/facture.class.php"; require_once DOL_DOCUMENT_ROOT."/societe.class.php"; diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index f04a83d4066..369a766bbe0 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -21,17 +21,17 @@ /** \file htdocs/compta/prelevement/factures.php \ingroup prelevement - \brief Page liste des factures pr�lev�es + \brief Page liste des factures prelevees \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/compta/prelevement/rejet-prelevement.class.php"); require_once(DOL_DOCUMENT_ROOT."/paiement.class.php"); $langs->load("companies"); -// S�curit� acc�s client +// S�curit� acc�s client if ($user->societe_id > 0) accessforbidden(); llxHeader('',$langs->trans("WithdrawalReceipt")); @@ -39,31 +39,31 @@ llxHeader('',$langs->trans("WithdrawalReceipt")); $h = 0; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Card"); -$h++; +$h++; if ($conf->use_preview_tabs) { $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/bon.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Preview"); - $h++; + $h++; } $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/lignes.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Lines"); -$h++; +$h++; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/factures.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Bills"); $hselected = $h; -$h++; +$h++; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche-rejet.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Rejects"); -$h++; +$h++; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche-stat.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Statistics"); -$h++; +$h++; if ($_GET["id"]) @@ -79,7 +79,7 @@ if ($_GET["id"]) print '<table class="border" width="100%">'; print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>'; print '</table>'; - + print '</div>'; } else @@ -121,7 +121,7 @@ if ($result) { $num = $db->num_rows($result); $i = 0; - + $urladd = "&id=".$_GET["id"]; print_barre_liste("", $page, "factures.php", $urladd, $sortfield, $sortorder, '', $num); @@ -140,7 +140,7 @@ if ($result) while ($i < min($num,$conf->liste_limit)) { - $obj = $db->fetch_object($result); + $obj = $db->fetch_object($result); print "<tr $bc[$var]><td>"; @@ -193,7 +193,7 @@ if ($result) print "</table>"; $db->free($result); } -else +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/facturesrejets.php b/htdocs/compta/prelevement/facturesrejets.php index 6152a665efd..48a25fc786a 100644 --- a/htdocs/compta/prelevement/facturesrejets.php +++ b/htdocs/compta/prelevement/facturesrejets.php @@ -17,17 +17,16 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ * */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT."/compta/prelevement/rejet-prelevement.class.php"; require_once DOL_DOCUMENT_ROOT."/paiement.class.php"; /* - * S�curite acces client + * Security check */ if ($user->societe_id > 0) accessforbidden(); @@ -36,21 +35,21 @@ llxHeader('',$langs->trans("WithdrawalReceipt")); $h = 0; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Fiche"); -$h++; +$h++; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/factures.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Factures"); -$h++; +$h++; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/rejets.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Rejets"); $hselected = $h; -$h++; +$h++; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche-stat.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Statistiques"); -$h++; +$h++; $prev_id = $_GET["id"]; @@ -97,12 +96,12 @@ if ($result) { $num = $db->num_rows($result); $i = 0; - - print_barre_liste("Pr�l�vements rejet�s", $page, "rejets.php", $urladd, $sortfield, $sortorder, '', $num); + + print_barre_liste("Pr�l�vements rejet�s", $page, "rejets.php", $urladd, $sortfield, $sortorder, '', $num); print"\n<!-- debut table -->\n"; print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; print '<tr class="liste_titre">'; - print_liste_field_titre("Bon N�","rejets.php","p.ref",'',$urladd); + print_liste_field_titre("Bon N�","rejets.php","p.ref",'',$urladd); print_liste_field_titre($langs->trans("Invoice"),"rejets.php","p.facnumber",'',$urladd); print_liste_field_titre($langs->trans("ThirdParty"),"rejets.php","s.nom",'',$urladd); print_liste_field_titre($langs->trans("Amount"),"rejets.php","f.total_ttc","",$urladd,'align="center"'); @@ -114,7 +113,7 @@ if ($result) while ($i < min($num,$conf->liste_limit)) { - $obj = $db->fetch_object($result); + $obj = $db->fetch_object($result); print "<tr $bc[$var]><td>"; @@ -123,7 +122,7 @@ if ($result) print "<td>"; print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'; - print img_file(); + print img_file(); print '</a> '; print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->facnumber."</a></td>\n"; @@ -133,7 +132,7 @@ if ($result) print '<td align="center">'.price($obj->total_ttc)."</td>\n"; - print '<td><b>Rejet�</b></td><td>'; + print '<td><b>Rejet�</b></td><td>'; print '</td>'; @@ -147,7 +146,7 @@ if ($result) print "</table>"; $db->free($result); } -else +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index fea3c1f3ec6..f425aa698d0 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -22,11 +22,11 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/compta/prelevement/rejet-prelevement.class.php"); require_once(DOL_DOCUMENT_ROOT."/paiement.class.php"); -// S�curit� acc�s client +// Securite acces client if ($user->societe_id > 0) accessforbidden(); llxHeader('',$langs->trans("WithdrawalReceipt")); @@ -34,31 +34,31 @@ llxHeader('',$langs->trans("WithdrawalReceipt")); $h = 0; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Card"); -$h++; +$h++; if ($conf->use_preview_tabs) { $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/bon.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Preview"); - $h++; + $h++; } $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/lignes.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Lines"); -$h++; +$h++; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/factures.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Bills"); -$h++; +$h++; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche-rejet.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Rejects"); $hselected = $h; -$h++; +$h++; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche-stat.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Statistics"); -$h++; +$h++; $prev_id = $_GET["id"]; @@ -73,7 +73,7 @@ if ($_GET["id"]) print '<table class="border" width="100%">'; print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>'; print '</table>'; - + print '</div>'; } else @@ -110,7 +110,7 @@ if ($resql) { $num = $db->num_rows($resql); $i = 0; - + print"\n<!-- debut table -->\n"; print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; print '<tr class="liste_titre">'; @@ -122,7 +122,7 @@ if ($resql) while ($i < $num) { - $obj = $db->fetch_object($resql); + $obj = $db->fetch_object($resql); print "<tr $bc[$var]><td>"; print '<img border="0" src="./statut'.$obj->statut.'.png"></a> '; @@ -151,7 +151,7 @@ if ($resql) print "</tr>\n</table>\n"; $db->free($resql); } -else +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index 1cb8863f159..f81df435554 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -21,9 +21,9 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); -// S�curit� acc�s client +// Security check if ($user->societe_id > 0) accessforbidden(); @@ -36,13 +36,13 @@ llxHeader('',$langs->trans("WithdrawalReceipt")); $h = 0; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Card"); -$h++; +$h++; if ($conf->use_preview_tabs) { $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/bon.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Preview"); - $h++; + $h++; } $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/lignes.php?id='.$_GET["id"]; @@ -51,16 +51,16 @@ $h++; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/factures.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Bills"); -$h++; +$h++; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche-rejet.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Rejects"); -$h++; +$h++; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche-stat.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Statistics"); $hselected = $h; -$h++; +$h++; $prev_id = $_GET["id"]; @@ -77,7 +77,7 @@ if ($prev_id) print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>'; print '</table>'; - + print '</div>'; } else @@ -93,25 +93,25 @@ if ($prev_id) $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl"; $sql.= " WHERE pl.fk_prelevement_bons = ".$prev_id; $sql.= " GROUP BY pl.statut"; - + if ($db->query($sql)) { $num = $db->num_rows(); $i = 0; - + print"\n<!-- debut table -->\n"; print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; print '<tr class="liste_titre">'; print '<td>Statut</td><td align="right">Montant</td><td align="right">%</td></tr>'; - + $var=false; - + while ($i < $num) { - $row = $db->fetch_row(); - + $row = $db->fetch_row(); + print "<tr $bc[$var]><td>"; - + if ($row[1] == 2) { print 'Credite'; @@ -124,28 +124,28 @@ if ($prev_id) { print 'En attente'; } - else print 'Unknown'; + else print 'Unknown'; - print '</td><td align="right">'; - print price($row[0]); + print '</td><td align="right">'; + print price($row[0]); - print '</td><td align="right">'; - print round($row[0]/$bon->amount*100,2)." %"; + print '</td><td align="right">'; + print round($row[0]/$bon->amount*100,2)." %"; print '</td>'; print "</tr>\n"; - + $var=!$var; $i++; } - + print "</table>"; $db->free(); } - else + else { print $db->error() . ' ' . $sql; - } + } } $db->close(); diff --git a/htdocs/compta/prelevement/fiche.php b/htdocs/compta/prelevement/fiche.php index 67e7b8ba71b..dc85837a998 100644 --- a/htdocs/compta/prelevement/fiche.php +++ b/htdocs/compta/prelevement/fiche.php @@ -24,7 +24,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); if (!$user->rights->prelevement->bons->lire) accessforbidden(); diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index d6e4e2e59c4..315431fbc8d 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -24,7 +24,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT."/includes/modules/modPrelevement.class.php"; require_once DOL_DOCUMENT_ROOT."/compta/facture/facture.class.php"; require_once DOL_DOCUMENT_ROOT."/societe.class.php"; diff --git a/htdocs/compta/prelevement/ligne-prelevement.class.php b/htdocs/compta/prelevement/ligne-prelevement.class.php index 41d2bca9b2d..91a6b8ab90e 100644 --- a/htdocs/compta/prelevement/ligne-prelevement.class.php +++ b/htdocs/compta/prelevement/ligne-prelevement.class.php @@ -17,8 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ - * */ /* @@ -40,8 +38,8 @@ class LignePrelevement var $db; var $statuts = array(); - - + + /** * \brief Constructeur de la classe * \param DB Handler acces base de donnees @@ -65,9 +63,9 @@ class LignePrelevement function fetch($rowid) { global $conf; - + $result = 0; - + $sql = "SELECT pl.rowid, pl.amount, p.ref, p.rowid as bon_rowid"; $sql.= ", pl.statut, pl.fk_soc"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl"; @@ -75,13 +73,13 @@ class LignePrelevement $sql.= " WHERE pl.rowid=".$rowid; $sql.= " AND p.rowid = pl.fk_prelevement_bons"; $sql.= " AND p.entity = ".$conf->entity; - + if ($this->db->query($sql)) { if ($this->db->num_rows()) { $obj = $this->db->fetch_object(); - + $this->id = $obj->rowid; $this->amount = $obj->amount; $this->socid = $obj->fk_soc; @@ -106,7 +104,7 @@ class LignePrelevement return $result; - } + } } ?> diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php index 4fdc6b6ceb6..a5111dcf981 100644 --- a/htdocs/compta/prelevement/ligne.php +++ b/htdocs/compta/prelevement/ligne.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/compta/prelevement/ligne-prelevement.class.php"); require_once(DOL_DOCUMENT_ROOT."/compta/prelevement/rejet-prelevement.class.php"); require_once(DOL_DOCUMENT_ROOT."/paiement.class.php"); diff --git a/htdocs/compta/prelevement/lignes.php b/htdocs/compta/prelevement/lignes.php index 05a9b6f9f7a..646ebbb0843 100644 --- a/htdocs/compta/prelevement/lignes.php +++ b/htdocs/compta/prelevement/lignes.php @@ -21,11 +21,12 @@ /* * \version $Id$ */ -require("./pre.inc.php"); + +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/compta/prelevement/rejet-prelevement.class.php"); require_once(DOL_DOCUMENT_ROOT."/paiement.class.php"); -// S�curit� acc�s client +// Security check if ($user->societe_id > 0) accessforbidden(); @@ -81,7 +82,7 @@ if ($_GET["id"]) print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>'; print '</table>'; - + print '</div>'; } else @@ -164,7 +165,7 @@ if ($result) if ($obj->statut == 3) { - print '<b>Rejet�</b>'; + print '<b>Rejet�</b>'; } else { diff --git a/htdocs/compta/prelevement/liste.php b/htdocs/compta/prelevement/liste.php index 7616f9a877c..2fea2316201 100644 --- a/htdocs/compta/prelevement/liste.php +++ b/htdocs/compta/prelevement/liste.php @@ -25,7 +25,7 @@ \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); $langs->load("withdrawals"); $langs->load("companies"); diff --git a/htdocs/compta/prelevement/liste_factures.php b/htdocs/compta/prelevement/liste_factures.php index ce533ded461..bf13520995f 100644 --- a/htdocs/compta/prelevement/liste_factures.php +++ b/htdocs/compta/prelevement/liste_factures.php @@ -21,11 +21,11 @@ /** \file htdocs/compta/prelevement/liste_factures.php \ingroup prelevement - \brief Page liste des factures pr�lev�es + \brief Page liste des factures prelevees \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/compta/prelevement/rejet-prelevement.class.php"); require_once(DOL_DOCUMENT_ROOT."/paiement.class.php"); @@ -88,7 +88,7 @@ if ($result) { $num = $db->num_rows($result); $i = 0; - + $urladd = "&socid=".$_GET["socid"]; print_barre_liste($langs->trans("WithdrawedBills"), $page, "liste_factures.php", $urladd, $sortfield, $sortorder, '', $num); @@ -120,7 +120,7 @@ if ($result) while ($i < min($num,$conf->liste_limit)) { - $obj = $db->fetch_object($result); + $obj = $db->fetch_object($result); print "<tr $bc[$var]><td>"; @@ -155,7 +155,7 @@ if ($result) print "</table>"; $db->free($result); } -else +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/pre.inc.php b/htdocs/compta/prelevement/pre.inc.php deleted file mode 100644 index e20fc758acb..00000000000 --- a/htdocs/compta/prelevement/pre.inc.php +++ /dev/null @@ -1,76 +0,0 @@ -<?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 - * the Free Software Foundation; either version 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -/** - \file htdocs/compta/prelevement/pre.inc.php - \ingroup prelevement - \brief Fichier gestionnaire du menu prelevement - \version $Id$ -*/ - -require("../../main.inc.php"); -require_once DOL_DOCUMENT_ROOT."/compta/prelevement/bon-prelevement.class.php"; - -$langs->load("banks"); -$langs->load("withdrawals"); -$langs->load("bills"); - - -function llxHeader($head = "", $title="", $help_url='') -{ - global $user, $conf, $langs; - - top_menu($head, $title); - - $menu = new Menu(); - - if ($conf->prelevement->enabled) - { - - if ($user->rights->prelevement->bons->lire) - { - - $menu->add(DOL_URL_ROOT."/compta/prelevement/",$langs->trans("StandingOrders")); - - if ($user->rights->prelevement->bons->creer) - $menu->add_submenu(DOL_URL_ROOT."/compta/prelevement/create.php",$langs->trans("NewStandingOrder")); - - $menu->add_submenu(DOL_URL_ROOT."/compta/prelevement/bons.php",$langs->trans("Receipts")); - $menu->add_submenu(DOL_URL_ROOT."/compta/prelevement/liste.php",$langs->trans("List")); - $menu->add_submenu(DOL_URL_ROOT."/compta/prelevement/liste_factures.php",$langs->trans("Bills")); - $menu->add_submenu(DOL_URL_ROOT."/compta/prelevement/rejets.php",$langs->trans("Rejects")); - $menu->add_submenu(DOL_URL_ROOT."/compta/prelevement/stats.php",$langs->trans("Statistics")); - - $menu->add_submenu(DOL_URL_ROOT."/compta/prelevement/config.php",$langs->trans("Setup")); - - $menu->add(DOL_URL_ROOT."/compta/prelevement/demandes.php",$langs->trans("Demandes")); - $menu->add_submenu(DOL_URL_ROOT."/compta/prelevement/demandes.php",$langs->trans("StandingOrderToProcess")); - $menu->add_submenu(DOL_URL_ROOT."/compta/prelevement/demandes.php?statut=1",$langs->trans("StandingOrderProcessed")); - - } - } - - $langs->load("bills"); - $menu->add(DOL_URL_ROOT."/compta/facture.php",$langs->trans("Bills")); - $menu->add_submenu(DOL_URL_ROOT."/compta/facture/impayees.php",$langs->trans("BillsUnpaid")); - - left_menu($menu->liste, $help_url); -} - -?> diff --git a/htdocs/compta/prelevement/rejet-prelevement.class.php b/htdocs/compta/prelevement/rejet-prelevement.class.php index 6b26f014297..97d71f06e80 100644 --- a/htdocs/compta/prelevement/rejet-prelevement.class.php +++ b/htdocs/compta/prelevement/rejet-prelevement.class.php @@ -17,7 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /* @@ -53,7 +52,7 @@ class RejetPrelevement $this->motifs[0] = "Non renseigne"; $this->motifs[1] = "Provision insuffisante"; $this->motifs[2] = "Tirage conteste"; - $this->motifs[3] = "Pas de bon � payer"; + $this->motifs[3] = "Pas de bon � payer"; $this->motifs[4] = "Opposition sur compte"; $this->motifs[5] = "RIB inexploitable"; $this->motifs[6] = "Compte solde"; @@ -66,16 +65,16 @@ class RejetPrelevement $error = 0; $this->id = $id; $this->bon_id = $bonid; - + dol_syslog("RejetPrelevement::Create id $id"); - + $facs = $this->_get_list_factures(); - + $this->db->begin(); /* Insert la ligne de rejet dans la base */ - + $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_rejet ("; $sql.= "fk_prelevement_lignes"; $sql.= ", date_rejet"; @@ -91,34 +90,34 @@ class RejetPrelevement $sql.= ", ".$this->db->idate(mktime()); $sql.= ", ".$facturation; $sql.= ")"; - + $result=$this->db->query($sql); - + if (!$result) { dol_syslog("RejetPrelevement::create Erreur 4"); dol_syslog("RejetPrelevement::create Erreur 4 $sql"); $error++; } - + /* Tag la ligne de prev comme rejetee */ - + $sql = " UPDATE ".MAIN_DB_PREFIX."prelevement_lignes "; $sql.= " SET statut = 3"; $sql.= " WHERE rowid = ".$id; - + if (! $this->db->query($sql)) { dol_syslog("RejetPrelevement::create Erreur 5"); $error++; } - - + + for ($i = 0 ; $i < sizeof($facs) ; $i++) - { + { $fac = new Facture($this->db); $fac->fetch($facs[$i]); - + /* Emet un paiement negatif */ $pai = new Paiement($this->db); @@ -137,8 +136,8 @@ class RejetPrelevement { $error++; dol_syslog("RejetPrelevement::Create Erreur creation paiement facture ".$facs[$i]); - } - + } + /* Valide le paiement */ if ($pai->valide() < 0) @@ -151,7 +150,7 @@ class RejetPrelevement dol_syslog("RejetPrelevement::Create set_unpaid fac ".$fac->ref); $fac->set_unpaid($fac->id, $user); - /* Envoi un email � l'emetteur de la demande de prev */ + /* Envoi un email � l'emetteur de la demande de prev */ $this->_send_email($fac); } @@ -175,12 +174,12 @@ class RejetPrelevement function _send_email($fac) { $userid = 0; - + $sql = "SELECT fk_user_demande"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; $sql.= " WHERE pfd.fk_prelevement_bons = ".$this->bon_id; $sql.= " AND pfd.fk_facture = ".$fac->id; - + $resql=$this->db->query($sql); if ($resql) { @@ -195,34 +194,34 @@ class RejetPrelevement { dol_syslog("RejetPrelevement::_send_email Erreur lecture user"); } - + if ($userid > 0) { $emuser = new User($this->db, $userid); $emuser->fetch(); - + $soc = new Societe($this->db); $soc->fetch($fac->socid); - + require_once(DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php"); - + $subject = "Prelevement rejete"; $sendto = $emuser->fullname." <".$emuser->email.">"; $from = $this->user->fullname." <".$this->user->email.">"; $msgishtml=0; - + $arr_file = array(); $arr_mime = array(); $arr_name = array(); - + $message = "Bonjour,\n"; $message .= "\nLe prelevement de la facture ".$fac->ref." pour le compte de la societe ".$soc->nom." d'un montant de ".price($fac->total_ttc)." a ete rejete par la banque."; $message .= "\n\n--\n".$this->user->fullname; - + $mailfile = new CMailFile($subject,$sendto,$from,$message, $arr_file,$arr_mime,$arr_name, '', '', 0, $msgishtml,$this->user->email); - + $result=$mailfile->sendfile(); if ($result) { @@ -246,13 +245,13 @@ class RejetPrelevement function _get_list_factures() { global $conf; - + $arr = array(); /* - * Renvoie toutes les factures associ�e � un pr�l�vement + * Renvoie toutes les factures associ�e � un pr�l�vement * */ - + $sql = "SELECT f.rowid as facid"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_facture as pf"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; @@ -286,7 +285,7 @@ class RejetPrelevement } - + /** * \brief Recupere l'objet prelevement @@ -299,20 +298,20 @@ class RejetPrelevement $sql.= ", motif"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_rejet as pr"; $sql.= " WHERE pr.fk_prelevement_lignes =".$rowid; - + if ($this->db->query($sql)) { if ($this->db->num_rows()) { $obj = $this->db->fetch_object(); - + $this->id = $rowid; $this->date_rejet = $obj->dr; $this->motif = $this->motifs[$obj->motif]; $this->db->free(); - + return 0; } else diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php index 6114fc3c30d..1a91176c145 100644 --- a/htdocs/compta/prelevement/rejets.php +++ b/htdocs/compta/prelevement/rejets.php @@ -21,7 +21,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/compta/prelevement/rejet-prelevement.class.php"); require_once(DOL_DOCUMENT_ROOT."/paiement.class.php"); @@ -43,20 +43,20 @@ llxHeader('',$langs->trans("WithdrawsRefused")); $h = 0; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Card"); -$h++; +$h++; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/factures.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Bills"); -$h++; +$h++; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/rejets.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Rejects"); $hselected = $h; -$h++; +$h++; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche-stat.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Statistics"); -$h++; +$h++; $prev_id = $_GET["id"]; @@ -95,7 +95,7 @@ if ($result) { $num = $db->num_rows($result); $i = 0; - + print_barre_liste($langs->trans("WithdrawsRefused"), $page, "rejets.php", $urladd, $sortfield, $sortorder, '', $num); print"\n<!-- debut table -->\n"; print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; @@ -111,7 +111,7 @@ if ($result) while ($i < min($num,$conf->liste_limit)) { - $obj = $db->fetch_object($result); + $obj = $db->fetch_object($result); print "<tr $bc[$var]><td>"; print '<img border="0" src="./statut'.$obj->statut.'.png"></a> '; @@ -130,7 +130,7 @@ if ($result) print "</table>"; $db->free($result); } -else +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index 031d0190698..e606824ed17 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -24,7 +24,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); $langs->load("withdrawals"); $langs->load("companies"); diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index 73dd9644ef1..3d5f086252b 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -27,7 +27,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/comm/propal/propal.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/propal.lib.php"); diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 5ea34eceab7..a4b9da3c951 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -24,7 +24,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); require_once(DOL_DOCUMENT_ROOT."/compta/facture/facture.class.php"); diff --git a/htdocs/compta/resultat/bilan.php b/htdocs/compta/resultat/bilan.php index 7fcc84856db..160fff6db75 100644 --- a/htdocs/compta/resultat/bilan.php +++ b/htdocs/compta/resultat/bilan.php @@ -22,7 +22,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/compta/tva/tva.class.php"); require_once(DOL_DOCUMENT_ROOT."/compta/chargesociales.class.php"); diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 3a2b7d09319..87bfda9332f 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -24,7 +24,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/compta/tva/tva.class.php"); require_once(DOL_DOCUMENT_ROOT."/compta/chargesociales.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/report.lib.php"); diff --git a/htdocs/compta/resultat/compteres.php b/htdocs/compta/resultat/compteres.php index ced0fe9cef1..b32b26ba8c4 100644 --- a/htdocs/compta/resultat/compteres.php +++ b/htdocs/compta/resultat/compteres.php @@ -16,8 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -require("./pre.inc.php"); + +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/compta/tva/tva.class.php"); require_once(DOL_DOCUMENT_ROOT."/compta/chargesociales.class.php"); diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 790fad2d04d..7c3d073438e 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -24,7 +24,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/lib/report.lib.php"); diff --git a/htdocs/compta/resultat/pre.inc.php b/htdocs/compta/resultat/pre.inc.php deleted file mode 100644 index 9eac2b8821e..00000000000 --- a/htdocs/compta/resultat/pre.inc.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php -/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> - * 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 - * the Free Software Foundation; either version 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ - * - */ - -/** - \file htdocs/compta/resultat/pre.inc.php - \ingroup compta - \brief Fichier gestionnaire du menu compta/stats -*/ - -require("../../main.inc.php"); - -function llxHeader($head = "") { - global $user, $conf, $langs; - - /* - * - * - */ - top_menu($head); - - $menu = new Menu(); - - $menu->add(DOL_URL_ROOT."/compta/resultat/","R�sultat / Exercice"); - $menu->add_submenu(DOL_URL_ROOT."/compta/resultat/clientfourn.php",$langs->trans("ByCompanies")); - - $menu->add(DOL_URL_ROOT."/compta/stats/index.php","Chiffre d'affaire"); - - $menu->add_submenu(DOL_URL_ROOT."/compta/stats/cumul.php","Cumul�"); - if ($conf->propal->enabled) { - $menu->add_submenu(DOL_URL_ROOT."/compta/stats/prev.php","Pr�visionnel"); - $menu->add_submenu(DOL_URL_ROOT."/compta/stats/comp.php","Transform�"); - } - $menu->add_submenu(DOL_URL_ROOT."/compta/stats/casoc.php",$langs->trans("ByCompanies")); - $menu->add_submenu(DOL_URL_ROOT."/compta/stats/cabyuser.php",$langs->trans("ByUsers")); - - left_menu($menu->liste); -} - -?> diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php index cec7a921269..c51b11207a0 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/charges.php @@ -24,7 +24,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require(DOL_DOCUMENT_ROOT."/compta/chargesociales.class.php"); $langs->load("compta"); diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index d9075e09de5..548f1d40ec6 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require(DOL_DOCUMENT_ROOT."/compta/chargesociales.class.php"); // Security check diff --git a/htdocs/compta/sociales/pre.inc.php b/htdocs/compta/sociales/pre.inc.php deleted file mode 100644 index 02e40f3057f..00000000000 --- a/htdocs/compta/sociales/pre.inc.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> - * Copyright (C) 2005-2006 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 - * the Free Software Foundation; either version 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ - */ - -/** - \file htdocs/compta/sociales/pre.inc.php - \ingroup tax - \brief Fichier gestionnaire du menu charges sociales -*/ - -require("../../main.inc.php"); - -function llxHeader($head = "") -{ - global $user, $conf, $langs; - $langs->load("compta"); - $langs->load("propal"); - - top_menu($head); - - $menu = new Menu(); - - $menu->add(DOL_URL_ROOT."/compta/charges/index.php",$langs->trans("Contributions")); - $menu->add_submenu(DOL_URL_ROOT."/compta/sociales/charges.php?action=create",$langs->trans("MenuNewSocialContribution")); - $menu->add_submenu(DOL_URL_ROOT."/compta/sociales/index.php",$langs->trans("List")); - - left_menu($menu->liste); -} - -?> diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 0ebe09c5728..e7cc6be0816 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -24,7 +24,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/lib/report.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/tax.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php"); diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 5b67eec34bc..79c13dba6bf 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/lib/report.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/tax.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php"); diff --git a/htdocs/compta/stats/comp.php b/htdocs/compta/stats/comp.php index e266fb5f232..5273ec249b2 100644 --- a/htdocs/compta/stats/comp.php +++ b/htdocs/compta/stats/comp.php @@ -23,7 +23,8 @@ * \ingroup commercial * \version $Id$ */ -require("./pre.inc.php"); + +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/lib/accountancy.lib.php"); // Security check @@ -34,10 +35,10 @@ if ($user->societe_id > 0) -function propals ($db, $year, $month) +function propals ($db, $year, $month) { global $bc,$langs,$conf; - + $sql = "SELECT s.nom, s.rowid as socid, p.rowid as propalid, p.price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."propal as p"; @@ -140,7 +141,7 @@ function factures ($db, $year, $month, $paye) print "<td>Num</td>"; print "<td align=\"right\">Date</td>"; print "<td align=\"right\">Montant</td>"; - print "<td align=\"right\">Pay�</td>"; + print "<td align=\"right\">Pay�</td>"; print "</tr>\n"; $var=True; while ($i < $num) @@ -158,17 +159,17 @@ function factures ($db, $year, $month, $paye) { print "<td align=\"right\"><b>!!!</b></td>\n"; } - + print "<td align=\"right\">".price($objp->total)."</td>\n"; - + $payes[1] = "oui"; $payes[0] = "<b>non</b>"; print "<td align=\"right\">".$payes[$objp->paye]."</td>\n"; print "</tr>\n"; - + $total = $total + $objp->total; - + $i++; } print "<tr><td colspan=\"4\" align=\"right\">"; @@ -184,7 +185,7 @@ function factures ($db, $year, $month, $paye) } -function pt ($db, $sql, $year) +function pt ($db, $sql, $year) { global $bc, $langs; @@ -261,9 +262,9 @@ function ppt ($db, $year, $socid) print "<table width=\"100%\">"; print '<tr class="liste_titre"><td align="center" valign="top" width="30%">'; - print "CA Pr�visionnel bas� sur les propal $year"; + print "CA Pr�visionnel bas� sur les propal $year"; - print "</td><td align=\"center\" valign=\"top\">CA R�alis� $year</td>"; + print "</td><td align=\"center\" valign=\"top\">CA R�alis� $year</td>"; print "<td align=\"center\" valign=\"top\">Delta $year</td></tr>"; print '<tr><td valign="top" align="center" width="30%">'; @@ -336,7 +337,7 @@ llxHeader(); $cyear = isset($_GET["year"])?$_GET["year"]:0; if (! $cyear) { $cyear = strftime ("%Y", time()); } -print_fiche_titre("Chiffre d'Affaire transform� (pr�vu-r�alis�)",($cyear?"<a href='comp.php?year=".($cyear-1)."'>".img_previous()."</a> Ann�e $cyear <a href='comp.php?year=".($cyear+1)."'>".img_next()."</a>":"")); +print_fiche_titre("Chiffre d'Affaire transform� (pr�vu-r�alis�)",($cyear?"<a href='comp.php?year=".($cyear-1)."'>".img_previous()."</a> Ann�e $cyear <a href='comp.php?year=".($cyear+1)."'>".img_next()."</a>":"")); ppt($db, $cyear, $socid); diff --git a/htdocs/compta/stats/cumul.php b/htdocs/compta/stats/cumul.php index e294642fffc..a1d23f96e2a 100644 --- a/htdocs/compta/stats/cumul.php +++ b/htdocs/compta/stats/cumul.php @@ -20,14 +20,14 @@ /** \file htdocs/compta/stats/cumul.php - \brief Page reporting compta chiffre affaire cumul� + \brief Page reporting compta chiffre affaire cumule \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); -// S�curit� acc�s client -if ($user->societe_id > 0) +// Security check +if ($user->societe_id > 0) { $socid = $user->societe_id; } @@ -41,7 +41,7 @@ if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"]; llxHeader(); -print_titre("Chiffre d'affaire cumul� (".$langs->trans("Currency".$conf->monnaie)." HT)"); +print_titre("Chiffre d'affaire cumul� (".$langs->trans("Currency".$conf->monnaie)." HT)"); print '<table width="100%"><tr><td valign="top">'; @@ -66,7 +66,7 @@ if ($socid) $sql.= " AND f.fk_soc = ".$socid; $sql.= " GROUP BY dm"; -pt($db, $sql,"Suivi cumul par ann�e"); +pt($db, $sql,"Suivi cumul par ann�e"); print "</td></tr></table>"; @@ -84,7 +84,7 @@ llxFooter('$Date$ - $Revision$'); function pt ($db, $sql, $date) { global $langs; - + $bc[0]="class=\"pair\""; $bc[1]="class=\"impair\""; @@ -100,7 +100,7 @@ function pt ($db, $sql, $date) print "<td align=\"right\">".$langs->trans("Total")."</td>\n"; print "</tr>\n"; $var=True; - while ($i < $num) + while ($i < $num) { $obj = $db->fetch_object($resql); $var=!$var; @@ -109,11 +109,11 @@ function pt ($db, $sql, $date) print "<td>$obj->dm</td>\n"; print "<td align=\"right\">".price($obj->amount)."</td><td align=\"right\">".price($total)."</td>\n"; print "</tr>\n"; - + $i++; } print "<tr class=\"liste_total\"><td align=\"right\">".$langs->trans("Total")."</td><td align=\"right\"> </b></td><td align=\"right\"><b>".price($total)."</b></td></tr>\n"; - + print "</table>\n"; $db->free($resql); } diff --git a/htdocs/compta/stats/exercices.php b/htdocs/compta/stats/exercices.php index 1bc0adca54a..a055d04f716 100644 --- a/htdocs/compta/stats/exercices.php +++ b/htdocs/compta/stats/exercices.php @@ -23,16 +23,15 @@ \brief Page ??? \version $Id$ */ - -require("./pre.inc.php"); -require("./lib.inc.php"); + +require('../../main.inc.php'); // Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES') $modecompta = $conf->compta->mode; if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"]; -// S�curit� acc�s client -if ($user->societe_id > 0) +// S�curit� acc�s client +if ($user->societe_id > 0) { $socid = $user->societe_id; } @@ -41,7 +40,7 @@ if ($user->societe_id > 0) llxHeader(); -print_titre("Comparatif CA ann�e en cours avec ann�e pr�c�dente (".$langs->trans("Currency".$conf->monnaie)." HT, ".$modecompta.")"); +print_titre("Comparatif CA ann�e en cours avec ann�e pr�c�dente (".$langs->trans("Currency".$conf->monnaie)." HT, ".$modecompta.")"); print "<br>\n"; @@ -71,7 +70,7 @@ function factures ($db, $year, $month, $paye) print "<TD>Num</TD>"; print "<TD align=\"right\">Date</TD>"; print "<TD align=\"right\">Montant</TD>"; - print "<TD align=\"right\">Pay�</TD>"; + print "<TD align=\"right\">Pay�</TD>"; print "</TR>\n"; $var=True; while ($i < $num) { @@ -85,18 +84,18 @@ function factures ($db, $year, $month, $paye) } else { print "<TD align=\"right\"><b>!!!</b></TD>\n"; } - + print "<TD align=\"right\">".price($objp->amount)."</TD>\n"; - + $payes[1] = "oui"; $payes[0] = "<b>non</b>"; - - + + print "<TD align=\"right\">".$payes[$objp->paye]."</TD>\n"; print "</TR>\n"; - + $total = $total + $objp->amount; - + $i++; } print "<tr><td align=\"right\"><b>".$langs->trans("Total")." : ".price($total)."</b></td><td></td></tr>"; @@ -129,7 +128,7 @@ function pt ($db, $sql, $year) { for ($b = $month ; $b < $obj->dm ; $b++) { print "<tr $bc[$var]>"; print "<td>".dol_print_date(dol_mktime(12,0,0,$b, 1, $year),"%b")."</td>\n"; - print "<td align=\"right\">0</td>\n"; + print "<td align=\"right\">0</td>\n"; print "</tr>\n"; $var=!$var; $ca[$b] = 0; @@ -141,7 +140,7 @@ function pt ($db, $sql, $year) { print "<td>"; print dol_print_date(dol_mktime(12,0,0,$obj->dm, 1, $year),"%b")."</td>\n"; print "<td align=\"right\">".price($obj->sum)."</td>\n"; - + print "</tr>\n"; $month = $obj->dm + 1; $ca[$obj->dm] = $obj->sum; @@ -161,13 +160,13 @@ function pt ($db, $sql, $year) { $var=!$var; print "<tr $bc[$var]>"; print "<td>".dol_print_date(dol_mktime(12,0,0,$b, 1, $year),"%b")."</td>\n"; - print "<td align=\"right\">0</td>\n"; + print "<td align=\"right\">0</td>\n"; print "</tr>\n"; $ca[$b] = 0; } } - print "<tr class=\"total\"><td align=\"right\">Total :</td><td align=\"right\"><b>".price($total)."</b></td></tr>"; + print "<tr class=\"total\"><td align=\"right\">Total :</td><td align=\"right\"><b>".price($total)."</b></td></tr>"; print "</table>"; $db->free(); @@ -184,11 +183,11 @@ function ppt ($db, $year, $socid) print "<tr class=\"liste_titre\"><td align=\"center\" width=\"30%\">"; print "CA ".($year - 1); - + print "</td><td align=\"center\">CA $year</td>"; print '<td align="center">Delta</td></tr>'; print "<tr><td valign=\"top\" width=\"30%\">"; - + $sql = "SELECT sum(f.total) as sum, round(date_format(f.datef, '%m')) as dm"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql.= " WHERE f.fk_statut in (1,2)"; @@ -197,11 +196,11 @@ function ppt ($db, $year, $socid) if ($conf->compta->mode != 'CREANCES-DETTES') $sql.= " AND f.paye = 1"; if ($socid) $sql.= " AND f.fk_soc = ".$socid; $sql.= " GROUP BY dm"; - + $prev = pt($db, $sql, $year - 1); - + print "</td><td valign=\"top\" width=\"30%\">"; - + $sql = "SELECT sum(f.total) as sum, round(date_format(f.datef, '%m')) as dm"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql.= " WHERE f.fk_statut in (1,2)"; @@ -210,11 +209,11 @@ function ppt ($db, $year, $socid) if ($conf->compta->mode != 'CREANCES-DETTES') $sql.= " AND f.paye = 1"; if ($socid) $sql.= " AND f.fk_soc = ".$socid; $sql.= " GROUP BY dm"; - + $ca = pt($db, $sql, $year); - + print "</td><td valign=\"top\" width=\"30%\">"; - + print '<table class="border" width="100%" cellspacing="0" cellpadding="3">'; print "<tr class=\"liste_titre\">"; print '<td>'.$langs->trans("Month").'</td>'; diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 3dd0bd7bf74..ceb8c2e19db 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -24,7 +24,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/lib/report.lib.php"); diff --git a/htdocs/compta/stats/pre.inc.php b/htdocs/compta/stats/pre.inc.php deleted file mode 100644 index 204b68065ae..00000000000 --- a/htdocs/compta/stats/pre.inc.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php -/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> - * 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 - * the Free Software Foundation; either version 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ - * - */ - -/** - \file htdocs/compta/stats/pre.inc.php - \ingroup compta - \brief Fichier gestionnaire du menu compta/stats -*/ - -require("../../main.inc.php"); - -function llxHeader($head = "") { - global $user, $conf, $langs; - - /* - * - * - */ - top_menu($head); - - $menu = new Menu(); - - $menu->add(DOL_URL_ROOT."/compta/resultat/","R�sultat / Exercice"); - $menu->add_submenu(DOL_URL_ROOT."/compta/resultat/clientfourn.php",$langs->trans("ByCompanies")); - - $menu->add(DOL_URL_ROOT."/compta/stats/index.php","Chiffre d'affaire"); - - $menu->add_submenu(DOL_URL_ROOT."/compta/stats/cumul.php","Cumul�"); - if ($conf->propal->enabled) { - $menu->add_submenu(DOL_URL_ROOT."/compta/stats/prev.php","Pr�visionnel"); - $menu->add_submenu(DOL_URL_ROOT."/compta/stats/comp.php","Transform�"); - } - $menu->add_submenu(DOL_URL_ROOT."/compta/stats/casoc.php",$langs->trans("ByCompanies")); - $menu->add_submenu(DOL_URL_ROOT."/compta/stats/cabyuser.php",$langs->trans("ByUsers")); - - left_menu($menu->liste); -} - -?> diff --git a/htdocs/compta/stats/prev.php b/htdocs/compta/stats/prev.php index 47cb6f0bf69..155b9c9257f 100644 --- a/htdocs/compta/stats/prev.php +++ b/htdocs/compta/stats/prev.php @@ -18,15 +18,12 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ - * */ -require("./pre.inc.php"); -/* - * S�curit� acc�s client - */ -if ($user->societe_id > 0) +require('../../main.inc.php'); + +// Security check +if ($user->societe_id > 0) { $socid = $user->societe_id; } @@ -41,37 +38,37 @@ function pt ($db, $sql, $title) { print "<td>$title</td>"; print "<td align=\"right\">Montant</td>"; print "</tr>\n"; - + $result = $db->query($sql); - if ($result) + if ($result) { $num = $db->num_rows(); $i = 0; $total = 0 ; - + $var=True; - while ($i < $num) + while ($i < $num) { $obj = $db->fetch_object($result); $var=!$var; print '<tr '.$bc[$var].'>'; print '<td>'.$obj->dm.'</td>'; print '<td align="right">'.price($obj->amount).'</td>'; - + print "</tr>\n"; $total = $total + $obj->amount; $i++; } print "<tr class=\"total\"><td colspan=\"2\" align=\"right\"><b>".$langs->trans("TotalHT").": ".price($total)."</b> ".$langs->trans("Currency".$conf->monnaie)."</td></tr>"; - + $db->free(); - } - else + } + else { dol_print_error($db); } print "</table>"; - + } /* * @@ -91,7 +88,7 @@ if ($sortorder == "") $in = "(1,2,4)"; -print_titre ("CA Pr�visionnel bas� sur les propositions <b>ouvertes</b> et <b>sign�es</b>"); +print_titre ("CA Pr�visionnel bas� sur les propositions <b>ouvertes</b> et <b>sign�es</b>"); print '<table width="100%">'; @@ -115,7 +112,7 @@ $sql.= " AND p.entity = ".$conf->entity; if ($socid) $sql.= " AND p.fk_soc = ".$socid; $sql.= " GROUP BY dm DESC"; -pt($db, $sql, "Ann�e"); +pt($db, $sql, "Ann�e"); print "<br>"; @@ -126,7 +123,7 @@ $sql.= " AND p.entity = ".$conf->entity; if ($socid) $sql.= " AND p.fk_soc = ".$socid; $sql.= " GROUP BY dm"; -pt($db, $sql, "Mois cumul�s"); +pt($db, $sql, "Mois cumul�s"); print "</td></tr></table>"; diff --git a/htdocs/compta/tva.php b/htdocs/compta/tva.php index 1bd600d281f..8a5d39c1781 100644 --- a/htdocs/compta/tva.php +++ b/htdocs/compta/tva.php @@ -17,12 +17,11 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /* \deprecated Ce fichier semble ne plus servir. A virer */ - -require("./pre.inc.php"); + +require('../main.inc.php'); /* @@ -31,7 +30,7 @@ require("./pre.inc.php"); */ function pt ($db, $sql, $date) { - global $bc; + global $bc; $result = $db->query($sql); if ($result) { @@ -51,13 +50,13 @@ function pt ($db, $sql, $date) { print "<TD>$obj->dm</TD>\n"; print "<TD align=\"right\">".price($obj->amount)."</TD><td> </td>\n"; print "</TR>\n"; - + $total = $total + $obj->amount; - + $i++; } print "<tr><td align=\"right\">".$langs->trans("TotalHT").":</td><td align=\"right\"><b>".price($total)."</b></td><td>".$langs->trans("Currency".$conf->monnaie)."</td></tr>"; - + print "</table>"; $db->free(); } @@ -74,7 +73,7 @@ $yearc = strftime("%Y",time()); echo '<table width="100%"><tr><td width="50%" valign="top">'; -print "<b>TVA collect�e</b>"; +print "<b>TVA collect�e</b>"; for ($y = $yearc ; $y >= $conf->years ; $y=$y-1 ) { @@ -84,14 +83,14 @@ for ($y = $yearc ; $y >= $conf->years ; $y=$y-1 ) { $sql = "SELECT sum(f.tva) as amount , date_format(f.datef,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1 AND f.datef >= '$y-01-01' AND f.datef <= '$y-12-31' "; $sql .= " GROUP BY dm DESC"; - - pt($db, $sql,"Ann�e $y"); - + + pt($db, $sql,"Ann�e $y"); + print "</td></tr></table>"; } echo '</td><td valign="top" width="50%">'; -echo 'Tva Pay�e<br>'; +echo 'Tva Pay�e<br>'; echo '</td></tr></table>'; diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index e0a102706f1..e6dec679407 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -26,7 +26,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/lib/report.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/tax.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php"); diff --git a/htdocs/compta/tva/fiche.php b/htdocs/compta/tva/fiche.php index aa9f0f64964..65786e44ca5 100644 --- a/htdocs/compta/tva/fiche.php +++ b/htdocs/compta/tva/fiche.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/compta/tva/tva.class.php"); require_once(DOL_DOCUMENT_ROOT."/compta/bank/account.class.php"); diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index ca7b890e2fc..c68d596a38e 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -25,7 +25,7 @@ * \brief Index page of VAT reports * \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/lib/tax.lib.php"); require_once(DOL_DOCUMENT_ROOT."/compta/tva/tva.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php"); diff --git a/htdocs/compta/tva/pre.inc.php b/htdocs/compta/tva/pre.inc.php deleted file mode 100644 index 77e36044199..00000000000 --- a/htdocs/compta/tva/pre.inc.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> - * Copyright (C) 2005-2008 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 - * the Free Software Foundation; either version 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -require("../../main.inc.php"); - -function llxHeader($head = "") { - global $user, $conf, $langs; - - - /* - * - * - */ - top_menu($head); - - $menu = new Menu(); - - $menu->add("index.php",$langs->trans("VAT")); - - $menu->add_submenu("reglement.php",$langs->trans("Payments")); - $menu->add_submenu("fiche.php?action=create",$langs->trans("NewPayment")); - $menu->add_submenu("clients.php",$langs->trans("Clients")); - $menu->add_submenu("quadri.php",$langs->trans("Quadri")); - - left_menu($menu->liste); -} - -?> diff --git a/htdocs/compta/tva/quadri.php b/htdocs/compta/tva/quadri.php index b7ee3635bec..cceb406543f 100644 --- a/htdocs/compta/tva/quadri.php +++ b/htdocs/compta/tva/quadri.php @@ -1,6 +1,6 @@ <?php /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> - * Copyright (C) 2004 �ric Seigne <eric.seigne@ryxeo.com> + * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006 Yannick Warnier <ywarnier@beeznest.org> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> @@ -28,7 +28,7 @@ \todo Deal with recurrent invoices as well */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/compta/tva/tva.class.php"); $year=$_GET["year"]; @@ -49,10 +49,10 @@ $result = restrictedArea($user, 'tax', '', '', 'charges'); /** * Gets VAT to collect for the given month of the given year - * + * * The function gets the VAT in split results, as the VAT declaration asks * to report the amounts for different VAT rates as different lines. - * This function also accounts recurrent invoices + * This function also accounts recurrent invoices * @param object Database handler object * @param integer Year * @param integer Year quarter (1-4) @@ -75,7 +75,7 @@ function tva_coll($db,$y,$q) $sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3); $sql.= " AND date_format(f.datef,'%m') <= ".($q*3).")"; $sql.= " ORDER BY rate, facid"; - + } else { @@ -94,7 +94,7 @@ function tva_coll($db,$y,$q) $list[$assoc['rate']]['totalht'] = $assoc['totalht']; $list[$assoc['rate']]['vat'] = $assoc['amount']; $list[$assoc['rate']]['facid'][] = $assoc['facid']; - $list[$assoc['rate']]['facnum'][] = $assoc['facnum']; + $list[$assoc['rate']]['facnum'][] = $assoc['facnum']; }else{ $list[$assoc['rate']]['totalht'] += $assoc['totalht']; $list[$assoc['rate']]['vat'] += $assoc['amount']; @@ -116,9 +116,9 @@ function tva_coll($db,$y,$q) /** * Gets VAT to pay for the given month of the given year - * + * * The function gets the VAT in split results, as the VAT declaration asks - * to report the amounts for different VAT rates as different lines. + * to report the amounts for different VAT rates as different lines. * @param object Database handler object * @param integer Year * @param integer Year quarter (1-4) @@ -159,7 +159,7 @@ function tva_paye($db, $y,$q) $list[$assoc['rate']]['totalht'] = $assoc['totalht']; $list[$assoc['rate']]['vat'] = $assoc['amount']; $list[$assoc['rate']]['facid'][] = $assoc['facid']; - $list[$assoc['rate']]['facnum'][] = $assoc['facnum']; + $list[$assoc['rate']]['facnum'][] = $assoc['facnum']; }else{ $list[$assoc['rate']]['totalht'] += $assoc['totalht']; $list[$assoc['rate']]['vat'] += $assoc['amount']; @@ -214,8 +214,8 @@ print "</tr>\n"; if ($conf->compta->mode == "CREANCES-DETTES") { $y = $year_current ; - - + + $total = 0; $subtotal = 0; $i=0; $subtot_coll_total = 0; @@ -226,7 +226,7 @@ if ($conf->compta->mode == "CREANCES-DETTES") { print "<tr class=\"liste_titre\"><td colspan=\"8\">".$langs->trans("Quadri")." $q (".dol_print_date(dol_mktime(0,0,0,(($q-1)*3)+1,1,$y),"%b %Y").' - '.dol_print_date(dol_mktime(0,0,0,($q*3),1,$y),"%b %Y").")</td></tr>"; $var=true; - + $x_coll = tva_coll($db, $y, $q); $x_paye = tva_paye($db, $y, $q); $x_both = array(); @@ -245,8 +245,8 @@ if ($conf->compta->mode == "CREANCES-DETTES") $x_both[$my_paye_rate]['paye']['totalht'] = $x_paye[$my_paye_rate]['totalht']; $x_both[$my_paye_rate]['paye']['vat'] = $x_paye[$my_paye_rate]['vat']; if(!isset($x_both[$my_paye_rate]['coll']['totalht'])){ - $x_both[$my_paye_rate]['coll']['total_ht'] = 0; - $x_both[$my_paye_rate]['coll']['vat'] = 0; + $x_both[$my_paye_rate]['coll']['total_ht'] = 0; + $x_both[$my_paye_rate]['coll']['vat'] = 0; } $x_both[$my_paye_rate]['paye']['links'] = ''; foreach($x_paye[$my_paye_rate]['facid'] as $id=>$dummy){ @@ -254,7 +254,7 @@ if ($conf->compta->mode == "CREANCES-DETTES") } } //now we have an array (x_both) indexed by rates for coll and paye - + $x_coll_sum = 0; $x_coll_ht = 0; $x_paye_sum = 0; @@ -282,7 +282,7 @@ if ($conf->compta->mode == "CREANCES-DETTES") $diff = $x_coll_sum - $x_paye_sum; $total = $total + $diff; $subtotal = $subtotal + $diff; - + $var=!$var; print "<tr $bc[$var]>"; print '<td colspan="7"></td>'; diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 3904b858cbe..8d2c95bdfee 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -27,7 +27,7 @@ * \todo Deal with recurrent invoices as well */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/lib/report.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/tax.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php"); diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php index 0b6d99cdc2d..ef4c94b2095 100644 --- a/htdocs/compta/tva/reglement.php +++ b/htdocs/compta/tva/reglement.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/compta/tva/tva.class.php"); $langs->load("compta"); diff --git a/htdocs/compta/ventilation/fiche.php b/htdocs/compta/ventilation/fiche.php index 9c524c532ba..892caeb30a9 100644 --- a/htdocs/compta/ventilation/fiche.php +++ b/htdocs/compta/ventilation/fiche.php @@ -17,7 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -27,7 +26,7 @@ \version $Revision$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/compta/facture/facture.class.php"); $langs->load("bills"); @@ -69,8 +68,8 @@ $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); - $i = 0; - + $i = 0; + while ($i < $num) { $row = $db->fetch_row($result); diff --git a/htdocs/compta/ventilation/fournisseur/fiche.php b/htdocs/compta/ventilation/fournisseur/fiche.php index a2a3c684ebb..302746bf3f2 100644 --- a/htdocs/compta/ventilation/fournisseur/fiche.php +++ b/htdocs/compta/ventilation/fournisseur/fiche.php @@ -17,8 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ - * */ /** @@ -28,7 +26,7 @@ \version $Revision$ */ -require("./pre.inc.php"); +require('../../../main.inc.php'); $mesg = ''; @@ -62,8 +60,8 @@ $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); - $i = 0; - + $i = 0; + while ($i < $num) { $row = $db->fetch_row($result); @@ -84,17 +82,17 @@ if($_GET["id"]) $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as l"; $sql .= " , ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " WHERE f.rowid = l.fk_facture_fourn AND f.fk_statut = 1 AND l.rowid = ".$_GET["id"]; - + $result = $db->query($sql); if ($result) { $num_lignes = $db->num_rows($result); - $i = 0; - + $i = 0; + if ($num_lignes) { - + $objp = $db->fetch_object($result); @@ -105,9 +103,9 @@ if($_GET["id"]) 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>'; @@ -126,7 +124,7 @@ if($_GET["id"]) } print '</td></tr>'; - + if($objp->fk_code_ventilation == 0) { print '<tr><td> </td><td><input type="submit" value="'.$langs->trans("Ventiler").'"></td></tr>'; diff --git a/htdocs/compta/ventilation/fournisseur/index.php b/htdocs/compta/ventilation/fournisseur/index.php index a88c0e53ec9..f7a7ced2b35 100644 --- a/htdocs/compta/ventilation/fournisseur/index.php +++ b/htdocs/compta/ventilation/fournisseur/index.php @@ -18,8 +18,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ - * */ /** @@ -29,7 +27,7 @@ \version $Revision$ */ -require("./pre.inc.php"); +require('../../../main.inc.php'); $langs->load("suppliers"); diff --git a/htdocs/compta/ventilation/fournisseur/lignes.php b/htdocs/compta/ventilation/fournisseur/lignes.php index 7e1c21bd710..05d8db6ce5f 100644 --- a/htdocs/compta/ventilation/fournisseur/lignes.php +++ b/htdocs/compta/ventilation/fournisseur/lignes.php @@ -25,7 +25,7 @@ \version $Revision$ */ -require("./pre.inc.php"); +require('../../../main.inc.php'); $langs->load("bills"); @@ -68,8 +68,8 @@ $result = $db->query($sql); if ($result) { $num_lignes = $db->num_rows($result); - $i = 0; - + $i = 0; + print_barre_liste("Lignes de facture ventil�es",$page,"lignes.php","",$sortfield,$sortorder,'',$num_lignes); print '<form method="GET" action="lignes.php">'; @@ -79,7 +79,7 @@ if ($result) print '<td align="right">'.$langs->trans("Montant").'</td>'; print '<td colspan="2" align="center">'.$langs->trans("Compte").'</td>'; 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 align="right"> </td>'; @@ -93,11 +93,11 @@ if ($result) $objp = $db->fetch_object($result); $var=!$var; print "<tr $bc[$var]>"; - + print '<td><a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$objp->facid.'">'.$objp->facnumber.'</a></td>'; print '<td>'.stripslashes(nl2br($objp->description)).'</td>'; - print '<td align="right">'.price($objp->price).'</td>'; + print '<td align="right">'.price($objp->price).'</td>'; print '<td align="right">'.$objp->numero.'</td>'; print '<td align="left">'.stripslashes($objp->intitule).'</td>'; diff --git a/htdocs/compta/ventilation/fournisseur/liste.php b/htdocs/compta/ventilation/fournisseur/liste.php index 41e10c2c2cf..9a11c78906d 100644 --- a/htdocs/compta/ventilation/fournisseur/liste.php +++ b/htdocs/compta/ventilation/fournisseur/liste.php @@ -1,6 +1,6 @@ <?php /* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> - * Copyright (C) 2004 �ric Seigne <eric.seigne@ryxeo.com> + * Copyright (C) 2004 �ric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net> * * This program is free software; you can redistribute it and/or modify @@ -21,21 +21,21 @@ */ -/** +/** \file htdocs/compta/ventilation/liste.php \ingroup compta \brief Page de ventilation des lignes de facture \version $Revision$ */ -require("./pre.inc.php"); +require('../../../main.inc.php'); $langs->load("bills"); if (!$user->rights->facture->lire) accessforbidden(); if (!$user->rights->compta->ventilation->creer) accessforbidden(); /* - * S�curit� acc�s client + * S�curit� acc�s client */ if ($user->societe_id > 0) accessforbidden(); @@ -61,9 +61,9 @@ $result = $db->query($sql); if ($result) { $num_lignes = $db->num_rows($result); - $i = 0; - - print_barre_liste("Lignes de facture � ventiler",$page,"liste.php","",$sortfield,$sortorder,'',$num_lignes); + $i = 0; + + print_barre_liste("Lignes de facture � ventiler",$page,"liste.php","",$sortfield,$sortorder,'',$num_lignes); print '<table class="noborder" width="100%">'; print '<tr class="liste_titre"><td>Facture</td>'; @@ -78,9 +78,9 @@ if ($result) $objp = $db->fetch_object($result); $var=!$var; print "<tr $bc[$var]>"; - + print '<td><a href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$objp->facid.'">'.$objp->facnumber.'</a></td>'; - print '<td>'.stripslashes(nl2br($objp->description)).'</td>'; + print '<td>'.stripslashes(nl2br($objp->description)).'</td>'; print '<td align="right">'; print price($objp->price); @@ -93,11 +93,11 @@ if ($result) print "</tr>"; $i++; } - + print "</table>"; - - - + + + } else { diff --git a/htdocs/compta/ventilation/fournisseur/pre.inc.php b/htdocs/compta/ventilation/fournisseur/pre.inc.php deleted file mode 100644 index 8be9ffb4cb6..00000000000 --- a/htdocs/compta/ventilation/fournisseur/pre.inc.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php -/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> - * Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> - * Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com> - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ - */ - -/** - \file htdocs/compta/ventilation/fournisseur/pre.inc.php - \ingroup compta - \brief Fichier gestionnaire du menu compta ventilation -*/ - -require("../../../main.inc.php"); - - -function llxHeader($head = "", $title="", $help_url='') -{ - global $user, $conf, $langs; - - top_menu($head, $title); - - $menu = new Menu(); - - $langs->load("commercial"); - $menu->add(DOL_URL_ROOT."/compta/clients.php", $langs->trans("Customers")); - - $menu->add(DOL_URL_ROOT."/compta/ventilation/",$langs->trans("Ventilation")." ".$langs->trans("Customers")); - $menu->add(DOL_URL_ROOT."/compta/ventilation/fournisseur/",$langs->trans("Ventilation")." ".$langs->trans("Suppliers")); - $menu->add_submenu(DOL_URL_ROOT."/compta/ventilation/fournisseur/liste.php",$langs->trans("ToDispatch")); - $menu->add_submenu(DOL_URL_ROOT."/compta/ventilation/fournisseur/lignes.php",$langs->trans("Dispatched")); - - $menu->add(DOL_URL_ROOT."/compta/export/",$langs->trans("Export")); - - - left_menu($menu->liste, $help_url); -} - -?> diff --git a/htdocs/compta/ventilation/index.php b/htdocs/compta/ventilation/index.php index 3d97679add6..ecfda6db26e 100644 --- a/htdocs/compta/ventilation/index.php +++ b/htdocs/compta/ventilation/index.php @@ -17,7 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -27,7 +26,7 @@ \version $Revision$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); $langs->load("compta"); $langs->load("bills"); @@ -80,7 +79,7 @@ if ($resql) $i = 0; $num = $db->num_rows($resql); $var=true; - + while ($i < $num) { diff --git a/htdocs/compta/ventilation/lignes.php b/htdocs/compta/ventilation/lignes.php index c511f92a184..634823e560c 100644 --- a/htdocs/compta/ventilation/lignes.php +++ b/htdocs/compta/ventilation/lignes.php @@ -17,7 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -27,7 +26,7 @@ * \version $Revision$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/compta/facture/facture.class.php"); require_once(DOL_DOCUMENT_ROOT."/product/product.class.php"); diff --git a/htdocs/compta/ventilation/liste.php b/htdocs/compta/ventilation/liste.php index a6168d367e4..89f1ade9631 100644 --- a/htdocs/compta/ventilation/liste.php +++ b/htdocs/compta/ventilation/liste.php @@ -18,7 +18,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ @@ -29,7 +28,7 @@ * \version $Revision$ */ -require("./pre.inc.php"); +require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/compta/facture/facture.class.php"); require_once(DOL_DOCUMENT_ROOT."/product/product.class.php"); diff --git a/htdocs/compta/ventilation/pre.inc.php b/htdocs/compta/ventilation/pre.inc.php deleted file mode 100644 index facc1f5443d..00000000000 --- a/htdocs/compta/ventilation/pre.inc.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php -/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> - * 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 - * the Free Software Foundation; either version 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ - */ - -/** - \file htdocs/compta/ventilation/pre.inc.php - \ingroup compta - \brief Fichier gestionnaire du menu compta ventilation -*/ - -require("../../main.inc.php"); - - -function llxHeader($head = "", $title="", $help_url='') -{ - global $user, $conf, $langs; - - top_menu($head, $title); - - $menu = new Menu(); - - $langs->load("commercial"); - $menu->add(DOL_URL_ROOT."/compta/clients.php", $langs->trans("Customers")); - - $menu->add(DOL_URL_ROOT."/compta/ventilation/",$langs->trans("Ventilation")); - $menu->add_submenu(DOL_URL_ROOT."/compta/ventilation/liste.php",$langs->trans("ToDispatch")); - $menu->add_submenu(DOL_URL_ROOT."/compta/ventilation/lignes.php",$langs->trans("Dispatched")); - - $menu->add(DOL_URL_ROOT."/compta/export/",$langs->trans("Export")); - - - left_menu($menu->liste, $help_url); -} - -?> -- GitLab