Nowhere near done yet, but checking in a snapshot of semi-working code. There is some simultaneous support for both with and without use of the Invoice/Receipt account. I want to do away with them completely, but will need to change how sitelink payments are mapped (right now, they split a payment into multiple parts to match the charge).
git-svn-id: file:///svn-source/pmgr/branches/single_AR_20090622/site@181 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -71,6 +71,7 @@ class LeasesController extends AppController {
|
||||
function jqGridRecordLinks(&$params, &$model, &$records, $links) {
|
||||
$links['Lease'] = array('number');
|
||||
$links['Unit'] = array('name');
|
||||
$links['Customer'] = array('name');
|
||||
return parent::jqGridRecordLinks($params, $model, $records, $links);
|
||||
}
|
||||
|
||||
@@ -107,7 +108,6 @@ class LeasesController extends AppController {
|
||||
array(// Models
|
||||
'LeaseType',
|
||||
'Unit',
|
||||
'Account' => array('CurrentLedger'),
|
||||
'Customer',
|
||||
),
|
||||
'conditions' => array(array('Lease.id' => $id)),
|
||||
@@ -115,23 +115,15 @@ class LeasesController extends AppController {
|
||||
)
|
||||
);
|
||||
|
||||
// Summarize each ledger
|
||||
$this->Lease->statsMerge($lease,
|
||||
$this->Lease->stats($lease['Lease']['id']));
|
||||
|
||||
// Obtain the overall lease balance
|
||||
$this->Lease->statsMerge($lease['Lease'],
|
||||
array('stats' => $this->Lease->stats($id)));
|
||||
$outstanding_balance = $lease['Lease']['stats']['Account']['Ledger']['balance'];
|
||||
$outstanding_balance = $lease['Lease']['stats']['balance'];
|
||||
|
||||
// Determine the lease security deposit
|
||||
$deposits = $this->Lease->findSecurityDeposits($lease['Lease']['id']);
|
||||
$outstanding_deposit = $deposits['summary']['balance'];
|
||||
|
||||
// Move the Leder stats into our alias 'CurrentLedger'
|
||||
$lease['Account']['CurrentLedger'] += $lease['Account']['Ledger'];
|
||||
unset($lease['Account']['Ledger']);
|
||||
|
||||
// Prepare to render
|
||||
$title = 'Lease: #' . $lease['Lease']['id'];
|
||||
$this->set(compact('lease', 'title',
|
||||
|
||||
Reference in New Issue
Block a user