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:
@@ -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'));
|
||||
|
||||
Reference in New Issue
Block a user