Still trying to figure out what issuing a refund should look like. I switched the entry to be negative, which may (should) make reporting easier.

git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@350 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-16 07:27:18 +00:00
parent 331e235e77
commit 115c82cd21
6 changed files with 66 additions and 19 deletions

View File

@@ -152,9 +152,7 @@ class AccountsController extends AppController {
$this->redirect(array('action'=>'index'));
}
$payment_accounts = $this->Account->paymentAccounts();
$payment_accounts[$this->Account->nsfAccountID()] =
$this->Account->name($this->Account->nsfAccountID());
$payment_accounts = $this->Account->collectableAccounts();
//$payment_accounts[$this->Account->nameToID('Bank')] = 'Bank';
$default_accounts = array_diff_key($payment_accounts,
array($this->Account->concessionAccountID() => 1));

View File

@@ -432,11 +432,14 @@ class CustomersController extends AppController {
$entries = $this->Customer->LedgerEntry->find
('all', array
('contain' => false,
'conditions' => array('LedgerEntry.id' => array(199,200,201)),
'conditions' => array('LedgerEntry.id' =>
//array(199,200,201)
61
),
));
pr(compact('entries'));
$this->Customer->LedgerEntry->refund($entries);
$this->Customer->LedgerEntry->reverse($entries);
}

View File

@@ -475,11 +475,18 @@ class LeasesController extends AppController {
'action' => 'receipt',
$lease['Customer']['id']));
if (isset($lease['Lease']['moveout_date']) && $outstanding_deposit > 0)
if (isset($lease['Lease']['moveout_date']) && $outstanding_deposit > 0 && $outstanding_balance > 0)
$this->sidemenu_links[] =
array('name' => 'Apply Deposit', 'url' => array('action' => 'apply_deposit',
$id));
if (isset($lease['Lease']['moveout_date']) &&
$outstanding_balance <= 0 &&
($outstanding_deposit - $outstanding_balance) > 0)
$this->sidemenu_links[] =
array('name' => 'Issue Refund', 'url' => array('action' => 'refund',
$id));
if (isset($lease['Lease']['moveout_date']) && $outstanding_deposit == 0 && $outstanding_balance > 0)
$this->sidemenu_links[] =
array('name' => 'Write-Off', 'url' => array('action' => 'bad_debt',

View File

@@ -341,7 +341,7 @@ class LedgerEntriesController extends AppController {
*/
function reverse($id) {
$id = $this->LedgerEntry->reverse($id);
$this->LedgerEntry->reverse($id);
$this->redirect(array('action'=>'view', $id));
}
@@ -433,13 +433,27 @@ class LedgerEntriesController extends AppController {
(!$entry['CreditLedger']['Account']['trackable'] ||
$stats['credit']['amount_reconciled'] == 0)
|| 1 // REVISIT <AP>: 20090711 : Testing
&& 0
)
{
// Set up dynamic menu items
$this->sidemenu_links[] =
array('name' => 'Operations', 'header' => true);
$this->sidemenu_links[] =
array('name' => 'Undo',
'url' => array('action' => 'reverse',
$id));
}
if ($this->LedgerEntry->Ledger->Account->type
($entry['CreditLedger']['Account']['id']) == 'INCOME')
{
// Set up dynamic menu items
$this->sidemenu_links[] =
array('name' => 'Operations', 'header' => true);
$this->sidemenu_links[] =
array('name' => 'Reverse',
'url' => array('action' => 'reverse',