noalyss Version-9
anc_balance_group.php
Go to the documentation of this file.
1<?php
2//This file is part of NOALYSS and is under GPL
3//see licence.txt
4/**
5 * defined variable $array with the result included from class_anc_group
6 */
7$prev='';
8?>
9
10<table class="result">
11
12<?php
14for ($i=0;$i<count($array);$i++):
15echo '<tr>';
16if ( $i==0) {
17 $prev=$array[$i]['ga_id'];
18 echo '<tr>';
19 echo td($array[$i]['ga_id'],' colspan="5" style="width:auto;font-size:1.2em"');
20 echo '</tr>';
21 ?>
22 <tr>
23<th>Activité</th>
24<th style="text-align:right" >Débit</th>
25<th style="text-align:right">Crébit</th>
26<th style="text-align:right">Solde</th>
27</tr>
28 <?php
29 }
30if ( $prev != $array[$i]['ga_id'])
31{
32 $prev=$array[$i]['ga_id'];
33
34 echo '<tr>';
35 echo td('Solde');
36 echo td(nbm($tot_group_deb),' class="num"');
37 echo td(nbm($tot_group_cred),' class="num"');
38 echo td(nbm(bcsub($tot_group_cred,$tot_group_deb)),' class="num"');
39
40 echo '</tr>';
42 $prev=$array[$i]['ga_id'];
43 echo '<tr>';
44 echo td($array[$i]['ga_id'],' colspan="5" style="width:auto;font-size:1.2em"');
45 echo '</tr>';
46 ?>
47 <tr>
48<th>Activité</th>
49<th style="text-align:right"><?php echo _("Débit");?></th>
50<th style="text-align:right" ><?php echo _("Crébit");?></th>
51<th style="text-align:right" ><?php echo _("Solde");?></th>
52</tr>
53<?php
54}
55if ($idx %2 == 0)
56 echo '<tr class="even">';
57else
58 echo '<tr class="odd">';
59 echo td($array[$i]['po_name']." ".h($array[$i]['po_description']));
60echo td(nbm($array[$i]['sum_deb']),' class="num"');
61echo td(nbm($array[$i]['sum_cred']),' class="num"');
62$solde=bcsub($array[$i]['sum_cred'],$array[$i]['sum_deb']);
63echo td(nbm($solde),' class="num"');
64 $tot_group_deb=bcadd($tot_group_deb,$array[$i]['sum_deb']);
65 $tot_group_cred=bcadd($tot_group_cred,$array[$i]['sum_cred']);
66echo '</tr>';
67$idx++;
68endfor;
69
70echo '<tr>';
71
72echo td(_('Solde'));
73echo td(nbm($tot_group_deb),' class="num"');
74echo td(nbm($tot_group_cred),' class="num"');
75echo td(nbm(bcsub($tot_group_cred,$tot_group_deb)),' class="num"');
76
77echo '</tr>';
78?>
79
80</table>
th($p_string, $p_extra='', $raw='')
Definition: ac_common.php:58
tr($p_string, $p_extra='')
Definition: ac_common.php:88
td($p_string='', $p_extra='')
surround the string with td
Definition: ac_common.php:83
nbm($p_number, $p_dec=2)
format the number with a sep.
Definition: ac_common.php:137
h( $row[ 'oa_description'])
$opd_description style
$tot_group_deb
$prev
defined variable $array with the result included from class_anc_group
$tot_group_cred
$all table
endfor