noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
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.
 
 get_request ()
 complete the object with the data in $_REQUEST
 
 set_sql_filter ()
 Set the filter (account_date)
 

Data Fields

 $db
 
 $from
 
 $from_poste
 
 $has_data
 
 $pa_id
 
 $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 43 of file anc_print.class.php.

44 {
45 global $g_user;
46 list($from,$to)=$g_user->get_limit_current_exercice();
47 $this->db=$p_cn;
48 $this->from=$from;
49 $this->to=$to;
50 $this->from_poste="";
51 $this->to_poste="";
52 $this->has_data=0;
53
54 }
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 207 of file anc_print.class.php.

208 {
209
210 /*
211 * check date
212 */
213 if (($this->from != '' && isDate ($this->from) == 0)
214 ||
215 ($this->to != '' && isDate ($this->to) == 0))
216 return -1;
217
218 return 0;
219 }
isDate($p_date)

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_Balance_Double, Anc_Balance_Simple, Anc_Listing, and Anc_Table.

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

86 {
87 /* if there is no analytic plan return */
88 $pa=new Anc_Plan($this->db);
89 if ( $pa->count() == 0 )
90 {
91 echo '<div class="content">';
92 echo '<h2 class="error">'._('Aucun plan défini').'</h2>';
93 echo '</div>';
94 return;
95 }
96
97 $from=new IDate('from','from');
98 $from->size=10;
99 $from->value=$this->from;
100
101 $to=new IDate('to','to');
102 $to->value=$this->to;
103 $to->size=10;
104
105 $from_poste=new IAncCard('from_poste','from_poste');
106 $from_poste->size=10;
107 $from_poste->plan_ctl='pa_id';
109
110 $to_poste=new IAncCard('to_poste','to_poste');
112 $to_poste->size=10;
113
114 $hidden=new IHidden();
115 $r=dossier::hidden();
116 $r.=$hidden->input("result","1");
117
118 $r.=HtmlInput::request_to_hidden(array('ac'));
119 $r.=$p_hidden;
120 $plan=new Anc_Plan($this->db);
121 $plan_id=new ISelect("pa_id");
122 $plan_id->value=$this->db->make_array("select pa_id, pa_name from plan_analytique order by pa_name");
123 $plan_id->selected=$this->pa_id;
124
125 $javascript="search_ca(".dossier::id().",'from_poste','pa_id')";
126 $choose_from=Icon_Action::icon_magnifier(uniqid(), $javascript);
127 $javascript="search_ca(".dossier::id().",'to_poste','pa_id')";
128 $choose_to=Icon_Action::icon_magnifier(uniqid(), $javascript);
129
130
131 $r.=HtmlInput::request_to_hidden(array('ac'));
132 ob_start();
133 ?>
134<table>
135 <tr>
136 <td>
137 <?php
138 echo _('Depuis') ;
139 echo Icon_Action::infobulle(37);
140 ?>
141 </td>
142 <td>
143 <?php
144 echo $from->input();
145 ?>
146 </td>
147 <td>
148 <?php
149 echo _('Jusque') ;
150 echo Icon_Action::infobulle(37);
151 ?>
152 </td>
153 <td>
154 <?php
155 echo $to->input();
156 ?>
157 </td>
158 <td>
159 <?php echo _( "Plan Analytique ")?>
160 </td>
161 <td>
162 <?php
163 echo $plan_id->input();
164 echo Icon_Action::infobulle(42);
165 ?>
166 </td>
167
168 </tr>
169
170</table>
171<span style="padding:5px;margin:5px;display:block;">
172
173</span>
174
175<?php
176 $r.=ob_get_clean();
177 $r.=_("Entre l'activité ").$from_poste->input();
178 $r.=$choose_from;
179 $r.=_(" et l'activité ").$to_poste->input();
180 $r.=$choose_to;
181
182 $r.='</span>';
183 return $r;
184 }
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
_("actif, passif,charge,...")
static request_to_hidden(array $array)
transform $_REQUEST data to hidden
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(), 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 58 of file anc_print.class.php.

59 {
60 $http=new HttpInput();
61 if ( isset($_REQUEST['from']))
62 $this->from=$http->request('from');
63
64 if ( isset($_REQUEST['to']))
65 $this->to=$http->request('to');
66
67 if ( isset($_REQUEST['from_poste']))
68 $this->from_poste=$http->request('from_poste');
69
70 if ( isset($_REQUEST['to_poste']))
71 $this->to_poste=$http->request('to_poste');
72 if ( isset($_REQUEST['pa_id']))
73 $this->pa_id=$http->request('pa_id');
74 else
75 $this->pa_id="";
76
77 }
$anc pa_id
$_REQUEST['ac']

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 191 of file anc_print.class.php.

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

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().

◆ $has_data

Anc_Print::$has_data

array of data

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

◆ $pa_id

Anc_Print::$pa_id

axis for analytic : plan

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

Referenced by display_form(), and Anc_Listing\load().

◆ $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: