Another snapshot
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@356 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -63,7 +63,7 @@ if ($group_by_tx)
|
||||
if (!isset($collected_account_id))
|
||||
$grid->invalidFields('Last Payment');
|
||||
|
||||
if (isset($account_ftype) || isset($ledger_id) || isset($account_id) || isset($ar_account))
|
||||
if (isset($account_ftype) || isset($ledger_id) || isset($account_id) || isset($ar_account) || isset($customer_id))
|
||||
$grid->invalidFields(array('Debit Account', 'Credit Account'));
|
||||
else
|
||||
$grid->invalidFields('Account');
|
||||
@@ -71,7 +71,7 @@ else
|
||||
if (isset($no_account) || $group_by_tx || isset($collected_account_id))
|
||||
$grid->invalidFields(array('Account', 'Debit Account', 'Credit Account'));
|
||||
|
||||
if (isset($ledger_id) || isset($account_id) || isset($ar_account)) {
|
||||
if (isset($ledger_id) || isset($account_id) || isset($ar_account) || isset($customer_id)) {
|
||||
$grid->invalidFields('Amount');
|
||||
$cols['Sub-Total']['index'] = 'subtotal-balance';
|
||||
} else {
|
||||
|
||||
@@ -9,6 +9,8 @@ $cols['Date'] = array('index' => 'Transaction.stamp', 'formatter' =>
|
||||
$cols['Effective'] = array('index' => 'DoubleEntry.effective_date', 'formatter' => 'date');
|
||||
$cols['Through'] = array('index' => 'Entry.through_date', 'formatter' => 'date');
|
||||
|
||||
$cols['Debit Account'] = array('index' => 'DebitAccount.name', 'formatter' => 'name');
|
||||
$cols['Credit Account'] = array('index' => 'CreditAccount.name', 'formatter' => 'name');
|
||||
$cols['Account'] = array('index' => 'Account.name', 'formatter' => 'name');
|
||||
$cols['Cr/Dr'] = array('index' => 'Entry.crdr', 'formatter' => 'name');
|
||||
|
||||
@@ -19,6 +21,8 @@ $cols['Unit'] = array('index' => 'Unit.name', 'formatter' =>
|
||||
$cols['Source'] = array('index' => 'Entry.name', 'formatter' => 'name');
|
||||
$cols['Comment'] = array('index' => 'Entry.comment', 'formatter' => 'comment', 'width'=>150);
|
||||
|
||||
$cols['Debit'] = array('index' => 'debit', 'formatter' => 'currency');
|
||||
$cols['Credit'] = array('index' => 'credit', 'formatter' => 'currency');
|
||||
$cols['Amount'] = array('index' => 'DoubleEntry.amount', 'formatter' => 'currency');
|
||||
|
||||
$cols['Last Payment'] = array('index' => 'last_paid', 'formatter' => 'date');
|
||||
@@ -26,49 +30,24 @@ $cols['Applied'] = array('index' => "applied", 'formatter' =>
|
||||
$cols['Sub-Total'] = array('index' => 'subtotal-DoubleEntry.amount', 'formatter' => 'currency', 'sortable' => false);
|
||||
|
||||
|
||||
// Since group_by_tx is a boolean, let's just get it
|
||||
// defined, regardless of whether the caller did so.
|
||||
// group_by_tx will cause all entry fields to be
|
||||
// invalidated, and will leave only the transaction
|
||||
// fields. Yes... the caller should just use the
|
||||
// transactions element instead, in theory. However,
|
||||
// it hasn't yet been implemented to the level of
|
||||
// this element, and additionally, the transactions
|
||||
// element will not allow for customer information
|
||||
// (rightly so, since it's a ledger_entry field).
|
||||
// However, at the current implementation, all ledger
|
||||
// entries of a transaction are for the same customer.
|
||||
// So... we allow it for now.
|
||||
if (!isset($group_by_tx))
|
||||
$group_by_tx = false;
|
||||
|
||||
// REVISIT <AP>: 20090715
|
||||
// If we really want to group by transaction, we need
|
||||
// a transaction listing, not a ledger_entry listing.
|
||||
// switch controllers... don't overload this one.
|
||||
$group_by_tx = false;
|
||||
|
||||
if (isset($transaction_id) || isset($reconcile_id))
|
||||
$grid->invalidFields('Transaction');
|
||||
|
||||
if ($group_by_tx)
|
||||
$grid->invalidFields('Entry');
|
||||
|
||||
if ($group_by_tx)
|
||||
$grid->invalidFields(array('Effective', 'Through'));
|
||||
|
||||
if (!isset($collected_account_id))
|
||||
$grid->invalidFields('Last Payment');
|
||||
|
||||
if (isset($account_ftype) || isset($ledger_id) || isset($account_id) || isset($ar_account))
|
||||
if (isset($account_ftype) || isset($ar_account) || isset($customer_id) || isset($lease_id))
|
||||
$grid->invalidFields(array('Debit Account', 'Credit Account'));
|
||||
else
|
||||
$grid->invalidFields('Account');
|
||||
$grid->invalidFields(array('Account', 'Cr/Dr'));
|
||||
|
||||
if (isset($no_account) || $group_by_tx || isset($collected_account_id))
|
||||
$grid->invalidFields(array('Account', 'Debit Account', 'Credit Account'));
|
||||
if (isset($customer_id) || isset($lease_id))
|
||||
$grid->invalidFields(array('Cr/Dr'));
|
||||
|
||||
if (isset($ledger_id) || isset($account_id) || isset($ar_account)) {
|
||||
if (isset($no_account) || isset($ledger_id) || isset($account_id) || isset($collected_account_id))
|
||||
$grid->invalidFields(array('Account', 'Cr/Dr', 'Debit Account', 'Credit Account'));
|
||||
|
||||
if (isset($ledger_id) || isset($account_id) || isset($ar_account) || isset($customer_id) || isset($lease_id)) {
|
||||
$grid->invalidFields('Amount');
|
||||
$cols['Sub-Total']['index'] = 'subtotal-balance';
|
||||
} else {
|
||||
@@ -76,12 +55,10 @@ if (isset($ledger_id) || isset($account_id) || isset($ar_account)) {
|
||||
$cols['Sub-Total']['index'] = 'subtotal-DoubleEntry.amount';
|
||||
}
|
||||
|
||||
// group_by_tx SHOULD wipe out Customer, but the reality
|
||||
// is that it works good at the present, so we'll leave it.
|
||||
if (isset($lease_id) || isset($customer_id))
|
||||
$grid->invalidFields(array('Customer'));
|
||||
|
||||
if (isset($lease_id) || $group_by_tx)
|
||||
if (isset($lease_id))
|
||||
$grid->invalidFields(array('Lease', 'Unit'));
|
||||
|
||||
if (!isset($reconcile_id) && !isset($collected_account_id))
|
||||
@@ -127,17 +104,18 @@ if (isset($searchfields))
|
||||
$grid->searchFields(array('Customer', 'Unit'));
|
||||
|
||||
// Include custom data
|
||||
$grid->customData(compact('ledger_id', 'account_id', 'ar_account',
|
||||
$grid->customData(compact('ledger_id', 'account_id', 'ar_account', 'entry_type',
|
||||
'account_type', 'account_ftype', 'monetary_source_id',
|
||||
'customer_id', 'lease_id', 'transaction_id', 'group_by_tx'));
|
||||
'customer_id', 'lease_id', 'transaction_id'));
|
||||
|
||||
// Render the grid
|
||||
$grid
|
||||
->render($this, isset($config) ? $config : null,
|
||||
array('Transaction', 'Entry', 'Date', 'Effective', 'Last Payment',
|
||||
'Account', 'Cr/Dr',
|
||||
'Debit Account', 'Credit Account', 'Account', 'Cr/Dr',
|
||||
'Customer', 'Unit',
|
||||
'Comment',
|
||||
'Amount',
|
||||
'Debit', 'Credit', 'Amount',
|
||||
'Applied', 'Sub-Total')
|
||||
);
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@ $cols['Comment'] = array('index' => 'Lease.comment', 'formatter' => 'com
|
||||
if (isset($searchfields))
|
||||
$grid->searchFields(array('Customer', 'Unit'));
|
||||
|
||||
if (isset($no_customer))
|
||||
$grid->invalidFields('Customer');
|
||||
|
||||
// Render the grid
|
||||
$grid
|
||||
->columns($cols)
|
||||
|
||||
Reference in New Issue
Block a user