noalyss Version-9
Public Member Functions | Data Fields
Anc_Print Class Reference

this class is the mother class for the CA printing More...

+ Inheritance diagram for Anc_Print:
+ Collaboration diagram for Anc_Print:

Public Member Functions

 __construct ($p_cn)
 
 check ()
 
 display_form ($p_hidden="")
 Compute the form to display. More...
 
 get_request ()
 complete the object with the data in $_REQUEST More...
 
 set_sql_filter ()
 Set the filter (account_date) More...
 

Data Fields

 $db
 
 $from
 
 $from_poste
 
 $to
 
 $to_poste
 

Detailed Description

this class is the mother class for the CA printing

Definition at line 33 of file anc_print.class.php.

Constructor & Destructor Documentation

◆ __construct()

Anc_Print::__construct (   $p_cn)

Reimplemented in Anc_Group, and Anc_Table.

Definition at line 41 of file anc_print.class.php.

42 {
43 global $g_user;
44 list($from,$to)=$g_user->get_limit_current_exercice();
45 $this->db=$p_cn;
46 $this->from=$from;
47 $this->to=$to;
48 $this->from_poste="";
49 $this->to_poste="";
50 $this->has_data=0;
51
52 }
global $g_user
if no group available , then stop
$anc_grandlivre from_poste
$anc_grandlivre to
$anc_grandlivre to_poste
$anc_grandlivre from
$SecUser db

References $from, $g_user, $to, db, from, from_poste, to, and to_poste.

Member Function Documentation

◆ check()

Anc_Print::check ( )

Definition at line 205 of file anc_print.class.php.

206 {
207
208 /*
209 * check date
210 */
211 if (($this->from != '' && isDate ($this->from) == 0)
212 ||
213 ($this->to != '' && isDate ($this->to) == 0))
214 return -1;
215
216 return 0;
217 }
isDate($p_date)
Definition: ac_common.php:236

References from, isDate(), and to.

Referenced by Anc_Acc_List\display_html(), Anc_Group\display_html(), Anc_Table\display_html(), Anc_Acc_List\export_csv(), and Anc_Table\export_csv().

+ Here is the call graph for this function:

◆ display_form()

Anc_Print::display_form (   $p_hidden = "")

Compute the form to display.

Parameters
$p_hiddenhidden tag to be included (gDossier,...)
Returns
string containing the data

Reimplemented in Anc_Acc_List, Anc_Table, Anc_Balance_Simple, Anc_Listing, and Anc_Balance_Double.

Definition at line 83 of file anc_print.class.php.

84 {
85 /* if there is no analytic plan return */
86 $pa=new Anc_Plan($this->db);
87 if ( $pa->count() == 0 )
88 {
89 echo '<div class="content">';
90 echo '<h2 class="error">'._('Aucun plan défini').'</h2>';
91 echo '</div>';
92 return;
93 }
94
95 $from=new IDate('from','from');
96 $from->size=10;
97 $from->value=$this->from;
98
99 $to=new IDate('to','to');
100 $to->value=$this->to;
101 $to->size=10;
102
103 $from_poste=new IAncCard('from_poste','from_poste');
104 $from_poste->size=10;
105 $from_poste->plan_ctl='pa_id';
107
108 $to_poste=new IAncCard('to_poste','to_poste');
110 $to_poste->size=10;
111
112 $hidden=new IHidden();
113 $r=dossier::hidden();
114 $r.=$hidden->input("result","1");
115
116 $r.=HtmlInput::request_to_hidden(array('ac'));
117 $r.=$p_hidden;
118 $plan=new Anc_Plan($this->db);
119 $plan_id=new ISelect("pa_id");
120 $plan_id->value=$this->db->make_array("select pa_id, pa_name from plan_analytique order by pa_name");
121 $plan_id->selected=$this->pa_id;
122
123 $javascript="search_ca(".dossier::id().",'from_poste','pa_id')";
124 $choose_from=Icon_Action::icon_magnifier(uniqid(), $javascript);
125 $javascript="search_ca(".dossier::id().",'to_poste','pa_id')";
126 $choose_to=Icon_Action::icon_magnifier(uniqid(), $javascript);
127
128
129 $r.=HtmlInput::request_to_hidden(array('ac'));
130 ob_start();
131 ?>
132<table>
133 <tr>
134 <td>
135 <?php
136 echo _('Depuis') ;
137 echo Icon_Action::infobulle(37);
138 ?>
139 </td>
140 <td>
141 <?php
142 echo $from->input();
143 ?>
144 </td>
145 <td>
146 <?php
147 echo _('Jusque') ;
148 echo Icon_Action::infobulle(37);
149 ?>
150 </td>
151 <td>
152 <?php
153 echo $to->input();
154 ?>
155 </td>
156 <td>
157 <?php echo _( "Plan Analytique ")?>
158 </td>
159 <td>
160 <?php
161 echo $plan_id->input();
162 echo Icon_Action::infobulle(42);
163 ?>
164 </td>
165
166 </tr>
167
168</table>
169<span style="padding:5px;margin:5px;display:block;">
170
171</span>
172
173<?php
174 $r.=ob_get_clean();
175 $r.=_("Entre l'activité ").$from_poste->input();
176 $r.=$choose_from;
177 $r.=_(" et l'activité ").$to_poste->input();
178 $r.=$choose_to;
179
180 $r.='</span>';
181 return $r;
182 }
span($p_string, $p_extra='')
Definition: ac_common.php:43
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
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
$opd_description style
$pa
Definition: anc_od.inc.php:34
Concerns the Analytic plan (table plan_analytique)
static request_to_hidden(array $array)
transform $_REQUEST data to hidden
HtmlInput for card of analytic accountancy.
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
Html Input.
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
static icon_magnifier($id, $p_javascript, $p_style="")
Display a icon with a magnify glass.
static infobulle($p_comment)
Display a info in a bubble, text is in message_javascript.
$all table

