* Copyright (C) 2005-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2010-2011 Juanjo Menent * * 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, see . */ /** \file htdocs/compta/prelevement/bons.php \ingroup prelevement \brief Page liste des bons de prelevements \version $Id: bons.php,v 1.26 2011/07/31 22:23:29 eldy Exp $ */ require("../bank/pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/compta/prelevement/class/bon-prelevement.class.php"); $langs->load("widthdrawals"); $langs->load("categories"); // Security check $socid = GETPOST("socid"); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'prelevement','','','bons'); // Get supervariables $page = GETPOST("page"); $sortorder = ((GETPOST("sortorder")=="")) ? "DESC" : GETPOST("sortorder"); $sortfield = ((GETPOST("sortfield")=="")) ? "p.datec" : GETPOST("sortfield"); $statut = GETPOST("statut"); $search_line = GETPOST("search_ligne"); llxHeader('',$langs->trans("WithdrawalsReceipts")); $bon=new BonPrelevement($db,""); 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, p.statut"; $sql.= ", p.datec"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql.= " WHERE p.entity = ".$conf->entity; $sql.= " ORDER BY $sortfield $sortorder "; $sql.= $db->plimit($conf->liste_limit+1, $offset); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); $i = 0; $urladd= "&statut=".$statut; print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, "bons.php", $urladd, $sortfield, $sortorder, '', $num); print"\n\n"; print ''; print ''; print_liste_field_titre($langs->trans("WithdrawalReceipt"),"bons.php","p.ref",'','','class="liste_titre"'); print_liste_field_titre($langs->trans("Date"),"bons.php","p.datec","","",'class="liste_titre" align="center"'); print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; $var=True; while ($i < min($num,$conf->liste_limit)) { $obj = $db->fetch_object($result); $var=!$var; print "\n"; print '\n"; print '\n"; print "\n"; $i++; } print "
'.$langs->trans("Amount").'
 
"; print $bon->LibStatut($obj->statut,2); print " "; print ''.$obj->ref."'.dol_print_date($db->jdate($obj->datec),'day')."'.price($obj->amount)."
"; $db->free($result); } else { dol_print_error($db); } $db->close(); llxFooter('$Date: 2011/07/31 22:23:29 $ - $Revision: 1.26 $'); ?>