altocompta/include/template/letter_all.php
Dany De Bontridder 6c029c2b80 Merged revisions 3285-3302 via svnmerge from
file:///home/developper/svn/phpcompta/branches/rel510

........
  r3286 | danydb | 2010-06-12 19:24:49 +0200 (Sat, 12 Jun 2010) | 2 lines
  
  Check if database is valid
........
  r3287 | danydb | 2010-06-12 20:41:47 +0200 (Sat, 12 Jun 2010) | 1 line
  
  Fix bug : when using twice the same accounting in operation, one of them is not visible in "impression->poste"
........
  r3288 | danydb | 2010-06-12 21:04:36 +0200 (Sat, 12 Jun 2010) | 2 lines
  
  Cosmetic
........
  r3289 | danydb | 2010-06-12 21:14:07 +0200 (Sat, 12 Jun 2010) | 1 line
  
  Cosmetic : fix CSS
........
  r3290 | danydb | 2010-06-12 21:17:05 +0200 (Sat, 12 Jun 2010) | 2 lines
  
  Fix CSS
........
  r3291 | danydb | 2010-06-12 21:48:52 +0200 (Sat, 12 Jun 2010) | 3 lines
  
  Cosmetic : fix CSS
  
  An user who is NOT admin and can access only ONE folder is automatically redirected to the plugins or the dashboard 
........
  r3292 | danydb | 2010-06-14 20:38:39 +0200 (Mon, 14 Jun 2010) | 2 lines
  
  Cosmetic highlight row for lettering
........
  r3293 | danydb | 2010-06-14 20:38:52 +0200 (Mon, 14 Jun 2010) | 2 lines
  
  Highlight row of lettering
........
  r3294 | danydb | 2010-06-14 20:41:53 +0200 (Mon, 14 Jun 2010) | 1 line
  
  Lettering : if an operation is removed : the lettering is also removed on both side
........
  r3295 | danydb | 2010-06-14 20:43:50 +0200 (Mon, 14 Jun 2010) | 1 line
  
  rename upgrade80
........
  r3296 | danydb | 2010-06-14 20:49:40 +0200 (Mon, 14 Jun 2010) | 2 lines
  
  cosmetic : parameter -> societe align to right
........
  r3297 | danydb | 2010-06-14 20:50:38 +0200 (Mon, 14 Jun 2010) | 2 lines
  
  width set auto for the table
........
  r3298 | danydb | 2010-06-14 21:04:09 +0200 (Mon, 14 Jun 2010) | 1 line
  
  Lettering : if an operation is removed : the lettering is also removed on both side
........
  r3299 | danydb | 2010-06-14 21:25:04 +0200 (Mon, 14 Jun 2010) | 2 lines
  
  Fix problem with offset unlimited
........
  r3300 | danydb | 2010-06-14 21:57:45 +0200 (Mon, 14 Jun 2010) | 1 line
  
  Update the doc  == Lettering : if an operation is removed : the lettering is also removed on both side
........
  r3301 | danydb | 2010-06-15 23:57:55 +0200 (Tue, 15 Jun 2010) | 1 line
  
  Add bank CBC on line
........
  r3302 | danydb | 2010-06-16 00:30:47 +0200 (Wed, 16 Jun 2010) | 2 lines
  
  Bug fix : when using a predefined operation, javascript for adding rows doesn't work properly
........
2010-06-16 09:37:29 +00:00

106 lines
2.7 KiB
PHP

<?php
require_once ('class_acc_operation.php');
require_once ('class_acc_reconciliation.php');
$amount_deb=0;$amount_cred=0;
$gDossier=dossier::id();
if ( count($this->content) == 0 ) :
?>
<h2 class="info2"><?=_('Désolé aucun résultat trouvé')?></h2>
<? exit();
endif;?>
<table class="result">
<tr>
<th>
<?=_('Lettrage')?>
</th>
<th>
<?=_('Date')?>
</th>
<th>
<?=_('Ref')?>
</th>
<th>
<?=_('Interne')?>
</th>
<th>
<?=_('Description')?>
</th>
<th>
<?=_('Montant')?>
</th>
<th>
<?=_('Debit / Credit')?>
</th>
<th>
<?=_('Op. concerné')?>
</th>
</tr>
<?php
for ($i=0;$i<count($this->content);$i++):
$class="";
if ( ($i % 2) == 0 ) $class="odd";
?>
<tr <? echo "class=\"$class\""; ?> >
<td>
<?php
$letter=($this->content[$i]['letter']==-1)?"x":$this->content[$i]['letter'];
$js="this.gDossier=".dossier::id().
";this.j_id=".$this->content[$i]['j_id'].
";this.obj_type='".$this->object_type."'".
";dsp_letter(this)";
?>
<A class="detail" href="javascript:<?=$js?>"><?=$letter?></A>
</td>
<td> <?=$this->content[$i]['j_date_fmt']?> </td>
<td> <?=$this->content[$i]['jr_pj_number']?> </td>
<?php
$r=sprintf('<A class="detail" style="text-decoration:underline" HREF="javascript:viewOperation(\'%s\',\'%s\')" >%s</A>',
$this->content[$i]['jr_id'], $gDossier, $this->content[$i]['jr_internal']);
?>
<td> <?=$r?> </td>
<td> <?=h($this->content[$i]['jr_comment'])?> </td>
<td> <?=$this->content[$i]['j_montant']?> </td>
<td> <?=($this->content[$i]['j_debit']=='t')?'D':'C'?> </td>
<td>
<?php
// Rapprochement
$rec=new Acc_Reconciliation($this->db);
$rec->set_jr_id($this->content[$i]['jr_id']);
$a=$rec->get();
if ( $a != null ) {
foreach ($a as $key => $element)
{
$operation=new Acc_Operation($this->db);
$operation->jr_id=$element;
$l_amount=$this->db->get_value("select jr_montant from jrn ".
" where jr_id=$element");
echo "<A class=\"detail\" HREF=\"javascript:viewOperation('".$element."',".$gDossier.")\" > ".$operation->get_internal()." [ $l_amount &euro; ]</A>";
}//for
}// if ( $a != null ) {
// compute amount
$amount_deb+=($this->content[$i]['j_debit']=='t')?$this->content[$i]['j_montant']:0;
$amount_cred+=($this->content[$i]['j_debit']=='f')?$this->content[$i]['j_montant']:0;
?>
</td>
</tr>
<?php
endfor;
?>
</table>
<h2 class="info2" style="margin:0 0"> Solde débit : <?=$amount_deb?>
<h2 class="info2" style="margin:0 0"> Solde crédit : <?=$amount_cred?>
<? $solde=$amount_deb-$amount_cred;
if ( $solde > 0 ) :
?>
<h2 class="info2" style="margin:0 0"> Solde débiteur : <?=$solde?>
<? else : ?>
<h2 class="info2" style="margin:0 0"> Solde créditeur : <?=abs($solde)?>
<? endif; ?>