More work on refund. I'm going to skip the whole voucher/credit_note bit and simply present a page that lets the user enter a date, an account, and the amount to refund, recording 1 payment transaction.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@491 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -203,8 +203,7 @@ class CustomersController extends AppController {
|
||||
//pr($customer);
|
||||
|
||||
// Figure out the outstanding balances for this customer
|
||||
$stats = $this->Customer->stats($id);
|
||||
$outstanding_balance = $stats['balance'];
|
||||
$outstanding_balance = $this->Customer->balance($id);
|
||||
$outstanding_deposit = $this->Customer->securityDepositBalance($id);
|
||||
|
||||
// Figure out if this customer has any non-closed leases
|
||||
@@ -407,7 +406,7 @@ class CustomersController extends AppController {
|
||||
));
|
||||
pr(compact('entries'));
|
||||
|
||||
$this->Customer->StatementEntry->reverse($entries);
|
||||
$this->Customer->refund($entries);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -239,12 +239,14 @@ class LeasesController extends AppController {
|
||||
*/
|
||||
|
||||
function refund($id) {
|
||||
// Obtain the overall lease balance
|
||||
$stats = $this->Lease->stats($id);
|
||||
$outstanding_balance = $stats['balance'];
|
||||
$this->Lease->refund($id);
|
||||
$this->render('/fake');
|
||||
/* // Obtain the overall lease balance */
|
||||
/* $stats = $this->Lease->stats($id); */
|
||||
/* $outstanding_balance = $stats['balance']; */
|
||||
|
||||
$this->set(compact('lease', 'title',
|
||||
'outstanding_balance'));
|
||||
/* $this->set(compact('lease', 'title', */
|
||||
/* 'outstanding_balance')); */
|
||||
}
|
||||
|
||||
|
||||
@@ -381,13 +383,9 @@ class LeasesController extends AppController {
|
||||
$this->set('charge_gaps', $this->Lease->rentChargeGaps($id));
|
||||
$this->set('charge_through', $this->Lease->rentChargeThrough($id));
|
||||
|
||||
// Obtain the overall lease balance
|
||||
$this->Lease->statsMerge($lease['Lease'],
|
||||
array('stats' => $this->Lease->stats($id)));
|
||||
$outstanding_balance = $lease['Lease']['stats']['balance'];
|
||||
|
||||
// Determine the lease security deposit
|
||||
$outstanding_deposit = $this->Lease->securityDepositBalance($lease['Lease']['id']);
|
||||
// Figure out the outstanding balances for this lease
|
||||
$outstanding_balance = $this->Lease->balance($id);
|
||||
$outstanding_deposit = $this->Lease->securityDepositBalance($id);
|
||||
|
||||
// Set up dynamic menu items
|
||||
if (!isset($lease['Lease']['close_date'])) {
|
||||
|
||||
Reference in New Issue
Block a user