noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
param_jrn.php
Go to the documentation of this file.
1<?php
2//This file is part of NOALYSS and is under GPL
3//see licence.txt
4?><TABLE style="width: auto" class="nowrap">
5<TR>
6<TD><?php echo _('Type de journal')?> </TD>
7<TD>
8<?php echo $type;?>
9</TD>
10</TR>
11
12<TR>
13
14 <TD><?php echo _('Nom journal')?> </TD>
15 <TD> <INPUT TYPE="text" class="input_text" NAME="p_jrn_name" VALUE="<?php echo $name; ?>"></TD>
16 <td></td>
17</TR>
18<?php
19//---------------------------------------------------------------------------------------------------------------
20//ODS
21//---------------------------------------------------------------------------------------------------------------
22if ( $new || $type=='ODS' ):
23?>
24<TR id="type_ods">
25<td style="white-space: nowrap"><?php echo _('Postes utilisables journal (débit/crédit) ')?>
26</TD>
27<td>
28<?php echo $search;?>
29</TD>
30<TD CLASS="notice">
31<?php echo _("Uniquement pour les journaux d'Opérations Diverses, les valeurs sont séparées par des espaces, on peut aussi
32 utiliser le * pour indiquer 'tous les postes qui en dépendent' exemple: 4*")?>
33</TD>
34</TR>
35<?php
36endif;
37?>
38<?php
39//---------------------------------------------------------------------------------------------------------------
40//FIN
41//---------------------------------------------------------------------------------------------------------------
42if ( $new|| $type=='FIN') :
43?>
44 <tr id="type_fin">
45 <td style="white-space: nowrap">
46 <?php echo _('Numérotation de chaque opération')?>
47 </td>
48 <td>
49 <?php echo $num_op->input();?>
50 </td>
51 </tr>
52 <tr id="type_fin2">
53 <TD style="white-space: nowrap">
54 <?php echo _('Compte en banque')?>
55 </td>
56 <TD>
57 <?php
58 $card=new ICard();
59 $card->name='bank';
60 // clean only the INPUT no javascript
61 $card->setAfter_clean("");
62 $card->extra=$cn->make_list('select fd_id from fiche_def where frd_id=4');
63 $card->set_dblclick("fill_ipopcard(this);");
64 $card->set_function('fill_data');
65 $card->set_attribute('ipopup','ipop_card');
66 $list=$cn->make_list('select fd_id from fiche_def where frd_id=4');
67 $card->set_attribute('typecard',$list);
68
69 $card->value=$qcode_bank;
70 echo $card->search();
71 echo $card->input();
72 echo $str_add_button;
73
74 ?>
75 </td>
76 <td class="notice" style="white-space: nowrap">
77 <?php echo _("Obligatoire pour les journaux FIN : donner ici la fiche du compte en banque utilisée")?>
78 </td>
79 </tr>
80 <?php
81endif;
82?>
83
84<?php
85//---------------------------------------------------------------------------------------------------------------
86//ACH / VEN
87//---------------------------------------------------------------------------------------------------------------
88if ( $type == 'ACH' || $type == 'VEN'||$new):
89 // Display the warning : always used negative amounts
90 ?>
91
92 <tr id="neg_amount">
93 <td style="white-space: nowrap">
94
95 <?php
96 echo _("Uniquement note de débit ou crédit");
98 ?>
99 </td>
100 <td>
101 <?php
102 $negative->javascript="toggle_row_warning_enable('negative_amount','row_warning')";
103 echo $negative->input();
104 ?>
105 </td>
106
107
108 </tr>
109 <tr id="row_warning">
110 <td style="white-space: nowrap">
111 <?php echo _("Avertissement montant positif"); ?>
112 </td>
113 <td>
114 <?php echo $negative_warning->input();?>
115 </td>
116 </tr>
117 <tr>
118 <td>
119 <?php echo _('Utilisation des quantités')?>
120 </td>
121 <td>
122
123 <?php
124 echo $quantity->input();
125 ?>
126 </td>
127 </tr>
128<?php
130?>
131
132
133
134<tr>
135 <td style="white-space: nowrap"><?php echo _("Minimum de lignes à afficher")?></td>
136<td><?php echo $min_row->input()?></td>
137</tr>
138<tr>
139<td><INPUT TYPE="hidden" id="p_jrn_deb_max_line" NAME="p_jrn_deb_max_line" VALUE="10"></td>
140</tr>
141<tr><td><INPUT TYPE="hidden" id="p_ech_lib" NAME="p_ech_lib" VALUE="echeance"></td>
142</tr>
143<tr>
144 <td style="width: 200px">
145 <?php echo _('Description') ?>
146 </TD>
147 <td style="width: 500px">
148 <?php echo $str_description; ?>
149 </td>
150</tr>
151
152<TR>
153<TD><?php echo _('Préfixe code interne')?> </TD><TD>
154<?php echo $code?> </TD>
155</TR>
156<TR>
157<TD><?php echo _('Préfixe pièce justificative')?>
158 <?php echo Icon_Action::infobulle(39);?>
159</TD>
160<TD>
161<?php echo $pj_pref; ?>
162</TD>
163</TR>
164 <tr>
165 <td>
166 <?=_("Nombre de chiffres du numéro de pièce, remplissage avec des 0 ")?>
167 </td>
168 <td>
169 <?=$padding->input()?>
170 </td>
171 </tr>
172
173</TR>
174<?php if ( $new == 0 ) : ?>
175 <TR>
176 <TD>
177 <?php echo _('Dernière pièce numérotée')?>
178 <?php echo Icon_Action::infobulle(40);?>
179 </TD>
180 <TD>
181
182 <?php echo str_pad($last_seq,$this->jrn_def_pj_padding??0,'0',STR_PAD_LEFT)?>
183 </TD>
184 </TR>
185
186 <tr>
187 <TD><?php echo _('N° pièce justificative')?>
188 <?php echo Icon_Action::infobulle(38);?>
189 </TD>
190 <TD>
191 <?php echo $pj_seq; ?>
192
193 </TD>
194 </tr>
195 <tr>
196 <td>
197 <?=_("Journal actif")?>
198 </td>
199 <td>
200 <?=$actif->input()?>
201 </td>
202 </TR>
203<?php endif; ?>
204<?php
205
206 // if the ledger is financial and has no operation let choose the currency
207 if ( $new == 1 || $type == 'FIN'):
208?>
209<tr id="type_fin3">
210 <td>
211 <?php echo _("Devise")?>
212 </td>
213 <td>
214 <?php echo $default_currency->input();?>
215 </td>
216</tr>
217<?php
218endif;
219?>
220</TABLE>
221<hr>
222 <?php
223 /////////////////// ACH //////////////////////////////////
224 if ( $new ==1 || $type=='ACH' ) :
225 ?>
226 <div id='ACH_div' >
227 <h2 class="h-section" > Fiches </h2>
228 <TABLE class="result" style="width:80%;margin-left:10%;">
229 <tr>
230 <th>
231 <?php echo _("Services, fournitures ou biens achetés (D)");?>
232 </th>
233 <th>
234 <?php echo _("Fournisseurs (C)"); ?>
235 </th>
236 </tr>
237
238
239 <?php
240 // Show the fiche in deb section
241 $Res=$cn->exec_sql("select fd_id,fd_label from fiche_def order by fd_label");
242 $num=$cn->size();
243 // default card for ACH
244 if ($new == 1)
245 {
246 $rdeb=$default_deb_purchase;
247 $rcred=$default_cred_purchase;
248 }
249
250 for ($i=0;$i<$num;$i++) {
251 $res=$cn->fetch($i);
252 $CHECKED=" unchecked";
253 foreach ( $rdeb as $element) {
254 if ( $element == $res['fd_id'] ) {
255 $CHECKED="CHECKED";
256 break;
257 }
258 }
259 echo '<tr>';
260 printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="ACH_FICHEDEB[]" class="ach_fichedeb" %s>%s</TD>',
261 $res['fd_id'],$CHECKED,$res['fd_label']);
262 $CHECKED=" unchecked";
263 foreach ( $rcred as $element) {
264 if ( $element == $res['fd_id'] ) {
265 $CHECKED="CHECKED";
266 break;
267 }
268 }
269 printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="ACH_FICHECRED[]" class="ach_fichecred" %s>%s</TD>',
270 $res['fd_id'],$CHECKED,$res['fd_label']);
271 echo '</TR>';
272 }
273 ?>
274 </TABLE>
275</div>
276<?php /////////////////// ACH //////////////////////////////////
277 endif;
278 ?>
279<?php
280 /////////////////// VEN //////////////////////////////////
281 if ( $new ==1 || $type=='VEN' ) :
282 ?>
283 <div id='VEN_div' >
284 <h2 class="h-section"> Fiches </h2>
285 <TABLE class="result" style="width:80%;margin-left:10%;">
286
287 <tr>
288 <th>
289 <?php echo _("Clients (D)");?>
290 </th>
291 <th>
292 <?php echo _("Services, fournitures ou biens vendus (C)");?>
293 </th>
294 </tr>
295
296
297 <?php
298 // Show the fiche in deb section
299 $Res=$cn->exec_sql("select fd_id,fd_label from fiche_def order by fd_label");
300 $num=$cn->size();
301 // default card for VEN
302 if ($new == 1)
303 {
304 $rdeb=$default_deb_sale;
305 $rcred=$default_cred_sale;
306 }
307
308 for ($i=0;$i<$num;$i++) {
309 $res=$cn->fetch($i);
310 $CHECKED=" unchecked";
311 foreach ( $rdeb as $element) {
312 if ( $element == $res['fd_id'] ) {
313 $CHECKED="CHECKED";
314 break;
315 }
316 }
317 echo '<tr>';
318 printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="VEN_FICHEDEB[]" class="ven_fichedeb" %s>%s</TD>',
319 $res['fd_id'],$CHECKED,$res['fd_label']);
320 $CHECKED=" unchecked";
321 foreach ( $rcred as $element) {
322 if ( $element == $res['fd_id'] ) {
323 $CHECKED="CHECKED";
324 break;
325 }
326 }
327 printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="VEN_FICHECRED[]" class="ven_fichecred" %s>%s</TD>',
328 $res['fd_id'],$CHECKED,$res['fd_label']);
329 echo '</TR>';
330 }
331 ?>
332 </TABLE>
333</div>
334<?php /////////////////// VEN //////////////////////////////////
335 endif;
336 ?>
337 <?php
338 /////////////////// ODS //////////////////////////////////
339 if ( $new ==1 || $type=='ODS' ) :
340 ?>
341 <div id='ODS_div' >
342 <h2 class="h-section"> Fiches </h2>
343 <TABLE class="result" style="width:60%;margin-left:20%;">
344 <tr>
345 <th>
346 <?php echo _("Fiches utilisables (D/C)"); ?>
347 </th>
348
349 </tr>
350
351
352 <?php
353 // Show the fiche in deb section
354 $Res=$cn->exec_sql("select fd_id,fd_label from fiche_def order by fd_label");
355 $num=$cn->size();
356 // default card for ODS
357 if ($new == 1)
358 {
359 $rdeb=$default_ods;
360 }
361 for ($i=0;$i<$num;$i++) {
362 $res=$cn->fetch($i);
363 $CHECKED=" unchecked";
364 if (!empty($rdeb)) foreach ( $rdeb as $element) {
365 if ( $element == $res['fd_id'] ) {
366 $CHECKED="CHECKED";
367 break;
368 }
369 }
370 echo '<tr>';
371 printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="ODS_FICHEDEB[]" class="ods_fichedeb" %s>%s</TD>',
372 $res['fd_id'],$CHECKED,$res['fd_label']);
373 $CHECKED=" unchecked";
374
375 echo '</TR>';
376 }
377 ?>
378 </TABLE>
379</div>
380<?php /////////////////// ODS //////////////////////////////////
381 endif;
382 ?>
383 <?php
384 /////////////////// FIN //////////////////////////////////
385 if ( $new ==1 || $type=='FIN' ) :
386 ?>
387 <div id='FIN_div' >
388 <h2 class="h-section"> Fiches </h2>
389 <TABLE class="result" style="width:60%;margin-left:20%;">
390 <tr>
391 <th>
392 Tiers (D/C)
393 </th>
394
395 </tr>
396
397
398 <?php
399 // Show the fiche in deb section
400 $Res=$cn->exec_sql("select fd_id,fd_label from fiche_def order by fd_label");
401 $num=$cn->size();
402 // default card for ACH
403 if ($new == 1)
404 {
405 $rdeb=$default_fin;
406 }
407 for ($i=0;$i<$num;$i++) {
408 $res=$cn->fetch($i);
409 $CHECKED=" unchecked";
410 foreach ( $rdeb as $element) {
411 if ( $element == $res['fd_id'] ) {
412 $CHECKED="CHECKED";
413 break;
414 }
415 }
416 echo '<tr>';
417 printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="FIN_FICHEDEB[]" class="fin_fichedeb" %s>%s</TD>',
418 $res['fd_id'],$CHECKED,$res['fd_label']);
419 $CHECKED=" unchecked";
420
421 echo '</TR>';
422 }
423 ?>
424 </TABLE>
425</div>
426<?php /////////////////// FIN //////////////////////////////////
427 endif;
428 ?>
429<?php if ( $new == 1 ) : ?>
430<script>
431 var a_div=Array('VEN_div','ODS_div','ACH_div','FIN_div');
432 function hide_ledger()
433 {
434 for (var i=0;i<a_div.length;i++)
435 {
436 $(a_div[i]).style.display='none';
437 }
438 }
439 function hide_row()
440 {
441 $('type_ods').style.display='none';
442 $('type_fin').style.display='none';
443 $('type_fin2').style.display='none';
444 $('type_fin3').style.display='none';
445 $('neg_amount').style.display='none';
446 $('row_warning').style.display='none';
447 }
449 {
450 hide_ledger();
451 var ch=$('p_jrn_type_select_id').options[$('p_jrn_type_select_id').selectedIndex].value;
452 if ( ch != -1 ) { $(ch+'_div').style.display='block';}
453 switch (ch) {
454 case 'FIN':
455 hide_row();
456 $('type_fin').style.display='table-row';
457 $('type_fin2').style.display='table-row';
458 $('type_fin3').style.display='table-row';
459 break;
460 case 'ODS':
461 hide_row();
462 $('type_ods').style.display='table-row';
463 break;
464 case 'ACH':
465 hide_row();
466 $('neg_amount').style.display='table-row';
467 toggle_row_warning_enable('negative_amount','row_warning');
468
469 break;
470 case 'VEN':
471 hide_row();
472 $('neg_amount').style.display='table-row';
473 toggle_row_warning_enable('negative_amount','row_warning');
474
475 break;
476
477 default:
478 hide_row();
479 }
480 }
481 hide_ledger();
482 hide_row();
483 <?php
484 if (isset ($previous_p_jrn_type) ):
485 ?>
487 <?php
488 endif;
489 ?>
490
491
492</script>
493<?php endif; ?>
494<?php if ( $type=="ACH" || $type=="VEN") :?>
495<script>
496toggle_row_warning_enable('negative_amount','row_warning');
497</script>
498<?php
499endif;
500?>
501<script>
502/** activate checkbox */
503(function () {var a_checkbox=['ach_fichecred','ach_fichedeb','ven_fichecred','ven_fichedeb','ods_fichedeb','fin_fichedeb'];
504 a_checkbox.forEach(element => activate_checkbox_range(element));})()
505</script>
h2($p_string, $p_class="", $raw="")
Definition ac_common.php:68
th($p_string, $p_extra='', $raw='')
Definition ac_common.php:58
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
else $num
$opd_description style
if(trim($query)==''|| $filter=='') $search
$new
_("actif, passif,charge,...")
Input HTML for the card show buttons, in the file, you have to add card.js How to use :
static warnbulle($p_comment)
Display a warning in a bubble, text is in message_javascript.
static infobulle($p_comment)
Display a info in a bubble, text is in message_javascript.
show_ledger_div()
hide_row()
hide_ledger()