Go to the documentation of this file.00001 <?php
00002
00003
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
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%'>
00057 <table style="width:100%;border:solid 1px yellow">
00058 <tr>
00059 <td>
00060 Note
00061 </td>
00062 </tr>
00063 <tr>
00064 <td>
00065 <?php
00066 $inote=new ITextarea('jrn_note');
00067 $inote->width=25;
00068 $inote->heigh=5;
00069 $inote->value=strip_tags($obj->det->note);
00070 echo $inote->input();
00071 ?>
00072
00073 </td>
00074 </tr>
00075 </table>
00076 </td>
00077 </tr>
00078 </table>
00079
00080 <div class="myfieldset">
00081 <h1 class="legend"><?php echo _('Détail')?></h1>
00082 <?php
00083 require_once('class_own.php');
00084 $owner=new Own($cn);
00085 ?>
00086 <table class="result">
00087 <tr>
00088 <?php
00089 echo th(_('Poste Comptable'));
00090 echo th(_('Quick Code'));
00091 echo th(_('Libellé'));
00092 echo th(_('Débit'), 'style="text-align:right"');
00093 echo th(_('Crédit'), 'style="text-align:right"');
00094 if ($owner->MY_ANALYTIC != 'nu' && $div == 'popup'){
00095 $anc=new Anc_Plan($cn);
00096 $a_anc=$anc->get_list(' order by pa_id ');
00097 $x=count($a_anc);
00098
00099 echo '<th colspan="'.$x.'">'._('Compt. Analytique').'</th>';
00100
00101
00102 echo Anc_Plan::hidden($a_anc);
00103 }
00104 echo '</tr>';
00105 $amount_idx=0;
00106 for ($e=0;$e<count($obj->det->array);$e++) {
00107 $row=''; $q=$obj->det->array;
00108 $view_history= sprintf('<A class="detail" style="text-decoration:underline" HREF="javascript:view_history_account(\'%s\',\'%s\')" >%s</A>',
00109 $q[$e]['j_poste'], $gDossier, $q[$e]['j_poste']);
00110
00111 $row.=td($view_history);
00112
00113 if ( $q[$e]['j_qcode'] !='') {
00114 $fiche=new Fiche($cn);
00115 $fiche->get_by_qcode($q[$e]['j_qcode']);
00116 $view_history= sprintf('<A class="detail" style="text-decoration:underline" HREF="javascript:view_history_card(\'%s\',\'%s\')" >%s</A>',
00117 $fiche->id, $gDossier, $q[$e]['j_qcode']);
00118 }
00119 else
00120 $view_history='';
00121 $row.=td($view_history);
00122 $l_lib = $q[$e]['j_text'] ;
00123
00124 if ( $l_lib!='')
00125 {
00126 $l_lib=$q[$e]['j_text'];
00127 }
00128 else if ( $q[$e]['j_qcode'] !='') {
00129
00130 $ff=new Fiche($cn);
00131 $ff->get_by_qcode( $q[$e]['j_qcode']);
00132 $l_lib=$ff->strAttribut(ATTR_DEF_NAME);
00133 } else {
00134
00135 $name=$cn->get_value('select pcm_lib from tmp_pcmn where pcm_val=$1',array($q[$e]['j_poste']));
00136 $l_lib=$name;
00137 }
00138 $l_lib=strip_tags($l_lib);
00139 if ($owner->MY_UPDLAB == 'Y')
00140 {
00141 $hidden = HtmlInput::hidden("j_id[]", $q[$e]['j_id']);
00142 $input = new IText("e_march" . $q[$e]['j_id'] . "_label", $l_lib);
00143 $input->css_size="100%";
00144 }
00145 else
00146 {
00147 $input = new ISpan("e_march" . $q[$e]['j_id'] . "_label");
00148 $input->value=$l_lib;
00149 $hidden = HtmlInput::hidden("j_id[]", $q[$e]['j_id']);
00150 }
00151 $row.=td($input->input().$hidden);
00152 $montant=td(nbm($q[$e]['j_montant']),'class="num"');
00153 $row.=($q[$e]['j_debit']=='t')?$montant:td('');
00154 $row.=($q[$e]['j_debit']=='f')?$montant:td('');
00155
00156 if ( $owner->MY_ANALYTIC != "nu" && $div=='popup'){
00157 if ( preg_match('/^(6|7)/',$q[$e]['j_poste'])) {
00158
00159 echo HtmlInput::hidden("amount_t".$amount_idx,$q[$e]['j_montant']);
00160 $anc_op=new Anc_Operation($cn);
00161 $anc_op->j_id=$q[$e]['j_id'];
00162 echo HtmlInput::hidden('op[]',$anc_op->j_id);
00163 $row.=$anc_op->display_table(1,$q[$e]['j_montant'],$div);
00164 $amount_idx++;
00165 } else {
00166 $row.=td('');
00167 }
00168 }
00169 $class=($e%2==0)?' class="even"':'class="odd"';
00170
00171 echo tr($row,$class);
00172
00173 }
00174 ?>
00175 </table>
00176 </div>
00177 <?php
00178 require_once('ledger_detail_bottom.php');
00179 ?>
00180 </div>