[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?PHP 2 /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 * 19 * $Id: fiche.php,v 1.6 2005/10/19 05:12:49 eldy Exp $ 20 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/compta/ventilation/fiche.php,v $ 21 */ 22 23 /** 24 \file htdocs/compta/ventilation/fiche.php 25 \ingroup compta 26 \brief Page fiche ventilation 27 \version $Revision: 1.6 $ 28 */ 29 30 require ("./pre.inc.php"); 31 32 $langs->load("bills"); 33 34 35 $mesg = ''; 36 37 if (!$user->rights->compta->ventilation->creer) accessforbidden(); 38 39 if ($_POST["action"] == 'ventil' && $user->rights->compta->ventilation->creer) 40 { 41 $sql = " UPDATE ".MAIN_DB_PREFIX."facturedet"; 42 $sql .= " SET fk_code_ventilation = ".$_POST["codeventil"]; 43 $sql .= " WHERE rowid = ".$_GET["id"]; 44 45 $db->query($sql); 46 } 47 48 llxHeader("","","Fiche ventilation"); 49 50 if ($cancel == $langs->trans("Cancel")) 51 { 52 $action = ''; 53 } 54 /* 55 * 56 * 57 */ 58 59 $sql = "SELECT rowid, numero, intitule"; 60 $sql .= " FROM ".MAIN_DB_PREFIX."compta_compte_generaux"; 61 $sql .= " ORDER BY numero ASC"; 62 63 $result = $db->query($sql); 64 if ($result) 65 { 66 $num = $db->num_rows($result); 67 $i = 0; 68 69 while ($i < $num) 70 { 71 $row = $db->fetch_row($result); 72 $cgs[$row[0]] = $row[1] . ' ' . $row[2]; 73 $i++; 74 } 75 } 76 77 /* 78 * Création 79 * 80 */ 81 $form = new Form($db); 82 83 if($_GET["id"]) 84 { 85 $sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_taux, l.remise_percent, l.subprice, ".$db->pdate("l.date_start")." as date_start, ".$db->pdate("l.date_end")." as date_end, l.fk_code_ventilation "; 86 $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as l"; 87 $sql .= " , ".MAIN_DB_PREFIX."facture as f"; 88 $sql .= " WHERE f.rowid = l.fk_facture AND f.fk_statut = 1 AND l.rowid = ".$_GET["id"]; 89 90 $result = $db->query($sql); 91 92 if ($result) 93 { 94 $num_lignes = $db->num_rows($result); 95 $i = 0; 96 97 if ($num_lignes) 98 { 99 100 $objp = $db->fetch_object($result); 101 102 103 if($objp->fk_code_ventilation == 0) 104 { 105 print '<form action="fiche.php?id='.$_GET["id"].'" method="post">'."\n"; 106 print '<input type="hidden" name="action" value="ventil">'; 107 } 108 109 110 print_titre("Ventilation"); 111 112 print '<table class="border" width="100%">'; 113 print '<tr><td>'.$langs->trans("Bill").'</td>'; 114 print '<td><a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$objp->facid.'">'.$objp->facnumber.'</a></td></tr>'; 115 116 print '<tr><td width="20%">Ligne</td>'; 117 print '<td>'.stripslashes(nl2br($objp->description)).'</td></tr>'; 118 print '<tr><td width="20%">Ventiler dans le compte :</td><td>'; 119 120 if($objp->fk_code_ventilation == 0) 121 { 122 print $form->select_array("codeventil",$cgs, $objp->fk_code_ventilation); 123 } 124 else 125 { 126 print $cgs[$objp->fk_code_ventilation]; 127 } 128 129 print '</td></tr>'; 130 131 if($objp->fk_code_ventilation == 0) 132 { 133 print '<tr><td> </td><td><input type="submit" class="button" value="'.$langs->trans("Ventiler").'"></td></tr>'; 134 } 135 print '</table>'; 136 print '</form>'; 137 } 138 else 139 { 140 print "Error"; 141 } 142 } 143 else 144 { 145 print "Error"; 146 } 147 } 148 else 149 { 150 print "Error ID incorrect"; 151 } 152 153 $db->close(); 154 155 llxFooter("<em>Dernière modification $Date: 2005/10/19 05:12:49 $ révision $Revision: 1.6 $</em>"); 156 ?>
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 |
![]() |