Moved the INTERNAL_ERROR calls to use the class function instead of the global one.

git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@561 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-08-14 21:21:21 +00:00
parent fe1b0626c2
commit 83e552211f
4 changed files with 14 additions and 14 deletions

View File

@@ -342,7 +342,7 @@ class LeasesController extends AppController {
// REVISIT <AP>: 20090708 // REVISIT <AP>: 20090708
// We should probably seek confirmation first... // We should probably seek confirmation first...
if (!$this->Lease->closeable($id)) { if (!$this->Lease->closeable($id)) {
INTERNAL_ERROR("This lease is not ready to close"); $this->INTERNAL_ERROR("This lease is not ready to close");
$this->redirect(array('action'=>'view', $id)); $this->redirect(array('action'=>'view', $id));
} }
@@ -503,7 +503,7 @@ class LeasesController extends AppController {
// when a charge is reimbursed; a bug that we'll either // when a charge is reimbursed; a bug that we'll either
// need to fix, or we'll have to revisit this assumption. // need to fix, or we'll have to revisit this assumption.
if ($outstanding_balance < 0) if ($outstanding_balance < 0)
INTERNAL_ERROR("Should not have a customer lease credit."); $this->INTERNAL_ERROR("Should not have a customer lease credit.");
/* if ($outstanding_balance < 0) */ /* if ($outstanding_balance < 0) */
/* $this->sidemenu_links[] = */ /* $this->sidemenu_links[] = */

View File

@@ -482,7 +482,7 @@ class TransactionsController extends AppController {
$deposit_total += $type['total']; $deposit_total += $type['total'];
if ($deposit['Transaction']['amount'] != $deposit_total) if ($deposit['Transaction']['amount'] != $deposit_total)
INTERNAL_ERROR("Deposit items do not add up to deposit slip total"); $this->INTERNAL_ERROR("Deposit items do not add up to deposit slip total");
$this->sidemenu_links[] = $this->sidemenu_links[] =
array('name' => 'Operations', 'header' => true); array('name' => 'Operations', 'header' => true);

View File

@@ -156,7 +156,7 @@ class StatementEntry extends AppModel {
$charge = $charge['StatementEntry']; $charge = $charge['StatementEntry'];
if ($charge['type'] !== 'CHARGE') if ($charge['type'] !== 'CHARGE')
INTERNAL_ERROR("Waiver item is not CHARGE."); $this->INTERNAL_ERROR("Waiver item is not CHARGE.");
// Query the stats to get the remaining balance // Query the stats to get the remaining balance
$stats = $this->stats($id); $stats = $this->stats($id);
@@ -197,7 +197,7 @@ class StatementEntry extends AppModel {
$charge = $charge['StatementEntry']; $charge = $charge['StatementEntry'];
if ($charge['type'] !== 'CHARGE') if ($charge['type'] !== 'CHARGE')
INTERNAL_ERROR("Reversal item is not CHARGE."); $this->INTERNAL_ERROR("Reversal item is not CHARGE.");
$voided_entry_transactions = array(); $voided_entry_transactions = array();
$reconciled = $this->reconciledEntries($id); $reconciled = $this->reconciledEntries($id);
@@ -206,7 +206,7 @@ class StatementEntry extends AppModel {
if ($reconciled && !$balance) { if ($reconciled && !$balance) {
foreach ($reconciled['entries'] AS $entry) { foreach ($reconciled['entries'] AS $entry) {
if ($entry['DisbursementEntry']['type'] === 'REVERSAL') if ($entry['DisbursementEntry']['type'] === 'REVERSAL')
INTERNAL_ERROR("Charge has already been reversed"); $this->INTERNAL_ERROR("Charge has already been reversed");
$voided_entry_transactions[$entry['DisbursementEntry']['transaction_id']] $voided_entry_transactions[$entry['DisbursementEntry']['transaction_id']]
= array_intersect_key($entry['DisbursementEntry'], = array_intersect_key($entry['DisbursementEntry'],
@@ -400,7 +400,7 @@ class StatementEntry extends AppModel {
if (empty($receipt_id)) { if (empty($receipt_id)) {
if (!empty($charge_ids)) if (!empty($charge_ids))
INTERNAL_ERROR("Charge IDs, yet no corresponding receipt"); $this->INTERNAL_ERROR("Charge IDs, yet no corresponding receipt");
$lquery = $query; $lquery = $query;
$lquery['conditions'][] = array('StatementEntry.type' => 'SURPLUS'); $lquery['conditions'][] = array('StatementEntry.type' => 'SURPLUS');
@@ -441,7 +441,7 @@ class StatementEntry extends AppModel {
); );
$receipt_credit = $this->Transaction->find('first', $lquery); $receipt_credit = $this->Transaction->find('first', $lquery);
if (!$receipt_credit) if (!$receipt_credit)
INTERNAL_ERROR("Unable to locate receipt."); $this->INTERNAL_ERROR("Unable to locate receipt.");
$stats = $this->Transaction->stats($receipt_id); $stats = $this->Transaction->stats($receipt_id);
$receipt_credit['balance'] = $receipt_credit['balance'] =
@@ -484,7 +484,7 @@ class StatementEntry extends AppModel {
if (empty($charge['balance'])) if (empty($charge['balance']))
break; break;
if ($charge['balance'] < 0) if ($charge['balance'] < 0)
INTERNAL_ERROR("Negative Charge Balance"); $this->INTERNAL_ERROR("Negative Charge Balance");
if (empty($credit['receipt'])) { if (empty($credit['receipt'])) {
// Explicit Credit // Explicit Credit
@@ -505,7 +505,7 @@ class StatementEntry extends AppModel {
if (empty($credit['balance'])) if (empty($credit['balance']))
continue; continue;
if ($credit['balance'] < 0) if ($credit['balance'] < 0)
INTERNAL_ERROR("Negative Credit Balance"); $this->INTERNAL_ERROR("Negative Credit Balance");
$this->pr(20, compact('charge'), $this->pr(20, compact('charge'),
'Attempt Charge Reconciliation'); 'Attempt Charge Reconciliation');

View File

@@ -129,7 +129,7 @@ class Transaction extends AppModel {
$this->prEnter(compact('data', 'charge_id', 'customer_id', 'lease_id')); $this->prEnter(compact('data', 'charge_id', 'customer_id', 'lease_id'));
if (count($data['Entry']) != 1) if (count($data['Entry']) != 1)
INTERNAL_ERROR("Should be one Entry for addWaiver"); $this->INTERNAL_ERROR("Should be one Entry for addWaiver");
// Just make sure the disbursement(s) are marked as waivers // Just make sure the disbursement(s) are marked as waivers
// and that they go to cover the specific charge. // and that they go to cover the specific charge.
@@ -156,7 +156,7 @@ class Transaction extends AppModel {
$this->prEnter(compact('data', 'charge_id', 'customer_id', 'lease_id')); $this->prEnter(compact('data', 'charge_id', 'customer_id', 'lease_id'));
if (count($data['Entry']) != 1) if (count($data['Entry']) != 1)
INTERNAL_ERROR("Should be one Entry for addReversal"); $this->INTERNAL_ERROR("Should be one Entry for addReversal");
// Just make sure the disbursement(s) are marked as reversals // Just make sure the disbursement(s) are marked as reversals
// and that they go to cover the specific charge. // and that they go to cover the specific charge.
@@ -184,7 +184,7 @@ class Transaction extends AppModel {
$this->prEnter(compact('data', 'charge_id', 'customer_id', 'lease_id')); $this->prEnter(compact('data', 'charge_id', 'customer_id', 'lease_id'));
if (count($data['Entry']) != 1) if (count($data['Entry']) != 1)
INTERNAL_ERROR("Should be one Entry for addWriteOff"); $this->INTERNAL_ERROR("Should be one Entry for addWriteOff");
// Just make sure the disbursement(s) are marked as write offs, // Just make sure the disbursement(s) are marked as write offs,
// and that the write-off account is used. // and that the write-off account is used.
@@ -838,7 +838,7 @@ class Transaction extends AppModel {
* - Update any cached or calculated fields * - Update any cached or calculated fields
*/ */
function update($id) { function update($id) {
INTERNAL_ERROR("Transaction::update not yet implemented"); $this->INTERNAL_ERROR("Transaction::update not yet implemented");
$result = $this->find $result = $this->find
('first', ('first',