noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
lettering.card.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 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
00026 require_once ('class_ipopup.php');
00027 require_once('class_lettering.php');
00028 
00029 
00030 echo '<div class="content">';
00031 echo '<div id="search">';
00032 echo '<FORM METHOD="GET">';
00033 echo dossier::hidden();
00034 echo HtmlInput::hidden('ac',$_REQUEST['ac']);
00035 echo HtmlInput::hidden('sa','qc');
00036 echo HtmlInput::hidden('p_jrn','0');
00037 echo '<table width="50%">';
00038 
00039 $poste=new ICard('acc');
00040 $poste->name="acc";
00041 $poste->extra="all";
00042 $poste->set_attribute('popup','ipopcard');
00043 $poste->set_attribute('typecard','all');
00044 $poste->set_callback('filter_card');
00045 
00046 
00047 
00048 if (isset($_GET['acc'])) $poste->value=strtoupper(trim($_GET['acc']));
00049 $poste_span=new ISpan('account_label');
00050 $r= td(_('Lettrage pour la fiche ')).
00051     td($poste->input().$poste->search()).
00052     td($poste_span->input());
00053 echo tr($r);
00054 // limit of the year
00055 $exercice=$g_user->get_exercice();
00056 $periode=new Periode($cn);
00057 list($first_per,$last_per)=$periode->get_limit($exercice);
00058 
00059 $start=new IDate('start');
00060 if ( isset ($_GET['start']) && isDate($_GET['start']) == null )
00061 {
00062     echo alert(_('Date malformée, désolé'));
00063         $_GET['start']=$first_per->first_day();
00064 
00065 }
00066 $start->value=(isset($_GET['start']))?$_GET['start']:$first_per->first_day();
00067 
00068 
00069 $r=td(_('Date début'));
00070 $r.=td($start->input());
00071 echo tr($r);
00072 
00073 $end=new IDate('end');
00074 if ( isset($_GET['end']) && isDate($_GET['end']) == null )
00075 {
00076     echo alert(_('Date malformée, désolé'));
00077         $_GET['end']=$last_per->last_day();
00078 
00079 }
00080 $end->value=(isset($_GET['end']))?$_GET['end']:$last_per->last_day();
00081 
00082 $r=td(_('Date fin'));
00083 $r.=td($end->input());
00084 echo tr($r);
00085 
00086 // type of lettering : all, lettered, not lettered
00087 $sel=new ISelect('type_let');
00088 $sel->value=array(
00089                 array('value'=>0,'label'=>_('Toutes opérations')),
00090                 array('value'=>1,'label'=>_('Opérations lettrées')),
00091                 array('value'=>3,'label'=>_('Opérations lettrées montants différents')),
00092                 array('value'=>2,'label'=>_('Opérations NON lettrées'))
00093             );
00094 if (isset($_GET['type_let'])) $sel->selected=$_GET['type_let'];
00095 
00096 $r= td("Filtre ").
00097     td($sel->input());
00098 
00099 echo tr($r);
00100 echo '</table>';
00101 echo '<br>';
00102 echo HtmlInput::submit("seek",_('Recherche'));
00103 echo '</FORM>';
00104 echo '</div>';
00105 if (! isset($_REQUEST['seek'])) exit;
00106 echo '<hr>';
00107 //--------------------------------------------------------------------------------
00108 // record the data
00109 //--------------------------------------------------------------------------------
00110 if ( isset($_POST['record']))
00111 {
00112     $letter=new Lettering_Account($cn);
00113     $letter->save($_POST);
00114 }
00115 //--------------------------------------------------------------------------------
00116 // Show the result
00117 //--------------------------------------------------------------------------------
00118 echo '<div id="list">';
00119 
00120 
00121 $letter=new Lettering_Card($cn);
00122 $quick_code=strtoupper(trim($_GET['acc']));
00123 $letter->set_parameter('quick_code',$quick_code);
00124 $letter->set_parameter('start',$_GET['start']);
00125 $letter->set_parameter('end',$_GET['end']);
00126 
00127 if ( $sel->selected == 0 )
00128     echo $letter->show_list('all');
00129 if ( $sel->selected == 1 )
00130     echo $letter->show_list('letter');
00131 if ( $sel->selected == 2 )
00132     echo $letter->show_list('unletter');
00133 if ( $sel->selected == 3 )
00134     echo $letter->show_list('letter_diff');
00135 echo '</div>';
00136 echo '<div id="detail" style="display:none">';
00137 echo 'Un instant...';
00138 echo '<IMG SRC=image/loading.gif>';
00139 echo '</div>';
 All Data Structures Namespaces Files Functions Variables Enumerations