noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
param_jrn.php
Go to the documentation of this file.
00001 <?php
00002 //This file is part of NOALYSS and is under GPL 
00003 //see licence.txt
00004 ?><TABLE style="width: auto">
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     <?php echo HtmlInput::infobulle(39);?>
00090 </TD>
00091 <TD>
00092 <?php echo $pj_pref; ?>
00093 </TD>
00094 
00095 </TR>
00096 <?php if ( $new == 0 ) : ?>
00097 <TR>
00098 <TD>
00099   <?php echo _('Dernière pièce numérotée')?>
00100   <?php echo HtmlInput::infobulle(40);?>
00101 </TD>
00102 <TD>
00103 <?php echo $last_seq?>
00104 </TD>
00105 </TR>
00106 
00107 <tr>
00108 <TD><?php echo _('N° pièce justificative')?>
00109     <?php echo HtmlInput::infobulle(38);?>
00110 </TD>
00111 <TD>
00112     <?php echo $pj_seq; ?>
00113    
00114 </TD>
00115 </tr>
00116 <?php endif; ?>
00117 <tr>
00118     <td style="width: 200px">
00119     <?php echo _('Description') ?>
00120     </TD>
00121     <td style="width: 500px">
00122      <?php echo $str_description; ?>   
00123     </td>
00124 </tr>    
00125 </TABLE>
00126 <hr>
00127     <?php
00128     /////////////////// ACH //////////////////////////////////
00129     if ( $new ==1 || $type=='ACH' ) : 
00130         ?>
00131     <div id='ACH_div' >
00132     <h2 > Fiches </h2>
00133     <TABLE class="result" style="width:80%;margin-left:10%;">
00134         <tr>
00135             <th>
00136                 Services, fournitures ou biens  achetés (D)
00137             </th>
00138             <th>
00139                 Fournisseurs (C)
00140             </th>
00141         </tr>
00142     
00143         
00144     <?php
00145     // Show the fiche in deb section
00146     $Res=$cn->exec_sql("select fd_id,fd_label from fiche_def order by fd_label");
00147     $num=$cn->size();
00148     // default card for ACH
00149     if ($new == 1)
00150     {
00151         $rdeb=$default_deb_purchase;
00152         $rcred=$default_cred_purchase;
00153     }
00154     
00155     for ($i=0;$i<$num;$i++) {
00156       $res=$cn->fetch($i);
00157       $CHECKED=" unchecked";
00158       foreach ( $rdeb as $element) {
00159         if ( $element == $res['fd_id'] ) {
00160           $CHECKED="CHECKED";
00161           break;
00162         }
00163       }
00164             echo '<tr>';
00165       printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="FICHEDEB[]" %s>%s</TD>',
00166               $res['fd_id'],$CHECKED,$res['fd_label']);
00167       $CHECKED=" unchecked";
00168       foreach ( $rcred as $element) {
00169         if ( $element == $res['fd_id'] ) {
00170           $CHECKED="CHECKED";
00171           break;
00172         }
00173       }
00174       printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="FICHECRED[]" %s>%s</TD>',
00175               $res['fd_id'],$CHECKED,$res['fd_label']);
00176       echo '</TR>';
00177     }
00178     ?>
00179     </TABLE>
00180 </div>
00181 <?php /////////////////// ACH //////////////////////////////////
00182  endif; 
00183  ?>
00184 <?php
00185     /////////////////// VEN //////////////////////////////////
00186     if ( $new ==1  || $type=='VEN' ) : 
00187         ?>
00188     <div id='VEN_div' >
00189     <h2> Fiches </h2>
00190     <TABLE class="result" style="width:80%;margin-left:10%;">
00191         
00192         <tr>
00193             <th>
00194                 Clients (C)
00195             </th>
00196             <th>
00197                 Services, fournitures ou biens  vendus (D)
00198             </th>
00199         </tr>
00200     
00201         
00202     <?php
00203     // Show the fiche in deb section
00204     $Res=$cn->exec_sql("select fd_id,fd_label from fiche_def order by fd_label");
00205     $num=$cn->size();
00206     // default card for VEN
00207     if ($new == 1)
00208     {
00209         $rdeb=$default_deb_sale;
00210         $rcred=$default_cred_sale;
00211     }
00212 
00213     for ($i=0;$i<$num;$i++) {
00214       $res=$cn->fetch($i);
00215       $CHECKED=" unchecked";
00216       foreach ( $rdeb as $element) {
00217         if ( $element == $res['fd_id'] ) {
00218           $CHECKED="CHECKED";
00219           break;
00220         }
00221       }
00222             echo '<tr>';
00223       printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="FICHEDEB[]" %s>%s</TD>',
00224               $res['fd_id'],$CHECKED,$res['fd_label']);
00225       $CHECKED=" unchecked";
00226       foreach ( $rcred as $element) {
00227         if ( $element == $res['fd_id'] ) {
00228           $CHECKED="CHECKED";
00229           break;
00230         }
00231       }
00232       printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="FICHECRED[]" %s>%s</TD>',
00233               $res['fd_id'],$CHECKED,$res['fd_label']);
00234       echo '</TR>';
00235     }
00236     ?>
00237     </TABLE>
00238 </div>
00239 <?php /////////////////// VEN //////////////////////////////////
00240  endif; 
00241  ?>
00242    <?php
00243     /////////////////// ODS //////////////////////////////////
00244     if ( $new ==1 || $type=='ODS' ) : 
00245         ?>
00246     <div id='ODS_div' >
00247     <h2> Fiches </h2>
00248    <TABLE class="result" style="width:60%;margin-left:20%;">
00249         <tr>
00250             <th>
00251                 Fiches utilisables (D/C)
00252             </th>
00253            
00254         </tr>
00255     
00256         
00257     <?php
00258     // Show the fiche in deb section
00259     $Res=$cn->exec_sql("select fd_id,fd_label from fiche_def order by fd_label");
00260     $num=$cn->size();
00261     // default card for ODS
00262     if ($new == 1)
00263     {
00264         $rdeb=$default_ods;
00265     }
00266     for ($i=0;$i<$num;$i++) {
00267       $res=$cn->fetch($i);
00268       $CHECKED=" unchecked";
00269       foreach ( $rdeb as $element) {
00270         if ( $element == $res['fd_id'] ) {
00271           $CHECKED="CHECKED";
00272           break;
00273         }
00274       }
00275             echo '<tr>';
00276       printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="FICHEDEB[]" %s>%s</TD>',
00277               $res['fd_id'],$CHECKED,$res['fd_label']);
00278       $CHECKED=" unchecked";
00279       foreach ( $rcred as $element) {
00280         if ( $element == $res['fd_id'] ) {
00281           $CHECKED="CHECKED";
00282           break;
00283         }
00284       }
00285       echo '</TR>';
00286     }
00287     ?>
00288     </TABLE>
00289 </div>
00290 <?php /////////////////// ODS //////////////////////////////////
00291  endif; 
00292  ?>
00293    <?php
00294     /////////////////// FIN //////////////////////////////////
00295     if ( $new ==1 || $type=='FIN' ) : 
00296         ?>
00297     <div id='FIN_div' >
00298     <h2> Fiches </h2>
00299      <TABLE class="result" style="width:60%;margin-left:20%;">
00300         <tr>
00301             <th>
00302                 Tiers (D/C)
00303             </th>
00304            
00305         </tr>
00306     
00307         
00308     <?php
00309     // Show the fiche in deb section
00310     $Res=$cn->exec_sql("select fd_id,fd_label from fiche_def order by fd_label");
00311     $num=$cn->size();
00312     // default card for ACH
00313     if ($new == 1)
00314     {
00315         $rdeb=$default_fin;
00316     }
00317     for ($i=0;$i<$num;$i++) {
00318       $res=$cn->fetch($i);
00319       $CHECKED=" unchecked";
00320       foreach ( $rdeb as $element) {
00321         if ( $element == $res['fd_id'] ) {
00322           $CHECKED="CHECKED";
00323           break;
00324         }
00325       }
00326             echo '<tr>';
00327       printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="FICHEDEB[]" %s>%s</TD>',
00328               $res['fd_id'],$CHECKED,$res['fd_label']);
00329       $CHECKED=" unchecked";
00330       foreach ( $rcred as $element) {
00331         if ( $element == $res['fd_id'] ) {
00332           $CHECKED="CHECKED";
00333           break;
00334         }
00335       }
00336       echo '</TR>';
00337     }
00338     ?>
00339     </TABLE>
00340 </div>
00341 <?php /////////////////// FIN //////////////////////////////////
00342  endif; 
00343  ?>
00344 <?php if ( $new == 1 ) : ?>
00345 <script>
00346     var a_div=Array('VEN_div','ODS_div','ACH_div','FIN_div');
00347     function hide_ledger()
00348     {
00349         for (var i=0;i<a_div.length;i++)
00350         {
00351             $(a_div[i]).style.display='none';
00352         }
00353     }
00354     function hide_row()
00355     {
00356         $('type_ods').style.display='none';
00357         $('type_fin').style.display='none';
00358         $('type_fin2').style.display='none';
00359     }
00360    function show_ledger_div()
00361    {
00362        hide_ledger();
00363        var ch=$('p_jrn_type_select_id').options[$('p_jrn_type_select_id').selectedIndex].value;
00364        console.log(" div = "+ch);
00365        $(ch+'_div').style.display='block';
00366        switch (ch) {
00367            case 'FIN':
00368              hide_row();
00369              $('type_fin').style.display='table-row';
00370              $('type_fin2').style.display='table-row';         
00371              break;
00372            case 'ODS':
00373                hide_row();
00374                $('type_ods').style.display='table-row';
00375                break;
00376            default:
00377                hide_row();
00378        }
00379    }
00380     hide_ledger();
00381     hide_row();
00382     <?php
00383     if (isset ($previous_p_jrn_type)  ):
00384     ?>
00385       show_ledger_div();              
00386     <?php
00387     endif;
00388     ?>
00389 </script>
00390 <?php endif; ?>
 All Data Structures Namespaces Files Functions Variables Enumerations