Logo Search packages:      
Sourcecode: fibusql version File versions  Download package

ledger-stats.inc

<?php
/*
    FibuSQL 0.4.1  -  (c) 2003 Martin Pitt <martin@piware.de>

    This software is protected by the GNU General Public License (see
    file COPYING).

    This file gets included from ledger.php.
*/
?>

<h3><?php echo $LANG_monthoverview ?></h3>

<table class="booktbl">
  <tr> <th><?php echo $LANG_month ?></th> <th class="num"><?php echo $LANG_balance ?></th>
  <th class="num"><?php echo $LANG_monthchange ?></th> </tr>
<?php
$bsum = 0;
$avg = 0;
$bals = balances_by_month( $account );
ksort( $bals );
foreach( $bals as $m => $b ) {
    # negate balance in liability accounts
    if( $accdata[1] >= 2 )
      $b = -$b;
    $bsum += $b;
    $avg += $bsum;
    echo '  <tr> <td>', $m, '</td> <td class="num">', formatval( $bsum ), 
      '</td> <td class="num">', formatval( $b ), "</td></tr>\n";
}
if( $num = count( $bals ) ) {
    echo '  <tr> <td>', $LANG_avg, '</td> <td class="num">', formatval( $avg/$num ),
       '</td> <td class="num">', formatval( $bsum/$num ), 
       "</td></tr>\n";
}
?>
</table>

<?php 
if( $accdata[1] >= 2 ) # liability account 
    echo '<p>', $LANG_negbalances, "</p>\n";
?>

Generated by  Doxygen 1.6.0   Back to index