Finished basic functionality for Move-Out. This still needs some work to handle the security deposit.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@202 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -140,6 +140,42 @@ class CustomersController extends AppController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
**************************************************************************
|
||||||
|
**************************************************************************
|
||||||
|
* action: move_out
|
||||||
|
* - prepare to move a customer out of one of their units
|
||||||
|
*/
|
||||||
|
|
||||||
|
function move_out($id) {
|
||||||
|
|
||||||
|
$customer = $this->Customer->find
|
||||||
|
('first', array
|
||||||
|
('contain' => array
|
||||||
|
(// Models
|
||||||
|
'Lease' =>
|
||||||
|
array('conditions' => array('Lease.moveout_date' => null),
|
||||||
|
// Models
|
||||||
|
'Unit' =>
|
||||||
|
array('order' => array('sort_order'),
|
||||||
|
'fields' => array('id', 'name'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
'conditions' => array('Customer.id' => $id),
|
||||||
|
));
|
||||||
|
|
||||||
|
$redirect = array('controller' => 'customers',
|
||||||
|
'action' => 'view',
|
||||||
|
$id);
|
||||||
|
|
||||||
|
$title = $customer['Customer']['name'] . ': Prepare Move-Out';
|
||||||
|
$this->set(compact('title', 'customer', 'redirect'));
|
||||||
|
$this->render('/leases/move_out');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
**************************************************************************
|
**************************************************************************
|
||||||
**************************************************************************
|
**************************************************************************
|
||||||
@@ -158,12 +194,31 @@ class CustomersController extends AppController {
|
|||||||
$outstanding_balance = $customer['stats']['balance'];
|
$outstanding_balance = $customer['stats']['balance'];
|
||||||
$outstanding_deposit = $customer['deposits']['summary']['balance'];
|
$outstanding_deposit = $customer['deposits']['summary']['balance'];
|
||||||
|
|
||||||
$this->sidemenu_links[] =
|
// Figure out if this customer has any non-closed leases
|
||||||
array('name' => 'Operations', 'header' => true);
|
$show_moveout = false;
|
||||||
$this->sidemenu_links[] =
|
$show_payment = false;
|
||||||
array('name' => 'Payment', 'url' => array('action' => 'payment', $id));
|
foreach ($customer['Lease'] AS $lease) {
|
||||||
$this->sidemenu_links[] =
|
if (!isset($lease['close_date']))
|
||||||
array('name' => 'Move-Out', 'url' => array('controller' => 'units', 'action' => 'move-out'));
|
$show_payment = true;
|
||||||
|
if (!isset($lease['moveout_date']))
|
||||||
|
$show_moveout = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set up dynamic menu items
|
||||||
|
if ($show_moveout || $show_payment) {
|
||||||
|
$this->sidemenu_links[] =
|
||||||
|
array('name' => 'Operations', 'header' => true);
|
||||||
|
|
||||||
|
if ($show_moveout) {
|
||||||
|
$this->sidemenu_links[] =
|
||||||
|
array('name' => 'Move-Out', 'url' => array('action' => 'move_out',
|
||||||
|
$id));
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->sidemenu_links[] =
|
||||||
|
array('name' => 'Payment', 'url' => array('action' => 'payment',
|
||||||
|
$id));
|
||||||
|
}
|
||||||
|
|
||||||
// Prepare to render.
|
// Prepare to render.
|
||||||
$title = $customer['Customer']['name'];
|
$title = $customer['Customer']['name'];
|
||||||
|
|||||||
@@ -88,6 +88,57 @@ class LeasesController extends AppController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
**************************************************************************
|
||||||
|
**************************************************************************
|
||||||
|
* action: move_out
|
||||||
|
* - prepare or execute a move out on a specific lease
|
||||||
|
*/
|
||||||
|
|
||||||
|
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']);
|
||||||
|
$this->redirect($this->data['redirect']);
|
||||||
|
//$this->autoRender = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($id))
|
||||||
|
die("Oh Nooooo!!");
|
||||||
|
|
||||||
|
$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),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
|
||||||
|
$redirect = array('controller' => 'leases',
|
||||||
|
'action' => 'view',
|
||||||
|
$id);
|
||||||
|
|
||||||
|
$title = ('Lease #' . $lease['Lease']['number'] . ': ' .
|
||||||
|
$lease['Unit']['name'] . ': ' .
|
||||||
|
$lease['Customer']['name'] . ': Prepare Move-Out');
|
||||||
|
$this->set(compact('title', 'lease', 'redirect'));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
**************************************************************************
|
**************************************************************************
|
||||||
**************************************************************************
|
**************************************************************************
|
||||||
@@ -111,7 +162,6 @@ class LeasesController extends AppController {
|
|||||||
'Customer',
|
'Customer',
|
||||||
),
|
),
|
||||||
'conditions' => array(array('Lease.id' => $id)),
|
'conditions' => array(array('Lease.id' => $id)),
|
||||||
'limit' => 2
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -124,6 +174,22 @@ class LeasesController extends AppController {
|
|||||||
$deposits = $this->Lease->findSecurityDeposits($lease['Lease']['id']);
|
$deposits = $this->Lease->findSecurityDeposits($lease['Lease']['id']);
|
||||||
$outstanding_deposit = $deposits['summary']['balance'];
|
$outstanding_deposit = $deposits['summary']['balance'];
|
||||||
|
|
||||||
|
// Set up dynamic menu items
|
||||||
|
if (!isset($lease['Lease']['close_date'])) {
|
||||||
|
$this->sidemenu_links[] =
|
||||||
|
array('name' => 'Operations', 'header' => true);
|
||||||
|
|
||||||
|
if (!isset($lease['Lease']['moveout_date'])) {
|
||||||
|
$this->sidemenu_links[] =
|
||||||
|
array('name' => 'Move-Out', 'url' => array('action' => 'move_out',
|
||||||
|
$id));
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->sidemenu_links[] =
|
||||||
|
array('name' => 'Payment', 'url' => array('action' => 'payment',
|
||||||
|
$id));
|
||||||
|
}
|
||||||
|
|
||||||
// Prepare to render
|
// Prepare to render
|
||||||
$title = 'Lease: #' . $lease['Lease']['id'];
|
$title = 'Lease: #' . $lease['Lease']['id'];
|
||||||
$this->set(compact('lease', 'title',
|
$this->set(compact('lease', 'title',
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ class MapsController extends AppController {
|
|||||||
$this->redirect(array('action'=>'index'));
|
$this->redirect(array('action'=>'index'));
|
||||||
}
|
}
|
||||||
$this->set('info', $this->mapInfo($id, $requested_width));
|
$this->set('info', $this->mapInfo($id, $requested_width));
|
||||||
|
$this->set('title', "Site Map");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -94,6 +94,42 @@ class UnitsController extends AppController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
**************************************************************************
|
||||||
|
**************************************************************************
|
||||||
|
* action: move_out
|
||||||
|
* - prepare or execute a move out on a specific lease
|
||||||
|
*/
|
||||||
|
|
||||||
|
function move_out($id) {
|
||||||
|
|
||||||
|
$unit = $this->Unit->find
|
||||||
|
('first', array
|
||||||
|
('contain' => array
|
||||||
|
(// Models
|
||||||
|
'CurrentLease' =>
|
||||||
|
array(//'conditions' => array('Lease.moveout_date' => null),
|
||||||
|
// Models
|
||||||
|
'Customer' =>
|
||||||
|
array('fields' => array('id', 'name'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'conditions' => array('Unit.id' => $id),
|
||||||
|
));
|
||||||
|
|
||||||
|
$redirect = array('controller' => 'units',
|
||||||
|
'action' => 'view',
|
||||||
|
$id);
|
||||||
|
|
||||||
|
$title = ('Lease' . $unit['CurrentLease']['number'] . ': ' .
|
||||||
|
$unit['Unit']['name'] . ': ' .
|
||||||
|
$unit['CurrentLease']['Customer']['name'] . ': Prepare Move-Out');
|
||||||
|
$this->set(compact('title', 'unit', 'redirect'));
|
||||||
|
$this->render('/leases/move_out');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
**************************************************************************
|
**************************************************************************
|
||||||
**************************************************************************
|
**************************************************************************
|
||||||
@@ -137,10 +173,22 @@ class UnitsController extends AppController {
|
|||||||
$outstanding_deposit = $deposits['summary']['balance'];
|
$outstanding_deposit = $deposits['summary']['balance'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->sidemenu_links[] =
|
// Set up dynamic menu items
|
||||||
array('name' => 'Operations', 'header' => true);
|
if (isset($unit['CurrentLease']['id']) &&
|
||||||
$this->sidemenu_links[] =
|
!isset($unit['CurrentLease']['close_date'])) {
|
||||||
array('name' => 'Move-Out', 'url' => array('controller' => 'units', 'action' => 'move-out'));
|
$this->sidemenu_links[] =
|
||||||
|
array('name' => 'Operations', 'header' => true);
|
||||||
|
|
||||||
|
if (!isset($unit['CurrentLease']['moveout_date'])) {
|
||||||
|
$this->sidemenu_links[] =
|
||||||
|
array('name' => 'Move-Out', 'url' => array('action' => 'move_out',
|
||||||
|
$id));
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->sidemenu_links[] =
|
||||||
|
array('name' => 'Payment', 'url' => array('action' => 'payment',
|
||||||
|
$id));
|
||||||
|
}
|
||||||
|
|
||||||
// Prepare to render.
|
// Prepare to render.
|
||||||
$title = 'Unit ' . $unit['Unit']['name'];
|
$title = 'Unit ' . $unit['Unit']['name'];
|
||||||
|
|||||||
@@ -31,9 +31,6 @@ class Lease extends AppModel {
|
|||||||
|
|
||||||
var $hasMany = array(
|
var $hasMany = array(
|
||||||
'LedgerEntry',
|
'LedgerEntry',
|
||||||
|
|
||||||
// Cheat to get Account set as part of this class
|
|
||||||
'Account',
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@@ -44,7 +41,8 @@ class Lease extends AppModel {
|
|||||||
* - Returns the accountId of the given lease
|
* - Returns the accountId of the given lease
|
||||||
*/
|
*/
|
||||||
function accountId($id) {
|
function accountId($id) {
|
||||||
return $this->Account->invoiceAccountID();
|
$A = new Account();
|
||||||
|
return $A->invoiceAccountID();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -64,8 +62,9 @@ class Lease extends AppModel {
|
|||||||
$cond = array();
|
$cond = array();
|
||||||
$cond[] = array('LedgerEntry.lease_id' => $id);
|
$cond[] = array('LedgerEntry.lease_id' => $id);
|
||||||
|
|
||||||
$entries = $this->Account->findLedgerEntries($this->accountId($id),
|
$A = new Account();
|
||||||
$all, $cond, $link);
|
$entries = $A->findLedgerEntries($this->accountId($id),
|
||||||
|
$all, $cond, $link);
|
||||||
|
|
||||||
/* pr(array('function' => 'Lease::findAccountEntries', */
|
/* pr(array('function' => 'Lease::findAccountEntries', */
|
||||||
/* 'args' => compact('id', 'all', 'cond', 'link'), */
|
/* 'args' => compact('id', 'all', 'cond', 'link'), */
|
||||||
@@ -87,9 +86,10 @@ class Lease extends AppModel {
|
|||||||
/* 'args' => compact('id', 'link'), */
|
/* 'args' => compact('id', 'link'), */
|
||||||
/* )); */
|
/* )); */
|
||||||
|
|
||||||
$entries = $this->Account->findLedgerEntriesRelatedToAccount
|
$A = new Account();
|
||||||
|
$entries = $A->findLedgerEntriesRelatedToAccount
|
||||||
($this->accountId($id),
|
($this->accountId($id),
|
||||||
$this->Account->securityDepositAccountID(),
|
$A->securityDepositAccountID(),
|
||||||
true, array('LedgerEntry.lease_id' => $id), $link);
|
true, array('LedgerEntry.lease_id' => $id), $link);
|
||||||
|
|
||||||
/* pr(array('function' => 'Lease::findSecurityDeposits', */
|
/* pr(array('function' => 'Lease::findSecurityDeposits', */
|
||||||
@@ -110,7 +110,8 @@ class Lease extends AppModel {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function findUnreconciledLedgerEntries($id = null, $fundamental_type = null) {
|
function findUnreconciledLedgerEntries($id = null, $fundamental_type = null) {
|
||||||
return $this->Account->findUnreconciledLedgerEntries
|
$A = new Account();
|
||||||
|
return $A->findUnreconciledLedgerEntries
|
||||||
($this->accountId($id), $fundamental_type, array('LedgerEntry.lease_id' => $id));
|
($this->accountId($id), $fundamental_type, array('LedgerEntry.lease_id' => $id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,11 +131,42 @@ class Lease extends AppModel {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function reconcileNewLedgerEntry($id, $fundamental_type, $amount) {
|
function reconcileNewLedgerEntry($id, $fundamental_type, $amount) {
|
||||||
return $this->Account->reconcileNewLedgerEntry
|
$A = new Account();
|
||||||
|
return $A->reconcileNewLedgerEntry
|
||||||
($this->accountId($id), $fundamental_type, $amount, array('LedgerEntry.lease_id' => $id));
|
($this->accountId($id), $fundamental_type, $amount, array('LedgerEntry.lease_id' => $id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
**************************************************************************
|
||||||
|
**************************************************************************
|
||||||
|
* function: moveOut
|
||||||
|
* - Moves the customer out of the specified lease
|
||||||
|
*/
|
||||||
|
|
||||||
|
function moveOut($id = null, $status = 'VACANT',
|
||||||
|
$stamp = null, $close = false) {
|
||||||
|
$this->create(false);
|
||||||
|
$this->id = $id;
|
||||||
|
|
||||||
|
// Use NOW if not given a moveout date
|
||||||
|
if (!isset($stamp))
|
||||||
|
$stamp = date('Y-m-d G:i:s');
|
||||||
|
|
||||||
|
// Move customer out of the lease, and possibly close it
|
||||||
|
$this->data['Lease']['moveout_date'] = $stamp;
|
||||||
|
if ($close)
|
||||||
|
$this->data['Lease']['close_date'] = $stamp;
|
||||||
|
|
||||||
|
// Save it!
|
||||||
|
$this->save($this->data, false);
|
||||||
|
|
||||||
|
// Finally, update the unit status
|
||||||
|
$this->recursive = -1;
|
||||||
|
$this->read();
|
||||||
|
$this->Unit->updateStatus($this->data['Lease']['unit_id'], $status);
|
||||||
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
**************************************************************************
|
**************************************************************************
|
||||||
**************************************************************************
|
**************************************************************************
|
||||||
@@ -146,8 +178,9 @@ class Lease extends AppModel {
|
|||||||
if (!$id)
|
if (!$id)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
$stats = $this->Account->stats($this->Account->accountReceivableAccountID(), true,
|
$A = new Account();
|
||||||
array('LedgerEntry.lease_id' => $id));
|
$stats = $A->stats($A->accountReceivableAccountID(), true,
|
||||||
|
array('LedgerEntry.lease_id' => $id));
|
||||||
|
|
||||||
// Pull to the top level and return
|
// Pull to the top level and return
|
||||||
$stats = $stats['Ledger'];
|
$stats = $stats['Ledger'];
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class Unit extends AppModel {
|
|||||||
var $hasOne = array(
|
var $hasOne = array(
|
||||||
'CurrentLease' => array(
|
'CurrentLease' => array(
|
||||||
'className' => 'Lease',
|
'className' => 'Lease',
|
||||||
'conditions' => 'CurrentLease.close_date IS NULL',
|
'conditions' => 'CurrentLease.moveout_date IS NULL',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -27,36 +27,54 @@ class Unit extends AppModel {
|
|||||||
'Lease',
|
'Lease',
|
||||||
);
|
);
|
||||||
|
|
||||||
function statusEnums() {
|
/**************************************************************************
|
||||||
static $status_enums;
|
**************************************************************************
|
||||||
if (!isset($status_enums))
|
**************************************************************************
|
||||||
$status_enums = $this->getEnumValues('status');
|
* helpers: status enumerations
|
||||||
return $status_enums;
|
*/
|
||||||
}
|
|
||||||
|
|
||||||
function statusValue($enum) {
|
function statusEnums() {
|
||||||
$enums = $this->statusEnums();
|
static $status_enums;
|
||||||
return $enums[$enum];
|
if (!isset($status_enums))
|
||||||
}
|
$status_enums = $this->getEnumValues('status');
|
||||||
|
return $status_enums;
|
||||||
|
}
|
||||||
|
|
||||||
function occupiedEnumValue() {
|
function statusValue($enum) {
|
||||||
return statusValue('OCCUPIED');
|
$enums = $this->statusEnums();
|
||||||
}
|
return $enums[$enum];
|
||||||
|
}
|
||||||
|
|
||||||
function conditionOccupied() {
|
function occupiedEnumValue() {
|
||||||
return ('Unit.status >= ' . $this->statusValue('OCCUPIED'));
|
return statusValue('OCCUPIED');
|
||||||
}
|
}
|
||||||
|
|
||||||
function conditionVacant() {
|
function conditionOccupied() {
|
||||||
return ('Unit.status BETWEEN ' .
|
return ('Unit.status >= ' . $this->statusValue('OCCUPIED'));
|
||||||
($this->statusValue('UNAVAILABLE')+1) .
|
}
|
||||||
' AND ' .
|
|
||||||
($this->statusValue('OCCUPIED')-1));
|
|
||||||
}
|
|
||||||
|
|
||||||
function conditionUnavailable() {
|
function conditionVacant() {
|
||||||
return ('Unit.status <= ' . $this->statusValue('UNAVAILABLE'));
|
return ('Unit.status BETWEEN ' .
|
||||||
}
|
($this->statusValue('UNAVAILABLE')+1) .
|
||||||
|
' AND ' .
|
||||||
|
($this->statusValue('OCCUPIED')-1));
|
||||||
|
}
|
||||||
|
|
||||||
|
function conditionUnavailable() {
|
||||||
|
return ('Unit.status <= ' . $this->statusValue('UNAVAILABLE'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
**************************************************************************
|
||||||
|
**************************************************************************
|
||||||
|
* function: updateStatus
|
||||||
|
* - Update the given unit to the given status
|
||||||
|
*/
|
||||||
|
function updateStatus($id, $status) {
|
||||||
|
$this->id = $id;
|
||||||
|
pr(compact('id', 'status'));
|
||||||
|
$this->saveField('status', $status);
|
||||||
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
**************************************************************************
|
**************************************************************************
|
||||||
|
|||||||
72
site/views/leases/move_out.ctp
Normal file
72
site/views/leases/move_out.ctp
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
<?php /* -*- mode:PHP -*- */
|
||||||
|
|
||||||
|
$multiple = false;
|
||||||
|
$class = 'move-out';
|
||||||
|
|
||||||
|
if (isset($lease)) {
|
||||||
|
$class .= ' lease';
|
||||||
|
$data = $lease;
|
||||||
|
}
|
||||||
|
elseif (isset($customer) && count($customer['Lease']) == 1) {
|
||||||
|
$class .= ' customer';
|
||||||
|
$data = array_diff_key($customer, array('Lease'=>1));
|
||||||
|
$data['Lease'] = array_diff_key($customer['Lease'][0], array('Unit'=>1));
|
||||||
|
$data['Unit'] = $customer['Lease'][0]['Unit'];
|
||||||
|
}
|
||||||
|
elseif (isset($customer)) {
|
||||||
|
$class .= ' customer';
|
||||||
|
$data = $customer;
|
||||||
|
$multiple = true;
|
||||||
|
}
|
||||||
|
elseif (isset($unit)) {
|
||||||
|
$class .= ' unit';
|
||||||
|
$data = array_diff_key($unit, array('CurrentLease'=>1));
|
||||||
|
$data['Lease'] = array_diff_key($unit['CurrentLease'], array('Customer'=>1));
|
||||||
|
$data['Customer'] = $unit['CurrentLease']['Customer'];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
die("INTERNAL ERROR");
|
||||||
|
}
|
||||||
|
|
||||||
|
//pr(compact('customer', 'lease', 'unit', 'class', 'multiple', 'data', 'redirect'));
|
||||||
|
|
||||||
|
echo '<div class="'.$class.'">' . "\n";
|
||||||
|
echo('<H2>Move Out: '. $data['Customer']['name'] .
|
||||||
|
(!$multiple ? ': Unit ' . $data['Unit']['name'] : '') .
|
||||||
|
'</H2>' . "\n");
|
||||||
|
echo('<P>Be sure that you really want to move this customer out, ' .
|
||||||
|
($multiple ? 'select the correct unit to move out of, ' : '') .
|
||||||
|
'and press the "Perform Move Out" button.' . "\n");
|
||||||
|
echo '<P><BR>' . "\n";
|
||||||
|
|
||||||
|
echo $form->create(null, array('id' => 'move-out-form',
|
||||||
|
'url' => array('controller' => 'leases',
|
||||||
|
'action' => 'move_out')));
|
||||||
|
|
||||||
|
if ($multiple) {
|
||||||
|
$options = array();
|
||||||
|
foreach ($data['Lease'] AS $lease)
|
||||||
|
$options[$lease['id']] = $lease['Unit']['name'];
|
||||||
|
echo $form->input('Lease.id', array('label' => 'Move Out of Unit: ',
|
||||||
|
'options' => $options));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo $form->input('Lease.id',
|
||||||
|
array('type' => 'hidden',
|
||||||
|
'value' => $data['Lease']['id'],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set up a redirect page. I use lower case 'redirect' here
|
||||||
|
// to avoid the model convention, which starts with upper-case.
|
||||||
|
foreach ($redirect AS $name => $value) {
|
||||||
|
echo $form->input("redirect.$name",
|
||||||
|
array('type' => 'hidden',
|
||||||
|
'value' => $value,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
echo $form->end('Perform Move Out');
|
||||||
|
|
||||||
|
// End page div
|
||||||
|
echo '</div>' . "\n";
|
||||||
@@ -59,14 +59,16 @@ echo $this->element('leases',
|
|||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* Current Tenant Lease Account History
|
* Current Tenant Lease Account History
|
||||||
*/
|
*/
|
||||||
|
if (isset($unit['CurrentLease']['id'])) {
|
||||||
echo $this->element('ledger_entries',
|
echo $this->element('ledger_entries',
|
||||||
array('caption' => ('Current Lease Account (' .
|
array('caption' =>
|
||||||
$unit['CurrentLease']['Customer']['name']
|
('Current Lease Account ('
|
||||||
. ')'),
|
. $unit['CurrentLease']['Customer']['name']
|
||||||
'ar_account' => true,
|
. ')'),
|
||||||
'lease_id' => $unit['CurrentLease']['id'],
|
'ar_account' => true,
|
||||||
));
|
'lease_id' => $unit['CurrentLease']['id'],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* End "detail supporting" div */
|
/* End "detail supporting" div */
|
||||||
|
|||||||
Reference in New Issue
Block a user