Added ability to move an existing customer into a vacant unit. Changed out all of the 'amount' fields with 'rent', since it's much more self-explanatory. We still need the ability to add customers and contacts. I'll consider doing this by using the insert row ability of jqGrid.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@204 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -20,9 +20,6 @@ class Customer extends AppModel {
|
||||
),
|
||||
'Lease',
|
||||
'LedgerEntry',
|
||||
|
||||
// Cheat to get Account set as part of this class
|
||||
'Account',
|
||||
);
|
||||
|
||||
var $hasAndBelongsToMany = array(
|
||||
@@ -86,9 +83,10 @@ class Customer extends AppModel {
|
||||
/* 'args' => compact('id', 'link'), */
|
||||
/* )); */
|
||||
|
||||
$entries = $this->Account->findLedgerEntriesRelatedToAccount
|
||||
($this->Account->invoiceAccountID(),
|
||||
$this->Account->securityDepositAccountID(),
|
||||
$A = new Account();
|
||||
$entries = $A->findLedgerEntriesRelatedToAccount
|
||||
($A->invoiceAccountID(),
|
||||
$A->securityDepositAccountID(),
|
||||
true, array('LedgerEntry.customer_id' => $id), $link);
|
||||
|
||||
/* pr(array('function' => 'Customer::findSecurityDeposits', */
|
||||
@@ -110,8 +108,9 @@ class Customer extends AppModel {
|
||||
*/
|
||||
|
||||
function findUnreconciledLedgerEntries($id = null, $fundamental_type = null) {
|
||||
$unreconciled = $this->Account->findUnreconciledLedgerEntries
|
||||
($this->Account->accountReceivableAccountID(),
|
||||
$A = new Account();
|
||||
$unreconciled = $A->findUnreconciledLedgerEntries
|
||||
($A->accountReceivableAccountID(),
|
||||
$fundamental_type,
|
||||
array('LedgerEntry.customer_id' => $id));
|
||||
|
||||
@@ -134,8 +133,9 @@ class Customer extends AppModel {
|
||||
*/
|
||||
|
||||
function reconcileNewLedgerEntry($id, $fundamental_type, $amount) {
|
||||
$reconciled = $this->Account->reconcileNewLedgerEntry
|
||||
($this->Account->accountReceivableAccountID(),
|
||||
$A = new Account();
|
||||
$reconciled = $A->reconcileNewLedgerEntry
|
||||
($A->accountReceivableAccountID(),
|
||||
$fundamental_type,
|
||||
$amount,
|
||||
array('LedgerEntry.customer_id' => $id));
|
||||
@@ -195,8 +195,9 @@ class Customer extends AppModel {
|
||||
if (!$id)
|
||||
return null;
|
||||
|
||||
$stats = $this->Account->stats($this->Account->accountReceivableAccountID(), true,
|
||||
array('LedgerEntry.customer_id' => $id));
|
||||
$A = new Account();
|
||||
$stats = $A->stats($A->accountReceivableAccountID(), true,
|
||||
array('LedgerEntry.customer_id' => $id));
|
||||
|
||||
// Pull to the top level and return
|
||||
$stats = $stats['Ledger'];
|
||||
|
||||
Reference in New Issue
Block a user