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
This commit is contained in:
abijah
2010-03-12 02:02:42 +00:00
parent df367d8316
commit eea66c6932
2 changed files with 4 additions and 4 deletions

View File

@@ -269,11 +269,11 @@ class StatementEntriesController extends AppController {
'SUM(amount) AS amount',
),
'conditions' => array('StatementEntry.type' => 'CHARGE',
'effective_date >=' => '2009-04-01',
'effective_date >= DATE(NOW() - INTERVAL 11 MONTH - INTERVAL DAY(NOW())-1 DAY)',
'effective_date <= NOW()',
),
'group' => array('YEAR(effective_date), MONTH(effective_date)', 'Account.id'),
'order' => array('YEAR(effective_date), MONTH(effective_date)', 'Account.name'),
'group' => array('YEAR(effective_date)', 'MONTH(effective_date)', 'Account.id'),
'order' => array('YEAR(effective_date) DESC', 'MONTH(effective_date) DESC', 'Account.name'),
));
$overview = array('months' => array(), 'charges' => 0);

View File

@@ -10,7 +10,7 @@ echo '<div class="statement_entry overview">' . "\n";
*/
$rows = array();
$rows[] = array('Total Charges', FormatHelper::currency($overview['charges']));
$rows[] = array('12 Month Charges', FormatHelper::currency($overview['charges']));
echo $this->element('table',
array('class' => 'item statement_entry detail',