Added an automatic $35 nsf charge when marking an item as nsf. This required removing the lease_id requirement when adding a transaction, since the charge is not associated with a lease, just a customer. The requirement was artificial anyway; imagine selling POS items to folks that don't even lease from us...
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@447 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -191,10 +191,54 @@ class Tender extends AppModel {
|
||||
if ($result['error'])
|
||||
die("Unable to save Bounce transaction");
|
||||
|
||||
// REVISIT <AP>: 20090730
|
||||
// Add NSF Charge
|
||||
/* [data] => Array */
|
||||
/* ( */
|
||||
/* [Transaction] => Array */
|
||||
/* ( */
|
||||
/* [stamp] => 07/30/2009 17:17 */
|
||||
/* [comment] => */
|
||||
/* [type] => INVOICE */
|
||||
/* [crdr] => DEBIT */
|
||||
/* [account_id] => 3 */
|
||||
/* [customer_id] => */
|
||||
/* [lease_id] => 43 */
|
||||
/* ) */
|
||||
|
||||
/* $nsf_fee_account_id = $A->nsfChargeAccountID(); */
|
||||
/* [Entry] => Array */
|
||||
/* ( */
|
||||
/* [1] => Array */
|
||||
/* ( */
|
||||
/* [account_id] => 17 */
|
||||
/* [effective_date] => 07/30/2009 */
|
||||
/* [through_date] => */
|
||||
/* [amount] => 35 */
|
||||
/* [comment] => */
|
||||
/* [type] => CHARGE */
|
||||
/* [crdr] => CREDIT */
|
||||
/* ) */
|
||||
/* ) */
|
||||
/* ) */
|
||||
|
||||
// Add NSF Charge
|
||||
$result = $this->NsfTransaction->addInvoice
|
||||
(array('Transaction' =>
|
||||
array('stamp' => $nsf_deposit['stamp'],
|
||||
),
|
||||
|
||||
'Entry' =>
|
||||
array
|
||||
(array('account_id' => $this->LedgerEntry->Account->nsfChargeAccountID(),
|
||||
'effective_date' => $nsf_deposit['stamp'],
|
||||
// REVISIT <AP>: 20090730
|
||||
// BAD, BAD, BAD... who would actually
|
||||
// hardcode a value like this???? ;-)
|
||||
'amount' => 35,
|
||||
'comment' => "NSF: " . $tender['Tender']['name'],
|
||||
),
|
||||
),
|
||||
),
|
||||
$tender['Tender']['customer_id']);
|
||||
$this->pr(20, compact('result'));
|
||||
|
||||
return $this->prReturn(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user