Merge in the v0.2.0 work

git-svn-id: file:///svn-source/pmgr/trunk/site@938 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2010-03-02 03:25:52 +00:00
parent 9312f8d49c
commit cf9be800e5
7 changed files with 281 additions and 124 deletions

View File

@@ -47,7 +47,17 @@ class StatementEntriesController extends AppController {
if (!empty($params['post']['custom']['statement_entry_id'])) {
$link['ChargeEntry'] = array();
$link['DisbursementEntry'] = array();
// This query actually represents a union...
// Unpaid Charge/Surplus: ChargeID - NULL; DisbursementID - NULL
// Paid Charge/Refund: ChargeID - NULL; DisbursementID - !NULL
// Disbursement/Reversal: ChargeID - !NULL; DisbursementID - NULL
// <EMPTY SET>: ChargeID - !NULL; DisbursementID - !NULL
//
// The query is really slow unless we add the `id` condition to the join.
// A cleaner query would be nice, but we must work within the Cake framework.
$link['DisbursementEntry'] = array('conditions' =>
'`DisbursementEntry`.`id` = '
. $params['post']['custom']['statement_entry_id']);
}
return array('link' => $link);