Added the ability to accept payments (or a write-off) on a closed lease, if there is a balance owing. Added the ability to do write off bad debt at the customer level, since some charges may not be on a lease, like the NSF fee.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@516 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -249,12 +249,17 @@ class CustomersController extends AppController {
|
||||
/* $id)); */
|
||||
/* } */
|
||||
|
||||
if ($show_payment) {
|
||||
if ($show_payment || $outstanding_balance > 0)
|
||||
$this->sidemenu_links[] =
|
||||
array('name' => 'Payment',
|
||||
'url' => array('action' => 'receipt',
|
||||
$id));
|
||||
}
|
||||
|
||||
if (!$show_moveout && $outstanding_balance > 0)
|
||||
$this->sidemenu_links[] =
|
||||
array('name' => 'Write-Off',
|
||||
'url' => array('action' => 'bad_debt',
|
||||
$id));
|
||||
|
||||
if ($outstanding_balance < 0)
|
||||
$this->sidemenu_links[] =
|
||||
@@ -439,6 +444,35 @@ class CustomersController extends AppController {
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
* action: bad_debt
|
||||
* - Sets up the write-off entry page, so that the
|
||||
* user can write off remaining charges of a customer.
|
||||
*/
|
||||
|
||||
function bad_debt($id) {
|
||||
$this->Customer->id = $id;
|
||||
$customer = $this->Customer->find
|
||||
('first', array
|
||||
('contain' => false,
|
||||
));
|
||||
|
||||
// Make sure we have a valid customer to write off
|
||||
if (empty($customer))
|
||||
$this->redirect(array('action' => 'index'));
|
||||
|
||||
// Get the customer balance
|
||||
$balance = $this->Customer->balance($id);
|
||||
|
||||
// Prepare to render
|
||||
$title = ($customer['Customer']['name'] . ': Write Off Bad Debt');
|
||||
$this->set(compact('title', 'customer', 'balance'));
|
||||
$this->render('/transactions/bad_debt');
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user