A working version of the collected report for accounts. There is still some error checking to do, since we don't want this report for just any account. Also, we may wish to do away with the form to prevent accidental submittal. Finally, it would be nice to do away with the button, and automatically update on date changes.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@324 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -16,22 +16,6 @@ class LedgerEntriesController extends AppController {
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
* action: index / etc
|
||||
* - Generate a listing of ledger_entries
|
||||
*/
|
||||
|
||||
function collected($account_id) {
|
||||
$A = new Account();
|
||||
$this->set('collected_account_id', $account_id);
|
||||
$this->jqGridView('Collected ' .
|
||||
$this->LedgerEntry->Ledger->Account->name($account_id) .
|
||||
' Entries');
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
@@ -214,22 +198,27 @@ class LedgerEntriesController extends AppController {
|
||||
$conditions = parent::jqGridDataConditions($params, $model);
|
||||
|
||||
if ($params['action'] === 'collected') {
|
||||
$conditions[] = array('Account.id' => $params['custom']['collected_account_id']);
|
||||
//$conditions[] = array('DebitAccount.tillable' => 1);
|
||||
//$conditions[] = array('ReceiptLedgerEntry.amount != LedgerEntry.amount');
|
||||
//$conditions[] = array('Reconciliation.amount < ReceiptLedgerEntry.amount');
|
||||
$conditions[] = array('MoneyAccount.payable' => 1);
|
||||
$conditions[] = array('NOT' => array('MoneyAccount.name' => 'Concession'));
|
||||
//$conditions[] = array('DA.name' => 'Check');
|
||||
//$conditions[] = array('DA.name' => 'Cash');
|
||||
//$conditions[] = array('ReceiptTransaction.stamp >=' => '2009-03-26');
|
||||
//$conditions[] = array('ReceiptTransaction.stamp <' => '2009-04-11');
|
||||
//$conditions[] = array('ReceiptTransaction.stamp >=' => '2009-04-11');
|
||||
//$conditions[] = array('ReceiptTransaction.stamp <' => '2009-05-09');
|
||||
//$conditions[] = array('ReceiptTransaction.stamp >=' => '2009-05-09');
|
||||
//$conditions[] = array('ReceiptTransaction.stamp <' => '2009-06-11');
|
||||
$conditions[] = array('ReceiptTransaction.stamp >=' => '2009-06-11');
|
||||
$conditions[] = array('ReceiptTransaction.stamp <' => '2009-07-11');
|
||||
extract($params['custom']);
|
||||
|
||||
if (isset($collected_account_id))
|
||||
$conditions[] = array('Account.id' => $params['custom']['collected_account_id']);
|
||||
else
|
||||
die("INTERNAL ERROR: COLLECTED ACCOUNT ID NOT SET");
|
||||
|
||||
if (isset($collected_from_date))
|
||||
$conditions[]
|
||||
= array('ReceiptTransaction.stamp >=' =>
|
||||
$this->LedgerEntry->Transaction->dateFormatBeforeSave($collected_from_date));
|
||||
|
||||
if (isset($collected_through_date))
|
||||
$conditions[]
|
||||
= array('ReceiptTransaction.stamp <=' =>
|
||||
$this->LedgerEntry->Transaction->dateFormatBeforeSave($collected_through_date . ' 23:59:59'));
|
||||
|
||||
if (isset($collected_payment_accounts))
|
||||
$conditions[] = array('MoneyAccount.id' => $collected_payment_accounts);
|
||||
else
|
||||
$conditions[] = array('MoneyAccount.payable' => 1);
|
||||
}
|
||||
|
||||
if ($params['action'] === 'ledger') {
|
||||
|
||||
Reference in New Issue
Block a user