noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
letter_all.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 ('class_acc_operation.php');
00006 require_once ('class_acc_reconciliation.php');
00007 $amount_deb=0;$amount_cred=0;
00008 $gDossier=dossier::id();
00009 global $g_failed;
00010 
00011 if ( count($this->content) == 0 ) :
00012 ?>
00013   <h2 class="info2"><?php echo _('Désolé aucun résultat trouvé')?></h2>
00014 
00015 <?php exit();
00016   endif;?>
00017   <table class="result">
00018 <tr>
00019 <th>
00020    <?php echo _('Lettrage')?>
00021 </th>
00022 <th>
00023    <?php echo _('Date')?>
00024 </th>
00025 <th>
00026    <?php echo _('Ref')?>
00027 </th>
00028 <th>
00029    <?php echo _('Interne')?>
00030 </th>
00031 <th>
00032    <?php echo _('Description')?>
00033 </th>
00034 <th style="text-align:right">
00035    <?php echo _('Débit')?>
00036 </th>
00037 <th style="text-align:right">
00038    <?php echo _('Crédit')?>
00039 </th>
00040 <th style="text-align:center">
00041   <?php echo _('Op. concernée')?>
00042 </th>
00043 </tr>
00044 
00045 <?php
00046 for ($i=0;$i<count($this->content);$i++):
00047   $class="";
00048 $class= ( ($i % 2) == 0 ) ? "odd":"even";
00049 ?>
00050   <tr <?php echo "class=\"$class\""; ?> >
00051 <td>
00052 <?php
00053 $letter=($this->content[$i]['letter']==-1)?" aucun lettrage ":strtoupper(base_convert($this->content[$i]['letter'],10,36));
00054 $js="this.gDossier=".dossier::id().
00055   ";this.j_id=".$this->content[$i]['j_id'].
00056   ";this.obj_type='".$this->object_type."'".
00057   ";dsp_letter(this)";
00058 
00059 ?>
00060 <A class="detail" style="text-decoration: underline" href="javascript:<?php echo $js?>"><?php echo $letter?>
00061 <?php if ( $this->content[$i]['letter_diff'] != 0) echo $g_failed;      ?>
00062         </A>
00063 </td>
00064 <td> <?php echo   smaller_date($this->content[$i]['j_date_fmt'])?> </td>
00065 <td> <?php echo $this->content[$i]['jr_pj_number']?> </td>
00066 
00067 <?php
00068 $r=sprintf('<A class="detail" style="text-decoration:underline" HREF="javascript:viewOperation(\'%s\',\'%s\')" >%s</A>',
00069              $this->content[$i]['jr_id'], $gDossier, $this->content[$i]['jr_internal']);
00070 ?>
00071   <td> <?php echo $r?> </td>
00072   <td> <?php echo h($this->content[$i]['jr_comment'])?> </td>
00073   <?php if ($this->content[$i]['j_debit']=='t') : ?>
00074   <td style="text-align:right"> <?php echo nb($this->content[$i]['j_montant'])?> </td>
00075   <td></td>
00076   <?php else : ?>
00077   <td></td>
00078   <td style="text-align:right"> <?php echo nb($this->content[$i]['j_montant'])?> </td>
00079   <?php endif ?>
00080 <td style="text-align:center">
00081 <?php
00082     // Rapprochement
00083     $rec=new Acc_Reconciliation($this->db);
00084     $rec->set_jr_id($this->content[$i]['jr_id']);
00085     $a=$rec->get();
00086     if ( $a != null ) {
00087       foreach ($a as $key => $element)
00088       {
00089         $operation=new Acc_Operation($this->db);
00090         $operation->jr_id=$element;
00091         $l_amount=$this->db->get_value("select jr_montant from jrn ".
00092                                          " where jr_id=$element");
00093         echo "<A class=\"detail\" HREF=\"javascript:viewOperation('".$element."',".$gDossier.")\" > ".$operation->get_internal()." [ ".nb($l_amount)." &euro; ]</A>";
00094       }//for
00095     }// if ( $a != null ) {
00096 // compute amount
00097 $amount_deb+=($this->content[$i]['j_debit']=='t')?$this->content[$i]['j_montant']:0;
00098 $amount_cred+=($this->content[$i]['j_debit']=='f')?$this->content[$i]['j_montant']:0;
00099 
00100 ?>
00101 </td>
00102 </tr>
00103 
00104 <?php
00105     endfor;
00106 ?>
00107 </table>
00108 <h2 class="info2" style="margin:0 0"> <?php echo _("Solde débit")?>  : <?php echo nb($amount_deb);?></h2>
00109 <h2 class="info2"  style="margin:0 0"> <?php echo _("Solde crédit")?> : <?php echo nb($amount_cred);?></h2>
00110   <?php 
00111 bcscale(2);
00112   $solde=bcsub($amount_deb,$amount_cred);
00113 if ( $solde > 0 ) :
00114 ?>
00115   <h2 class="info2"  style="margin:0 0"> <?php echo _("Solde débiteur")?>       : <?php echo nb($solde)?></h2>
00116 <?php else : ?>
00117      <h2 class="info2"  style="margin:0 0"> <?php echo _("Solde créditeur")?>       : <?php echo nb(abs($solde))?></h2>
00118 <?php endif; ?>
 All Data Structures Namespaces Files Functions Variables Enumerations