Made progress adapting the receipt code onto the latest db changes.

git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@387 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-24 07:43:42 +00:00
parent 743ff52e59
commit b820929ddc
7 changed files with 54 additions and 29 deletions

View File

@@ -5,6 +5,25 @@ class TenderType extends AppModel {
'Tender',
);
/**************************************************************************
**************************************************************************
**************************************************************************
* function: accountID
* - Returns the intended account ID for receipt of the given tender
*/
function accountID($id) {
$this->cacheQueries = true;
$item = $this->find('first', array
('contain' => false,
'conditions' => array('TenderType.id' => $id),
));
$this->cacheQueries = false;
//pr(compact('id', 'item'));
return $item['TenderType']['account_id'];
}
/**************************************************************************
**************************************************************************
**************************************************************************
@@ -21,12 +40,6 @@ class TenderType extends AppModel {
);
$this->cacheQueries = false;
/* // Rearrange to be of the form (id => name) */
/* $rel_accounts = array(); */
/* foreach ($accounts AS $acct) { */
/* $rel_accounts[$acct['Account']['id']] = $acct['Account']['name']; */
/* } */
return $accounts;
}