Implemented a list that checks for collected rents. There is AccountsController::collected, which I'm keeping at the moment, but I decided to move the logic into ledger_entries, since ultimately that's what we want a list of and it doesn't make sense to add a bunch of LedgerEntry logic into the jqGrid query of AccountsController. Of course, right now there is hardcoded calendar functions, and hardcoded exclusion of the Concession Account. I will probably offer up two calendars to provide a range, and a list of checkboxes of each payable account.

git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@318 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-12 18:01:01 +00:00
parent 14ab0975ac
commit 46417de2b8
4 changed files with 196 additions and 3 deletions

View File

@@ -0,0 +1,45 @@
<?php /* -*- mode:PHP -*- */
// Define the table columns
$cols = array();
$cols['REntry'] = array('index' => 'RLedgerEntry.id', 'formatter' => 'id');
$cols['RDate'] = array('index' => 'RTransaction.stamp', 'formatter' => 'date');
$cols['REffective'] = array('index' => 'RLedgerEntry.effective_date', 'formatter' => 'date');
$cols['RThrough'] = array('index' => 'RLedgerEntry.through_date', 'formatter' => 'date');
$cols['RAccount'] = array('index' => 'RAccount.name', 'formatter' => 'name');
//$cols['Transaction'] = array('index' => 'Transaction.id', 'formatter' => 'id');
$cols['Entry'] = array('index' => 'LedgerEntry.id', 'formatter' => 'id');
$cols['Date'] = array('index' => 'Transaction.stamp', 'formatter' => 'date');
$cols['Account'] = array('index' => 'DebitAccount.name', 'formatter' => 'name');
$cols['Customer'] = array('index' => 'Customer.name', 'formatter' => 'longname');
//$cols['Lease'] = array('index' => 'Lease.number', 'formatter' => 'id');
$cols['Unit'] = array('index' => 'Unit.name', 'formatter' => 'name');
//$cols['Source'] = array('index' => 'MonetarySource.name', 'formatter' => 'name');
//$cols['Comment'] = array('index' => 'LedgerEntry.comment', 'formatter' => 'comment', 'width'=>150);
$cols['RAmount'] = array('index' => 'RLedgerEntry.amount', 'formatter' => 'currency');
$cols['Amount'] = array('index' => 'LedgerEntry.amount', 'formatter' => 'currency');
$cols['Applied'] = array('index' => 'Reconciliation.amount', 'formatter' => 'currency');
$cols['Sub-Total'] = array('index' => 'subtotal', 'formatter' => 'currency', 'sortable' => false);
// This element is non-standard.
// Let grid know who the controller is
$grid->controller = 'ledger_entries';
$collected_account_id = $this->passedArgs[0];
$collected_not = (isset($this->passedArgs[1]) ? $this->passedArgs[1] : 0);
$grid->customData(compact('collected_account_id', 'collected_not'));
// Render the grid
$grid
->limit(500)
->columns($cols)
->sortField('Date')
->render($this, isset($config) ? $config : null);