On move-out, redirecting back to the customer instead of the closed lease

git-svn-id: file:///svn-source/pmgr/branches/v0.3_work@976 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2010-03-31 19:45:45 +00:00
parent 1be8df7a75
commit 4892143c0c

View File

@@ -176,16 +176,20 @@ class LeasesController extends AppController {
function move_out($id = null) {
if ($this->data) {
// Handle the move out based on the data given
//pr($this->data);
$this->Lease->moveOut($this->data['Lease']['id'],
'VACANT',
$this->data['Lease']['moveout_date']
);
$this->redirect(array('controller' => 'leases',
$lease = $this->Lease->find
('first', array
('contain' => array('Customer.id'),
'conditions' => array(array('Lease.id' => $this->data['Lease']['id'])),
));
$this->redirect(array('controller' => 'customers',
'action' => 'view',
$this->data['Lease']['id']));
$lease['Customer']['id']));
}
if (isset($id)) {