Modified which columns are displayed for ledger entries
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@263 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -14,7 +14,7 @@ $cols['Debit Account'] = array('index' => 'DebitAccount.name', 'formatter' =>
|
||||
$cols['Credit Account'] = array('index' => 'CreditAccount.name', 'formatter' => 'name');
|
||||
|
||||
$cols['Customer'] = array('index' => 'Customer.name', 'formatter' => 'longname');
|
||||
//$cols['Lease'] = array('index' => 'Lease.number', 'formatter' => 'id');
|
||||
$cols['Lease'] = array('index' => 'Lease.number', 'formatter' => 'id');
|
||||
$cols['Unit'] = array('index' => 'Unit.name', 'formatter' => 'name');
|
||||
|
||||
$cols['Source'] = array('index' => 'MonetarySource.name', 'formatter' => 'name');
|
||||
@@ -28,60 +28,28 @@ $cols['Applied'] = array('index' => "Reconciliation.amount", 'formatter'
|
||||
$cols['Sub-Total'] = array('index' => 'subtotal', 'formatter' => 'currency', 'sortable' => false);
|
||||
|
||||
|
||||
if (isset($account_ftype) || isset($ledger_id) || isset($account_id) || isset($ar_account)) {
|
||||
$single_account = true;
|
||||
$double_account = false;
|
||||
} else {
|
||||
$single_account = false;
|
||||
$double_account = true;
|
||||
}
|
||||
|
||||
if (isset($no_account))
|
||||
$single_account = $double_account = false;
|
||||
|
||||
if (isset($ledger_id) || isset($account_id) || isset($ar_account)) {
|
||||
$single_amount = false;
|
||||
} else {
|
||||
$single_amount = true;
|
||||
}
|
||||
|
||||
if (isset($lease_id) || isset($customer_id)) {
|
||||
$references = false;
|
||||
} else {
|
||||
$references = true;
|
||||
}
|
||||
|
||||
if (isset($reconcile_id)) {
|
||||
$applied_amount = true;
|
||||
} else {
|
||||
$applied_amount = false;
|
||||
}
|
||||
|
||||
if (isset($account_ftype)) {
|
||||
$subtotal_amount = false;
|
||||
} else {
|
||||
$subtotal_amount = true;
|
||||
}
|
||||
|
||||
|
||||
if (!$single_account)
|
||||
if (isset($account_ftype) || isset($ledger_id) || isset($account_id) || isset($ar_account))
|
||||
$grid->invalidFields(array('Debit Account', 'Credit Account'));
|
||||
else
|
||||
$grid->invalidFields('Account');
|
||||
|
||||
if (!$double_account)
|
||||
$grid->invalidFields(array('Debit Account', 'Credit Account'));
|
||||
if (isset($no_account))
|
||||
$grid->invalidFields(array('Account', 'Debit Account', 'Credit Account'));
|
||||
|
||||
if (!$references)
|
||||
$grid->invalidFields(array('Customer', 'Lease', 'Unit'));
|
||||
|
||||
if ($single_amount)
|
||||
$grid->invalidFields(array('Debit', 'Credit'));
|
||||
else
|
||||
if (isset($ledger_id) || isset($account_id) || isset($ar_account))
|
||||
$grid->invalidFields('Amount');
|
||||
else
|
||||
$grid->invalidFields(array('Debit', 'Credit'));
|
||||
|
||||
if (!$applied_amount)
|
||||
if (isset($lease_id) || isset($customer_id))
|
||||
$grid->invalidFields(array('Customer', 'Lease', 'Unit'))
|
||||
// Invoice/Receipt accounts don't use effective/through
|
||||
->invalidFields(array('Effective', 'Through'));
|
||||
|
||||
if (!isset($reconcile_id))
|
||||
$grid->invalidFields('Applied');
|
||||
|
||||
if (!$subtotal_amount)
|
||||
if (isset($account_ftype))
|
||||
$grid->invalidFields('Sub-Total');
|
||||
|
||||
|
||||
@@ -107,5 +75,12 @@ $grid->customData(compact('ledger_id', 'account_id', 'ar_account',
|
||||
$grid
|
||||
->columns($cols)
|
||||
->sortField('Date')
|
||||
->defaultFields(array('Entry', 'Amount', 'Credit', 'Debit'))
|
||||
->render($this, isset($config) ? $config : null);
|
||||
->defaultFields(array('Entry', 'Date', 'Amount', 'Credit', 'Debit'))
|
||||
->render($this, isset($config) ? $config : null,
|
||||
array('Transaction', 'Entry', 'Date', 'Effective',
|
||||
'Account', 'Debit Account', 'Credit Account',
|
||||
'Customer', 'Unit',
|
||||
'Comment',
|
||||
'Amount', 'Debit', 'Credit',
|
||||
'Applied', 'Sub-Total')
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user