Go to the documentation of this file.00001 <?php
00002
00003
00004 ?><TABLE>
00005 <TR>
00006
00007 <TD><?php echo _('Nom journal')?> </TD>
00008 <TD> <INPUT TYPE="text" class="input_text" NAME="p_jrn_name" VALUE="<?php echo $name; ?>"></TD>
00009 <td></td>
00010 </TR>
00011 <?php
00012 if ( $new || $type=='ODS' ):
00013 ?>
00014 <TR id="type_ods">
00015 <td><?php echo _('Postes utilisables journal (débit/crédit) ')?>
00016 </TD>
00017 <td>
00018 <?php echo $search;?>
00019 </TD>
00020 <TD CLASS="notice">
00021 <?php echo _("Uniquement pour les journaux d'Opérations Diverses, les valeurs sont séparées par des espaces, on peut aussi
00022 utiliser le * pour indiquer 'tous les postes qui en dépendent' exemple: 4*")?>
00023 </TD>
00024 </TR>
00025 <?php
00026 endif;
00027 ?>
00028 <?php
00029 if ( $new|| $type=='FIN') {
00030 ?>
00031 <tr id="type_fin">
00032 <td>
00033 <?php echo _('Numérotation de chaque opération')?>
00034 </td>
00035 <td>
00036 <?php echo $num_op->input();?>
00037 </td>
00038 </tr>
00039 <tr id="type_fin2">
00040 <TD>
00041 <?php echo _('Compte en banque')?>
00042 </td>
00043 <TD>
00044 <?php
00045 $card=new ICard();
00046 $card->name='bank';
00047 $card->extra=$cn->make_list('select fd_id from fiche_def where frd_id=4');
00048 $card->set_dblclick("fill_ipopcard(this);");
00049 $card->set_function('fill_data');
00050 $card->set_attribute('ipopup','ipop_card');
00051 $list=$cn->make_list('select fd_id from fiche_def where frd_id=4');
00052 $card->set_attribute('typecard',$list);
00053
00054 $card->value=$qcode_bank;
00055 echo $card->search();
00056 echo $card->input();
00057 echo $str_add_button;
00058 ?>
00059 </td>
00060 <td class="notice">
00061 <?php echo _("Obligatoire pour les journaux FIN : donner ici la fiche de la banque utilisée")?>
00062 </td>
00063 <?php
00064 }
00065 ?>
00066 </TR>
00067 <tr>
00068 <td>Minimum de lignes à afficher</td>
00069 <td><?php echo $min_row->input()?></td>
00070 </tr>
00071 <tr>
00072 <td><INPUT TYPE="hidden" id="p_jrn_deb_max_line" NAME="p_jrn_deb_max_line" VALUE="10"></td>
00073 </tr>
00074 <tr><td><INPUT TYPE="hidden" id="p_ech_lib" NAME="p_ech_lib" VALUE="echeance"></td>
00075 </tr>
00076
00077 <TR>
00078 <TD><?php echo _('Type de journal')?> </TD>
00079 <TD>
00080 <?php echo $type;?>
00081 </TD>
00082 </TR>
00083 <TR>
00084 <TD><?php echo _('Préfixe code interne')?> </TD><TD>
00085 <?php echo $code?> </TD>
00086 </TR>
00087 <TR>
00088 <TD><?php echo _('Préfixe pièce justificative')?>
00089 </TD>
00090 <TD>
00091 <?php echo $pj_pref; ?>
00092 </TD>
00093 <TD>
00094 <span class="notice"><?php echo _('Le préfixe des pièces doit être différent pour chaque journal, on peut aussi utiliser l\'année')?></span><br>
00095 <span class="notice"><?php echo _('Uniquement des chiffres')?></span>
00096 </TD>
00097
00098 </TR>
00099 <?php if ( $new == 0 ) : ?>
00100 <TR>
00101 <TD>
00102 <?php echo _('Dernière pièce numérotée')?>
00103 </TD>
00104 <TD>
00105 <?php echo $last_seq?>
00106 </TD>
00107 </TR>
00108
00109 <tr>
00110 <TD><?php echo _('N° pièce justificative')?>
00111 </TD>
00112 <TD>
00113 <?php echo $pj_seq; ?>
00114 </TD>
00115
00116 <TD>
00117 <span class="notice" style="display:block"><?php echo _('La numérotation est propre à chaque journal')?></span>
00118 <span class="notice" style="display:block"><?php echo _('Laissez à 0 pour ne pas changer le numéro')?></span>
00119 </TD>
00120 </tr>
00121 <?php endif; ?>
00122 <tr>
00123 <td>
00124 <?php echo _('Description') ?>
00125 </TD>
00126 <td>
00127 <?php echo $str_description; ?>
00128 </td>
00129 </tr>
00130 </TABLE>
00131 <?php
00132
00133 if ( $new ==1 || $type=='ACH' ) :
00134 ?>
00135 <div id='ACH_div' >
00136 <H2 class="info"> Fiches </H2>
00137 <TABLE class="result" style="width:80%;margin-left:10%;">
00138 <tr>
00139 <th>
00140 Services, fournitures ou biens achetés (C)
00141 </th>
00142 <th>
00143 Fournisseurs (D)
00144 </th>
00145 </tr>
00146
00147
00148 <?php
00149
00150 $Res=$cn->exec_sql("select fd_id,fd_label from fiche_def order by fd_label");
00151 $num=$cn->size();
00152
00153 for ($i=0;$i<$num;$i++) {
00154 $res=$cn->fetch($i);
00155 $CHECKED=" unchecked";
00156 foreach ( $rdeb as $element) {
00157 if ( $element == $res['fd_id'] ) {
00158 $CHECKED="CHECKED";
00159 break;
00160 }
00161 }
00162 echo '<tr>';
00163 printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="FICHEDEB[]" %s>%s</TD>',
00164 $res['fd_id'],$CHECKED,$res['fd_label']);
00165 $CHECKED=" unchecked";
00166 foreach ( $rcred as $element) {
00167 if ( $element == $res['fd_id'] ) {
00168 $CHECKED="CHECKED";
00169 break;
00170 }
00171 }
00172 printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="FICHECRED[]" %s>%s</TD>',
00173 $res['fd_id'],$CHECKED,$res['fd_label']);
00174 echo '</TR>';
00175 }
00176 ?>
00177 </TABLE>
00178 </div>
00179 <?php
00180 endif;
00181 ?>
00182 <?php
00183
00184 if ( $new ==1 || $type=='VEN' ) :
00185 ?>
00186 <div id='VEN_div' >
00187 <H2 class="info"> Fiches </H2>
00188 <TABLE class="result" style="width:80%;margin-left:10%;">
00189
00190 <tr>
00191 <th>
00192 Clients (C)
00193 </th>
00194 <th>
00195 Services, fournitures ou biens vendus (D)
00196 </th>
00197 </tr>
00198
00199
00200 <?php
00201
00202 $Res=$cn->exec_sql("select fd_id,fd_label from fiche_def order by fd_label");
00203 $num=$cn->size();
00204
00205 for ($i=0;$i<$num;$i++) {
00206 $res=$cn->fetch($i);
00207 $CHECKED=" unchecked";
00208 foreach ( $rdeb as $element) {
00209 if ( $element == $res['fd_id'] ) {
00210 $CHECKED="CHECKED";
00211 break;
00212 }
00213 }
00214 echo '<tr>';
00215 printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="FICHEDEB[]" %s>%s</TD>',
00216 $res['fd_id'],$CHECKED,$res['fd_label']);
00217 $CHECKED=" unchecked";
00218 foreach ( $rcred as $element) {
00219 if ( $element == $res['fd_id'] ) {
00220 $CHECKED="CHECKED";
00221 break;
00222 }
00223 }
00224 printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="FICHECRED[]" %s>%s</TD>',
00225 $res['fd_id'],$CHECKED,$res['fd_label']);
00226 echo '</TR>';
00227 }
00228 ?>
00229 </TABLE>
00230 </div>
00231 <?php
00232 endif;
00233 ?>
00234 <?php
00235
00236 if ( $new ==1 || $type=='ODS' ) :
00237 ?>
00238 <div id='ODS_div' >
00239 <H2 class="info"> Fiches </H2>
00240 <TABLE class="result" style="width:60%;margin-left:20%;">
00241 <tr>
00242 <th>
00243 Fiches utilisables (D/C)
00244 </th>
00245
00246 </tr>
00247
00248
00249 <?php
00250
00251 $Res=$cn->exec_sql("select fd_id,fd_label from fiche_def order by fd_label");
00252 $num=$cn->size();
00253
00254 for ($i=0;$i<$num;$i++) {
00255 $res=$cn->fetch($i);
00256 $CHECKED=" unchecked";
00257 foreach ( $rdeb as $element) {
00258 if ( $element == $res['fd_id'] ) {
00259 $CHECKED="CHECKED";
00260 break;
00261 }
00262 }
00263 echo '<tr>';
00264 printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="FICHEDEB[]" %s>%s</TD>',
00265 $res['fd_id'],$CHECKED,$res['fd_label']);
00266 $CHECKED=" unchecked";
00267 foreach ( $rcred as $element) {
00268 if ( $element == $res['fd_id'] ) {
00269 $CHECKED="CHECKED";
00270 break;
00271 }
00272 }
00273 echo '</TR>';
00274 }
00275 ?>
00276 </TABLE>
00277 </div>
00278 <?php
00279 endif;
00280 ?>
00281 <?php
00282
00283 if ( $new ==1 || $type=='FIN' ) :
00284 ?>
00285 <div id='FIN_div' >
00286 <H2 class="info"> Fiches </H2>
00287 <TABLE class="result" style="width:60%;margin-left:20%;">
00288 <tr>
00289 <th>
00290 Tiers (D/C)
00291 </th>
00292
00293 </tr>
00294
00295
00296 <?php
00297
00298 $Res=$cn->exec_sql("select fd_id,fd_label from fiche_def order by fd_label");
00299 $num=$cn->size();
00300
00301 for ($i=0;$i<$num;$i++) {
00302 $res=$cn->fetch($i);
00303 $CHECKED=" unchecked";
00304 foreach ( $rdeb as $element) {
00305 if ( $element == $res['fd_id'] ) {
00306 $CHECKED="CHECKED";
00307 break;
00308 }
00309 }
00310 echo '<tr>';
00311 printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="FICHEDEB[]" %s>%s</TD>',
00312 $res['fd_id'],$CHECKED,$res['fd_label']);
00313 $CHECKED=" unchecked";
00314 foreach ( $rcred as $element) {
00315 if ( $element == $res['fd_id'] ) {
00316 $CHECKED="CHECKED";
00317 break;
00318 }
00319 }
00320 echo '</TR>';
00321 }
00322 ?>
00323 </TABLE>
00324 </div>
00325 <?php
00326 endif;
00327 ?>
00328 <?php if ( $new == 1 ) : ?>
00329 <script>
00330 var a_div=Array('VEN_div','ODS_div','ACH_div','FIN_div');
00331 function hide_ledger()
00332 {
00333 for (var i=0;i<a_div.length;i++)
00334 {
00335 $(a_div[i]).style.display='none';
00336 }
00337 }
00338 function hide_row()
00339 {
00340 $('type_ods').style.display='none';
00341 $('type_fin').style.display='none';
00342 $('type_fin2').style.display='none';
00343 }
00344 function show_ledger_div()
00345 {
00346 hide_ledger();
00347 var ch=$('p_jrn_type_select_id').options[$('p_jrn_type_select_id').selectedIndex].value;
00348 console.log(" div = "+ch);
00349 $(ch+'_div').style.display='block';
00350 switch (ch) {
00351 case 'FIN':
00352 hide_row();
00353 $('type_fin').style.display='table-row';
00354 $('type_fin2').style.display='table-row';
00355 break;
00356 case 'ODS':
00357 hide_row();
00358 $('type_ods').style.display='table-row';
00359 break;
00360 default:
00361 hide_row();
00362 }
00363 }
00364 hide_ledger();
00365 hide_row();
00366 </script>
00367 <?php endif; ?>