From e448519a1e2bd27cccabef31e496c266a5d5c021 Mon Sep 17 00:00:00 2001 From: abijah Date: Fri, 24 Jul 2009 03:58:57 +0000 Subject: [PATCH] I accidentally tried to cehck in tender.php instead of the intended tender_type.php git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@383 97e9348a-65ac-dc4b-aefc-98561f571b83 --- models/tender_type.php | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/models/tender_type.php b/models/tender_type.php index 12d7875..d72c181 100644 --- a/models/tender_type.php +++ b/models/tender_type.php @@ -5,5 +5,42 @@ class TenderType extends AppModel { 'Tender', ); + /************************************************************************** + ************************************************************************** + ************************************************************************** + * function: paymentTypes + * - Returns an array of types that can be used for payments + */ + + function paymentTypes($extra = null) { + $this->cacheQueries = true; + $accounts = $this->find('all', array + ('contain' => false, + 'order' => array('name'), + ) + (isset($extra) ? $extra : array()) + ); + $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; + } + + + /************************************************************************** + ************************************************************************** + ************************************************************************** + * function: defaultPaymentTypes + * - Returns an array of types that can be used for payments + */ + + function defaultPaymentType() { + return $this->nameToID('Check'); + } + } ?> \ No newline at end of file