References $from, $from_poste, $hidden, $pa, $pa_id, $r, $to, $to_poste, db, Icon_Action\icon_magnifier(), Icon_Action\infobulle(), HtmlInput\request_to_hidden(), span(), style, table, td(), and tr().

+ Here is the call graph for this function:

◆ get_request()

Anc_Print::get_request ( )

complete the object with the data in $_REQUEST

Reimplemented in Anc_Acc_Link, Anc_Balance_Double, and Anc_Listing.

Definition at line 56 of file anc_print.class.php.

57 {
58 $http=new HttpInput();
59 if ( isset($_REQUEST['from']))
60 $this->from=$http->request('from');
61
62 if ( isset($_REQUEST['to']))
63 $this->to=$http->request('to');
64
65 if ( isset($_REQUEST['from_poste']))
66 $this->from_poste=$http->request('from_poste');
67
68 if ( isset($_REQUEST['to_poste']))
69 $this->to_poste=$http->request('to_poste');
70 if ( isset($_REQUEST['pa_id']))
71 $this->pa_id=$http->request('pa_id');
72 else
73 $this->pa_id="";
74
75 }
$anc pa_id
$_REQUEST['ac']
manage the http input (get , post, request) and extract from an array

References $_REQUEST, $http, from, from_poste, pa_id, to, and to_poste.

◆ set_sql_filter()

Anc_Print::set_sql_filter ( )

Set the filter (account_date)

Returns
return the string to add to load

Reimplemented in Anc_Acc_Link, Anc_Balance_Simple, Anc_GrandLivre, and Anc_Group.

Definition at line 189 of file anc_print.class.php.

190 {
191 $sql="";
192 $and=" and ";
193 if ( $this->from != "" )
194 {
195 $sql.="$and a.oa_date >= to_date('".$this->from."','DD.MM.YYYY')";
196 }
197 if ( $this->to != "" )
198 {
199 $sql.=" $and a.oa_date <= to_date('".$this->to."','DD.MM.YYYY')";
200 }
201
202 return $sql;
203
204 }

References $sql, from, and to.

Field Documentation

◆ $db

Anc_Print::$db

$db database connection

Definition at line 35 of file anc_print.class.php.

◆ $from

Anc_Print::$from

$from end date

Definition at line 37 of file anc_print.class.php.

Referenced by __construct(), and display_form().

◆ $from_poste

Anc_Print::$from_poste

$from_poste from poste

Definition at line 38 of file anc_print.class.php.

Referenced by display_form().

◆ $to

Anc_Print::$to

$to start date

Definition at line 36 of file anc_print.class.php.

Referenced by __construct(), and display_form().

◆ $to_poste

Anc_Print::$to_poste

$to_poste to the poste

Definition at line 39 of file anc_print.class.php.

Referenced by display_form().


The documentation for this class was generated from the following file: