Moved all grid elements onto the grid helper. Basic testing done, but more testing needs to be done.

git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@262 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-08 20:40:44 +00:00
parent a88f5829ce
commit 4d123b63f0
22 changed files with 327 additions and 321 deletions

View File

@@ -48,13 +48,19 @@ foreach ($tillableAccount AS $acct) {
echo "\n"; echo "\n";
$grid_div_id = 'ledger_entries'.$acct['CurrentLedger']['id'].'-list'; $grid_div_id = 'ledger_entries'.$acct['CurrentLedger']['id'].'-list';
echo $this->element('ledger_entries', echo $this->element('ledger_entries', array
array('grid_div_id' => $grid_div_id, (// Element configuration
'caption' => ('<A HREF="#" ONCLICK="$(\'#'.$grid_div_id.' .HeaderButton\').click();'.
' return false;">Items in '.$acct['Account']['name'].' Ledger</A>'),
'ledger_id' => $acct['CurrentLedger']['id'], 'ledger_id' => $acct['CurrentLedger']['id'],
'no_account' => true, 'no_account' => true,
// Grid configuration
'config' => array
(
'grid_div_id' => $grid_div_id,
'caption' => ('<A HREF="#" ONCLICK="$(\'#'.$grid_div_id.' .HeaderButton\').click();'.
' return false;">Items in '.$acct['Account']['name'].' Ledger</A>'),
'grid_setup' => $grid_setup, 'grid_setup' => $grid_setup,
),
)); ));
} }

View File

@@ -55,19 +55,31 @@ echo '<div CLASS="detail supporting">' . "\n";
* Ledgers * Ledgers
*/ */
echo $this->element('ledgers', echo $this->element('ledgers', array
array('caption' => $account['Account']['name'] . " Ledgers", ('config' => array
'ledgers' => $account['Ledger'])); ('caption' => $account['Account']['name'] . " Ledgers",
'rows' => $account['Ledger'],
)));
/********************************************************************** /**********************************************************************
* Current Ledger * Current Ledger
*/ */
echo $this->element('ledger_entries', echo $this->element('ledger_entries', array
array('caption' => "Current Ledger: (#{$account['Account']['id']}-{$account['CurrentLedger']['sequence']})", (// Element configuration
'ledger_id' => $account['CurrentLedger']['id'], 'ledger_id' => $account['CurrentLedger']['id'],
'account_type' => $account['Account']['type'], 'account_type' => $account['Account']['type'],
// Grid configuration
'config' => array
('caption' =>
"Current Ledger: (" .
"#{$account['Account']['id']}" .
"-" .
"{$account['CurrentLedger']['sequence']}" .
")",
),
)); ));
/* End "detail supporting" div */ /* End "detail supporting" div */

View File

@@ -121,9 +121,12 @@ echo $this->element('table',
/********************************************************************** /**********************************************************************
* Customers * Customers
*/ */
echo $this->element('customers', array('heading' => '',
'caption' => 'Related Customers', echo $this->element('customers', array
'customers' => $contact['Customer'])); ('config' => array
('caption' => 'Related Customers',
'rows' => $contact['Customer'],
)));
/* End "detail supporting" div */ /* End "detail supporting" div */

View File

@@ -323,15 +323,16 @@ function updateCharges(id) {
; // align ; // align
//echo '<DIV ID="dialog">' . "\n"; //echo '<DIV ID="dialog">' . "\n";
echo $this->element('customers', echo $this->element('customers', array
array('grid_div_id' => 'customers-list', ('config' => array
('grid_div_id' => 'customers-list',
'grid_div_class' => 'text-below', 'grid_div_class' => 'text-below',
'caption' => ('<A HREF="#" ONCLICK="$(\'#customers-list .HeaderButton\').click();'. 'caption' => ('<A HREF="#" ONCLICK="$(\'#customers-list .HeaderButton\').click();'.
' return false;">Select Customer</A>'), ' return false;">Select Customer</A>'),
'grid_setup' => $grid_setup, 'grid_setup' => $grid_setup,
'nolinks' => true, 'nolinks' => true,
'limit' => 10, 'limit' => 10,
)); )));
echo ('<H2>' . echo ('<H2>' .
'<SPAN id="current-customer" style="display:none">' . '<SPAN id="current-customer" style="display:none">' .
@@ -343,12 +344,18 @@ echo ('<H2>' .
'</SPAN>' . '</SPAN>' .
'</H2>' . "\n"); '</H2>' . "\n");
echo $this->element('ledger_entries', echo $this->element('ledger_entries', array
array('grid_div_id' => 'charge-entries', (// Element configuration
'caption' => 'Outstanding Charges',
'account_ftype' => 'credit', 'account_ftype' => 'credit',
'ledger_entries' => $charges['entry'],
'limit' => 8, 'limit' => 8,
// Grid configuration
'config' => array
(
'grid_div_id' => 'charge-entries',
'caption' => 'Outstanding Charges',
'rows' => $charges['entry'],
),
)); ));
echo $form->create(null, array('id' => 'receipt-form', echo $form->create(null, array('id' => 'receipt-form',

View File

@@ -49,19 +49,22 @@ echo '<div CLASS="detail supporting">' . "\n";
/********************************************************************** /**********************************************************************
* Contacts * Contacts
*/ */
echo $this->element('contacts',
array('caption' => 'Customer Contacts', echo $this->element('contacts', array
'contacts' => $customer['Contact'])); ('config' => array
('caption' => 'Customer Contacts',
'rows' => $customer['Contact'],
)));
/********************************************************************** /**********************************************************************
* Lease History * Lease History
*/ */
echo $this->element('leases', array echo $this->element('leases', array
('config' => array ('config' => array
('caption' => 'Lease History', ('caption' => 'Lease History',
'rows' => $customer['Lease'], 'rows' => $customer['Lease'],
'limit' => 5,
))); )));
@@ -69,10 +72,15 @@ echo $this->element('leases', array
* Customer Account History * Customer Account History
*/ */
echo $this->element('ledger_entries', echo $this->element('ledger_entries', array
array('caption' => 'Account', (// Element configuration
'customer_id' => $customer['Customer']['id'], 'customer_id' => $customer['Customer']['id'],
'ar_account' => true, 'ar_account' => true,
// Grid configuration
'config' => array
('caption' => 'Account',
),
)); ));

View File

@@ -11,26 +11,13 @@ $cols['Credits'] = array('index' => 'credits', 'formatter' => 'currenc
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency'); $cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
$cols['Comment'] = array('index' => 'Account.comment', 'formatter' => 'comment'); $cols['Comment'] = array('index' => 'Account.comment', 'formatter' => 'comment');
$custom_post_data = compact('nothing'); // Set up search fields if requested by caller
if (isset($searchfields))
$grid->searchFields(array('Name'));
$jqGrid_options = array('jqGridColumns' => $cols, // Render the grid
'controller' => 'accounts', $grid
); ->columns($cols)
->sortField('Name')
$jqGrid_options += compact('grid_div_id', 'grid_id', 'caption', 'grid_setup', 'limit'); ->defaultFields(array('ID', 'Name'))
->render($this, isset($config) ? $config : null);
if (isset($accounts)) {
$jqGrid_options += array('custom_ids' =>
array_map(create_function('$data',
'return $data["id"];'),
$accounts),
'limit' => 5);
}
else {
$jqGrid_options += array('search_fields' => array('Name'));
}
$jqGrid_options += compact('custom_post_data');
$jqGrid_options['sort_column'] = 'Name';
echo $this->element('jqGrid', $jqGrid_options);

View File

@@ -12,19 +12,13 @@ if (0) { // REVISIT<AP>: Need to figure out how to put this in play
} }
$cols['Comment'] = array('index' => 'Contact.comment', 'formatter' => 'comment'); $cols['Comment'] = array('index' => 'Contact.comment', 'formatter' => 'comment');
$jqGrid_options = array('jqGridColumns' => $cols, // Set up search fields if requested by caller
'controller' => 'contacts', if (isset($searchfields))
'caption' => isset($caption) ? $caption : null); $grid->searchFields(array('Last Name', 'First Name'));
if (isset($contacts)) { // Render the grid
$jqGrid_options += array('custom_ids' => $grid
array_map(create_function('$data', ->columns($cols)
'return $data["id"];'), ->sortField('Last Name')
$contacts), ->defaultFields(array('ID', 'Last Name', 'First Name'))
'limit' => 5); ->render($this, isset($config) ? $config : null);
}
else {
$jqGrid_options += array('search_fields' => array('Last Name', 'First Name'));
}
echo $this->element('jqGrid', $jqGrid_options);

View File

@@ -12,24 +12,13 @@ $cols['Leases'] = array('index' => 'lease_count', 'width' =>
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency'); $cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
$cols['Comment'] = array('index' => 'Customer.comment', 'formatter' => 'comment'); $cols['Comment'] = array('index' => 'Customer.comment', 'formatter' => 'comment');
$custom_post_data = compact('nothing'); // Set up search fields if requested by caller
$jqGrid_options = array('jqGridColumns' => $cols, if (isset($searchfields))
'controller' => 'customers'); $grid->searchFields(array('Last Name', 'First Name'));
$jqGrid_options += compact('action', 'caption',
'grid_div_id', 'grid_div_class', 'grid_id', 'grid_setup',
'nolinks', 'limit');
if (isset($customers)) { // Render the grid
$jqGrid_options += array('custom_ids' => $grid
array_map(create_function('$data', ->columns($cols)
'return $data["id"];'), ->sortField('Name')
$customers), ->defaultFields(array('ID', 'Name'))
'limit' => 5); ->render($this, isset($config) ? $config : null);
}
// Not the long term solution here... just for testing
if (isset($searchfields)) {
$jqGrid_options += array('search_fields' => array('Last Name', 'First Name'));
}
echo $this->element('jqGrid', $jqGrid_options);

View File

@@ -1,5 +1,33 @@
<?php /* -*- mode: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['Debit Account'] = array('index' => 'DebitAccount.name', 'formatter' => 'name');
$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['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['Debit'] = array('index' => 'debit', 'formatter' => 'currency');
$cols['Credit'] = array('index' => 'credit', 'formatter' => 'currency');
$cols['Applied'] = array('index' => "Reconciliation.amount", 'formatter' => 'currency');
$cols['Sub-Total'] = array('index' => 'subtotal', 'formatter' => 'currency', 'sortable' => false);
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)) {
$single_account = true; $single_account = true;
$double_account = false; $double_account = false;
@@ -36,85 +64,48 @@ if (isset($account_ftype)) {
} }
// Define the table columns if (!$single_account)
$cols = array(); $grid->invalidFields('Account');
if (0) {
if (isset($notxgroup)) if (!$double_account)
$cols['Entry'] = array('index' => 'LedgerEntry.id', 'formatter' => 'id'); $grid->invalidFields(array('Debit Account', 'Credit Account'));
if (!$references)
$grid->invalidFields(array('Customer', 'Lease', 'Unit'));
if ($single_amount)
$grid->invalidFields(array('Debit', 'Credit'));
else else
$cols['Transaction'] = array('index' => 'Transaction.id', 'formatter' => 'id'); $grid->invalidFields('Amount');
} else {
$notxgroup = false;
$cols['Transaction'] = array('index' => 'Transaction.id', 'formatter' => 'id');
$cols['Entry'] = array('index' => 'LedgerEntry.id', 'formatter' => 'id');
}
$cols['Date'] = array('index' => 'Transaction.stamp', 'formatter' => 'date'); if (!$applied_amount)
$cols['Effective'] = array('index' => 'LedgerEntry.effective_date', 'formatter' => 'date'); $grid->invalidFields('Applied');
$cols['Through'] = array('index' => 'LedgerEntry.through_date', 'formatter' => 'date');
if ($single_account) { if (!$subtotal_amount)
$cols['Account'] = array('index' => 'Account.name', 'formatter' => 'name'); $grid->invalidFields('Sub-Total');
}
if ($double_account) {
$cols['Debit Account'] = array('index' => 'DebitAccount.name', 'formatter' => 'name');
$cols['Credit Account'] = array('index' => 'CreditAccount.name', 'formatter' => 'name');
}
if ($references) { if (!isset($config['rows'])) {
$cols['Customer'] = array('index' => 'Customer.name', 'formatter' => 'longname'); $config['action'] = 'ledger';
//$cols['Lease'] = array('index' => 'Lease.number', 'formatter' => 'id'); $grid->limit(50);
$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);
if ($single_amount) {
$cols['Amount'] = array('index' => 'LedgerEntry.amount', 'formatter' => 'currency');
}
else {
$cols['Debit'] = array('index' => 'debit', 'formatter' => 'currency');
$cols['Credit'] = array('index' => 'credit', 'formatter' => 'currency');
}
if ($applied_amount) {
$cols['Applied'] = array('index' => "Reconciliation.amount", 'formatter' => 'currency');
}
if ($subtotal_amount) {
$cols['Sub-Total'] = array('index' => 'subtotal', 'formatter' => 'currency', 'sortable' => false);
}
$custom_post_data = compact('ledger_id', 'account_id', 'ar_account',
'account_type', 'account_ftype',
'customer_id', 'lease_id', 'transaction_id', 'notxgroup');
$jqGrid_options = array('jqGridColumns' => $cols,
'controller' => 'ledger_entries',
);
$jqGrid_options += compact('grid_div_id', 'grid_id', 'caption', 'grid_setup', 'limit');
if (isset($ledger_entries)) {
$jqGrid_options += array('custom_ids' =>
array_map(create_function('$data',
'return $data["id"];'),
$ledger_entries),
'limit' => 10);
}
else {
$jqGrid_options += array('action' => 'ledger',
'limit' => 50);
} }
if (isset($reconcile_id)) { if (isset($reconcile_id)) {
$custom_post_data += compact('reconcile_id'); $grid->customData(compact('reconcile_id'))->limit(5);
$jqGrid_options += array('limit' => 5);
} }
$jqGrid_options += compact('custom_post_data'); // Set up search fields if requested by caller
$jqGrid_options['sort_column'] = 'Date'; if (isset($searchfields))
echo $this->element('jqGrid', $jqGrid_options); $grid->searchFields(array('Customer', 'Unit'));
// Include custom data
$grid->customData(compact('ledger_id', 'account_id', 'ar_account',
'account_type', 'account_ftype',
'customer_id', 'lease_id', 'transaction_id', 'notxgroup'));
// Render the grid
$grid
->columns($cols)
->sortField('Date')
->defaultFields(array('Entry', 'Amount', 'Credit', 'Debit'))
->render($this, isset($config) ? $config : null);

View File

@@ -12,25 +12,13 @@ $cols['Debits'] = array('index' => 'debits', 'formatter' => 'c
$cols['Credits'] = array('index' => 'credits', 'formatter' => 'currency'); $cols['Credits'] = array('index' => 'credits', 'formatter' => 'currency');
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency'); $cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
$custom_post_data = compact('nothing'); // Set up search fields if requested by caller
$jqGrid_options = array('jqGridColumns' => $cols, if (isset($searchfields))
'controller' => 'ledgers', $grid->searchFields(array('Account', 'Comment'));
);
$jqGrid_options += compact('grid_div_id', 'grid_id', 'caption', 'grid_setup', 'limit');
// Render the grid
if (isset($ledgers)) { $grid
$jqGrid_options += array('custom_ids' => ->columns($cols)
array_map(create_function('$data', ->sortField('ID', 'DESC')
'return $data["id"];'), ->defaultFields(array('ID', 'Account'))
$ledgers), ->render($this, isset($config) ? $config : null);
'limit' => 5);
}
else {
$jqGrid_options += array('search_fields' => array('Account'));
}
$jqGrid_options += compact('custom_post_data');
$jqGrid_options['sort_column'] = 'ID';
$jqGrid_options['sort_order'] = 'DESC';
echo $this->element('jqGrid', $jqGrid_options);

View File

@@ -9,16 +9,13 @@ $cols['Width'] = array('index' => 'Map.width', 'width' => '50', 'align
$cols['Depth'] = array('index' => 'Map.depth', 'width' => '50', 'align' => 'right'); $cols['Depth'] = array('index' => 'Map.depth', 'width' => '50', 'align' => 'right');
$cols['Comment'] = array('index' => 'Map.comment', 'formatter' => 'comment'); $cols['Comment'] = array('index' => 'Map.comment', 'formatter' => 'comment');
$jqGrid_options = array('jqGridColumns' => $cols, // Set up search fields if requested by caller
'controller' => 'maps', if (isset($searchfields))
'caption' => isset($caption) ? $caption : null); $grid->searchFields(array('Name'));
if (isset($maps)) { // Render the grid
$jqGrid_options += array('custom_ids' => $grid
array_map(create_function('$data', ->columns($cols)
'return $data["id"];'), ->sortField('Name')
$maps), ->defaultFields(array('ID', 'Name'))
'limit' => 5); ->render($this, isset($config) ? $config : null);
}
echo $this->element('jqGrid', $jqGrid_options);

View File

@@ -7,16 +7,13 @@ $cols['Name'] = array('index' => 'MonetarySource.name', 'formatter'
$cols['Type'] = array('index' => 'MonetaryType.name', 'formatter' => 'name'); $cols['Type'] = array('index' => 'MonetaryType.name', 'formatter' => 'name');
$cols['Comment'] = array('index' => 'MonetarySource.comment', 'formatter' => 'comment'); $cols['Comment'] = array('index' => 'MonetarySource.comment', 'formatter' => 'comment');
$jqGrid_options = array('jqGridColumns' => $cols, // Set up search fields if requested by caller
'controller' => 'monetary_sources', if (isset($searchfields))
'caption' => isset($caption) ? $caption : null); $grid->searchFields(array('ID', 'Name'));
if (isset($monetary_sources)) { // Render the grid
$jqGrid_options += array('custom_ids' => $grid
array_map(create_function('$data', ->columns($cols)
'return $data["id"];'), ->sortField('ID')
$monetary_sources), ->defaultFields(array('ID', 'Name'))
'limit' => 5); ->render($this, isset($config) ? $config : null);
}
echo $this->element('jqGrid', $jqGrid_options);

View File

@@ -8,19 +8,13 @@ $cols['Timestamp'] = array('index' => 'Transaction.stamp', 'formatter' =
$cols['Due'] = array('index' => 'Transaction.due_date', 'formatter' => 'date'); $cols['Due'] = array('index' => 'Transaction.due_date', 'formatter' => 'date');
$cols['Comment'] = array('index' => 'Transaction.comment', 'formatter' => 'comment'); $cols['Comment'] = array('index' => 'Transaction.comment', 'formatter' => 'comment');
$jqGrid_options = array('jqGridColumns' => $cols, // Set up search fields if requested by caller
'controller' => 'transactions', if (isset($searchfields))
'caption' => isset($caption) ? $caption : null); $grid->searchFields(array('Due', 'Comment'));
if (isset($transactions)) { // Render the grid
$jqGrid_options += array('custom_ids' => $grid
array_map(create_function('$data', ->columns($cols)
'return $data["id"];'), ->sortField('ID')
$transactions), ->defaultFields(array('ID', 'Timestamp'))
'limit' => 5); ->render($this, isset($config) ? $config : null);
}
else {
$jqGrid_options += array('search_fields' => array('Due', 'Comment'));
}
echo $this->element('jqGrid', $jqGrid_options);

View File

@@ -12,27 +12,13 @@ $cols['Status'] = array('index' => 'Unit.status', 'width' => '75');
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency'); $cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
$cols['Comment'] = array('index' => 'Unit.comment', 'formatter' => 'comment'); $cols['Comment'] = array('index' => 'Unit.comment', 'formatter' => 'comment');
// Set up search fields if requested by caller
if (isset($searchfields))
$grid->searchFields(array('Unit', 'Size', 'Status'));
$custom_post_data = compact('nothing'); // Render the grid
$jqGrid_options = array('jqGridColumns' => $cols, $grid
'controller' => 'units'); ->columns($cols)
$jqGrid_options += compact('action', 'caption', ->sortField('Sort')
'grid_div_id', 'grid_div_class', 'grid_id', 'grid_setup', ->defaultFields(array('Sort', 'ID', 'Unit'))
'nolinks', 'limit'); ->render($this, isset($config) ? $config : null);
if (isset($units)) {
$jqGrid_options += array('custom_ids' =>
array_map(create_function('$data',
'return $data["id"];'),
$units),
'limit' => 5);
}
if (isset($searchfields)) {
$jqGrid_options += array('search_fields' => array('Unit', 'Size', 'Status'));
}
$jqGrid_options += compact('custom_post_data');
$jqGrid_options['sort_column'] = 'Sort';
echo $this->element('jqGrid', $jqGrid_options);

View File

@@ -13,7 +13,10 @@ class GridHelper extends AppHelper {
function reset() { function reset() {
$this->jqGrid_options $this->jqGrid_options
= array('limit' => 20); = array('limit' => 20,
'search_fields' => array(),
'custom_post_data' => array(),
);
$this->columns = array(); $this->columns = array();
$this->included = array(); $this->included = array();
@@ -71,8 +74,10 @@ class GridHelper extends AppHelper {
return $this; return $this;
} }
function sortField($field) { function sortField($field, $order = null) {
$this->jqGrid_options['sort_column'] = $field; $this->jqGrid_options['sort_column'] = $field;
if ($order)
$this->jqGrid_options['sort_order'] = $order;
return $this; return $this;
} }
@@ -149,6 +154,12 @@ class GridHelper extends AppHelper {
elseif (is_bool($excluded) && !$excluded) elseif (is_bool($excluded) && !$excluded)
$excluded = array(); $excluded = array();
// Tack on any config include/exclude requests
if (isset($config['include']))
$included = array_merge($included, $config['include']);
if (isset($config['exclude']))
$excluded = array_merge($excluded, $config['exclude']);
// Calculate the actual inclusion set // Calculate the actual inclusion set
$included = array_diff(array_merge($this->included, $included), $included = array_diff(array_merge($this->included, $included),
array_merge($this->invalid, $excluded)); array_merge($this->invalid, $excluded));

View File

@@ -205,15 +205,16 @@ function addChargeSource(flash) {
<?php <?php
; // align ; // align
echo $this->element('leases', echo $this->element('leases', array
array('grid_div_id' => 'leases-list', ('config' => array
('grid_div_id' => 'leases-list',
'grid_div_class' => 'text-below', 'grid_div_class' => 'text-below',
'caption' => ('<A HREF="#" ONCLICK="$(\'#leases-list .HeaderButton\').click();'. 'caption' => ('<A HREF="#" ONCLICK="$(\'#leases-list .HeaderButton\').click();'.
' return false;">Select Lease</A>'), ' return false;">Select Lease</A>'),
'grid_setup' => $lease_grid_setup, 'grid_setup' => $lease_grid_setup,
'nolinks' => true, 'nolinks' => true,
'limit' => 10, 'limit' => 10,
)); )));
echo ('<SPAN id="current-lease" style="display:none">' . echo ('<SPAN id="current-lease" style="display:none">' .
'<DIV>' . '<DIV>' .

View File

@@ -94,23 +94,25 @@ function onGridState(grid_id, item_type, state) {
<?php <?php
; // align ; // align
echo $this->element('customers', echo $this->element('customers', array
array('grid_div_id' => 'customers-list', ('config' => array
('grid_div_id' => 'customers-list',
'grid_div_class' => 'text-below', 'grid_div_class' => 'text-below',
'caption' => ('<A HREF="#" ONCLICK="$(\'#customers-list .HeaderButton\').click();'. 'caption' => ('<A HREF="#" ONCLICK="$(\'#customers-list .HeaderButton\').click();'.
' return false;">Select Customer</A>'), ' return false;">Select Customer</A>'),
'grid_setup' => $customer_grid_setup, 'grid_setup' => $customer_grid_setup,
'nolinks' => true, 'nolinks' => true,
'limit' => 10, 'limit' => 10,
)); )));
echo ('<H2>' . echo ('<H2>' .
'<SPAN id="current-customer">Customer: <SPAN id="movein-customer"></SPAN></SPAN>' . '<SPAN id="current-customer">Customer: <SPAN id="movein-customer"></SPAN></SPAN>' .
'<SPAN id="no-customer">Please select customer</SPAN>' . '<SPAN id="no-customer">Please select customer</SPAN>' .
'</H2>' . "\n"); '</H2>' . "\n");
echo $this->element('units', echo $this->element('units', array
array('grid_div_id' => 'units-list', ('config' => array
('grid_div_id' => 'units-list',
'grid_div_class' => 'text-below', 'grid_div_class' => 'text-below',
'caption' => ('<A HREF="#" ONCLICK="$(\'#units-list .HeaderButton\').click();'. 'caption' => ('<A HREF="#" ONCLICK="$(\'#units-list .HeaderButton\').click();'.
' return false;">Select Unit</A>'), ' return false;">Select Unit</A>'),
@@ -118,7 +120,7 @@ echo $this->element('units',
'action' => 'unoccupied', 'action' => 'unoccupied',
'nolinks' => true, 'nolinks' => true,
'limit' => 10, 'limit' => 10,
)); )));
echo ('<H2>' . echo ('<H2>' .
'<SPAN id="current-unit">Unit: <SPAN id="movein-unit"></SPAN></SPAN>' . '<SPAN id="current-unit">Unit: <SPAN id="movein-unit"></SPAN></SPAN>' .

View File

@@ -78,10 +78,15 @@ echo '<div CLASS="detail supporting">' . "\n";
* Lease Account History * Lease Account History
*/ */
echo $this->element('ledger_entries', echo $this->element('ledger_entries', array
array('caption' => 'Account', (// Element configuration
'lease_id' => $lease['id'], 'lease_id' => $lease['id'],
'ar_account' => true, 'ar_account' => true,
// Grid configuration
'config' => array
('caption' => 'Account',
),
)); ));

View File

@@ -118,20 +118,30 @@ echo '<div CLASS="detail supporting">' . "\n";
*/ */
if ($debit_ledger['Account']['trackable']) { if ($debit_ledger['Account']['trackable']) {
echo $this->element('ledger_entries', echo $this->element('ledger_entries', array
array('caption' => "Applied to " . $debit_ledger['Account']['name'], (// Element configuration
'grid_div_id' => 'debit_reconciliation_ledger_entries',
'account_ftype' => 'debit', 'account_ftype' => 'debit',
'reconcile_id' => $entry['id'], 'reconcile_id' => $entry['id'],
// Grid configuration
'config' => array
('caption' => "Applied to " . $debit_ledger['Account']['name'],
'grid_div_id' => 'debit_reconciliation_ledger_entries',
),
)); ));
} }
if ($credit_ledger['Account']['trackable']) { if ($credit_ledger['Account']['trackable']) {
echo $this->element('ledger_entries', echo $this->element('ledger_entries', array
array('caption' => "Applied to " . $credit_ledger['Account']['name'], (// Element configuration
'grid_div_id' => 'credit_reconciliation_ledger_entries',
'account_ftype' => 'credit', 'account_ftype' => 'credit',
'reconcile_id' => $entry['id'], 'reconcile_id' => $entry['id'],
// Grid configuration
'config' => array
('caption' => "Applied to " . $credit_ledger['Account']['name'],
'grid_div_id' => 'credit_reconciliation_ledger_entries',
),
)); ));
} }

View File

@@ -63,12 +63,18 @@ echo '<div CLASS="detail supporting">' . "\n";
* Ledger Entries * Ledger Entries
*/ */
echo $this->element('ledger_entries', echo $this->element('ledger_entries', array
array('caption' => "Ledger Entries", (// Element configuration
'ledger_id' => $ledger['id'], 'ledger_id' => $ledger['id'],
'account_type' => $account['type'], 'account_type' => $account['type'],
// Grid configuration
'config' => array
('caption' => "Ledger Entries",
),
)); ));
/* End "detail supporting" div */ /* End "detail supporting" div */
echo '</div>' . "\n"; echo '</div>' . "\n";

View File

@@ -51,11 +51,16 @@ echo '<div CLASS="detail supporting">' . "\n";
* Entries * Entries
*/ */
echo $this->element('ledger_entries', echo $this->element('ledger_entries', array
array('caption' => 'Entries in Transaction', (// Element configuration
//'ledger_entries' => $transaction['LedgerEntry'],
'transaction_id' => $transaction['Transaction']['id'], 'transaction_id' => $transaction['Transaction']['id'],
'notxgroup' => true, 'notxgroup' => true,
// Grid configuration
'config' => array
(
'caption' => 'Entries in Transaction',
),
)); ));

View File

@@ -71,14 +71,21 @@ echo $this->element('leases', array
/********************************************************************** /**********************************************************************
* Current Customer Lease Account History * Current Customer Lease Account History
*/ */
if (isset($current_lease['id'])) { if (isset($current_lease['id'])) {
echo $this->element('ledger_entries', echo $this->element('ledger_entries', array
array('caption' => (// Element configuration
'ar_account' => true,
'lease_id' => $current_lease['id'],
// Grid configuration
'config' => array
(
'caption' =>
('Current Lease Account (' ('Current Lease Account ('
. $current_lease['Customer']['name'] . $current_lease['Customer']['name']
. ')'), . ')'),
'ar_account' => true, ),
'lease_id' => $current_lease['id'],
)); ));
} }