Took some of the new learnings from invoice generation and put into receipt generations. Also moved some shared functions to pmgr.js, and renamed things for consistency.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@239 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -251,7 +251,7 @@ class CustomersController extends AppController {
|
||||
if ($show_payment) {
|
||||
$this->sidemenu_links[] =
|
||||
array('name' => 'Payment',
|
||||
'url' => array('action' => 'payment',
|
||||
'url' => array('action' => 'receipt',
|
||||
$id));
|
||||
}
|
||||
|
||||
@@ -352,11 +352,11 @@ class CustomersController extends AppController {
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
* action: payment
|
||||
* - Sets up the payment entry page for the given customer.
|
||||
* action: receipt
|
||||
* - Sets up the receipt entry page for the given customer.
|
||||
*/
|
||||
|
||||
function payment($id = null) {
|
||||
function receipt($id = null) {
|
||||
/* if (!$id) { */
|
||||
/* $this->Session->setFlash(__('Invalid Item.', true)); */
|
||||
/* $this->redirect(array('action'=>'index')); */
|
||||
@@ -379,7 +379,7 @@ class CustomersController extends AppController {
|
||||
$charges = array('balance' => 0, 'entry' => array());
|
||||
}
|
||||
|
||||
$title = 'Payment Entry';
|
||||
$title = ($customer['name'] . ': Payment Entry');
|
||||
$this->set(compact('customer', 'charges', 'title'));
|
||||
}
|
||||
|
||||
|
||||
@@ -169,11 +169,11 @@ class LeasesController extends AppController {
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
* action: assess
|
||||
* - Assesses charges to the lease
|
||||
* action: invoice
|
||||
* - Sets up the invoice entry page for the given customer.
|
||||
*/
|
||||
|
||||
function assess($id = null, $type = null) {
|
||||
function invoice($id = null, $type = null) {
|
||||
|
||||
$lease = $this->Lease->find
|
||||
('first', array
|
||||
@@ -209,7 +209,7 @@ class LeasesController extends AppController {
|
||||
|
||||
$title = ('Lease #' . $lease['Lease']['number'] . ': ' .
|
||||
$lease['Unit']['name'] . ': ' .
|
||||
$lease['Customer']['name'] . ': Assess Charges');
|
||||
$lease['Customer']['name'] . ': Charge Entry');
|
||||
$this->set(compact('title', 'lease', 'charge'));
|
||||
}
|
||||
|
||||
@@ -255,11 +255,11 @@ class LeasesController extends AppController {
|
||||
array('name' => 'Operations', 'header' => true);
|
||||
|
||||
$this->sidemenu_links[] =
|
||||
array('name' => 'Assess Rent', 'url' => array('action' => 'assess',
|
||||
array('name' => 'Assess Rent', 'url' => array('action' => 'invoice',
|
||||
$id, 'rent'));
|
||||
|
||||
$this->sidemenu_links[] =
|
||||
array('name' => 'Assess Late Charge', 'url' => array('action' => 'assess',
|
||||
array('name' => 'Assess Late Charge', 'url' => array('action' => 'invoice',
|
||||
$id, 'late'));
|
||||
|
||||
if (!isset($lease['Lease']['moveout_date'])) {
|
||||
@@ -270,7 +270,7 @@ class LeasesController extends AppController {
|
||||
|
||||
$this->sidemenu_links[] =
|
||||
array('name' => 'Payment', 'url' => array('controller' => 'customers',
|
||||
'action' => 'payment',
|
||||
'action' => 'receipt',
|
||||
$lease['Customer']['id']));
|
||||
}
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ class TransactionsController extends AppController {
|
||||
}
|
||||
|
||||
if (!$this->Transaction->addReceipt($this->data,
|
||||
$this->data['customer_id'])) {
|
||||
$this->data['Customer']['id'])) {
|
||||
$this->Session->setFlash("RECEIPT FAILED", true);
|
||||
// REVISIT <AP> 20090706:
|
||||
// Until we can work out the session problems,
|
||||
|
||||
@@ -222,8 +222,9 @@ class UnitsController extends AppController {
|
||||
if (isset($unit['CurrentLease']['id']) &&
|
||||
!isset($unit['CurrentLease']['close_date'])) {
|
||||
$this->sidemenu_links[] =
|
||||
array('name' => 'Payment', 'url' => array('action' => 'payment',
|
||||
$id));
|
||||
array('name' => 'Payment', 'url' => array('controller' => 'customers',
|
||||
'action' => 'receipt',
|
||||
$unit['CurrentLease']['customer_id']));
|
||||
}
|
||||
|
||||
// Prepare to render.
|
||||
|
||||
Reference in New Issue
Block a user