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:
@@ -37,6 +37,8 @@ class Transaction extends AppModel {
|
||||
);
|
||||
|
||||
|
||||
//var $default_log_level = 30;
|
||||
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
@@ -45,6 +47,8 @@ class Transaction extends AppModel {
|
||||
*/
|
||||
|
||||
function addInvoice($data, $customer_id, $lease_id = null) {
|
||||
$this->prEnter(compact('data', 'customer_id', 'lease_id'));
|
||||
|
||||
// Establish the transaction as an invoice
|
||||
$invoice =& $data['Transaction'];
|
||||
$invoice['type'] = 'INVOICE';
|
||||
@@ -75,6 +79,8 @@ class Transaction extends AppModel {
|
||||
*/
|
||||
|
||||
function addReceipt($data, $customer_id, $lease_id = null) {
|
||||
$this->prEnter(compact('data', 'customer_id', 'lease_id'));
|
||||
|
||||
// Establish the transaction as a receipt
|
||||
$receipt =& $data['Transaction'];
|
||||
$receipt['type'] = 'RECEIPT';
|
||||
@@ -108,6 +114,8 @@ class Transaction extends AppModel {
|
||||
*/
|
||||
|
||||
function addDeposit($data, $account_id) {
|
||||
$this->prEnter(compact('data', 'account_id'));
|
||||
|
||||
// Establish the transaction as a deposit
|
||||
$deposit =& $data['Transaction'];
|
||||
$deposit['type'] = 'DEPOSIT';
|
||||
@@ -156,6 +164,8 @@ class Transaction extends AppModel {
|
||||
*/
|
||||
|
||||
function addClose($data) {
|
||||
$this->prEnter(compact('data'));
|
||||
|
||||
// Establish the transaction as a close
|
||||
$close =& $data['Transaction'];
|
||||
$close['type'] = 'CLOSE';
|
||||
@@ -220,9 +230,7 @@ class Transaction extends AppModel {
|
||||
&& (empty($transaction['account_id']) ||
|
||||
empty($transaction['crdr']))) ||
|
||||
(in_array($transaction['type'], array('INVOICE', 'RECEIPT'))
|
||||
&& empty($transaction['customer_id'])) ||
|
||||
(in_array($transaction['type'], array('INVOICE'))
|
||||
&& empty($transaction['lease_id']))
|
||||
&& empty($transaction['customer_id']))
|
||||
) {
|
||||
return $this->prReturn(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user