Files
pmgr/views/statement_entries/chargesbymonth.ctp
abijah eea66c6932 Changed the monthly charge report to limit itself to 11 months (plus the current month), and to sort in reverse order, keeping the most relevant month at the top.
git-svn-id: file:///svn-source/pmgr/branches/v0.3_work/site@961 97e9348a-65ac-dc4b-aefc-98561f571b83
2010-03-12 02:02:42 +00:00

70 lines
2.4 KiB
PHP

<?php /* -*- mode:PHP -*- */
echo '<div class="statement_entry overview">' . "\n";
/**********************************************************************
**********************************************************************
**********************************************************************
**********************************************************************
* Overview Main Section
*/
$rows = array();
$rows[] = array('12 Month Charges', FormatHelper::currency($overview['charges']));
echo $this->element('table',
array('class' => 'item statement_entry detail',
'caption' => 'Monthly Charges',
'rows' => $rows,
'column_class' => array('field', 'value')));
/**********************************************************************
**********************************************************************
**********************************************************************
**********************************************************************
* Supporting Elements Section
*/
echo '<div CLASS="detail supporting">' . "\n";
$headers = array('Account', 'Amount');
$row_class = array();
$rows = array();
foreach ($overview['months'] AS $month) {
$row_class[] = 'subheader';
$rows[] = array($month['name']);
$odd = 1;
foreach ($month['subs'] AS $sub) {
$row_class[] = array('subitem', $odd ? 'oddrow' : 'evenrow');
$rows[] = array($sub['name'], FormatHelper::currency($sub['charges']));
$odd = !$odd;
}
$row_class[] = 'grand';
$rows[] = array('Total for '.$month['name'], FormatHelper::currency($month['charges']));
}
echo $this->element('table',
array('class' => 'item statement_entry-overview overview list',
'caption' => 'Months',
'headers' => $headers,
'rows' => $rows,
'row_class' => $row_class,
'suppress_alternate_rows' => true
));
?>
<script type="text/javascript"><!--
jQuery(document).ready(function(){
jQuery('table.overview td.subheader').attr('colSpan', 2);
});
--></script>
<?php
/* End "detail supporting" div */
echo '</div>' . "\n";
/* End page div */
echo '</div>' . "\n";