Modified how NSF customer surplus items are handled. Instead of creating a negative surplus (which was dumb, but a decent first pass), we just void out the surplus. This drops the surplus off the radar, and in fact may cause confusion since the transaction no longer has enough statement entries to total up correctly. However, it doesn't appear too confusing, especially as tender item names are now decorated with strikethrough when they're NSF (the previous checkin).

git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@444 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-31 01:40:16 +00:00
parent fe17f87f7d
commit a1a9c7800b
5 changed files with 27 additions and 14 deletions

View File

@@ -171,15 +171,22 @@ class Tender extends AppModel {
$bounce['Transaction']['amount'] = -1 * $tender['LedgerEntry']['amount'];
foreach ($nsf_ledger_entry['Transaction']['StatementEntry'] AS $payment) {
$bounce['Entry'][] =
array('type' => $payment['type'],
'amount' => -1 * $payment['amount'],
'account_id' => $this->LedgerEntry->Account->nsfAccountID(),
'customer_id' => $payment['customer_id'],
'lease_id' => $payment['lease_id'],
'charge_entry_id' => $payment['charge_entry_id'],
'effective_date' => $nsf_deposit['stamp'],
);
if ($payment['type'] === 'SURPLUS') {
$payment['type'] = 'VOID';
$this->NsfTransaction->StatementEntry->id = $payment['id'];
$this->NsfTransaction->StatementEntry->saveField('type', $payment['type']);
}
else {
$bounce['Entry'][] =
array('type' => $payment['type'],
'amount' => -1 * $payment['amount'],
'account_id' => $this->LedgerEntry->Account->nsfAccountID(),
'customer_id' => $payment['customer_id'],
'lease_id' => $payment['lease_id'],
'charge_entry_id' => $payment['charge_entry_id'],
'effective_date' => $nsf_deposit['stamp'],
);
}
}
pr(compact('bounce'));