| [ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?PHP 2 /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 * 18 * $Id: rejets.php,v 1.7 2005/09/10 14:24:10 eldy Exp $ 19 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/compta/prelevement/rejets.php,v $ 20 */ 21 22 require ("./pre.inc.php"); 23 require_once(DOL_DOCUMENT_ROOT."/compta/prelevement/rejet-prelevement.class.php"); 24 require_once(DOL_DOCUMENT_ROOT."/paiement.class.php"); 25 26 if (!$user->rights->prelevement->bons->lire) 27 accessforbidden(); 28 29 // Sécurité accés client 30 if ($user->societe_id > 0) accessforbidden(); 31 32 33 llxHeader('','Bon de prélèvement - Rejet'); 34 35 $h = 0; 36 $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche.php?id='.$_GET["id"]; 37 $head[$h][1] = $langs->trans("Card"); 38 $h++; 39 40 $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/factures.php?id='.$_GET["id"]; 41 $head[$h][1] = $langs->trans("Bills"); 42 $h++; 43 44 $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/rejets.php?id='.$_GET["id"]; 45 $head[$h][1] = $langs->trans("Rejects"); 46 $hselected = $h; 47 $h++; 48 49 $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche-stat.php?id='.$_GET["id"]; 50 $head[$h][1] = $langs->trans("Statistics"); 51 $h++; 52 53 $prev_id = $_GET["id"]; 54 55 $page = $_GET["page"]; 56 $sortorder = $_GET["sortorder"]; 57 $sortfield = $_GET["sortfield"]; 58 59 $offset = $conf->liste_limit * $page ; 60 $pageprev = $page - 1; 61 $pagenext = $page + 1; 62 63 if ($sortorder == "") $sortorder="DESC"; 64 if ($sortfield == "") $sortfield="p.datec"; 65 66 $rej = new RejetPrelevement($db, $user); 67 68 /* 69 * Liste des factures 70 * 71 */ 72 $sql = "SELECT pl.rowid, pr.motif, p.ref, pl.statut"; 73 $sql .= " , s.idp, s.nom"; 74 $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; 75 $sql .= " , ".MAIN_DB_PREFIX."prelevement_rejet as pr"; 76 $sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl"; 77 $sql .= " , ".MAIN_DB_PREFIX."societe as s"; 78 $sql .= " WHERE pr.fk_prelevement_lignes = pl.rowid"; 79 $sql .= " AND pl.fk_prelevement_bons = p.rowid"; 80 $sql .= " AND pl.fk_soc = s.idp"; 81 82 if ($_GET["socid"]) 83 { 84 $sql .= " AND s.idp = ".$_GET["socid"]; 85 } 86 87 $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); 88 89 $result = $db->query($sql); 90 if ($result) 91 { 92 $num = $db->num_rows($result); 93 $i = 0; 94 95 print_barre_liste("Prélèvements rejetés", $page, "rejets.php", $urladd, $sortfield, $sortorder, '', $num); 96 print"\n<!-- debut table -->\n"; 97 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; 98 print '<tr class="liste_titre">'; 99 print_liste_field_titre("Ligne N°","rejets.php","p.ref",'',$urladd); 100 print_liste_field_titre("Société","rejets.php","s.nom",'',$urladd); 101 print_liste_field_titre("Motif","rejets.php","pr.motif","",$urladd); 102 print '</tr>'; 103 104 $var=True; 105 106 $total = 0; 107 108 while ($i < min($num,$conf->liste_limit)) 109 { 110 $obj = $db->fetch_object($result); 111 112 print "<tr $bc[$var]><td>"; 113 print '<img border="0" src="./statut'.$obj->statut.'.png"></a> '; 114 print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid.'">'; 115 116 print substr('000000'.$obj->rowid, -6)."</a></td>"; 117 118 print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->idp.'">'.stripslashes($obj->nom)."</a></td>\n"; 119 120 print '<td>'.$rej->motifs[$obj->motif].'</td>'; 121 print "</tr>\n"; 122 $var=!$var; 123 $i++; 124 } 125 126 print "</table>"; 127 $db->free($result); 128 } 129 else 130 { 131 dolibarr_print_error($db); 132 } 133 134 $db->close(); 135 136 llxFooter('$Date: 2005/09/10 14:24:10 $ - $Revision: 1.7 $'); 137 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Mon Nov 26 12:29:37 2007 | par Balluche grâce à PHPXref 0.7 |
|