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:
@@ -269,11 +269,11 @@ class StatementEntriesController extends AppController {
|
|||||||
'SUM(amount) AS amount',
|
'SUM(amount) AS amount',
|
||||||
),
|
),
|
||||||
'conditions' => array('StatementEntry.type' => 'CHARGE',
|
'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()',
|
'effective_date <= NOW()',
|
||||||
),
|
),
|
||||||
'group' => array('YEAR(effective_date), MONTH(effective_date)', 'Account.id'),
|
'group' => array('YEAR(effective_date)', 'MONTH(effective_date)', 'Account.id'),
|
||||||
'order' => array('YEAR(effective_date), MONTH(effective_date)', 'Account.name'),
|
'order' => array('YEAR(effective_date) DESC', 'MONTH(effective_date) DESC', 'Account.name'),
|
||||||
));
|
));
|
||||||
|
|
||||||
$overview = array('months' => array(), 'charges' => 0);
|
$overview = array('months' => array(), 'charges' => 0);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ echo '<div class="statement_entry overview">' . "\n";
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$rows = array();
|
$rows = array();
|
||||||
$rows[] = array('Total Charges', FormatHelper::currency($overview['charges']));
|
$rows[] = array('12 Month Charges', FormatHelper::currency($overview['charges']));
|
||||||
|
|
||||||
echo $this->element('table',
|
echo $this->element('table',
|
||||||
array('class' => 'item statement_entry detail',
|
array('class' => 'item statement_entry detail',
|
||||||
|
|||||||
Reference in New Issue
Block a user