git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@322 97e9348a-65ac-dc4b-aefc-98561f571b83
59 lines
3.6 KiB
PHP
59 lines
3.6 KiB
PHP
<?php /* -*- mode:PHP -*- */
|
|
|
|
// Define the table columns
|
|
$cols = array();
|
|
|
|
$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['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');
|
|
$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['Amount'] = array('index' => 'LedgerEntry.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-applied', '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);
|