noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
ledger_detail_bottom.php
Go to the documentation of this file.
00001 <hr>
00002 <?php
00003 /**
00004 //This file is part of NOALYSS and is under GPL 
00005 //see licence.txt
00006 */
00007 /**
00008  * @brief show the common parts of operation details 
00009  * 
00010  * Variables : $div = popup or box (det[0-9]
00011  * 
00012  */
00013 
00014 // Contains all the linked actions
00015 $a_followup = Follow_Up::get_all_operation($jr_id);
00016 //
00017 // Contains all the linked operations
00018 $oRap=new Acc_Reconciliation($cn);
00019 $oRap->jr_id=$jr_id;
00020 $aRap=$oRap->get();
00021 
00022 // Detail of operation
00023  $detail = new Acc_Misc($cn, $obj->jr_id);
00024  $detail->get();
00025  
00026  $nb_document=($detail->det->jr_pj_name != "")?1:0;
00027 
00028 
00029 // Array of tab
00030 // 
00031 $a_tab['writing_div']=array('id'=>'writing_div'.$div,'label'=>_('Ecriture Comptable'),'display'=>'none');
00032 $a_tab['info_operation_div']=array('id'=>'info_operation_div'.$div,'label'=>_('Information'),'display'=>'none');
00033 $a_tab['linked_operation_div']=array('id'=>'linked_operation_div'.$div,'label'=>_('Opérations liées').'('.count($aRap).')','display'=>'none');
00034 $a_tab['document_operation_div']=array('id'=>'document_operation_div'.$div,'label'=>_('Document').'('.$nb_document.')','display'=>'block');
00035 $a_tab['linked_action_div']=array('id'=>'linked_action_div'.$div,'label'=>_('Actions Gestion').'('.count($a_followup).')','display'=>'none');
00036 $a_tab['analytic_div']=array('id'=>'analytic_div'.$div,'label'=>_('Comptabilité Analytique'),'display'=>'none');
00037 
00038  
00039 // show tabs
00040 if ( $div != "popup") :
00041  $a_tab['document_operation_div']['display']='block';
00042 ?>
00043 <ul  class="tabs">
00044     <?php foreach ($a_tab as $idx=>$a_value): ?>
00045     <?php 
00046         $class=($a_value['display']=='block') ?"tabs_selected":"tabs"
00047     ?>
00048     <li class="<?php echo $class?>">
00049         <?php $div_tab_id=$a_value['id'];?>
00050         <a href="javascript:void(0)" onclick="unselect_other_tab(this.parentNode.parentNode);var tab=Array('writing_div<?php echo $div?>','info_operation_div<?php echo $div?>','linked_operation_div<?php echo $div?>','document_operation_div<?php echo $div?>','linked_action_div<?php echo $div?>','analytic_div<?php echo $div?>');this.parentNode.className='tabs_selected' ;show_tabs(tab,'<?php echo $div_tab_id; ?>');"><?php echo $a_value['label']?></a>
00051     </li>
00052     <?php    endforeach; ?>
00053 </ul>
00054 <?php
00055 else :
00056     foreach ($a_tab as $idx=>$a_value):
00057     $a_tab[$idx]['display']='block';
00058     endforeach; 
00059 endif;
00060 ?>
00061 
00062 
00063 <?php
00064     $cmd=new IText('BON_COMMANDE',$obj->info->command);
00065     $other=new IText('OTHER',$obj->info->other);
00066 ?>
00067         <div id="writing_div<?php echo $div;?>" class="myfieldset" style="display:<?php echo $a_tab['writing_div']['display']?>">
00068           <?php 
00069           // display title only in popup
00070           if ($div == 'popup') :
00071           ?> 
00072                 <h1 class="legend"><?php echo $a_tab['writing_div']['label']?></h1>
00073           <?php endif; ?>
00074 
00075 <div class="content">
00076             <?php
00077            
00078             ?>
00079             <table class="result">
00080                 <tr>
00081                     <?php
00082                     echo th(_('Poste Comptable'));
00083                     echo th(_('Quick Code'));
00084                     echo th(_('Libellé'));
00085                     echo th(_('Débit'), ' style="text-align:right"');
00086                     echo th(_('Crédit'), ' style="text-align:right"');
00087                     echo '</tr>';
00088                     for ($e = 0; $e < count($detail->det->array); $e++)
00089                     {
00090                         $row = '';
00091                         $q = $detail->det->array;
00092                         $view_history = sprintf('<A class="detail" style="text-decoration:underline" HREF="javascript:view_history_account(\'%s\',\'%s\')" >%s</A>', $q[$e]['j_poste'], $gDossier, $q[$e]['j_poste']);
00093 
00094                         $row.=td($view_history);
00095                         if ($q[$e]['j_qcode'] != '')
00096                         {
00097                             $fiche = new Fiche($cn);
00098                             $fiche->get_by_qcode($q[$e]['j_qcode']);
00099                             $view_history = sprintf('<A class="detail" style="text-decoration:underline" HREF="javascript:view_history_card(\'%s\',\'%s\')" >%s</A>', $fiche->id, $gDossier, $q[$e]['j_qcode']);
00100                         } else
00101                             $view_history = '';
00102                         $row.=td($view_history);
00103                         
00104                         if ($q[$e]['j_text']=="")
00105                         {
00106                             if ($q[$e]['j_qcode'] != '')
00107                             {
00108                             // nom de la fiche
00109                                 $ff = new Fiche($cn);
00110                                 $ff->get_by_qcode($q[$e]['j_qcode']);
00111                                 $row.=td($ff->strAttribut(h(ATTR_DEF_NAME)));
00112                             } else
00113                             {
00114                                 // libellé du compte
00115                                 $name = $cn->get_value('select pcm_lib from tmp_pcmn where pcm_val=$1', array($q[$e]['j_poste']));
00116                                 $row.=td(h($name));
00117                             }
00118                         }
00119                         else 
00120                             $row.=td(h($q[$e]['j_text']));
00121                         
00122                         $montant = td(nbm($q[$e]['j_montant']), 'class="num"');
00123                         $row.=($q[$e]['j_debit'] == 't') ? $montant : td('');
00124                         $row.=($q[$e]['j_debit'] == 'f') ? $montant : td('');
00125                         $class=($e%2==0)?' class="even"':'class="odd"';
00126 
00127                         echo tr($row,$class);
00128                     }
00129                     ?>
00130             </table>
00131         </div>
00132 </div>
00133 <div id="info_operation_div<?php echo $div;?>" class="myfieldset" style="display:<?php echo $a_tab['info_operation_div']['display']?>">
00134     <?php 
00135           // display title only in popup
00136           if ($div == 'popup') :
00137           ?> 
00138                 <h1 class="legend"><?php echo $a_tab['info_operation_div']['label']?></h1>
00139           <?php endif; ?>
00140     <table>
00141         <tr>
00142             <td><?php echo _(" Bon de commande")?>   :</td><td> <?php echo HtmlInput::infobulle(31)." ".$cmd->input();  ?></td>
00143         </tr>
00144         <tr>
00145             <td> <?php echo _("Autre information")?> : </td><td><?php echo HtmlInput::infobulle(30)." ".$other->input();?></td>
00146         </tr>
00147     </table>
00148 </div>
00149 <div id="linked_operation_div<?php echo $div;?>" style="display:<?php echo $a_tab['linked_operation_div']['display']?>" class="myfieldset">
00150  <?php 
00151           // display title only in popup
00152           if ($div == 'popup') :
00153           ?> 
00154                 <h1 class="legend"><?php echo $a_tab['linked_operation_div']['label']?></h1>
00155           <?php endif; ?>
00156 <?php 
00157 
00158 if ($aRap  != null ) {
00159   $tableid="tb".$div;
00160   echo '<table id="'.$tableid.'">';
00161   for ($e=0;$e<count($aRap);$e++)  {
00162     $opRap=new Acc_Operation($cn);
00163     $opRap->jr_id=$aRap[$e];
00164     $internal=$opRap->get_internal();
00165     $array_jr=$cn->get_array('select jr_montant,jr_comment from jrn where jr_id=$1',array($aRap[$e]));
00166     $amount=$array_jr[0]['jr_montant'];
00167     $str="modifyOperation(".$aRap[$e].",".$gDossier.")";
00168     $rmReconciliation=new IButton('rmr');
00169     $rmReconciliation->label='&#x2D5D;';
00170     $rmReconciliation->class="tinybutton";
00171     $rmReconciliation->javascript="if (confirm ('vous confirmez?') ) {";
00172     $rmReconciliation->javascript.=sprintf('dropLink(\'%s\',\'%s\',\'%s\',\'%s\');deleteRowRec(\'%s\',this);}',
00173                                           $gDossier,
00174                                           $div,
00175                                           $jr_id,
00176                                            $aRap[$e],
00177                                            $tableid
00178                                           );
00179     if ( $access=='W')
00180       $remove=$rmReconciliation->input();
00181     else
00182       $remove='';
00183     
00184     $comment=strip_tags($array_jr[0]['jr_comment']);
00185     echo tr (td('<a class="line" href="javascript:void(0)" onclick="'.$str.'" >'.$internal.'</A>').td(nbm($amount)).td($comment).td($remove));
00186   }
00187   echo '</table>';
00188 }
00189 ?>
00190 <?php 
00191 if ( $access=='W') {
00192      $wConcerned=new IConcerned("rapt".$div);
00193      $wConcerned->amount_id=$obj->det->jr_montant;
00194     echo $wConcerned->input();
00195 
00196 }
00197 ?>
00198 </div>
00199 <div id="linked_action_div<?php echo $div;?>" style="display:<?php echo $a_tab['linked_action_div']['display']?>" class="myfieldset">
00200          <?php 
00201   // display title only in popup
00202   if ($div == 'popup') :
00203   ?> 
00204         <h1 class="legend"><?php echo $a_tab['linked_action_div']['label']?></h1>
00205   <?php endif; ?>
00206 <?php 
00207 /**
00208  * show possible linked actions
00209  */
00210 echo '<ul style="list-style-type:square;">';
00211 for ($i = 0; $i < count($a_followup); $i++)
00212 {
00213     $remove='';
00214     if ( $access=='W') $remove=HtmlInput::button_action_remove_operation($a_followup[$i]['ago_id']);
00215         if ( $div == 'popup')
00216         {
00217                 echo '<li id="op'.$a_followup[$i]['ago_id'].'">'.HtmlInput::detail_action($a_followup[$i]['ag_id'], h($a_followup[$i]['ag_ref']." ".$a_followup[$i]['ag_title']),0).$remove.'</li>';
00218         }
00219         else
00220         {
00221                 echo '<li id="op'.$a_followup[$i]['ago_id'].'">'.HtmlInput::detail_action($a_followup[$i]['ag_id'], h($a_followup[$i]['ag_ref']." ".$a_followup[$i]['ag_title']),1).$remove.'</li>';
00222         }
00223 }
00224 echo '</ul>';
00225 $related=new IRelated_Action('related');
00226 $related->id='related'.$div;
00227  if ( $access=='W') echo $related->input();
00228 echo '</div>';
00229 ?>
00230 
00231 <?php 
00232 
00233 require_once('template/ledger_detail_file.php');
00234 ?>
00235 
00236 
00237 <div id="analytic_div<?php echo $div;?>" style="overflow:auto;display:<?php echo $a_tab['analytic_div']['display']?>">
00238    <?php
00239     if ($div == 'popup') :
00240     ?> 
00241         <h1 class="legend"><?php echo $a_tab['analytic_div']['label']?></h1>
00242   <?php endif; ?>
00243     <?php if ( $owner->MY_ANALYTIC != "nu") : 
00244         if ( strpos($str_anc,'<td>') == true ):
00245         ?>
00246      
00247                 <table class="result">
00248                             <?php echo $str_anc;?>
00249                 </table>
00250         <?php else: ?>
00251         <span class="notice">
00252         <?php echo _('Aucune donnée'); ?>
00253             </span>
00254         <?php endif;?>
00255 <?php else:?>
00256     <span class="notice">
00257     <?php echo _('Non utilisée'); ?>
00258     </span>
00259 <?php endif;?>
00260 </div>
00261 
00262 <hr>
00263 <?php 
00264 
00265 if ( $div != 'popup' ) {
00266   $a=new IButton('Fermer',_('Fermer'));
00267   $a->label=_("Fermer");
00268   $a->javascript="removeDiv('".$div."')";
00269   echo $a->input();
00270 } else {
00271     echo HtmlInput::hidden('p_jrn',$oLedger->id);
00272 }
00273 
00274 ?>
00275 <?php 
00276 
00277 /**
00278  * if you can write
00279  */
00280   if ( $access=='W') {
00281   echo HtmlInput::submit('save',_('Sauver'),'onClick="return verify_ca(\'popup\');"');
00282   $owner=new Own($cn);
00283   if ($owner->MY_ANALYTIC != 'nu' /*&& $div=='popup' */){
00284     echo '<input type="button" class="button" value="'._('verifie CA').'" onClick="verify_ca(\''.$div.'\');">';
00285   }
00286 
00287   $per=new Periode($cn,$obj->det->jr_tech_per);
00288   if ( $per->is_closed() == 0 && $owner->MY_STRICT=='N'){
00289     $remove=new IButton('Effacer');
00290     $remove->label=_('Effacer');
00291     $remove->javascript="if ( confirm('Vous confirmez effacement ?')) {removeOperation('".$obj->det->jr_id."',".dossier::id().",'".$div."')}";
00292     echo $remove->input();
00293   }
00294 
00295   $reverse=new IButton('bext'.$div);
00296   $reverse->label=_('Extourner');
00297   $reverse->javascript="g('ext".$div."').style.display='block'";
00298   echo $reverse->input();
00299 
00300 echo '</form>';
00301 
00302   echo '<div id="ext'.$div.'" class="inner_box" style="position:relative;top:-150px;display:none">';
00303   $date=new IDate('ext_date');
00304   $r="<form id=\"form_".$div."\" onsubmit=\"this.divname='$div';return reverseOperation(this);\">";
00305   $r.=HtmlInput::hidden('jr_id',$_REQUEST['jr_id']).HtmlInput::hidden('div',$div).dossier::hidden().HtmlInput::hidden('act','reverseop');
00306   $r.=HtmlInput::title_box(_('Extourner'), 'ext'.$div, 'hide');
00307   $r.="entrez une date :".$date->input();
00308   $r.=HtmlInput::submit('x','accepter','onclick="return confirm(\'Vous confirmez  ? \');"');
00309   $r.='</form>';
00310   echo $r;
00311   echo '</div>';
00312 
00313 
00314 
00315 }
00316 ?>
 All Data Structures Namespaces Files Functions Variables Enumerations