noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
lettering.account.inc.php
Go to the documentation of this file.
00001 <?php
00002 /*
00003  *   This file is part of NOALYSS.
00004  *
00005  *   NOALYSS 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  *   NOALYSS 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 NOALYSS; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 
00020 // Copyright Author Dany De Bontridder danydb@aevalys.eu
00021 
00022 /*!\file
00023  * \brief show the lettering by account
00024  */
00025 
00026 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
00027 require_once('class_lettering.php');
00028 
00029 echo '<div class="content">';
00030 echo '<div id="search">';
00031 echo '<FORM METHOD="GET">';
00032 echo dossier::hidden();
00033 echo HtmlInput::hidden('ac',$_REQUEST['ac']);
00034 echo HtmlInput::hidden('sa','poste');
00035 
00036 $poste=new IPoste();
00037 $poste->name="acc";
00038 $poste->table=0;
00039 $poste->set_attribute('jrn',0);
00040 $poste->set_attribute('gDossier',dossier::id());
00041 $poste->set_attribute('ipopup','ipop_account');
00042 $poste->set_attribute('label','account_label');
00043 $poste->set_attribute('account','acc');
00044 $acc_lib="";
00045 if (isset($_GET['acc'])) { 
00046     $poste->value=$_GET['acc']; 
00047     $acc_lib=$cn->get_value('select pcm_lib from tmp_pcmn where pcm_val=upper($1)',array($poste->value));
00048 }
00049 
00050 $poste_span=new ISpan('account_label');
00051 $poste_span->value=$acc_lib;
00052 
00053 $r= td(_('Lettrage pour le poste comptable ')).
00054     td($poste->input()).
00055     td($poste_span->input());
00056 
00057 echo '<table width="50%">';
00058 echo tr($r);
00059 // limit of the year
00060 $exercice=$g_user->get_exercice();
00061 $periode=new Periode($cn);
00062 list($first_per,$last_per)=$periode->get_limit($exercice);
00063 
00064 $start=new IDate('start');
00065 if ( isset ($_GET['start']) && isDate($_GET['start']) == null )
00066 {
00067     echo alert(_('Date malformée, désolé'));
00068         $_GET['start']=$first_per->first_day();
00069 
00070 }
00071 $start->value=(isset($_GET['start']))?$_GET['start']:$first_per->first_day();
00072 
00073 $r=td(_('Date début'));
00074 $r.=td($start->input());
00075 echo tr($r);
00076 
00077 $end=new IDate('end');
00078 if ( isset($_GET['end']) && isDate($_GET['end']) == null )
00079 {
00080     echo alert(_('Date malformée, désolé'));
00081         $_GET['end']=$last_per->last_day();
00082 
00083 }
00084 $end->value=(isset($_GET['end']))?$_GET['end']:$last_per->last_day();
00085 $r=td(_('Date fin'));
00086 $r.=td($end->input());
00087 echo tr($r);
00088 
00089 // type of lettering : all, lettered, not lettered
00090 $sel=new ISelect('type_let');
00091 $sel->value=array(
00092                 array('value'=>0,'label'=>_('Toutes opérations')),
00093                 array('value'=>1,'label'=>_('Opérations lettrées')),
00094                                 array('value'=>3,'label'=>_('Opérations lettrées montants différents')),
00095                 array('value'=>2,'label'=>_('Opérations NON lettrées'))
00096             );
00097 if (isset($_GET['type_let'])) $sel->selected=$_GET['type_let'];
00098 
00099 $r= td("Filtre ").
00100     td($sel->input());
00101 
00102 echo tr($r);
00103 echo '</table>';
00104 echo '<br>';
00105 echo HtmlInput::submit("seek",_('Recherche'));
00106 echo '</FORM>';
00107 echo '</div>';
00108 if (! isset($_REQUEST['seek'])) exit;
00109 echo '<hr>';
00110 //--------------------------------------------------------------------------------
00111 // record the data
00112 //--------------------------------------------------------------------------------
00113 if ( isset($_POST['record']))
00114 {
00115     $letter=new Lettering_Account($cn);
00116     $letter->save($_POST);
00117 }
00118 //--------------------------------------------------------------------------------
00119 // Show the result
00120 //--------------------------------------------------------------------------------
00121 echo '<div id="list">';
00122 if ( isDate($_GET['start']) == null || isDate($_GET['end']) == null )
00123 {
00124     echo alert(_('Date malformée, désolé'));
00125     return;
00126 }
00127 $letter=new Lettering_Account($cn);
00128 $letter->set_parameter('account',$_GET['acc']);
00129 $letter->set_parameter('start',$_GET['start']);
00130 $letter->set_parameter('end',$_GET['end']);
00131 
00132 if ( $sel->selected == 0 )
00133     echo $letter->show_list('all');
00134 if ( $sel->selected == 1 )
00135     echo $letter->show_list('letter');
00136 if ( $sel->selected == 2 )
00137     echo $letter->show_list('unletter');
00138 if ( $sel->selected == 3 )
00139     echo $letter->show_list('letter_diff');
00140 echo '</div>';
00141 echo '<div id="detail" style="display:none">';
00142 echo 'Un instant...';
00143 echo '<IMG SRC=image/loading.gif>';
00144 echo '</div>';
 All Data Structures Namespaces Files Functions Variables Enumerations