Continued waiver progress. At the moment, it works ok, but I don't like the way that security deposit balances work. It's probably a general issue, not just security deposits, but it's not clear whether stats from StatementEntry should be subtracting waiver totals from the overall charge reconciliation total. It should in some cases, and not in others. I'll tweak on it in later checkins.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@479 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -12,6 +12,7 @@ class Lease extends AppModel {
|
||||
'StatementEntry',
|
||||
);
|
||||
|
||||
var $default_log_level = array('log' => 30, 'show' => 15);
|
||||
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
@@ -85,9 +86,6 @@ class Lease extends AppModel {
|
||||
$secdeps = $secdeps['entries'];
|
||||
$this->pr(20, compact('secdeps'));
|
||||
|
||||
$this->securityDepositBalance($id, $query);
|
||||
die();
|
||||
|
||||
// If there are no paid security deposits, then
|
||||
// we can consider all security deposits released.
|
||||
if (count($secdeps) == 0)
|
||||
@@ -101,17 +99,10 @@ class Lease extends AppModel {
|
||||
die("INTERNAL ERROR: SECURITY DEPOSIT IS NOT CHARGE");
|
||||
|
||||
// Since security deposits are being released, this also means
|
||||
// we're reducing any oustanding amount on a security deposit
|
||||
// since we no longer expect it to be owed.
|
||||
// REVISIT <AP>: 20090730
|
||||
// This is kludgy, and I really don't like it. However, this
|
||||
// is not presently something that even happens at the moment,
|
||||
// so this solution will have to work until we come up with
|
||||
// something more robust, like flagging those charges as defunct.
|
||||
if ($charge['StatementEntry']['balance'] > 0) {
|
||||
$this->StatementEntry->id = $charge['StatementEntry']['id'];
|
||||
$this->StatementEntry->saveField('amount', $charge['StatementEntry']['reconciled']);
|
||||
}
|
||||
// any unpaid (or only partially paid) security deposit should
|
||||
// have the remaining balance simply waived.
|
||||
if ($charge['StatementEntry']['balance'] > 0)
|
||||
$this->StatementEntry->waive($charge['StatementEntry']['id']);
|
||||
|
||||
$release['Entry'][] =
|
||||
array('amount' => $charge['StatementEntry']['reconciled'],
|
||||
|
||||
Reference in New Issue
Block a user