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