From 609ce3ac18287a35fedb5e3eac1171639b67653c Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 11 Jan 2005 09:37:35 +0000 Subject: [PATCH] Nouveau fichier --- htdocs/compta/prelevement/bons.php | 137 +++++++++++++++++++++++++ htdocs/compta/prelevement/demandes.php | 114 ++++++++++++++++++++ 2 files changed, 251 insertions(+) create mode 100644 htdocs/compta/prelevement/bons.php create mode 100644 htdocs/compta/prelevement/demandes.php diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php new file mode 100644 index 00000000000..3388da1b735 --- /dev/null +++ b/htdocs/compta/prelevement/bons.php @@ -0,0 +1,137 @@ + + * + * 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$ + * + */ +require("./pre.inc.php"); + +$page = $_GET["page"]; +$sortorder = $_GET["sortorder"]; +$sortfield = $_GET["sortfield"]; + +llxHeader('','Telephonie - Ligne - Liste'); +/* + * Sécurité accés client + */ +if ($user->societe_id > 0) +{ + $action = ''; + $socidp = $user->societe_id; +} + +if ($sortorder == "") { + $sortorder="DESC"; +} +if ($sortfield == "") { + $sortfield="p.datec"; +} + +/* + * Recherche + * + * + */ + +if ($page == -1) { $page = 0 ; } + +$offset = $conf->liste_limit * $page ; +$pageprev = $page - 1; +$pagenext = $page + 1; + +/* + * Mode Liste + * + * + * + */ +$sql = "SELECT p.rowid, p.ref, p.amount,".$db->pdate("p.datec")." as datec"; +$sql .= " FROM ".MAIN_DB_PREFIX."prelevement as p"; + +if ($_GET["search_client"]) +{ + $sel =urldecode($_GET["search_client"]); + $sql .= " AND s.nom LIKE '%".$sel."%'"; +} + +$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); + +$result = $db->query($sql); +if ($result) +{ + $num = $db->num_rows(); + $i = 0; + + $urladd= "&statut=".$_GET["statut"]; + + print_barre_liste("Prélèvements", $page, "bons.php", $urladd, $sortfield, $sortorder, '', $num); + print"\n\n"; + print ''; + print ''; + + print_liste_field_titre("Bon","bons.php","p.ref"); + print_liste_field_titre("Date","bons.php","p.datec","","",'align="center"'); + + print ''; + + print ''; + + print ''; + print ''; + print ''; + print ''; + + + print ''; + print ''; + + + $var=True; + + while ($i < min($num,$conf->liste_limit)) + { + $obj = $db->fetch_object($i); + $var=!$var; + + print "\n"; + + print '\n"; + + print '\n"; + + print "\n"; + $i++; + } + print "
Montant
 
"; + + print ''; + print img_file(); + print ' '; + + print ''.$obj->ref."'.strftime("%d/%m/%Y",$obj->datec)."'.price($obj->amount)." euros
"; + $db->free(); +} +else +{ + print $db->error() . ' ' . $sql; +} + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php new file mode 100644 index 00000000000..97a41938db6 --- /dev/null +++ b/htdocs/compta/prelevement/demandes.php @@ -0,0 +1,114 @@ + + * + * 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/prelevement/index.php + \brief Prelevement + \version $Revision$ +*/ + +require("./pre.inc.php"); + +require_once DOL_DOCUMENT_ROOT."/includes/modules/modPrelevement.class.php"; + +if ($user->societe_id > 0) +{ + $socidp = $user->societe_id; +} + +llxHeader(); + +print_titre($langs->trans("Demandes de prélèvement à traiter")); + +print '
'; + +/* + * Demandes en attente + * + */ + + +if ($sortorder == "") $sortorder="DESC"; + +if ($sortfield == "") $sortfield="f.facnumber"; + +$sql = "SELECT f.facnumber, f.rowid, s.nom, s.idp"; +$sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s"; +$sql .= " , ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; +$sql .= " WHERE s.idp = f.fk_soc"; +$sql .= " AND pfd.traite = 0 AND pfd.fk_facture = f.rowid"; + +if (strlen(trim($_GET["search_societe"]))) +{ + $sql .= " AND s.nom LIKE '%".$_GET["search_societe"]."%'"; +} + +if ($socidp) +{ + $sql .= " AND f.fk_soc = $socidp"; +} + +$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); + +if ( $db->query($sql) ) +{ + $num = $db->num_rows(); + $i = 0; + + if ($num) + { + print ''; + print ''; + print ''; + + print ''; + + print ''; + print ''; + $i++; + } + + print "
FactureSociété
-'; + print ' '; + print ''; + print ''; + + + + $var = True; + + while ($i < min($num,$conf->liste_limit)) + { + $obj = $db->fetch_object(); + $var=!$var; + print '
'; + print ''.img_file().' '; + print ''.$obj->facnumber.''.$obj->nom.'

"; + + } +} +else +{ + dolibarr_print_error($db); +} + +llxFooter(); +?>