Added an assert whenever we lookup an account that doesn't exist.

git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@608 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-08-17 23:51:09 +00:00
parent 1c82d55c1c
commit 8167cc6a6a

View File

@@ -121,25 +121,32 @@ class Account extends AppModel {
* - Returns the ID of the desired account * - Returns the ID of the desired account
*/ */
function securityDepositAccountID() { return $this->nameToID('Security Deposit'); } function lookup($name, $check = true) {
function rentAccountID() { return $this->nameToID('Rent'); } $id = $this->nameToID($name);
function lateChargeAccountID() { return $this->nameToID('Late Charge'); } if (empty($id) && $check)
function nsfAccountID() { return $this->nameToID('NSF'); } $this->INTERNAL_ERROR("Missing Account '$name'");
function nsfChargeAccountID() { return $this->nameToID('NSF Charge'); } return $id;
function taxAccountID() { return $this->nameToID('Tax'); } }
function accountReceivableAccountID() { return $this->nameToID('A/R'); }
function accountPayableAccountID() { return $this->nameToID('A/P'); } function securityDepositAccountID() { return $this->lookup('Security Deposit'); }
function cashAccountID() { return $this->nameToID('Cash'); } function rentAccountID() { return $this->lookup('Rent'); }
function checkAccountID() { return $this->nameToID('Check'); } function lateChargeAccountID() { return $this->lookup('Late Charge'); }
function moneyOrderAccountID() { return $this->nameToID('Money Order'); } function nsfAccountID() { return $this->lookup('NSF'); }
function achAccountID() { return $this->nameToID('ACH'); } function nsfChargeAccountID() { return $this->lookup('NSF Charge'); }
function concessionAccountID() { return $this->nameToID('Concession'); } function taxAccountID() { return $this->lookup('Tax'); }
function waiverAccountID() { return $this->nameToID('Waiver'); } function accountReceivableAccountID() { return $this->lookup('A/R'); }
function pettyCashAccountID() { return $this->nameToID('Petty Cash'); } function accountPayableAccountID() { return $this->lookup('A/P'); }
function invoiceAccountID() { return $this->nameToID('Invoice'); } function cashAccountID() { return $this->lookup('Cash'); }
function receiptAccountID() { return $this->nameToID('Receipt'); } function checkAccountID() { return $this->lookup('Check'); }
function badDebtAccountID() { return $this->nameToID('Bad Debt'); } function moneyOrderAccountID() { return $this->lookup('Money Order'); }
function customerCreditAccountID() { return $this->nameToID( function achAccountID() { return $this->lookup('ACH'); }
function concessionAccountID() { return $this->lookup('Concession'); }
function waiverAccountID() { return $this->lookup('Waiver'); }
function pettyCashAccountID() { return $this->lookup('Petty Cash'); }
function invoiceAccountID() { return $this->lookup('Invoice'); }
function receiptAccountID() { return $this->lookup('Receipt'); }
function badDebtAccountID() { return $this->lookup('Bad Debt'); }
function customerCreditAccountID() { return $this->lookup(
// REVISIT <AP>: 20090816 // REVISIT <AP>: 20090816
// Use of A/R works, and saves an excess of accounts. // Use of A/R works, and saves an excess of accounts.
// However, a dedicated account is nice, since it can // However, a dedicated account is nice, since it can
@@ -238,8 +245,8 @@ class Account extends AppModel {
$this->nsfAccountID(), $this->nsfAccountID(),
$this->waiverAccountID(), $this->waiverAccountID(),
$this->badDebtAccountID(), $this->badDebtAccountID(),
//$this->nameToID('Closing'), //$this->lookup('Closing'),
//$this->nameToID('Equity'), //$this->lookup('Equity'),
) )
AS $account_id) { AS $account_id) {
$accounts[$account_id] = $this->name($account_id); $accounts[$account_id] = $this->name($account_id);