Modified to dynamically determine eligible charge accounts, instead of the two that were hardcoded.

git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@244 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-07 07:14:18 +00:00
parent a8c91d8b22
commit aab8a994c8
4 changed files with 89 additions and 46 deletions

View File

@@ -194,13 +194,16 @@ class LeasesController extends AppController {
),
));
$charge['type'] = $type;
if ($type == 'rent')
$charge['amount'] = $lease['Lease']['rent'];
elseif ($type == 'late')
// REVISIT <AP> 20090705:
// Of course, the late charge should come from the late_schedule
$charge['amount'] = 10.00;
$A = new Account();
$charge_accounts = $A->chargeAccounts();
$default_account = $A->rentAccountID();
$this->set(compact('charge_accounts', 'default_account'));
// REVISIT <AP> 20090705:
// Of course, the late charge should come from the late_schedule
$default_rent = $lease['Lease']['rent'];
$default_late = 10;
$this->set(compact('default_rent', 'default_late'));
$title = ('Lease #' . $lease['Lease']['number'] . ': ' .
$lease['Unit']['name'] . ': ' .