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/site@444 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -171,6 +171,12 @@ class Tender extends AppModel {
|
|||||||
$bounce['Transaction']['amount'] = -1 * $tender['LedgerEntry']['amount'];
|
$bounce['Transaction']['amount'] = -1 * $tender['LedgerEntry']['amount'];
|
||||||
|
|
||||||
foreach ($nsf_ledger_entry['Transaction']['StatementEntry'] AS $payment) {
|
foreach ($nsf_ledger_entry['Transaction']['StatementEntry'] AS $payment) {
|
||||||
|
if ($payment['type'] === 'SURPLUS') {
|
||||||
|
$payment['type'] = 'VOID';
|
||||||
|
$this->NsfTransaction->StatementEntry->id = $payment['id'];
|
||||||
|
$this->NsfTransaction->StatementEntry->saveField('type', $payment['type']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
$bounce['Entry'][] =
|
$bounce['Entry'][] =
|
||||||
array('type' => $payment['type'],
|
array('type' => $payment['type'],
|
||||||
'amount' => -1 * $payment['amount'],
|
'amount' => -1 * $payment['amount'],
|
||||||
@@ -181,6 +187,7 @@ class Tender extends AppModel {
|
|||||||
'effective_date' => $nsf_deposit['stamp'],
|
'effective_date' => $nsf_deposit['stamp'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pr(compact('bounce'));
|
pr(compact('bounce'));
|
||||||
$result = $this->NsfTransaction->addNsf($bounce);
|
$result = $this->NsfTransaction->addNsf($bounce);
|
||||||
|
|||||||
@@ -81,7 +81,8 @@ echo $this->element('statement_entries', array
|
|||||||
(// Grid configuration
|
(// Grid configuration
|
||||||
'config' => array
|
'config' => array
|
||||||
('caption' => 'Account',
|
('caption' => 'Account',
|
||||||
'filter' => array('Customer.id' => $customer['Customer']['id']),
|
'filter' => array('Customer.id' => $customer['Customer']['id'],
|
||||||
|
'type !=' => 'VOID'),
|
||||||
'exclude' => array('Customer'),
|
'exclude' => array('Customer'),
|
||||||
)));
|
)));
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ $cols['Date'] = array('index' => 'Transaction.stamp', 'formatter' =>
|
|||||||
|
|
||||||
$cols['Account'] = array('index' => 'Account.name', 'formatter' => 'name');
|
$cols['Account'] = array('index' => 'Account.name', 'formatter' => 'name');
|
||||||
$cols['Cr/Dr'] = array('index' => 'LedgerEntry.crdr', 'formatter' => 'enum');
|
$cols['Cr/Dr'] = array('index' => 'LedgerEntry.crdr', 'formatter' => 'enum');
|
||||||
$cols['Tender'] = array('index' => 'Tender.name', 'formatter' => 'name');
|
$cols['Tender'] = array('index' => 'Tender.name', 'formatter' => 'longname');
|
||||||
$cols['Comment'] = array('index' => 'LedgerEntry.comment', 'formatter' => 'comment', 'width'=>150);
|
$cols['Comment'] = array('index' => 'LedgerEntry.comment', 'formatter' => 'comment', 'width'=>150);
|
||||||
|
|
||||||
$cols['Amount'] = array('index' => 'LedgerEntry.amount', 'formatter' => 'currency');
|
$cols['Amount'] = array('index' => 'LedgerEntry.amount', 'formatter' => 'currency');
|
||||||
|
|||||||
@@ -73,8 +73,9 @@ if ($transaction['type'] === 'INVOICE' || $transaction['type'] === 'RECEIPT') {
|
|||||||
'config' => array
|
'config' => array
|
||||||
(
|
(
|
||||||
'caption' => 'Statement Entries',
|
'caption' => 'Statement Entries',
|
||||||
'filter' => array('Transaction.id' => $transaction['id']),
|
'filter' => array('Transaction.id' => $transaction['id'],
|
||||||
'exclude' => array('Transaction'),
|
'type !=' => 'VOID'),
|
||||||
|
'exclude' => array('Transaction', 'Account'),
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user