Implemented more around lease closings.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@278 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -170,9 +170,15 @@ class LeasesController extends AppController {
|
||||
// Handle the move out based on the data given
|
||||
//pr($this->data);
|
||||
|
||||
$this->Lease->moveOut($this->data['Lease']['id']);
|
||||
$this->Lease->moveOut($this->data['Lease']['id'],
|
||||
'VACANT',
|
||||
$this->data['Lease']['moveout_date'],
|
||||
//true // Close this lease, if able
|
||||
false
|
||||
);
|
||||
|
||||
$this->redirect($this->data['redirect']);
|
||||
//$this->autoRender = false;
|
||||
$this->autoRender = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -213,6 +219,21 @@ class LeasesController extends AppController {
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
* action: close
|
||||
* - Closes a lease to any further action
|
||||
*/
|
||||
|
||||
function close($id) {
|
||||
// REVISIT <AP>: 20090708
|
||||
// We should probably seek confirmation first...
|
||||
$this->Lease->close($id);
|
||||
$this->redirect(array('action'=>'view', $id));
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
@@ -299,11 +320,10 @@ class LeasesController extends AppController {
|
||||
$this->sidemenu_links[] =
|
||||
array('name' => 'Operations', 'header' => true);
|
||||
|
||||
if (!isset($lease['Lease']['moveout_date'])) {
|
||||
if (!isset($lease['Lease']['moveout_date']))
|
||||
$this->sidemenu_links[] =
|
||||
array('name' => 'Move-Out', 'url' => array('action' => 'move_out',
|
||||
$id));
|
||||
}
|
||||
|
||||
$this->sidemenu_links[] =
|
||||
array('name' => 'Charges', 'url' => array('action' => 'invoice',
|
||||
@@ -313,6 +333,11 @@ class LeasesController extends AppController {
|
||||
array('name' => 'Payments', 'url' => array('controller' => 'customers',
|
||||
'action' => 'receipt',
|
||||
$lease['Customer']['id']));
|
||||
|
||||
if ($this->Lease->closeable($id))
|
||||
$this->sidemenu_links[] =
|
||||
array('name' => 'Close', 'url' => array('action' => 'close',
|
||||
$id));
|
||||
}
|
||||
|
||||
// Prepare to render
|
||||
|
||||
Reference in New Issue
Block a user