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