Changed prints to use the new logging system
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@439 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -77,6 +77,7 @@ class Customer extends AppModel {
|
|||||||
* - Returns an array of security deposit entries
|
* - Returns an array of security deposit entries
|
||||||
*/
|
*/
|
||||||
function securityDeposits($id, $query = null) {
|
function securityDeposits($id, $query = null) {
|
||||||
|
$this->prEnter(compact('id', 'query'));
|
||||||
$this->queryInit($query);
|
$this->queryInit($query);
|
||||||
|
|
||||||
$A = new Account();
|
$A = new Account();
|
||||||
@@ -90,8 +91,7 @@ class Customer extends AppModel {
|
|||||||
$query['conditions'][] = array('StatementEntry.account_id' => $A->securityDepositAccountID());
|
$query['conditions'][] = array('StatementEntry.account_id' => $A->securityDepositAccountID());
|
||||||
|
|
||||||
$set = $this->StatementEntry->reconciledSet('CHARGE', $query);
|
$set = $this->StatementEntry->reconciledSet('CHARGE', $query);
|
||||||
//pr(compact('set'));
|
return $this->prReturn($set);
|
||||||
return $set;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -103,6 +103,7 @@ class Customer extends AppModel {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function unreconciledCharges($id, $query = null) {
|
function unreconciledCharges($id, $query = null) {
|
||||||
|
$this->prEnter(compact('id', 'query'));
|
||||||
$this->queryInit($query);
|
$this->queryInit($query);
|
||||||
|
|
||||||
if (!isset($query['link']['Customer']))
|
if (!isset($query['link']['Customer']))
|
||||||
@@ -119,8 +120,7 @@ class Customer extends AppModel {
|
|||||||
$query['conditions'][] = array('Customer.id' => $id);
|
$query['conditions'][] = array('Customer.id' => $id);
|
||||||
|
|
||||||
$set = $this->StatementEntry->reconciledSet('CHARGE', $query, true);
|
$set = $this->StatementEntry->reconciledSet('CHARGE', $query, true);
|
||||||
//pr(compact('set'));
|
return $this->prReturn($set);
|
||||||
return $set;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -132,6 +132,7 @@ class Customer extends AppModel {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function excessPayments($id, $query = null) {
|
function excessPayments($id, $query = null) {
|
||||||
|
$this->prEnter(compact('id', 'query'));
|
||||||
$this->queryInit($query);
|
$this->queryInit($query);
|
||||||
|
|
||||||
if (!isset($query['link']['StatementEntry']))
|
if (!isset($query['link']['StatementEntry']))
|
||||||
@@ -144,8 +145,7 @@ class Customer extends AppModel {
|
|||||||
$query['conditions'][] = array('Customer.id' => $id);
|
$query['conditions'][] = array('Customer.id' => $id);
|
||||||
|
|
||||||
$set = $this->StatementEntry->reconciledSet('PAYMENT', $query, true);
|
$set = $this->StatementEntry->reconciledSet('PAYMENT', $query, true);
|
||||||
//pr(compact('set'));
|
return $this->prReturn($set);
|
||||||
return $set;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -157,6 +157,8 @@ class Customer extends AppModel {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function details($id = null) {
|
function details($id = null) {
|
||||||
|
$this->prEnter(compact('id'));
|
||||||
|
|
||||||
// Query the DB for need information.
|
// Query the DB for need information.
|
||||||
$customer = $this->find
|
$customer = $this->find
|
||||||
('first', array
|
('first', array
|
||||||
@@ -186,7 +188,7 @@ class Customer extends AppModel {
|
|||||||
// Figure out the total security deposit for the current lease.
|
// Figure out the total security deposit for the current lease.
|
||||||
$customer['deposits'] = $this->securityDeposits($id);
|
$customer['deposits'] = $this->securityDeposits($id);
|
||||||
|
|
||||||
return $customer;
|
return $this->prReturn($customer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -274,8 +276,10 @@ class Customer extends AppModel {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function stats($id = null, $query = null) {
|
function stats($id = null, $query = null) {
|
||||||
|
//$this->prFunctionLevel(20);
|
||||||
|
$this->prEnter(compact('id', 'query'));
|
||||||
if (!$id)
|
if (!$id)
|
||||||
return null;
|
return $this->prExit(null);
|
||||||
|
|
||||||
$this->queryInit($query);
|
$this->queryInit($query);
|
||||||
|
|
||||||
@@ -301,20 +305,20 @@ class Customer extends AppModel {
|
|||||||
'conditions' => array('StatementEntry.customer_id' => $id),
|
'conditions' => array('StatementEntry.customer_id' => $id),
|
||||||
));
|
));
|
||||||
$find_stats = $find_stats[0];
|
$find_stats = $find_stats[0];
|
||||||
/* pr(compact('find_stats')); */
|
$this->pr(17, compact('find_stats'));
|
||||||
|
|
||||||
$tquery = $query;
|
$tquery = $query;
|
||||||
$tquery['conditions'][] = array('StatementEntry.customer_id' => $id);
|
$tquery['conditions'][] = array('StatementEntry.customer_id' => $id);
|
||||||
$statement_stats = $this->StatementEntry->stats(null, $tquery);
|
$statement_stats = $this->StatementEntry->stats(null, $tquery);
|
||||||
$statement_stats['balance'] = $statement_stats['Charge']['balance'];
|
$statement_stats['balance'] = $statement_stats['Charge']['balance'];
|
||||||
/* pr(compact('statement_stats')); */
|
$this->pr(17, compact('statement_stats'));
|
||||||
|
|
||||||
$tquery = $query;
|
$tquery = $query;
|
||||||
//$tquery['conditions'][] = array('StatementEntry.customer_id' => $id);
|
//$tquery['conditions'][] = array('StatementEntry.customer_id' => $id);
|
||||||
$tquery['conditions'][] = array('Transaction.customer_id' => $id);
|
$tquery['conditions'][] = array('Transaction.customer_id' => $id);
|
||||||
$transaction_stats = $this->Transaction->stats(null, $tquery);
|
$transaction_stats = $this->Transaction->stats(null, $tquery);
|
||||||
$transaction_stats += $transaction_stats['StatementEntry'];
|
$transaction_stats += $transaction_stats['StatementEntry'];
|
||||||
/* pr(compact('transaction_stats')); */
|
$this->pr(17, compact('transaction_stats'));
|
||||||
|
|
||||||
$tquery = $query;
|
$tquery = $query;
|
||||||
//$tquery['conditions'][] = array('StatementEntry.customer_id' => $id);
|
//$tquery['conditions'][] = array('StatementEntry.customer_id' => $id);
|
||||||
@@ -322,11 +326,11 @@ class Customer extends AppModel {
|
|||||||
$ar_transaction_stats = $this->Transaction->stats(null, $tquery,
|
$ar_transaction_stats = $this->Transaction->stats(null, $tquery,
|
||||||
$this->Transaction->Account->accountReceivableAccountID());
|
$this->Transaction->Account->accountReceivableAccountID());
|
||||||
$ar_transaction_stats += $ar_transaction_stats['LedgerEntry'];
|
$ar_transaction_stats += $ar_transaction_stats['LedgerEntry'];
|
||||||
/* pr(compact('ar_transaction_stats')); */
|
$this->pr(17, compact('ar_transaction_stats'));
|
||||||
|
|
||||||
//$stats = $ar_transaction_stats;
|
//$stats = $ar_transaction_stats;
|
||||||
$stats = $find_stats;
|
$stats = $find_stats;
|
||||||
return $stats;
|
return $this->prReturn($stats);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user