Added a way to associate the meaningful part of NSF with the corresponding tender.

git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@456 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-31 18:10:48 +00:00
parent e09fb7d258
commit 00c99ea60a
4 changed files with 10 additions and 31 deletions

View File

@@ -194,24 +194,16 @@ class Tender extends AppModel {
// charges, void any credits, and other similar work.
$this->pr(20, compact('bounce'));
$bounce_result = $this->NsfTransaction->addNsf($bounce);
$this->pr(20, compact('bounce_result'));
if ($bounce_result['error'])
die("Unable to save Bounce transaction");
// Flag the tender as NSF, using the transaction created above.
// REVISIT <AP>: 20090730
// For symmetry, it seems like we should be using the nsf_result.
// Thus the tender's deposit_transaction_id would record how the
// money got into the bank account, and the nsf_transaction_id
// would record how the money was taken back out. However, that
// transaction is just not very useful. So, either we ignore
// the fact that the nsf_result is not useful to the user, we
// use the bounce_result instead, or we modify the tender view
// page to reference the bounce_result, and still use nsf_result
// for our nsf_transaction_id.
// Flag the tender as NSF, using the items created above.
$this->id = $id;
$this->saveField('nsf_transaction_id', $nsf_result['transaction_id']);
$this->saveField('nsf_ledger_entry_id', $bounce_result['entries'][0]['DoubleEntry']['Entry1']['ledger_entry_id']);
// Add NSF Charge