Finally, a working NSF implementation. Ledger Entry tracking stops at the Bank account, since we switch from positive to negative ledger entries. However, we're not going to reconcile debits to credits in the bank account anyway, so I just disabled tracking on the account.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@334 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -184,6 +184,9 @@ class LedgerEntriesController extends AppController {
|
||||
if (count(array_intersect($params['fields'], array('applied'))) == 1)
|
||||
$fields[] = 'SUM(Reconciliation.amount) AS applied';
|
||||
|
||||
if ($params['action'] === 'collected')
|
||||
$fields[] = 'MAX(ReceiptTransaction.stamp) AS last_paid';
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
@@ -205,12 +208,12 @@ class LedgerEntriesController extends AppController {
|
||||
else
|
||||
die("INTERNAL ERROR: COLLECTED ACCOUNT ID NOT SET");
|
||||
|
||||
if (isset($collected_from_date))
|
||||
if (!empty($collected_from_date))
|
||||
$conditions[]
|
||||
= array('ReceiptTransaction.stamp >=' =>
|
||||
$this->LedgerEntry->Transaction->dateFormatBeforeSave($collected_from_date));
|
||||
|
||||
if (isset($collected_through_date))
|
||||
if (!empty($collected_through_date))
|
||||
$conditions[]
|
||||
= array('ReceiptTransaction.stamp <=' =>
|
||||
$this->LedgerEntry->Transaction->dateFormatBeforeSave($collected_through_date . ' 23:59:59'));
|
||||
|
||||
Reference in New Issue
Block a user