Eliminated the unnecessary $A Account variable in the actual Account model (duh)

git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@316 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-11 16:50:13 +00:00
parent 06bf383707
commit 14ab0975ac

View File

@@ -495,9 +495,6 @@ class Account extends AppModel {
$monetary_data, $monetary_data,
$entry_data, $entry_data,
$reconcile = null) { $reconcile = null) {
// Create some models for convenience
$A = new Account();
//pr(compact('transaction_data', 'monetary_data', 'entry_data', 'reconcile')); //pr(compact('transaction_data', 'monetary_data', 'entry_data', 'reconcile'));
// Automatically figure out the customer if we have the lease // Automatically figure out the customer if we have the lease
@@ -538,12 +535,12 @@ class Account extends AppModel {
// Convert Account ID to name or vice versa // Convert Account ID to name or vice versa
if (isset($monetary_data['account_id'])) { if (isset($monetary_data['account_id'])) {
$monetary_data['account_name'] = $A->name($monetary_data['account_id']); $monetary_data['account_name'] = $this->name($monetary_data['account_id']);
} elseif (isset($monetary_data['account_name'])) { } elseif (isset($monetary_data['account_name'])) {
$monetary_data['account_id'] = $A->nameToID($monetary_data['account_name']); $monetary_data['account_id'] = $this->nameToID($monetary_data['account_name']);
} }
if ($monetary_data['account_id'] == $A->cashAccountID()) { if ($monetary_data['account_id'] == $this->cashAccountID()) {
// No distinguishing features of Cash, just // No distinguishing features of Cash, just
// use the shared monetary source // use the shared monetary source
$monetary_data['monetary_source_id'] = $monetary_data['monetary_source_id'] =
@@ -561,8 +558,8 @@ class Account extends AppModel {
// Create a new one dedicated to this entry // Create a new one dedicated to this entry
// Give it a fancy name based on the check number // Give it a fancy name based on the check number
$monetary_data['MonetarySource']['name'] = $monetary_data['account_name']; $monetary_data['MonetarySource']['name'] = $monetary_data['account_name'];
if ($monetary_data['account_name'] === $A->name($A->checkAccountID()) || if ($monetary_data['account_name'] === $this->name($this->checkAccountID()) ||
$monetary_data['account_name'] === $A->name($A->moneyOrderAccountID())) { $monetary_data['account_name'] === $this->name($this->moneyOrderAccountID())) {
$monetary_data['MonetarySource']['name'] .= $monetary_data['MonetarySource']['name'] .=
' #' . $monetary_data['MonetarySource']['data1']; ' #' . $monetary_data['MonetarySource']['data1'];
} }
@@ -593,9 +590,9 @@ class Account extends AppModel {
if (!isset($entry_data['debit_ledger_id'])) { if (!isset($entry_data['debit_ledger_id'])) {
$entry_data['debit_ledger_id'] = $entry_data['debit_ledger_id'] =
(isset($entry_data['debit_account_id']) (isset($entry_data['debit_account_id'])
? $A->currentLedgerID($entry_data['debit_account_id']) ? $this->currentLedgerID($entry_data['debit_account_id'])
: (isset($entry_data['debit_account_name']) : (isset($entry_data['debit_account_name'])
? $A->currentLedgerID($A->nameToID($entry_data['debit_account_name'])) ? $this->currentLedgerID($this->nameToID($entry_data['debit_account_name']))
: null : null
) )
); );
@@ -605,9 +602,9 @@ class Account extends AppModel {
if (!isset($entry_data['credit_ledger_id'])) { if (!isset($entry_data['credit_ledger_id'])) {
$entry_data['credit_ledger_id'] = $entry_data['credit_ledger_id'] =
(isset($entry_data['credit_account_id']) (isset($entry_data['credit_account_id'])
? $A->currentLedgerID($entry_data['credit_account_id']) ? $this->currentLedgerID($entry_data['credit_account_id'])
: (isset($entry_data['credit_account_name']) : (isset($entry_data['credit_account_name'])
? $A->currentLedgerID($A->nameToID($entry_data['credit_account_name'])) ? $this->currentLedgerID($this->nameToID($entry_data['credit_account_name']))
: null : null
) )
); );
@@ -673,8 +670,8 @@ class Account extends AppModel {
$ids = $this->postLedgerEntry $ids = $this->postLedgerEntry
($split_transaction, ($split_transaction,
null, null,
array('debit_ledger_id' => $A->currentLedgerID($A->receiptAccountID()), array('debit_ledger_id' => $this->currentLedgerID($this->receiptAccountID()),
'credit_ledger_id' => $A->currentLedgerID($A->accountReceivableAccountID()), 'credit_ledger_id' => $this->currentLedgerID($this->accountReceivableAccountID()),
'amount' => $rec['applied'], 'amount' => $rec['applied'],
'lease_id' => $rec['lease_id'], 'lease_id' => $rec['lease_id'],
'customer_id' => $rec['customer_id'], 'customer_id' => $rec['customer_id'],