Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007 $prev='';
00008 ?>
00009
00010 <table class="result">
00011
00012 <?php
00013 $idx=0;bcscale(2);$solde=0;$tot_group_deb=0;$tot_group_cred=0;
00014 for ($i=0;$i<count($array);$i++):
00015 echo '<tr>';
00016 if ( $i==0) {
00017 $prev=$array[$i]['ga_id'];
00018 echo '<tr>';
00019 echo td($array[$i]['ga_id'],' colspan="5" style="width:auto;font-size:1.2em"');
00020 echo '</tr>';
00021 ?>
00022 <tr>
00023 <th>Activité</th>
00024 <th style="text-align:right" >Débit</th>
00025 <th style="text-align:right">Crébit</th>
00026 <th style="text-align:right">Solde</th>
00027 </tr>
00028 <?php
00029 }
00030 if ( $prev != $array[$i]['ga_id'])
00031 {
00032 $prev=$array[$i]['ga_id'];
00033
00034 echo '<tr>';
00035 echo td('Solde');
00036 echo td(nbm($tot_group_deb),' class="num"');
00037 echo td(nbm($tot_group_cred),' class="num"');
00038 echo td(nbm(bcsub($tot_group_cred,$tot_group_deb)),' class="num"');
00039
00040 echo '</tr>';
00041 $tot_group_deb=0;$tot_group_cred=0;
00042 $prev=$array[$i]['ga_id'];
00043 echo '<tr>';
00044 echo td($array[$i]['ga_id'],' colspan="5" style="width:auto;font-size:1.2em"');
00045 echo '</tr>';
00046 ?>
00047 <tr>
00048 <th>Activité</th>
00049 <th style="text-align:right"><?php echo _("Débit");?></th>
00050 <th style="text-align:right" ><?php echo _("Crébit");?></th>
00051 <th style="text-align:right" ><?php echo _("Solde");?></th>
00052 </tr>
00053 <?php
00054 }
00055 if ($idx %2 == 0)
00056 echo '<tr class="even">';
00057 else
00058 echo '<tr class="odd">';
00059 echo td($array[$i]['po_name']);
00060 echo td(nbm($array[$i]['sum_deb']),' class="num"');
00061 echo td(nbm($array[$i]['sum_cred']),' class="num"');
00062 $solde=bcsub($array[$i]['sum_cred'],$array[$i]['sum_deb']);
00063 echo td(nbm($solde),' class="num"');
00064 $tot_group_deb=bcadd($tot_group_deb,$array[$i]['sum_deb']);
00065 $tot_group_cred=bcadd($tot_group_cred,$array[$i]['sum_cred']);
00066 echo '</tr>';
00067 $idx++;
00068 endfor;
00069
00070 echo '<tr>';
00071
00072 echo td(_('Solde'));
00073 echo td(nbm($tot_group_deb),' class="num"');
00074 echo td(nbm($tot_group_cred),' class="num"');
00075 echo td(nbm(bcsub($tot_group_cred,$tot_group_deb)),' class="num"');
00076
00077 echo '</tr>';
00078 ?>
00079
00080 </table>