noalyss
Version-9
include
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
26
if
( ! defined (
'ALLOWED'
) ) die(
'Appel direct ne sont pas permis'
);
27
28
$http
=
new
HttpInput
();
29
echo
'<div class="content">'
;
30
echo
'<div id="search">'
;
31
echo
'<FORM METHOD="GET">'
;
32
echo dossier::hidden();
33
echo
HtmlInput::hidden
(
'ac'
,
$http
->request(
'ac'
));
34
35
echo
HtmlInput::hidden
(
'sa'
,
'poste'
);
36
37
$poste
=
new
IPoste
();
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'
);
45
$acc_lib
=
""
;
46
if
(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'
);
52
$poste_span
->value=
$acc_lib
;
53
54
$r
=
td
(_(
'Lettrage pour le poste comptable '
)).
55
td
(
$poste
->input()).
56
td
(
$poste_span
->input());
57
58
echo
'<table width="50%">'
;
59
echo
tr
(
$r
);
60
// limit of the year
61
$exercice
=
$g_user
->get_exercice();
62
$periode
=
new
Periode
(
$cn
);
63
list($first_per,$last_per)=
$periode
->get_limit(
$exercice
);
64
// date limit
65
$start
=
new
IDate
(
'start'
);
66
$end
=
new
IDate
(
'end'
);
67
try
{
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());
83
echo
tr
(
$r
);
84
85
$r
=
td
(_(
'Date fin'
));
86
$r
.=
td
(
$end
->input());
87
echo
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
103
echo
tr
(
$r
);
104
echo
'</table>'
;
105
echo
'<br>'
;
106
echo
HtmlInput::submit
(
"seek"
,_(
'Recherche'
));
107
echo
'</FORM>'
;
108
echo
'</div>'
;
109
if
(! isset(
$_REQUEST
[
'seek'
]))
exit
;
110
echo
'<hr>'
;
111
//--------------------------------------------------------------------------------
112
// record the data
113
//--------------------------------------------------------------------------------
114
if
( isset(
$_POST
[
'record'
]))
115
{
116
$letter
=
new
Lettering_Account
(
$cn
);
117
$letter
->save(
$_POST
);
118
}
119
//--------------------------------------------------------------------------------
120
// Show the result
121
//--------------------------------------------------------------------------------
122
echo
'<div id="list">'
;
123
$letter
=
new
Lettering_Account
(
$cn
);
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();
128
if
(
$sel
->selected == 0 )
129
echo
$letter
->show_list(
'all'
);
130
if
(
$sel
->selected == 1 )
131
echo
$letter
->show_list(
'letter'
);
132
if
(
$sel
->selected == 2 )
133
echo
$letter
->show_list(
'unletter'
);
134
if
(
$sel
->selected == 3 )
135
echo
$letter
->show_list(
'letter_diff'
);
136
echo
'</div>'
;
137
echo
'<div id="detail" style="display:none">'
;
138
echo _(
'Un instant...'
);
139
echo
'<IMG SRC=image/loading.gif>'
;
140
echo
'</div>'
;
tr
tr($p_string, $p_extra='')
Definition:
ac_common.php:88
td
td($p_string='', $p_extra='')
surround the string with td
Definition:
ac_common.php:83
$g_user
global $g_user
if no group available , then stop
Definition:
action.common.inc.php:46
$cn
$cn
Definition:
ajax_anc_accounting.php:30
$_REQUEST
$_REQUEST['ac']
Definition:
ajax_search_action.php:26
id
$input_from id
Definition:
balance.inc.php:63
$_GET
$_GET['qcode']
Definition:
category_followup.inc.php:53
HtmlInput\hidden
static hidden($p_name, $p_value, $p_id="")
Definition:
html_input.class.php:230
HtmlInput\submit
static submit($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
Definition:
html_input.class.php:211
HttpInput
manage the http input (get , post, request) and extract from an array
Definition:
http_input.class.php:38
IDate
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
IPoste
show a button, for selecting a account and a input text for manually inserting an account the differe...
Definition:
iposte.class.php:75
ISelect
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
Definition:
iselect.class.php:40
ISpan
Html Input.
Definition:
ispan.class.php:32
Lettering_Account
only for operation retrieved thanks a account (jrnx.j_poste) manage the accounting entries for a give...
Definition:
lettering.class.php:482
Periode
For the periode tables parm_periode and jrn_periode.
Definition:
periode.class.php:33
$_POST
$_POST['ac']
Definition:
do.php:310
exit
for($e=0; $e< count($afiche); $e++) exit
Definition:
export_fiche_balance_csv.php:109
$poste
$poste
Definition:
lettering.account.inc.php:37
$start
$start
Definition:
lettering.account.inc.php:65
$letter
$letter
Definition:
lettering.account.inc.php:123
$poste_span
if(isset($_GET['acc'])) $poste_span
Definition:
lettering.account.inc.php:51
$end_value
$end_value
Definition:
lettering.account.inc.php:69
$http
$http
Definition:
lettering.account.inc.php:28
$sel
$sel
Definition:
lettering.account.inc.php:90
$r
$r
Definition:
lettering.account.inc.php:54
$periode
$periode
Definition:
lettering.account.inc.php:62
$acc_lib
$acc_lib
Definition:
lettering.account.inc.php:45
$end
$end
Definition:
lettering.account.inc.php:66
$exercice
$exercice
Definition:
lettering.account.inc.php:61
$e
$e
Definition:
result_cat_card_summary.php:26