Implementing NSF in MonetarySourcesController. It's nowhere near done, but it seems we're headed in the right direction.

git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@328 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-13 10:14:38 +00:00
parent 3551ad0603
commit 69b3cf3ed3
3 changed files with 339 additions and 0 deletions

View File

@@ -48,6 +48,22 @@ class MonetarySourcesController extends AppController {
}
/**************************************************************************
**************************************************************************
**************************************************************************
* action: nsf
* - Marks a monetary source as having insufficient funds.
*/
function nsf($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Item.', true));
$this->redirect(array('action'=>'index'));
}
$this->MonetarySource->nsf($id);
}
/**************************************************************************
**************************************************************************
**************************************************************************
@@ -67,6 +83,22 @@ class MonetarySourcesController extends AppController {
('contain' => false,
));
// REVISIT <AP>: 20090713
// Consider allowing the NSF operation only if the source is used on
// a ledger entry that is debited on a "payable" account (perhaps
// even restricted to "payable" ASSET accounts), credited on Receipt
// (or A/R), and reconciles the credit to an entry that debits on a
// "depositable" account.
// Set up dynamic menu items
$this->sidemenu_links[] =
array('name' => 'Operations', 'header' => true);
$this->sidemenu_links[] =
array('name' => 'NSF',
'url' => array('action' => 'nsf',
$id));
// Prepare to render.
$title = "Monetary Source #{$monetary_source['MonetarySource']['id']}";
$this->set(compact('monetary_source', 'title'));