Preventing moved-out leases in sitelink data from being closed, since the security deposit hasn't been released. Added a temporary function to release the deposit, so I can manually release and close the few leases needed.

git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@510 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-08-10 01:27:12 +00:00
parent 07a2be05f7
commit cdb7d4b15c
3 changed files with 21 additions and 6 deletions

View File

@@ -700,12 +700,13 @@ class Lease extends AppModel {
if (isset($this->data['Lease']['close_date']))
return $this->prReturn(false);
$deposit_balance = $this->securityDepositBalance($id);
$stats = $this->stats($id);
// A lease can only be closed if there are no outstanding
// security deposits, and if the account balance is zero.
if ($deposit_balance != 0)
// security deposits ...
if ($this->securityDepositBalance($id) != 0)
return $this->prReturn(false);
// ... and if the account balance is zero.
if ($this->balance($id) != 0)
return $this->prReturn(false);
// Apparently this lease meets all the criteria!