Charge/Invoice assessment is working fairly well. Still need to accept multiple charges on a single invoice, have client side validation, and post through ajax to allow posting repeated invoices.

git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@236 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-07 00:43:41 +00:00
parent c7d7c9e7e4
commit db5eed24f6
3 changed files with 104 additions and 53 deletions

View File

@@ -174,15 +174,6 @@ class LeasesController extends AppController {
*/
function assess($id = null, $type = null) {
if ($this->data) {
// Assess the charges based on the given data
pr($this->data);
$this->Lease->addCharge($this->data['Lease']['id'], $this->data['Charge']);
//$this->redirect($this->data['redirect']);
$this->render('/empty');
return;
}
$lease = $this->Lease->find
('first', array
@@ -206,11 +197,16 @@ class LeasesController extends AppController {
$charge['type'] = $type;
if ($type == 'rent')
$charge['amount'] = $lease['Lease']['rent'];
else
elseif ($type == 'rent')
// REVISIT <AP> 20090705:
// Of course, the late charge should come from the late_schedule
$charge['amount'] = 10.00;
$redirect = array('controller' => 'leases',
'action' => 'view',
$id);
$this->set(compact('redirect'));
$title = ('Lease #' . $lease['Lease']['number'] . ': ' .
$lease['Unit']['name'] . ': ' .
$lease['Customer']['name'] . ': Assess Charges');