More tweaking with grids that need to be reloaded immediately after page load. Fixed a bug with the statement_entry balance field, as there were two of them.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@534 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -64,7 +64,8 @@ class StatementEntriesController extends AppController {
|
||||
function gridDataTables(&$params, &$model) {
|
||||
$tables = $this->gridDataCountTables($params, $model);
|
||||
|
||||
if (in_array('applied', $params['post']['fields'])) {
|
||||
if (in_array('applied', $params['post']['fields']) ||
|
||||
isset($params['post']['custom']['statement_entry_id'])) {
|
||||
$tables['link']['DisbursementEntry'] = array();
|
||||
$tables['link']['ChargeEntry'] = array();
|
||||
}
|
||||
@@ -80,11 +81,13 @@ class StatementEntriesController extends AppController {
|
||||
" SUM(COALESCE(DisbursementEntry.amount,0))," .
|
||||
" SUM(COALESCE(ChargeEntry.amount,0)))" .
|
||||
" AS 'applied'");
|
||||
}
|
||||
if (in_array('unapplied', $params['post']['fields'])) {
|
||||
$fields[] = ("StatementEntry.amount - (" .
|
||||
"IF(StatementEntry.type = 'CHARGE'," .
|
||||
" SUM(COALESCE(DisbursementEntry.amount,0))," .
|
||||
" SUM(COALESCE(ChargeEntry.amount,0)))" .
|
||||
") AS 'balance'");
|
||||
") AS 'unapplied'");
|
||||
}
|
||||
|
||||
$fields = array_merge($fields,
|
||||
|
||||
Reference in New Issue
Block a user