noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
ledger_detail_misc.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 ?><?php 
00005 require_once('template/ledger_detail_top.php');
00006 require_once('class_anc_operation.php');
00007 require_once('class_anc_plan.php');
00008  $str_anc="";
00009 ?>
00010 <?php 
00011 require_once('class_own.php');
00012 require_once ('class_anc_plan.php');
00013 ?>
00014 <div class="content" style="padding:0">
00015 
00016     <?php if ( $access=='W') : ?>
00017 <form class="print" onsubmit="return op_save(this);">
00018    <?php endif; ?>
00019 
00020     <?php echo HtmlInput::hidden('whatdiv',$div).HtmlInput::hidden('jr_id',$jr_id).dossier::hidden();?>
00021   <table style="width:100%"><tr><td>
00022                                         <table>
00023                                                                 <tr><td>
00024                                                                 <?php
00025                                                                 $date=new IDate('p_date');
00026                                                                 $date->value=format_date($obj->det->jr_date);
00027                                                                  echo td(_('Date')).td($date->input());
00028 
00029                                                                  ?>
00030                                                                 </td>
00031                                                                 </tr>
00032 
00033                                                                 <tr><td>
00034                                                                 <?php 
00035                                                                   $itext=new IText('lib');
00036                                                                   $itext->value=strip_tags($obj->det->jr_comment);
00037                                                                   $itext->size=40;
00038                                                                   echo td(_('Libellé')).td($itext->input());
00039 
00040 
00041                                                                 ?>
00042                                                                 </td></tr>
00043                                                                 <tr><td>
00044                                                                 <?php echo td(_('Montant')).td(nbm($obj->det->jr_montant),' class="inum"');?>
00045                                                                 </td></tr>
00046                                                                 <tr><td>
00047                                                                 <?php 
00048                                                                 $itext=new IText('npj');
00049                                                                 $itext->value=strip_tags($obj->det->jr_pj_number);
00050                                                                 echo td(_('Pièce')).td($itext->input());
00051                                                                 ?>
00052 
00053                                                                 </td></tr>
00054                         </table>
00055                         </td>
00056                 <td style="width:50%;height:100%;vertical-align:top;text-align: center">
00057                     <table style="width:99%;height:8rem;vertical-align:top;">
00058                         <tr style="height: 5%">
00059                             <td style="text-align:center;vertical-align: top">
00060                                 Note
00061                             </td></tr>
00062                         <tr>
00063                             <td style="text-align:center;vertical-align: top">
00064                                 <?php
00065                                 $inote = new ITextarea('jrn_note');
00066                                 $inote->style=' class="itextarea" style="width:90%;height:100%;"';
00067                                 $inote->value = strip_tags($obj->det->note);
00068                                 echo $inote->input();
00069                                 ?>
00070 
00071                             </td>
00072                         </tr>
00073                     </table>
00074                 </td>
00075 
00076 </tr>
00077 </table>
00078 
00079 <div class="myfieldset">
00080 <?php 
00081   require_once('class_own.php');
00082   $owner=new Own($cn);
00083 ?>
00084 <table class="result">
00085 <tr>
00086 <?php 
00087     echo th(_('Poste Comptable'));
00088     echo th(_('Quick Code'));
00089     echo th(_('Libellé'));
00090 echo th(_('Débit'), 'style="text-align:right"');
00091 echo th(_('Crédit'), 'style="text-align:right"');
00092     if ($owner->MY_ANALYTIC != 'nu' /* && $div == 'popup' */ ){
00093       $anc=new Anc_Plan($cn);
00094       $a_anc=$anc->get_list(' order by pa_id ');
00095       $x=count($a_anc);
00096       /* set the width of the col */
00097        $str_anc.='<tr><th>Code</th><th>Poste</th><th>Montant</th><th colspan="' . $x . '">' . _('Compt. Analytique') . '</th>';
00098 
00099       /* add hidden variables pa[] to hold the value of pa_id */
00100       $str_anc.= Anc_Plan::hidden($a_anc);
00101     }
00102 echo '</tr>';
00103 $amount_idx=0;
00104   for ($e=0;$e<count($obj->det->array);$e++) {
00105     $row=''; $q=$obj->det->array;
00106     $view_history= sprintf('<A class="detail" style="text-decoration:underline" HREF="javascript:view_history_account(\'%s\',\'%s\')" >%s</A>',
00107                            $q[$e]['j_poste'], $gDossier, $q[$e]['j_poste']);
00108 
00109     $row.=td($view_history);
00110 
00111     if ( $q[$e]['j_qcode'] !='') {
00112       $fiche=new Fiche($cn);
00113       $fiche->get_by_qcode($q[$e]['j_qcode']);
00114       $view_history= sprintf('<A class="detail" style="text-decoration:underline" HREF="javascript:view_history_card(\'%s\',\'%s\')" >%s</A>',
00115                            $fiche->id, $gDossier, $q[$e]['j_qcode']);
00116     }
00117     else
00118       $view_history='';
00119     $row.=td($view_history);
00120         $l_lib = $q[$e]['j_text'] ;
00121 
00122     if ( $l_lib!='')
00123         {
00124          $l_lib=$q[$e]['j_text'];
00125         }
00126       else  if ( $q[$e]['j_qcode'] !='') {
00127       // nom de la fiche
00128       $ff=new Fiche($cn);
00129       $ff->get_by_qcode( $q[$e]['j_qcode']);
00130       $l_lib=$ff->strAttribut(ATTR_DEF_NAME);
00131     } else {
00132       // libellé du compte
00133       $name=$cn->get_value('select pcm_lib from tmp_pcmn where pcm_val=$1',array($q[$e]['j_poste']));
00134       $l_lib=$name;
00135     }
00136     $l_lib=strip_tags($l_lib);
00137     if ($owner->MY_UPDLAB == 'Y')
00138     {
00139         $hidden = HtmlInput::hidden("j_id[]", $q[$e]['j_id']);
00140         $input = new IText("e_march" . $q[$e]['j_id'] . "_label", $l_lib);
00141         $input->css_size="100%";
00142     }
00143     else
00144     {
00145         $input = new ISpan("e_march" . $q[$e]['j_id'] . "_label");
00146                 $input->value=$l_lib;
00147         $hidden = HtmlInput::hidden("j_id[]", $q[$e]['j_id']);
00148     }
00149      $row.=td($input->input().$hidden);
00150     $montant=td(nbm($q[$e]['j_montant']),'class="num"');
00151     $row.=($q[$e]['j_debit']=='t')?$montant:td('');
00152     $row.=($q[$e]['j_debit']=='f')?$montant:td('');
00153     /* Analytic accountancy */
00154     if ( $owner->MY_ANALYTIC != "nu" /*&& $div=='popup'*/){
00155       if ( preg_match('/^(6|7)/',$q[$e]['j_poste'])) {
00156 
00157         echo HtmlInput::hidden("amount_t".$amount_idx,$q[$e]['j_montant']);
00158         $anc_op=new Anc_Operation($cn);
00159         $anc_op->j_id=$q[$e]['j_id'];
00160         $anc_op->in_div=$div;
00161         $str_anc.='<tr>';
00162         $str_anc.=HtmlInput::hidden('op[]',$anc_op->j_id);
00163         $str_anc.=td($q[$e]['j_qcode']);
00164         $str_anc.=td($q[$e]['j_poste']);
00165         $str_anc.=td($q[$e]['j_montant']);
00166         $str_anc.=$anc_op->display_table(1,$q[$e]['j_montant'],$div);
00167         $str_anc.='</tr>';
00168         $amount_idx++;
00169       }  else {
00170         $row.=td('');
00171       }
00172     }
00173     $class=($e%2==0)?' class="even"':'class="odd"';
00174 
00175     echo tr($row,$class);
00176 
00177   }
00178 ?>
00179 </table>
00180 </div>
00181 <?php 
00182 require_once('ledger_detail_bottom.php');
00183 ?>
00184 </div>
 All Data Structures Namespaces Files Functions Variables Enumerations