[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?php 2 /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * Copyright (C) 2003 Association FSF France <contact@fsffrance.org> 4 * Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 * 20 * $Id: depenses_code.php,v 1.12 2005/07/10 15:46:19 eldy Exp $ 21 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/public/dons/depenses_code.php,v $ 22 * 23 */ 24 25 26 $conf = new Conf(); 27 $conf->db->type = $dolibarr_main_db_type; 28 $conf->db->host = $dolibarr_main_db_host; 29 $conf->db->name = $dolibarr_main_db_name; 30 $conf->db->user = $dolibarr_main_db_user; 31 $conf->db->pass = $dolibarr_main_db_pass; 32 33 $db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name); 34 $sql = "SELECT ".$db->pdate("f.datef")." as datef, s.nom, f.total, f.note, f.paye"; 35 $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."societe as s"; 36 $sql .= " WHERE f.fk_soc = s.idp ORDER BY f.datef DESC"; 37 38 if ( $db->query( $sql) ) 39 { 40 $num = $db->num_rows(); 41 if ($num) 42 { 43 44 print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">"; 45 46 print '<TR>'; 47 print "<td>Société</td>"; 48 print "<td>Date</td>"; 49 print "<td align=\"right\">Montant</TD>"; 50 print "</TR>\n"; 51 52 $var=True; 53 $bc[1]='bgcolor="#f5f5f5"'; 54 $bc[0]='bgcolor="#f0f0f0"'; 55 while ($i < $num) 56 { 57 $objp = $db->fetch_object( $i); 58 59 $var=!$var; 60 print "<TR $bc[$var]>"; 61 print "<td>".stripslashes($objp->nom)."</TD>\n"; 62 63 print "<TD>".strftime("%d %B %Y",$objp->datef)."</td>\n"; 64 print '<TD align="right">'.number_format($objp->total,2,'.','').' '.$langs->trans("Currency".$conf->monnaie); 65 66 if ($objp->paye == 1) 67 { 68 print "<br>payé"; 69 $total_paye += $objp->total; 70 } 71 else 72 { 73 print "<br>A payer"; 74 $total_apayer += $objp->total; 75 } 76 77 print '</TD>'; 78 print "</tr>"; 79 80 print "<TR $bc[$var]><td> </td><td>"; 81 print nl2br(stripslashes($objp->note)); 82 print "</td><td> </td></tr>"; 83 84 $total += $objp->total; 85 86 $i++; 87 } 88 89 $var=!$var; 90 print "<TR $bc[$var]>"; 91 print '<TD colspan="3" align="right">Payé : '.number_format($total_paye,2,'.',' ').' '.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; 92 93 $var=!$var; 94 print "<TR $bc[$var]>"; 95 print '<TD colspan="3" align="right">A payer : '.number_format($total_apayer,2,'.',' ').' '.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; 96 97 $var=!$var; 98 print "<TR $bc[$var]>"; 99 print '<TD colspan="3" align="right">'.$langs->trans("Total").': '.number_format($total,2,'.',' ').' '.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; 100 101 print "</table>"; 102 103 } 104 } 105 else 106 { 107 print $db->error(); 108 } 109 110 $db->close(); 111 112 ?>
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 |
![]() |