Added a column to Tender that identifies the exact ledger entry which was used to deposit the tender. It was necessary due to the kludgy way that I've set ACH items to auto-deposit, which uses a ledger entry that has nothing to do with the transaction account. This would probably allow us to eliminate the deposit_transaction_id, but I'd like to break as little as possible at the moment. I'll come back and clean this up in the future. Also, fixed a stupid bug that was causing major database thrash whenever a transaction was entered without a customer id. I could have fixed the Customer::update() function, but it was designed to accept null so that we could update all the customers, something definitely useful while developing.

git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@609 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-08-17 23:55:51 +00:00
parent 4b8dc3da02
commit d141f61055
5 changed files with 64 additions and 86 deletions

View File

@@ -493,4 +493,19 @@ class TransactionsController extends AppController {
return;
}
function foo() {
$all_tenders = $this->Transaction->LedgerEntry->Tender->find
('all', array('link' => array('TenderType',
'LedgerEntry' =>
array('Transaction')),
'conditions' => array(array('TenderType.auto_deposit' => true),
array('Tender.deposit_transaction_id' => null)),
));
foreach ($all_tenders AS $cur_tender) {
$tender_ids = array($cur_tender['Tender']['id']);
$ids = array('transaction_id' => $cur_tender['Transaction']['id']);
$this->Transaction->_autoDeposit($tender_ids, $ids);
}
}
}