noalyss Version-9
lettering.account.inc.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS 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 * NOALYSS 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 NOALYSS; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19
20// Copyright Author Dany De Bontridder danydb@aevalys.eu
21
22/*!\file
23 * \brief show the lettering by account
24 */
25
26if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
27
29echo '<div class="content">';
30echo '<div id="search">';
31echo '<FORM METHOD="GET">';
32echo dossier::hidden();
33echo HtmlInput::hidden('ac',$http->request('ac'));
34
35echo HtmlInput::hidden('sa','poste');
36
38$poste->name="acc";
39$poste->table=0;
40$poste->set_attribute('jrn',0);
41$poste->set_attribute('gDossier',dossier::id());
42$poste->set_attribute('ipopup','ipop_account');
43$poste->set_attribute('label','account_label');
44$poste->set_attribute('account','acc');
46if (isset($_GET['acc'])) {
47 $poste->value=$http->get("acc");
48 $acc_lib=$cn->get_value('select pcm_lib from tmp_pcmn where pcm_val=upper($1)',array($poste->value));
49}
50
51$poste_span=new ISpan('account_label');
53
54$r= td(_('Lettrage pour le poste comptable ')).
55 td($poste->input()).
56 td($poste_span->input());
57
58echo '<table width="50%">';
59echo tr($r);
60// limit of the year
61$exercice=$g_user->get_exercice();
63list($first_per,$last_per)=$periode->get_limit($exercice);
64// date limit
65$start=new IDate('start');
66$end=new IDate('end');
67try {
68 $start_value=$http->get("start","date",$first_per->first_day());
69 $end_value=$http->get("end","date",$last_per->last_day());
70 $start->value=$start_value;
71 $end->value=$end_value;
72}catch (Exception $e) {
73 $start_value=$first_per->first_day();
74 $end_value=$last_per->last_day();
75 echo '<span class="warning">'._('Date malformée, désolé').'</span>';
76}
77
78$start->value=$start_value;
79$end->value=$end_value;
80
81$r=td(_('Date début'));
82$r.=td($start->input());
83echo tr($r);
84
85$r=td(_('Date fin'));
86$r.=td($end->input());
87echo tr($r);
88
89// type of lettering : all, lettered, not lettered
90$sel=new ISelect('type_let');
91$sel->value=array(
92 array('value'=>0,'label'=>_('Toutes opérations')),
93 array('value'=>1,'label'=>_('Opérations lettrées')),
94 array('value'=>3,'label'=>_('Opérations lettrées montants différents')),
95 array('value'=>2,'label'=>_('Opérations NON lettrées'))
96 );
97
98$sel->selected=$http->get('type_let','number',0);
99
100$r= td("Filtre ").
101 td($sel->input());
102
103echo tr($r);
104echo '</table>';
105echo '<br>';
106echo HtmlInput::submit("seek",_('Recherche'));
107echo '</FORM>';
108echo '</div>';
109if (! isset($_REQUEST['seek'])) exit;
110echo '<hr>';
111//--------------------------------------------------------------------------------
112// record the data
113//--------------------------------------------------------------------------------
114if ( isset($_POST['record']))
115{
117 $letter->save($_POST);
118}
119//--------------------------------------------------------------------------------
120// Show the result
121//--------------------------------------------------------------------------------
122echo '<div id="list">';
124$letter->set_parameter('account',$http->get('acc'));
125$letter->set_parameter('start',$start->value);
126$letter->set_parameter('end',$end->value);
127$letter->remove_incoherent();
128if ( $sel->selected == 0 )
129 echo $letter->show_list('all');
130if ( $sel->selected == 1 )
131 echo $letter->show_list('letter');
132if ( $sel->selected == 2 )
133 echo $letter->show_list('unletter');
134if ( $sel->selected == 3 )
135 echo $letter->show_list('letter_diff');
136echo '</div>';
137echo '<div id="detail" style="display:none">';
138echo _('Un instant...');
139echo '<IMG SRC=image/loading.gif>';
140echo '</div>';
tr($p_string, $p_extra='')
Definition: ac_common.php:88
td($p_string='', $p_extra='')
surround the string with td
Definition: ac_common.php:83
global $g_user
if no group available , then stop
$_REQUEST['ac']
$input_from id
Definition: balance.inc.php:63
$_GET['qcode']
static hidden($p_name, $p_value, $p_id="")
static submit($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
manage the http input (get , post, request) and extract from an array
Html Input : Input a date format dd.mm.yyyy The property title should be set to indicate what it is e...
Definition: idate.class.php:34
show a button, for selecting a account and a input text for manually inserting an account the differe...
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
Html Input.
Definition: ispan.class.php:32
only for operation retrieved thanks a account (jrnx.j_poste) manage the accounting entries for a give...
For the periode tables parm_periode and jrn_periode.
$_POST['ac']
Definition: do.php:310
for($e=0; $e< count($afiche); $e++) exit
if(isset($_GET['acc'])) $poste_span