Main Page | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

impress_listing_client.php

Go to the documentation of this file.
00001 <?
00002 /*
00003  *   This file is part of PhpCompta.
00004  *
00005  *   PhpCompta is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU General Public License as published by
00007  *   the Free Software Foundation; either version 2 of the License, or
00008  *   (at your option) any later version.
00009  *
00010  *   PhpCompta is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with PhpCompta; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 /* $Revision: 1.7 $ */
00020 include_once("class_widget.php");
00025 //-----------------------------------------------------
00026 // Show the jrn and date
00027 //-----------------------------------------------------
00028 
00029 //-----------------------------------------------------
00030 // Submit Html
00031 //-----------------------------------------------------
00032 if ( isset($_POST['bt_html'] )) {
00033   require_once("class_customer.php");
00034   $customer=new Customer($cn);
00035   $a_Res=$customer->VatListing($_POST['year']);
00036 
00037 echo "
00038 <div class=\"u_redcontent\"
00039 <form method=\"post\" action=\"listing_client.php\">
00040 <input type=\"submit\" name=\"bt_disk\" value=\"expérimental !! déclaration magnétique\" disable>
00041 <input type=\"hidden\" name=\"year\" value=\"".$_POST['year']."\">
00042 </form>
00043 <Table class=\"result\">
00044 <tr>
00045 <th> Nom </th>
00046 <th> Numéro TVA </th>
00047 <th> Montant HTVA </th>
00048 <th> Montant TVA </th>
00049 </tr>
00050 ";
00051  foreach ($a_Res as $key=>$elt) {
00052    echo "<tr>".
00053      "<td>".$elt['name']."</td>".
00054      "<td>".$elt['vat_number']."</td>".
00055      "<td align=\"right\">".sprintf("% 8.2f",$elt['amount'])."</td>".
00056      "<td align=\"right\">".sprintf("% 8.2f",$elt['tva'])."</td>".
00057      "</tr>";
00058  }
00059  echo "</table>";
00060  echo "</div>";
00061   return;
00062  }
00063 
00064 //-----------------------------------------------------
00065 // Form
00066 //-----------------------------------------------------
00067 $w=new widget("select");
00068 $w->table=1;
00069 
00070 echo '<div class="u_redcontent">';
00071 echo '<FORM ACTION="user_impress.php?type=list_client" METHOD="POST">';
00072 echo '<TABLE>';
00073 
00074 print '<TR>';
00075 $year=make_array($cn,"select distinct extract(year from jr_date), extract(year from jr_date) from jrn");
00076 if ( sizeof($year) == 0 ) 
00077 {
00078   echo "Aucun enregistrement dans les journaux";
00079   exit();
00080 }
00081 $w->label="Année concernée";
00082 print $w->IOValue('year',$year);
00083 print "</TR>";
00084 echo '</TABLE>';
00085 print $w->Submit('bt_html','Impression');
00086 
00087 echo '</FORM>';
00088 
00089 echo '</div>';
00090 
00091 ?>