Experiment with converting the 'collected' grid results to be a query of the rent ledger entries that resolve out to payments, instead of payment entries that resolve rent entries. It's a subtle difference, but gives a couple benefits. First, rent looks like rent, meaning that if someone paid $30 in rent over 6 days at $5 per day, the collected rent entry shows $30, not 6 entries of $5. Depending on your perspective, that can be a good or bad thing. Since we're looking at collected entries of an account, I think each account entry should only get one line, so this seems like it's a logical fit. The second thing is that I might be able to do away with a collected page altogether, and simply add a 'collected' column to each account/ledger. Not sure on that, especially since we'll be wanting a date range, and probably a selection of which accounts consititute payment (such that the user could simply see rent collected in cash or similar). In any event, this is NOT working at the moment, I seem to be getting invalid data. To figure this out, I'm going to check in now, revert back, and print the results for reference, since it was working before this change, back at r320
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@322 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -3,18 +3,30 @@
|
||||
// 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['Transaction'] = array('index' => 'Transaction.id', 'formatter' => 'id');
|
||||
$cols['Entry'] = array('index' => 'LedgerEntry.id', 'formatter' => 'id');
|
||||
|
||||
$cols['Date'] = array('index' => 'Transaction.stamp', 'formatter' => 'date');
|
||||
$cols['Effective'] = array('index' => 'LedgerEntry.effective_date', 'formatter' => 'date');
|
||||
$cols['Through'] = array('index' => 'LedgerEntry.through_date', 'formatter' => 'date');
|
||||
//$cols['Account'] = array('index' => 'Account.name', 'formatter' => 'name');
|
||||
|
||||
$cols['Account'] = array('index' => 'DebitAccount.name', 'formatter' => 'name');
|
||||
/* $cols['RTransaction'] = array('index' => 'ReceiptTransaction.id', 'formatter' => 'id'); */
|
||||
/* $cols['REntry'] = array('index' => 'ReceiptLedgerEntry.id', 'formatter' => 'id'); */
|
||||
/* $cols['RDate'] = array('index' => 'ReceiptTransaction.stamp', 'formatter' => 'date'); */
|
||||
/* $cols['REffective'] = array('index' => 'ReceiptLedgerEntry.effective_date', 'formatter' => 'date'); */
|
||||
/* $cols['RThrough'] = array('index' => 'ReceiptLedgerEntry.through_date', 'formatter' => 'date'); */
|
||||
/* $cols['RAccount'] = array('index' => 'ReceiptAccount.name', 'formatter' => 'name'); */
|
||||
/* $cols['RAmount'] = array('index' => 'ReceiptLedgerEntry.amount', 'formatter' => 'currency'); */
|
||||
|
||||
/* $cols['MTransaction'] = array('index' => 'MoneyTransaction.id', 'formatter' => 'id'); */
|
||||
/* $cols['MEntry'] = array('index' => 'MoneyLedgerEntry.id', 'formatter' => 'id'); */
|
||||
/* $cols['MDate'] = array('index' => 'MoneyTransaction.stamp', 'formatter' => 'date'); */
|
||||
/* $cols['MEffective'] = array('index' => 'MoneyLedgerEntry.effective_date', 'formatter' => 'date'); */
|
||||
/* $cols['MThrough'] = array('index' => 'MoneyLedgerEntry.through_date', 'formatter' => 'date'); */
|
||||
/* $cols['MAccount'] = array('index' => 'MoneyAccount.name', 'formatter' => 'name'); */
|
||||
/* $cols['MAmount'] = array('index' => 'MoneyLedgerEntry.amount', 'formatter' => 'currency'); */
|
||||
|
||||
$cols['Paid'] = array('index' => 'ReceiptTransaction.stamp', 'formatter' => 'date');
|
||||
|
||||
$cols['Customer'] = array('index' => 'Customer.name', 'formatter' => 'longname');
|
||||
//$cols['Lease'] = array('index' => 'Lease.number', 'formatter' => 'id');
|
||||
@@ -23,11 +35,12 @@ $cols['Unit'] = array('index' => 'Unit.name', 'formatter' =>
|
||||
//$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['RAmount'] = array('index' => 'ReceiptLedgerEntry.amount', 'formatter' => 'currency'); */
|
||||
/* $cols['MAmount'] = array('index' => 'MoneyLedgerEntry.amount', 'formatter' => 'currency'); */
|
||||
$cols['Applied'] = array('index' => 'applied', 'formatter' => 'currency');
|
||||
|
||||
$cols['Sub-Total'] = array('index' => 'subtotal', 'formatter' => 'currency', 'sortable' => false);
|
||||
$cols['Sub-Total'] = array('index' => 'subtotal-applied', 'formatter' => 'currency', 'sortable' => false);
|
||||
|
||||
// This element is non-standard.
|
||||
// Let grid know who the controller is
|
||||
@@ -41,5 +54,5 @@ $grid->customData(compact('collected_account_id', 'collected_not'));
|
||||
$grid
|
||||
->limit(500)
|
||||
->columns($cols)
|
||||
->sortField('Date')
|
||||
//->sortField('Date')
|
||||
->render($this, isset($config) ? $config : null);
|
||||
|
||||
Reference in New Issue
Block a user