First pass at entering charges for a lease. This works, but does not have the ability to add multiple charges, and does not mirror the payment method, which is ajax based.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@231 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -125,7 +125,7 @@ class LeasesController extends AppController {
|
||||
function move_out($id = null) {
|
||||
if ($this->data) {
|
||||
// Handle the move out based on the data given
|
||||
pr($this->data);
|
||||
//pr($this->data);
|
||||
|
||||
$this->Lease->moveOut($this->data['Lease']['id']);
|
||||
$this->redirect($this->data['redirect']);
|
||||
@@ -166,6 +166,58 @@ class LeasesController extends AppController {
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
* action: assess
|
||||
* - Assesses charges to the lease
|
||||
*/
|
||||
|
||||
function assess($id = null, $type = null) {
|
||||
if ($this->data) {
|
||||
// Assess the charges based on the given data
|
||||
pr($this->data);
|
||||
|
||||
$this->Lease->addCharge($this->data['Lease']['id'], $this->data['Charge']);
|
||||
//$this->redirect($this->data['redirect']);
|
||||
$this->render('/empty');
|
||||
return;
|
||||
}
|
||||
|
||||
$lease = $this->Lease->find
|
||||
('first', array
|
||||
('contain' => array
|
||||
(// Models
|
||||
'Unit' =>
|
||||
array('order' => array('sort_order'),
|
||||
'fields' => array('id', 'name'),
|
||||
),
|
||||
|
||||
'Customer' =>
|
||||
array('fields' => array('id', 'name'),
|
||||
),
|
||||
),
|
||||
|
||||
'conditions' => array(array('Lease.id' => $id),
|
||||
array('Lease.close_date' => null),
|
||||
),
|
||||
));
|
||||
|
||||
$charge['type'] = $type;
|
||||
if ($type == 'rent')
|
||||
$charge['amount'] = $lease['Lease']['rent'];
|
||||
else
|
||||
// REVISIT <AP> 20090705:
|
||||
// Of course, the late charge should come from the late_schedule
|
||||
$charge['amount'] = 10.00;
|
||||
|
||||
$title = ('Lease #' . $lease['Lease']['number'] . ': ' .
|
||||
$lease['Unit']['name'] . ': ' .
|
||||
$lease['Customer']['name'] . ': Assess Charges');
|
||||
$this->set(compact('title', 'lease', 'charge'));
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
@@ -206,6 +258,14 @@ class LeasesController extends AppController {
|
||||
$this->sidemenu_links[] =
|
||||
array('name' => 'Operations', 'header' => true);
|
||||
|
||||
$this->sidemenu_links[] =
|
||||
array('name' => 'Assess Rent', 'url' => array('action' => 'assess',
|
||||
$id, 'rent'));
|
||||
|
||||
$this->sidemenu_links[] =
|
||||
array('name' => 'Assess Late Charge', 'url' => array('action' => 'assess',
|
||||
$id, 'late'));
|
||||
|
||||
if (!isset($lease['Lease']['moveout_date'])) {
|
||||
$this->sidemenu_links[] =
|
||||
array('name' => 'Move-Out', 'url' => array('action' => 'move_out',
|
||||
|
||||
Reference in New Issue
Block a user