noalyss Version-9
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 $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</TR>
162 <tr>
163 <td>
164 <?=_("Nombre de caractère du numéro de pièce, remplissage avec des 0 ")?>
165 </td>
166 <td>
167 <?=$padding->input()?>
168 </td>
169 </tr>
170
171</TR>
172<?php if ( $new == 0 ) : ?>
173 <TR>
174 <TD>
175 <?php echo _('Dernière pièce numérotée')?>
176 <?php echo Icon_Action::infobulle(40);?>
177 </TD>
178 <TD>
179
180 <?php echo str_pad($last_seq,$this->jrn_def_pj_padding??0,'0',STR_PAD_LEFT)?>
181 </TD>
182 </TR>
183
184 <tr>
185 <TD><?php echo _('N° pièce justificative')?>
186 <?php echo Icon_Action::infobulle(38);?>
187 </TD>
188 <TD>
189 <?php echo $pj_seq; ?>
190
191 </TD>
192 </tr>
193 <tr>
194 <td>
195 <?=_("Journal actif")?>
196 </td>
197 <td>
198 <?=$actif->input()?>
199 </td>
200 </TR>
201<?php endif; ?>
202<?php
203
204 // if the ledger is financial and has no operation let choose the currency
205 if ( $new == 1 || $type == 'FIN'):
206?>
207<tr id="type_fin3">
208 <td>
209 <?php echo _("Devise")?>
210 </td>
211 <td>
212 <?php echo $default_currency->input();?>
213 </td>
214</tr>
215<?php
216endif;
217?>
218</TABLE>
219<hr>
220 <?php
221 /////////////////// ACH //////////////////////////////////
222 if ( $new ==1 || $type=='ACH' ) :
223 ?>
224 <div id='ACH_div' >
225 <h2 class="h-section" > Fiches </h2>
226 <TABLE class="result" style="width:80%;margin-left:10%;">
227 <tr>
228 <th>
229 <?php echo _("Services, fournitures ou biens achetés (D)");?>
230 </th>
231 <th>
232 <?php echo _("Fournisseurs (C)"); ?>
233 </th>
234 </tr>
235
236
237 <?php
238 // Show the fiche in deb section
239 $Res=$cn->exec_sql("select fd_id,fd_label from fiche_def order by fd_label");
240 $num=$cn->size();
241 // default card for ACH
242 if ($new == 1)
243 {
244 $rdeb=$default_deb_purchase;
245 $rcred=$default_cred_purchase;
246 }
247
248 for ($i=0;$i<$num;$i++) {
249 $res=$cn->fetch($i);
250 $CHECKED=" unchecked";
251 foreach ( $rdeb as $element) {
252 if ( $element == $res['fd_id'] ) {
253 $CHECKED="CHECKED";
254 break;
255 }
256 }
257 echo '<tr>';
258 printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="ACH_FICHEDEB[]" class="ach_fichedeb" %s>%s</TD>',
259 $res['fd_id'],$CHECKED,$res['fd_label']);
260 $CHECKED=" unchecked";
261 foreach ( $rcred as $element) {
262 if ( $element == $res['fd_id'] ) {
263 $CHECKED="CHECKED";
264 break;
265 }
266 }
267 printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="ACH_FICHECRED[]" class="ach_fichecred" %s>%s</TD>',
268 $res['fd_id'],$CHECKED,$res['fd_label']);
269 echo '</TR>';
270 }
271 ?>
272 </TABLE>
273</div>
274<?php /////////////////// ACH //////////////////////////////////
275 endif;
276 ?>
277<?php
278 /////////////////// VEN //////////////////////////////////
279 if ( $new ==1 || $type=='VEN' ) :
280 ?>
281 <div id='VEN_div' >
282 <h2 class="h-section"> Fiches </h2>
283 <TABLE class="result" style="width:80%;margin-left:10%;">
284
285 <tr>
286 <th>
287 <?php echo _("Clients (D)");?>
288 </th>
289 <th>
290 <?php echo _("Services, fournitures ou biens vendus (C)");?>
291 </th>
292 </tr>
293
294
295 <?php
296 // Show the fiche in deb section
297 $Res=$cn->exec_sql("select fd_id,fd_label from fiche_def order by fd_label");
298 $num=$cn->size();
299 // default card for VEN
300 if ($new == 1)
301 {
302 $rdeb=$default_deb_sale;
303 $rcred=$default_cred_sale;
304 }
305
306 for ($i=0;$i<$num;$i++) {
307 $res=$cn->fetch($i);
308 $CHECKED=" unchecked";
309 foreach ( $rdeb as $element) {
310 if ( $element == $res['fd_id'] ) {
311 $CHECKED="CHECKED";
312 break;
313 }
314 }
315 echo '<tr>';
316 printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="VEN_FICHEDEB[]" class="ven_fichedeb" %s>%s</TD>',
317 $res['fd_id'],$CHECKED,$res['fd_label']);
318 $CHECKED=" unchecked";
319 foreach ( $rcred as $element) {
320 if ( $element == $res['fd_id'] ) {
321 $CHECKED="CHECKED";
322 break;
323 }
324 }
325 printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="VEN_FICHECRED[]" class="ven_fichecred" %s>%s</TD>',
326 $res['fd_id'],$CHECKED,$res['fd_label']);
327 echo '</TR>';
328 }
329 ?>
330 </TABLE>
331</div>
332<?php /////////////////// VEN //////////////////////////////////
333 endif;
334 ?>
335 <?php
336 /////////////////// ODS //////////////////////////////////
337 if ( $new ==1 || $type=='ODS' ) :
338 ?>
339 <div id='ODS_div' >
340 <h2 class="h-section"> Fiches </h2>
341 <TABLE class="result" style="width:60%;margin-left:20%;">
342 <tr>
343 <th>
344 <?php echo _("Fiches utilisables (D/C)"); ?>
345 </th>
346
347 </tr>
348
349
350 <?php
351 // Show the fiche in deb section
352 $Res=$cn->exec_sql("select fd_id,fd_label from fiche_def order by fd_label");
353 $num=$cn->size();
354 // default card for ODS
355 if ($new == 1)
356 {
357 $rdeb=$default_ods;
358 }
359 for ($i=0;$i<$num;$i++) {
360 $res=$cn->fetch($i);
361 $CHECKED=" unchecked";
362 if (!empty($rdeb)) foreach ( $rdeb as $element) {
363 if ( $element == $res['fd_id'] ) {
364 $CHECKED="CHECKED";
365 break;
366 }
367 }
368 echo '<tr>';
369 printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="ODS_FICHEDEB[]" class="ods_fichedeb" %s>%s</TD>',
370 $res['fd_id'],$CHECKED,$res['fd_label']);
371 $CHECKED=" unchecked";
372
373 echo '</TR>';
374 }
375 ?>
376 </TABLE>
377</div>
378<?php /////////////////// ODS //////////////////////////////////
379 endif;
380 ?>
381 <?php
382 /////////////////// FIN //////////////////////////////////
383 if ( $new ==1 || $type=='FIN' ) :
384 ?>
385 <div id='FIN_div' >
386 <h2 class="h-section"> Fiches </h2>
387 <TABLE class="result" style="width:60%;margin-left:20%;">
388 <tr>
389 <th>
390 Tiers (D/C)
391 </th>
392
393 </tr>
394
395
396 <?php
397 // Show the fiche in deb section
398 $Res=$cn->exec_sql("select fd_id,fd_label from fiche_def order by fd_label");
399 $num=$cn->size();
400 // default card for ACH
401 if ($new == 1)
402 {
403 $rdeb=$default_fin;
404 }
405 for ($i=0;$i<$num;$i++) {
406 $res=$cn->fetch($i);
407 $CHECKED=" unchecked";
408 foreach ( $rdeb as $element) {
409 if ( $element == $res['fd_id'] ) {
410 $CHECKED="CHECKED";
411 break;
412 }
413 }
414 echo '<tr>';
415 printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="FIN_FICHEDEB[]" class="fin_fichedeb" %s>%s</TD>',
416 $res['fd_id'],$CHECKED,$res['fd_label']);
417 $CHECKED=" unchecked";
418
419 echo '</TR>';
420 }
421 ?>
422 </TABLE>
423</div>
424<?php /////////////////// FIN //////////////////////////////////
425 endif;
426 ?>
427<?php if ( $new == 1 ) : ?>
428<script>
429 var a_div=Array('VEN_div','ODS_div','ACH_div','FIN_div');
430 function hide_ledger()
431 {
432 for (var i=0;i<a_div.length;i++)
433 {
434 $(a_div[i]).style.display='none';
435 }
436 }
437 function hide_row()
438 {
439 $('type_ods').style.display='none';
440 $('type_fin').style.display='none';
441 $('type_fin2').style.display='none';
442 $('type_fin3').style.display='none';
443 $('neg_amount').style.display='none';
444 $('row_warning').style.display='none';
445 }
447 {
448 hide_ledger();
449 var ch=$('p_jrn_type_select_id').options[$('p_jrn_type_select_id').selectedIndex].value;
450 if ( ch != -1 ) { $(ch+'_div').style.display='block';}
451 switch (ch) {
452 case 'FIN':
453 hide_row();
454 $('type_fin').style.display='table-row';
455 $('type_fin2').style.display='table-row';
456 $('type_fin3').style.display='table-row';
457 break;
458 case 'ODS':
459 hide_row();
460 $('type_ods').style.display='table-row';
461 break;
462 case 'ACH':
463 hide_row();
464 $('neg_amount').style.display='table-row';
465 toggle_row_warning_enable('negative_amount','row_warning');
466
467 break;
468 case 'VEN':
469 hide_row();
470 $('neg_amount').style.display='table-row';
471 toggle_row_warning_enable('negative_amount','row_warning');
472
473 break;
474
475 default:
476 hide_row();
477 }
478 }
479 hide_ledger();
480 hide_row();
481 <?php
482 if (isset ($previous_p_jrn_type) ):
483 ?>
485 <?php
486 endif;
487 ?>
488
489
490</script>
491<?php endif; ?>
492<?php if ( $type=="ACH" || $type=="VEN") :?>
493<script>
494toggle_row_warning_enable('negative_amount','row_warning');
495</script>
496<?php
497endif;
498?>
499<script>
500/** activate checkbox */
501(function () {var a_checkbox=['ach_fichecred','ach_fichedeb','ven_fichecred','ven_fichedeb','ods_fichedeb','fin_fichedeb'];
502 a_checkbox.forEach(element => activate_checkbox_range(element));})()
503</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
_("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()