Many, many changes, and yet still much to do. Many things are working, but certainly nothing beyond simply data retrieval (no editing or adding of any data). Also, some work is still required to ensure the grids have the right columns; we can strip out certain columns for some views (such as removing customer from the leases grid of the customer view... completely redundant). And of course, there are still many bugs and lots to clean up.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@368 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -31,10 +31,10 @@ function updateEntriesGrid() {
|
||||
account_ids.push($(this).val());
|
||||
});
|
||||
|
||||
cust['collected_account_id'] = <?php echo $account['id']; ?>;
|
||||
cust['collected_from_date'] = $('#TxFromDate').val();
|
||||
cust['collected_through_date'] = $('#TxThroughDate').val();
|
||||
cust['collected_payment_accounts'] = account_ids;
|
||||
cust['account_id'] = <?php echo $account['id']; ?>;
|
||||
cust['from_date'] = $('#TxFromDate').val();
|
||||
cust['through_date'] = $('#TxThroughDate').val();
|
||||
cust['payment_accounts'] = account_ids;
|
||||
|
||||
$('#collected-total').html('Calculating...');
|
||||
$('#collected-entries-jqGrid').clearGridData();
|
||||
@@ -155,7 +155,7 @@ echo '<div CLASS="detail supporting">' . "\n";
|
||||
|
||||
echo $this->element('ledger_entries', array
|
||||
(// Element configuration
|
||||
'collected_account_id' => $account['id'],
|
||||
'account_id' => $account['id'],
|
||||
|
||||
// Grid configuration
|
||||
'config' => array
|
||||
|
||||
@@ -9,12 +9,19 @@ echo '<div class="account view">' . "\n";
|
||||
* Account Detail Main Section
|
||||
*/
|
||||
|
||||
$rows = array(array('ID', $account['Account']['id']),
|
||||
array('Name', $account['Account']['name']),
|
||||
array('Type', $account['Account']['type']),
|
||||
array('External Name', $account['Account']['external_name']),
|
||||
array('External Account', $account['Account']['external_account']),
|
||||
array('Comment', $account['Account']['comment']));
|
||||
$ledger = $account['Ledger'];
|
||||
$current_ledger = $account['CurrentLedger'];
|
||||
|
||||
if (isset($account['Account']))
|
||||
$account = $account['Account'];
|
||||
|
||||
$rows = array();
|
||||
$rows[] = array('ID', $account['id']);
|
||||
$rows[] = array('Name', $account['name']);
|
||||
$rows[] = array('Type', $account['type']);
|
||||
$rows[] = array('External Name', $account['external_name']);
|
||||
$rows[] = array('External Account', $account['external_account']);
|
||||
$rows[] = array('Comment', $account['comment']);
|
||||
|
||||
echo $this->element('table',
|
||||
array('class' => 'item account detail',
|
||||
@@ -56,9 +63,10 @@ echo '<div CLASS="detail supporting">' . "\n";
|
||||
*/
|
||||
|
||||
echo $this->element('ledgers', array
|
||||
('config' => array
|
||||
('caption' => $account['Account']['name'] . " Ledgers",
|
||||
'rows' => $account['Ledger'],
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
('caption' => $account['name'] . " Ledgers",
|
||||
'filter' => array('account_id' => $account['id']),
|
||||
)));
|
||||
|
||||
|
||||
@@ -66,21 +74,29 @@ echo $this->element('ledgers', array
|
||||
* Current Ledger
|
||||
*/
|
||||
|
||||
echo $this->element('entries', array
|
||||
(// Element configuration
|
||||
'ledger_id' => $account['CurrentLedger']['id'],
|
||||
'account_type' => $account['Account']['type'],
|
||||
|
||||
// Grid configuration
|
||||
echo $this->element('ledger_entries', array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
('caption' =>
|
||||
"Current Ledger: (" .
|
||||
"#{$account['Account']['id']}" .
|
||||
"-" .
|
||||
"{$account['CurrentLedger']['sequence']}" .
|
||||
")",
|
||||
),
|
||||
));
|
||||
('caption' => ("Current Ledger: " .
|
||||
"(". $current_ledger['name'] .")"),
|
||||
'filter' => array('ledger_id' => $current_ledger['id']),
|
||||
)));
|
||||
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Entire Account
|
||||
*/
|
||||
|
||||
echo $this->element('ledger_entries', array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
('grid_setup' => array('hiddengrid' => true),
|
||||
'caption' => "Entire Ledger",
|
||||
'filter' => array('account_id' => $account['id']),
|
||||
)));
|
||||
|
||||
|
||||
|
||||
/* End "detail supporting" div */
|
||||
echo '</div>' . "\n";
|
||||
|
||||
@@ -9,16 +9,24 @@ echo '<div class="contact view">' . "\n";
|
||||
* Contact Detail Main Section
|
||||
*/
|
||||
|
||||
$rows = array(array('First Name', $contact['Contact']['first_name']),
|
||||
array('Middle Name', $contact['Contact']['middle_name']),
|
||||
array('Last Name', $contact['Contact']['last_name']),
|
||||
array('Company', $contact['Contact']['company_name']),
|
||||
array('SSN', $contact['Contact']['id_federal']),
|
||||
array('ID', ($contact['Contact']['id_local']
|
||||
. ($contact['Contact']['id_local']
|
||||
? " - ".$contact['Contact']['id_local_state']
|
||||
: ""))),
|
||||
array('Comment', $contact['Contact']['comment']));
|
||||
$phones = $contact['ContactPhone'];
|
||||
$addresses = $contact['ContactAddress'];
|
||||
$emails = $contact['ContactEmail'];
|
||||
|
||||
if (isset($contact['Contact']))
|
||||
$contact = $contact['Contact'];
|
||||
|
||||
$rows = array();
|
||||
$rows[] = array('First Name', $contact['first_name']);
|
||||
$rows[] = array('Middle Name', $contact['middle_name']);
|
||||
$rows[] = array('Last Name', $contact['last_name']);
|
||||
$rows[] = array('Company', $contact['company_name']);
|
||||
$rows[] = array('SSN', $contact['id_federal']);
|
||||
$rows[] = array('ID', ($contact['id_local']
|
||||
. ($contact['id_local']
|
||||
? " - ".$contact['id_local_state']
|
||||
: "")));
|
||||
$rows[] = array('Comment', $contact['comment']);
|
||||
|
||||
echo $this->element('table',
|
||||
array('class' => 'item contact detail',
|
||||
@@ -57,7 +65,7 @@ echo '<div CLASS="detail supporting">' . "\n";
|
||||
*/
|
||||
$headers = array('Phone', 'Preference', 'Comment');
|
||||
$rows = array();
|
||||
foreach($contact['ContactPhone'] AS $phone) {
|
||||
foreach($phones AS $phone) {
|
||||
$rows[] = array(FormatHelper::phone($phone['phone']) .
|
||||
($phone['ext'] ? " x".$phone['ext'] : ""),
|
||||
$phone['ContactsMethod']['preference'] . " / " .
|
||||
@@ -79,7 +87,7 @@ echo $this->element('table',
|
||||
*/
|
||||
$headers = array('Address', 'Preference', 'Comment');
|
||||
$rows = array();
|
||||
foreach($contact['ContactAddress'] AS $address) {
|
||||
foreach($addresses AS $address) {
|
||||
$rows[] = array(preg_replace("/\n/", "<BR>\n", $address['address']) . "<BR>\n" .
|
||||
$address['city'] . ", " .
|
||||
$address['state'] . " " .
|
||||
@@ -103,7 +111,7 @@ echo $this->element('table',
|
||||
*/
|
||||
$headers = array('Email', 'Preference', 'Comment');
|
||||
$rows = array();
|
||||
foreach($contact['ContactEmail'] AS $email) {
|
||||
foreach($emails AS $email) {
|
||||
$rows[] = array($email['email'],
|
||||
$email['ContactsMethod']['preference'] . " / " .
|
||||
$email['ContactsMethod']['type'],
|
||||
@@ -123,9 +131,10 @@ echo $this->element('table',
|
||||
*/
|
||||
|
||||
echo $this->element('customers', array
|
||||
('config' => array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
('caption' => 'Related Customers',
|
||||
'rows' => $contact['Customer'],
|
||||
'filter' => array('contact_id' => $contact['id']),
|
||||
)));
|
||||
|
||||
|
||||
|
||||
@@ -9,8 +9,9 @@ echo '<div class="customer view">' . "\n";
|
||||
* Customer Detail Main Section
|
||||
*/
|
||||
|
||||
$rows = array(array('Name', $customer['Customer']['name']),
|
||||
array('Comment', $customer['Customer']['comment']));
|
||||
$rows = array();
|
||||
$rows[] = array('Name', $customer['Customer']['name']);
|
||||
$rows[] = array('Comment', $customer['Customer']['comment']);
|
||||
|
||||
echo $this->element('table',
|
||||
array('class' => 'item customer detail',
|
||||
@@ -51,9 +52,10 @@ echo '<div CLASS="detail supporting">' . "\n";
|
||||
*/
|
||||
|
||||
echo $this->element('contacts', array
|
||||
('config' => array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
('caption' => 'Customer Contacts',
|
||||
'rows' => $customer['Contact'],
|
||||
'filter' => array('Customer.id' => $customer['Customer']['id']),
|
||||
)));
|
||||
|
||||
|
||||
@@ -62,10 +64,10 @@ echo $this->element('contacts', array
|
||||
*/
|
||||
|
||||
echo $this->element('leases', array
|
||||
('customer_id' => $customer['Customer']['id'],
|
||||
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
('caption' => 'Lease History',
|
||||
'filter' => array('Customer.id' => $customer['Customer']['id']),
|
||||
)));
|
||||
|
||||
|
||||
@@ -73,15 +75,12 @@ echo $this->element('leases', array
|
||||
* Customer Account History
|
||||
*/
|
||||
|
||||
echo $this->element('ledger_entries', array
|
||||
(// Element configuration
|
||||
'customer_id' => $customer['Customer']['id'],
|
||||
|
||||
// Grid configuration
|
||||
echo $this->element('statement_entries', array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
('caption' => 'Account',
|
||||
),
|
||||
));
|
||||
'filter' => array('Customer.id' => $customer['Customer']['id']),
|
||||
)));
|
||||
|
||||
|
||||
/* End "detail supporting" div */
|
||||
|
||||
@@ -4,20 +4,18 @@
|
||||
$cols = array();
|
||||
$cols['ID'] = array('index' => 'Account.id', 'formatter' => 'id');
|
||||
$cols['Name'] = array('index' => 'Account.name', 'formatter' => 'longname');
|
||||
$cols['Type'] = array('index' => 'Account.type', 'formatter' => 'name');
|
||||
$cols['Entries'] = array('index' => 'entries', 'width' => '60', 'align' => 'right');
|
||||
$cols['Type'] = array('index' => 'Account.type', 'formatter' => 'enum');
|
||||
$cols['Entries'] = array('index' => 'entries', 'formatter' => 'number');
|
||||
$cols['Debits'] = array('index' => 'debits', 'formatter' => 'currency');
|
||||
$cols['Credits'] = array('index' => 'credits', 'formatter' => 'currency');
|
||||
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
|
||||
$cols['Comment'] = array('index' => 'Account.comment', 'formatter' => 'comment');
|
||||
|
||||
// Set up search fields if requested by caller
|
||||
if (isset($searchfields))
|
||||
$grid->searchFields(array('Name'));
|
||||
|
||||
// Render the grid
|
||||
$grid
|
||||
->columns($cols)
|
||||
->sortField('Name')
|
||||
->defaultFields(array('ID', 'Name'))
|
||||
->render($this, isset($config) ? $config : null);
|
||||
->searchFields(array('Name'))
|
||||
->render($this, isset($config) ? $config : null,
|
||||
array_diff(array_keys($cols), array('Comment')));
|
||||
|
||||
@@ -2,23 +2,19 @@
|
||||
|
||||
// Define the table columns
|
||||
$cols = array();
|
||||
$cols['ID'] = array('index' => 'Contact.id', 'formatter' => 'id');
|
||||
$cols['Last Name'] = array('index' => 'Contact.last_name', 'formatter' => 'name');
|
||||
$cols['First Name'] = array('index' => 'Contact.first_name', 'formatter' => 'name');
|
||||
$cols['Company'] = array('index' => 'Contact.company_name', 'formatter' => 'longname');
|
||||
if (0) { // REVISIT<AP>: Need to figure out how to put this in play
|
||||
$cols['Type'] = array('index' => 'ContactsCustomer.type', 'width' => '75');
|
||||
$cols['Active'] = array('index' => 'ContactsCustomer.active', 'width' => '75');
|
||||
}
|
||||
$cols['Comment'] = array('index' => 'Contact.comment', 'formatter' => 'comment');
|
||||
|
||||
// Set up search fields if requested by caller
|
||||
if (isset($searchfields))
|
||||
$grid->searchFields(array('Last Name', 'First Name'));
|
||||
$cols['ID'] = array('index' => 'Contact.id', 'formatter' => 'id');
|
||||
$cols['Last Name'] = array('index' => 'Contact.last_name', 'formatter' => 'name');
|
||||
$cols['First Name'] = array('index' => 'Contact.first_name', 'formatter' => 'name');
|
||||
$cols['Company'] = array('index' => 'Contact.company_name', 'formatter' => 'longname');
|
||||
$cols['Type'] = array('index' => 'ContactsCustomer.type', 'formatter' => 'enum');
|
||||
$cols['Active'] = array('index' => 'ContactsCustomer.active', 'formatter' => 'enum');
|
||||
$cols['Comment'] = array('index' => 'Contact.comment', 'formatter' => 'comment');
|
||||
|
||||
// Render the grid
|
||||
$grid
|
||||
->columns($cols)
|
||||
->sortField('Last Name')
|
||||
->defaultFields(array('ID', 'Last Name', 'First Name'))
|
||||
->render($this, isset($config) ? $config : null);
|
||||
->searchFields(array('Last Name', 'First Name', 'Company'))
|
||||
->render($this, isset($config) ? $config : null,
|
||||
array_diff(array_keys($cols), array('Type', 'Active', 'Comment')));
|
||||
|
||||
@@ -2,26 +2,25 @@
|
||||
|
||||
// Define the table columns
|
||||
$cols = array();
|
||||
$cols['ID'] = array('index' => 'Customer.id', 'formatter' => 'id');
|
||||
if (0) // REVISIT<AP>: Need to figure out how to put this in play
|
||||
$cols['Relationship'] = array('index' => 'ContactsCustomer.type', 'width' => '75');
|
||||
$cols['Name'] = array('index' => 'Customer.name', 'formatter' => 'longname');
|
||||
$cols['Last Name'] = array('index' => 'PrimaryContact.last_name', 'formatter' => 'name');
|
||||
$cols['First Name'] = array('index' => 'PrimaryContact.first_name', 'formatter' => 'name');
|
||||
$cols['Leases'] = array('index' => 'lease_count', 'width' => '60');
|
||||
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
|
||||
$cols['Comment'] = array('index' => 'Customer.comment', 'formatter' => 'comment');
|
||||
$cols['ID'] = array('index' => 'Customer.id', 'formatter' => 'id');
|
||||
$cols['Relationship'] = array('index' => 'ContactsCustomer.type', 'formatter' => 'enum');
|
||||
$cols['Name'] = array('index' => 'Customer.name', 'formatter' => 'longname');
|
||||
$cols['Last Name'] = array('index' => 'PrimaryContact.last_name', 'formatter' => 'name');
|
||||
$cols['First Name'] = array('index' => 'PrimaryContact.first_name', 'formatter' => 'name');
|
||||
$cols['Leases'] = array('index' => 'lease_count', 'formatter' => 'number');
|
||||
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
|
||||
$cols['Comment'] = array('index' => 'Customer.comment', 'formatter' => 'comment');
|
||||
|
||||
// Set up search fields if requested by caller
|
||||
if (isset($searchfields))
|
||||
$grid->searchFields(array('Last Name', 'First Name'));
|
||||
|
||||
// Include custom data
|
||||
//$grid->customData(compact('lease_id'));
|
||||
// Certain fields are only valid with a particular context
|
||||
if (!isset($config['filter']['contact_id']) && !isset($config['filter']['Contact.id']))
|
||||
$grid->invalidFields('Relationship');
|
||||
|
||||
// Render the grid
|
||||
$grid
|
||||
->columns($cols)
|
||||
->sortField('Name')
|
||||
->defaultFields(array('ID', 'Name'))
|
||||
->render($this, isset($config) ? $config : null);
|
||||
->searchFields(array('Name', 'Last Name', 'First Name'))
|
||||
->render($this, isset($config) ? $config : null,
|
||||
array_diff(array_keys($cols), array('Comment')));
|
||||
|
||||
@@ -29,37 +29,9 @@ $cols['Applied'] = array('index' => "applied", 'formatter' =>
|
||||
$cols['Sub-Total'] = array('index' => 'subtotal-LedgerEntry.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');
|
||||
|
||||
|
||||
@@ -97,22 +97,35 @@ $postData['custom'] = isset($custom_post_data) ? $custom_post_data : null;
|
||||
// Perform column customizations.
|
||||
// This will largely be based off of the 'formatter' parameter,
|
||||
// but could be on any pertinent condition.
|
||||
foreach ($jqGridColumns AS &$col) {
|
||||
foreach ($jqGridColumns AS $header => &$col) {
|
||||
$default = array();
|
||||
|
||||
// Make sure every column has a name
|
||||
$default['name'] = preg_replace("/\./", '-', $col['index']);
|
||||
$default['name'] = preg_replace("/\./", '-', $col['index']);
|
||||
$default['force'] = isset($col['forcewidth']) ? $col['forcewidth'] : null;
|
||||
|
||||
// Perform customization based on formatter
|
||||
if (isset($col['formatter'])) {
|
||||
if ($col['formatter'] === 'id') {
|
||||
// Switch currency over to our own custom formatting
|
||||
// Use our custom formatting for ids
|
||||
$col['formatter'] = array('--special' => 'idFormatter');
|
||||
$default['width'] = 50;
|
||||
$default['align'] = 'center';
|
||||
|
||||
// For IDs, force the width by default,
|
||||
// unless otherwise instructed NOT to.
|
||||
if (!isset($default['force']))
|
||||
$default['force'] = true;
|
||||
}
|
||||
elseif ($col['formatter'] === 'number') {
|
||||
$default['width'] = 60;
|
||||
$default['align'] = 'right';
|
||||
|
||||
// No special formatting for number
|
||||
unset($col['formatter']);
|
||||
}
|
||||
elseif ($col['formatter'] === 'currency') {
|
||||
// Switch currency over to our own custom formatting
|
||||
// Use our custom formatting for currency
|
||||
$col['formatter'] = array('--special' => 'currencyFormatter');
|
||||
$default['width'] = 85;
|
||||
$default['align'] = 'right';
|
||||
@@ -122,14 +135,24 @@ foreach ($jqGridColumns AS &$col) {
|
||||
$default['width'] = 95;
|
||||
$default['align'] = 'center';
|
||||
}
|
||||
elseif ($col['formatter'] === 'name' || $col['formatter'] === 'longname') {
|
||||
elseif (preg_match("/^(long|short)?name$/",
|
||||
$col['formatter'], $matches)) {
|
||||
$default['width'] = 100;
|
||||
if ($col['formatter'] === 'longname')
|
||||
if (!empty($matches[1]) && $matches[1] === 'long')
|
||||
$default['width'] *= 1.5;
|
||||
if (!empty($matches[1]) && $matches[1] === 'short')
|
||||
$default['width'] *= 0.7;
|
||||
|
||||
// No special formatting for name
|
||||
unset($col['formatter']);
|
||||
}
|
||||
elseif ($col['formatter'] === 'enum') {
|
||||
$default['width'] = 60;
|
||||
//$default['align'] = 'right';
|
||||
|
||||
// No special formatting for enum
|
||||
unset($col['formatter']);
|
||||
}
|
||||
elseif ($col['formatter'] === 'comment') {
|
||||
$default['width'] = 300;
|
||||
$default['sortable'] = false;
|
||||
@@ -137,6 +160,13 @@ foreach ($jqGridColumns AS &$col) {
|
||||
// No special formatting for comment
|
||||
unset($col['formatter']);
|
||||
}
|
||||
// else just let the formatter pass through untouched
|
||||
|
||||
// Just a rough approximation to ensure columns
|
||||
// are wide enough to fully display their header.
|
||||
$min_width = strlen($header) * 10;
|
||||
if ((!isset($default['width']) || $default['width'] < $min_width) && !$default['force'])
|
||||
$default['width'] = $min_width;
|
||||
}
|
||||
|
||||
$col = array_merge($default, $col);
|
||||
|
||||
@@ -14,19 +14,11 @@ $cols['Move-Out'] = array('index' => 'Lease.moveout_date', 'formatter' => 'dat
|
||||
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
|
||||
$cols['Comment'] = array('index' => 'Lease.comment', 'formatter' => 'comment');
|
||||
|
||||
// Set up search fields if requested by caller
|
||||
if (isset($searchfields))
|
||||
$grid->searchFields(array('Customer', 'Unit'));
|
||||
|
||||
if (isset($customer_id))
|
||||
$grid->invalidFields('Customer');
|
||||
|
||||
// Include custom data
|
||||
$grid->customData(compact('customer_id'));
|
||||
|
||||
// Render the grid
|
||||
$grid
|
||||
->columns($cols)
|
||||
->sortField('LeaseID')
|
||||
->defaultFields(array('LeaseID', 'Lease'))
|
||||
->render($this, isset($config) ? $config : null);
|
||||
->searchFields(array('Customer', 'Unit'))
|
||||
->render($this, isset($config) ? $config : null,
|
||||
array_diff(array_keys($cols), array('Comment')));
|
||||
|
||||
@@ -3,119 +3,27 @@
|
||||
// Define the table columns
|
||||
$cols = array();
|
||||
$cols['Transaction'] = array('index' => 'Transaction.id', 'formatter' => 'id');
|
||||
$cols['Entry'] = array('index' => 'Entry.id', 'formatter' => 'id');
|
||||
|
||||
$cols['Entry'] = array('index' => 'LedgerEntry.id', 'formatter' => 'id');
|
||||
$cols['Date'] = array('index' => 'Transaction.stamp', 'formatter' => 'date');
|
||||
$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');
|
||||
|
||||
$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' => 'Entry.name', 'formatter' => 'name');
|
||||
$cols['Comment'] = array('index' => 'Entry.comment', 'formatter' => 'comment', 'width'=>150);
|
||||
$cols['Cr/Dr'] = array('index' => 'LedgerEntry.crdr', 'formatter' => 'enum');
|
||||
$cols['Tender'] = array('index' => 'Tender.name', 'formatter' => 'name');
|
||||
$cols['Comment'] = array('index' => 'LedgerEntry.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['Amount'] = array('index' => 'LedgerEntry.amount', 'formatter' => 'currency');
|
||||
$cols['Sub-Total'] = array('index' => 'subtotal-balance', 'formatter' => 'currency', 'sortable' => false);
|
||||
|
||||
$cols['Last Payment'] = array('index' => 'last_paid', 'formatter' => 'date');
|
||||
$cols['Applied'] = array('index' => "applied", 'formatter' => 'currency');
|
||||
$cols['Sub-Total'] = array('index' => 'subtotal-DoubleEntry.amount', 'formatter' => 'currency', 'sortable' => false);
|
||||
|
||||
|
||||
if (isset($transaction_id) || isset($reconcile_id))
|
||||
$grid->invalidFields('Transaction');
|
||||
|
||||
if (!isset($collected_account_id))
|
||||
$grid->invalidFields('Last Payment');
|
||||
|
||||
if (isset($account_ftype) || isset($ar_account) || isset($customer_id) || isset($lease_id))
|
||||
$grid->invalidFields(array('Debit Account', 'Credit Account'));
|
||||
else
|
||||
$grid->invalidFields(array('Account', 'Cr/Dr'));
|
||||
|
||||
if (isset($customer_id) || isset($lease_id))
|
||||
$grid->invalidFields(array('Cr/Dr'));
|
||||
|
||||
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 {
|
||||
$grid->invalidFields(array('Debit', 'Credit'));
|
||||
$cols['Sub-Total']['index'] = 'subtotal-DoubleEntry.amount';
|
||||
}
|
||||
|
||||
if (isset($lease_id) || isset($customer_id))
|
||||
$grid->invalidFields(array('Customer'));
|
||||
|
||||
if (isset($lease_id))
|
||||
$grid->invalidFields(array('Lease', 'Unit'));
|
||||
|
||||
if (!isset($reconcile_id) && !isset($collected_account_id))
|
||||
$grid->invalidFields('Applied');
|
||||
else
|
||||
$cols['Sub-Total']['index'] = 'subtotal-applied';
|
||||
|
||||
if (isset($account_ftype) || isset($collected_account_id))
|
||||
$grid->invalidFields('Sub-Total');
|
||||
|
||||
|
||||
// Now that columns are defined, establish basic grid parameters
|
||||
$grid
|
||||
->columns($cols)
|
||||
->sortField('Date')
|
||||
->defaultFields(array('Entry', 'Date', 'Amount', 'Credit', 'Debit'));
|
||||
|
||||
|
||||
if (!isset($config['rows']) && !isset($collected_account_id)) {
|
||||
$config['action'] = 'ledger';
|
||||
$grid->limit(50);
|
||||
}
|
||||
|
||||
if (isset($reconcile_id)) {
|
||||
$config['action'] = 'reconcile';
|
||||
$grid->customData(compact('reconcile_id'))->limit(20);
|
||||
}
|
||||
|
||||
if (isset($collected_account_id)) {
|
||||
$config['action'] = 'collected';
|
||||
$account_id = $collected_account_id;
|
||||
$grid->limit(50);
|
||||
$grid->sortField('Last Payment');
|
||||
}
|
||||
|
||||
if (isset($entry_ids)) {
|
||||
unset($config['action']);
|
||||
$grid->id_list($entry_ids);
|
||||
}
|
||||
|
||||
// Set up search fields if requested by caller
|
||||
if (isset($searchfields))
|
||||
$grid->searchFields(array('Customer', 'Unit'));
|
||||
|
||||
// Include custom data
|
||||
$grid->customData(compact('ledger_id', 'account_id', 'ar_account', 'entry_type',
|
||||
'account_type', 'account_ftype', 'monetary_source_id',
|
||||
'customer_id', 'lease_id', 'transaction_id'));
|
||||
|
||||
// Render the grid
|
||||
$grid
|
||||
->limit(50)
|
||||
->columns($cols)
|
||||
->sortField('Date')
|
||||
->defaultFields(array('Entry', 'Date', 'Amount'))
|
||||
->searchFields(array('Customer', 'Unit'))
|
||||
->render($this, isset($config) ? $config : null,
|
||||
array('Transaction', 'Entry', 'Date', 'Effective', 'Last Payment',
|
||||
'Debit Account', 'Credit Account', 'Account', 'Cr/Dr',
|
||||
'Customer', 'Unit',
|
||||
'Comment',
|
||||
'Debit', 'Credit', 'Amount',
|
||||
'Applied', 'Sub-Total')
|
||||
);
|
||||
array_diff(array_keys($cols), array('Debit', 'Credit', 'Sub-Total', 'Comment')));
|
||||
|
||||
|
||||
@@ -3,22 +3,21 @@
|
||||
// Define the table columns
|
||||
$cols = array();
|
||||
$cols['ID'] = array('index' => 'id_sequence', 'formatter' => 'id');
|
||||
$cols['Name'] = array('index' => 'Ledger.name', 'formatter' => 'name');
|
||||
$cols['Account'] = array('index' => 'Account.name', 'formatter' => 'longname');
|
||||
//$cols['Open Date'] = array('index' => 'PriorClose.stamp', 'formatter' => 'date');
|
||||
$cols['Open Date'] = array('index' => 'PriorClose.stamp', 'formatter' => 'date');
|
||||
$cols['Close Date'] = array('index' => 'Close.stamp', 'formatter' => 'date');
|
||||
$cols['Comment'] = array('index' => 'Ledger.comment', 'formatter' => 'comment');
|
||||
$cols['Entries'] = array('index' => 'entries', 'width' => '60', 'align' => 'right');
|
||||
$cols['Entries'] = array('index' => 'entries', 'formatter' => 'number');
|
||||
$cols['Debits'] = array('index' => 'debits', 'formatter' => 'currency');
|
||||
$cols['Credits'] = array('index' => 'credits', 'formatter' => 'currency');
|
||||
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
|
||||
|
||||
// Set up search fields if requested by caller
|
||||
if (isset($searchfields))
|
||||
$grid->searchFields(array('Account', 'Comment'));
|
||||
|
||||
// Render the grid
|
||||
$grid
|
||||
->columns($cols)
|
||||
->sortField('ID', 'DESC')
|
||||
->defaultFields(array('ID', 'Account'))
|
||||
->render($this, isset($config) ? $config : null);
|
||||
->sortField('ID', 'ASC')
|
||||
->defaultFields(array('ID', 'Name', 'Account'))
|
||||
->searchFields(array('Account', 'Comment'))
|
||||
->render($this, isset($config) ? $config : null,
|
||||
array_diff(array_keys($cols), array('Open Date', 'Comment')));
|
||||
|
||||
@@ -5,17 +5,15 @@ $cols = array();
|
||||
$cols['ID'] = array('index' => 'Map.id', 'formatter' => 'id');
|
||||
$cols['Name'] = array('index' => 'Map.name', 'formatter' => 'longname');
|
||||
$cols['Site Area'] = array('index' => 'SiteArea.name', 'formatter' => 'longname');
|
||||
$cols['Width'] = array('index' => 'Map.width', 'width' => '50', 'align' => 'right');
|
||||
$cols['Depth'] = array('index' => 'Map.depth', 'width' => '50', 'align' => 'right');
|
||||
$cols['Width'] = array('index' => 'Map.width', 'formatter' => 'number');
|
||||
$cols['Depth'] = array('index' => 'Map.depth', 'formatter' => 'number');
|
||||
$cols['Comment'] = array('index' => 'Map.comment', 'formatter' => 'comment');
|
||||
|
||||
// Set up search fields if requested by caller
|
||||
if (isset($searchfields))
|
||||
$grid->searchFields(array('Name'));
|
||||
|
||||
// Render the grid
|
||||
$grid
|
||||
->columns($cols)
|
||||
->sortField('Name')
|
||||
->defaultFields(array('ID', 'Name'))
|
||||
->render($this, isset($config) ? $config : null);
|
||||
->searchFields(array('Name'))
|
||||
->render($this, isset($config) ? $config : null,
|
||||
array_diff(array_keys($cols), array()));
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<?php /* -*- mode:PHP -*- */
|
||||
|
||||
// Define the table columns
|
||||
$cols = array();
|
||||
$cols['ID'] = array('index' => 'MonetarySource.id', 'formatter' => 'id');
|
||||
$cols['Name'] = array('index' => 'MonetarySource.name', 'formatter' => 'longname');
|
||||
$cols['Comment'] = array('index' => 'MonetarySource.comment', 'formatter' => 'comment');
|
||||
|
||||
// Set up search fields if requested by caller
|
||||
if (isset($searchfields))
|
||||
$grid->searchFields(array('ID', 'Name'));
|
||||
|
||||
// Render the grid
|
||||
$grid
|
||||
->columns($cols)
|
||||
->sortField('ID')
|
||||
->defaultFields(array('ID', 'Name'))
|
||||
->render($this, isset($config) ? $config : null);
|
||||
@@ -3,7 +3,7 @@
|
||||
// Define the table columns
|
||||
$cols = array();
|
||||
$cols['Transaction'] = array('index' => 'Transaction.id', 'formatter' => 'id');
|
||||
$cols['StatementEntry'] = array('index' => 'StatementEntry.id', 'formatter' => 'id');
|
||||
$cols['Entry'] = array('index' => 'StatementEntry.id', 'formatter' => 'id');
|
||||
|
||||
$cols['Date'] = array('index' => 'Transaction.stamp', 'formatter' => 'date');
|
||||
$cols['Effective'] = array('index' => 'StatementEntry.effective_date', 'formatter' => 'date');
|
||||
@@ -13,7 +13,7 @@ $cols['Account'] = array('index' => 'Account.name', 'formatter' =>
|
||||
|
||||
$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['Unit'] = array('index' => 'Unit.name', 'formatter' => 'shortname');
|
||||
|
||||
$cols['Comment'] = array('index' => 'StatementEntry.comment', 'formatter' => 'comment', 'width'=>150);
|
||||
|
||||
@@ -25,55 +25,26 @@ $cols['Applied'] = array('index' => "applied", 'formatter' =>
|
||||
$cols['Sub-Total'] = array('index' => 'subtotal-StatementEntry.amount', 'formatter' => 'currency', 'sortable' => false);
|
||||
|
||||
|
||||
if (isset($transaction_id))
|
||||
$grid->invalidFields('Transaction');
|
||||
|
||||
if (!isset($collected_account_id))
|
||||
$grid->invalidFields('Last Payment');
|
||||
|
||||
if (isset($ledger_id) || isset($account_id))
|
||||
$grid->invalidFields(array('Account'));
|
||||
|
||||
if (isset($lease_id) || isset($customer_id))
|
||||
$grid->invalidFields(array('Customer'));
|
||||
|
||||
if (isset($lease_id))
|
||||
$grid->invalidFields(array('Lease', 'Unit'));
|
||||
|
||||
if (!isset($statement_entry_id))
|
||||
$grid->invalidFields('Applied');
|
||||
else
|
||||
$cols['Sub-Total']['index'] = 'subtotal-applied';
|
||||
/* if (!isset($statement_entry_id)) */
|
||||
/* $grid->invalidFields('Applied'); */
|
||||
/* else */
|
||||
/* $cols['Sub-Total']['index'] = 'subtotal-applied'; */
|
||||
|
||||
// REVISIT <AP>: 20090722
|
||||
// Disallowing these fields until more of the rework is complete
|
||||
$grid->invalidFields('Sub-Total');
|
||||
$grid->invalidFields('Applied');
|
||||
|
||||
|
||||
// Now that columns are defined, establish basic grid parameters
|
||||
$grid
|
||||
->columns($cols)
|
||||
->sortField('Date')
|
||||
->defaultFields(array('Entry', 'Date', 'Amount', 'Credit', 'Debit'));
|
||||
|
||||
|
||||
/* // Set up search fields if requested by caller */
|
||||
/* if (isset($searchfields)) */
|
||||
/* $grid->searchFields(array('Customer', 'Unit')); */
|
||||
|
||||
|
||||
// Include custom data
|
||||
$grid->customData(compact('transaction_id', 'account_id', 'customer_id', 'lease_id',
|
||||
'statement_entry_id', 'from_date', 'through_date',
|
||||
$grid->customData(compact('statement_entry_id', 'from_date', 'through_date',
|
||||
'payment_accounts', 'charge_accounts'));
|
||||
|
||||
// Render the grid
|
||||
$grid
|
||||
->columns($cols)
|
||||
->sortField('Date')
|
||||
->defaultFields(array('Entry', 'Date', 'Charge', 'Payment'))
|
||||
->searchFields(array('Customer', 'Unit'))
|
||||
->render($this, isset($config) ? $config : null,
|
||||
array('Transaction', 'StatementEntry', 'Date', 'Effective', 'Last Payment',
|
||||
'Account',
|
||||
'Customer', 'Unit',
|
||||
'Comment',
|
||||
'Charge', 'Payment', 'Amount',
|
||||
'Applied', 'Sub-Total')
|
||||
);
|
||||
array_diff(array_keys($cols), array('Through', 'Lease', 'Last Payment', 'Comment')));
|
||||
|
||||
|
||||
16
site/views/elements/tenders.ctp
Normal file
16
site/views/elements/tenders.ctp
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php /* -*- mode:PHP -*- */
|
||||
|
||||
// Define the table columns
|
||||
$cols = array();
|
||||
$cols['ID'] = array('index' => 'Tender.id', 'formatter' => 'id');
|
||||
$cols['Name'] = array('index' => 'Tender.name', 'formatter' => 'longname');
|
||||
$cols['Comment'] = array('index' => 'Tender.comment', 'formatter' => 'comment');
|
||||
|
||||
// Render the grid
|
||||
$grid
|
||||
->columns($cols)
|
||||
->sortField('ID')
|
||||
->defaultFields(array('ID', 'Name'))
|
||||
->searchFields(array('ID', 'Name'))
|
||||
->render($this, isset($config) ? $config : null,
|
||||
array_diff(array_keys($cols), array()));
|
||||
@@ -3,18 +3,17 @@
|
||||
// Define the table columns
|
||||
$cols = array();
|
||||
$cols['ID'] = array('index' => 'Transaction.id', 'formatter' => 'id');
|
||||
$cols['Type'] = array('index' => 'Transaction.type', 'formatter' => 'enum');
|
||||
//$cols['Customer'] = array('index' => 'Customer.name', 'formatter' => 'longname');
|
||||
$cols['Timestamp'] = array('index' => 'Transaction.stamp', 'formatter' => 'date');
|
||||
$cols['Due'] = array('index' => 'Transaction.due_date', 'formatter' => 'date');
|
||||
$cols['Amount'] = array('index' => 'Transaction.amount', 'formatter' => 'currency');
|
||||
$cols['Comment'] = array('index' => 'Transaction.comment', 'formatter' => 'comment');
|
||||
|
||||
// Set up search fields if requested by caller
|
||||
if (isset($searchfields))
|
||||
$grid->searchFields(array('Due', 'Comment'));
|
||||
|
||||
// Render the grid
|
||||
$grid
|
||||
->columns($cols)
|
||||
->sortField('ID')
|
||||
->sortField('Timestamp')
|
||||
->defaultFields(array('ID', 'Timestamp'))
|
||||
->render($this, isset($config) ? $config : null);
|
||||
->searchFields(array('Type', 'Comment'))
|
||||
->render($this, isset($config) ? $config : null,
|
||||
array_diff(array_keys($cols), array('Comment')));
|
||||
|
||||
@@ -3,22 +3,19 @@
|
||||
// Define the table columns
|
||||
$cols = array();
|
||||
$cols['Sort'] = array('index' => 'Unit.sort_order', 'hidden' => true);
|
||||
//$cols['Sort'] = array('index' => 'Unit.sort_order');
|
||||
//$cols['Walk'] = array('index' => 'Unit.walk_order');
|
||||
$cols['Walk'] = array('index' => 'Unit.walk_order', 'formatter' => 'number');
|
||||
$cols['ID'] = array('index' => 'Unit.id', 'formatter' => 'id');
|
||||
$cols['Unit'] = array('index' => 'Unit.name', 'width' => '50');
|
||||
$cols['Size'] = array('index' => 'UnitSize.name', 'width' => '75');
|
||||
$cols['Status'] = array('index' => 'Unit.status', 'width' => '75');
|
||||
$cols['Unit'] = array('index' => 'Unit.name', 'formatter' => 'shortname');
|
||||
$cols['Size'] = array('index' => 'UnitSize.name', 'formatter' => 'shortname');
|
||||
$cols['Status'] = array('index' => 'Unit.status', 'formatter' => 'shortname');
|
||||
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
|
||||
$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'));
|
||||
|
||||
// Render the grid
|
||||
$grid
|
||||
->columns($cols)
|
||||
->sortField('Sort')
|
||||
->defaultFields(array('Sort', 'ID', 'Unit'))
|
||||
->render($this, isset($config) ? $config : null);
|
||||
->searchFields(array('Unit', 'Size', 'Status'))
|
||||
->render($this, isset($config) ? $config : null,
|
||||
array_diff(array_keys($cols), array('Walk', 'Comment')));
|
||||
|
||||
@@ -1,169 +0,0 @@
|
||||
<?php /* -*- mode:PHP -*- */
|
||||
|
||||
echo '<div class="entry view">' . "\n";
|
||||
|
||||
// The two entry ids, debit and credit, are actually individual
|
||||
// entries in separate accounts (each make up one of the two
|
||||
// entries required for "double entry"). The reconciling entries
|
||||
// are those on the opposite side of the ledger in the specific
|
||||
// account. For example, assume the double entry is:
|
||||
// debit: A/R credit: Cash amount: 55
|
||||
//
|
||||
// Then, our accounts might look like:
|
||||
//
|
||||
// RENT TAX A/R CASH BANK
|
||||
// ------- ------- ------- ------- -------
|
||||
// |20 | 20| | | <-- Unrelated
|
||||
// | | |20 20| | <-- Unrelated
|
||||
// | | | | |
|
||||
// |50 | 50| | | <-- Rent paid by this entry
|
||||
// | |5 5| | | <-- Tax paid by this entry
|
||||
// | | |55 55| | <-- THIS DOUBLE ENTRY
|
||||
// | | | | |
|
||||
// | | | |75 75| <-- Deposit includes this entry
|
||||
// | | | | |
|
||||
//
|
||||
// In this case, assume that THIS specific Entry is the A/R credit
|
||||
// of the Double Entry. We'll need to provide information on the
|
||||
// two A/R entries, 50 & 5, which are both debits, i.e. opposite
|
||||
// entries to the credit of A/R.
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
* Entry Detail Main Section
|
||||
*/
|
||||
|
||||
$account = $entry['Account'];
|
||||
$double = $entry['DoubleEntry'];
|
||||
$transaction = $double['Transaction'];
|
||||
$customer = $double['Customer'];
|
||||
$lease = $double['Lease'];
|
||||
$entry = $entry['Entry'];
|
||||
|
||||
$rows = array();
|
||||
$rows[] = array('ID', $entry['id']);
|
||||
$rows[] = array('Transaction', $html->link('#'.$transaction['id'],
|
||||
array('controller' => 'transactions',
|
||||
'action' => 'view',
|
||||
$transaction['id'])));
|
||||
$rows[] = array('Timestamp', FormatHelper::datetime($transaction['stamp']));
|
||||
$rows[] = array('Effective', FormatHelper::date($double['effective_date']));
|
||||
$rows[] = array('Through', FormatHelper::date($entry['through_date']));
|
||||
$rows[] = array('Amount', FormatHelper::currency($double['amount']));
|
||||
$rows[] = array('Account', $html->link($account['name'],
|
||||
array('controller' => 'accounts',
|
||||
'action' => 'view',
|
||||
$account['id'])));
|
||||
$rows[] = array('Cr/Dr', ($entry['crdr'] .
|
||||
' (Matching ' . $entry['opposite_crdr'] . ': ' .
|
||||
$html->link('#'.$entry['matching_entry_id'],
|
||||
array('controller' => 'entries',
|
||||
'action' => 'view',
|
||||
$entry['matching_entry_id'])) .
|
||||
')'));
|
||||
$rows[] = array('Double Entry', $html->link('#'.$double['id'],
|
||||
array('controller' => 'double_entries',
|
||||
'action' => 'view',
|
||||
$double['id'])));
|
||||
$rows[] = array('Customer', (isset($customer['name'])
|
||||
? $html->link($customer['name'],
|
||||
array('controller' => 'customers',
|
||||
'action' => 'view',
|
||||
$customer['id']))
|
||||
: null));
|
||||
$rows[] = array('Lease', (isset($lease['id'])
|
||||
? $html->link('#'.$lease['id'],
|
||||
array('controller' => 'leases',
|
||||
'action' => 'view',
|
||||
$lease['id']))
|
||||
: null));
|
||||
$rows[] = array('Comment', $entry['comment']);
|
||||
|
||||
echo $this->element('table',
|
||||
array('class' => 'item entry detail',
|
||||
'caption' => 'Ledger Entry Detail',
|
||||
'rows' => $rows,
|
||||
'column_class' => array('field', 'value')));
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Entry Info Box
|
||||
*/
|
||||
|
||||
echo '<div class="infobox">' . "\n";
|
||||
|
||||
//pr($reconciled);
|
||||
foreach ($reconciled['summary'] AS $Rtype => $stats) {
|
||||
$rtype = strtolower($Rtype);
|
||||
|
||||
$applied_caption = "Applied";
|
||||
$remaining_caption = "Balance";
|
||||
|
||||
/* $applied_caption = $Rtype . 's Applied'; */
|
||||
/* $remaining_caption = 'Remaining for ' . $Rtype . 's'; */
|
||||
|
||||
$rows = array();
|
||||
$rows[] = array($applied_caption,
|
||||
'<SPAN id="'.$rtype.'-applied">' .
|
||||
FormatHelper::currency($stats['reconciled']) .
|
||||
'</SPAN>');
|
||||
$rows[] = array($remaining_caption,
|
||||
'<SPAN id="'.$rtype.'-unapplied">' .
|
||||
FormatHelper::currency($stats['balance']) .
|
||||
'</SPAN>');
|
||||
|
||||
echo $this->element('table',
|
||||
array('class' => 'item summary',
|
||||
'caption' => $Rtype . 's',
|
||||
'rows' => $rows,
|
||||
'column_class' => array('field', 'value'),
|
||||
//'suppress_alternate_rows' => true,
|
||||
));
|
||||
}
|
||||
|
||||
echo '</div>' . "\n";
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
* Supporting Elements Section
|
||||
*/
|
||||
|
||||
echo '<div CLASS="detail supporting">' . "\n";
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Reconciliation Ledger Entries
|
||||
*/
|
||||
|
||||
foreach ($reconciled['entries'] AS $Rtype => $entries) {
|
||||
$rtype = strtolower($Rtype);
|
||||
|
||||
$caption = $Rtype . 's applied';
|
||||
echo $this->element('entries', array
|
||||
(// Element configuration
|
||||
'entry_ids' => $entries,
|
||||
/* 'action' => 'reconcile', */
|
||||
/* 'entry_id' => $entry['id'], */
|
||||
/* 'reconcile_types' => array($rtype), */
|
||||
// 'reconcile_id' => $entry['id'],
|
||||
|
||||
// Grid configuration
|
||||
'config' => array
|
||||
('caption' => $caption,
|
||||
'grid_div_id' => $rtype.'-entries',
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
/* End "detail supporting" div */
|
||||
echo '</div>' . "\n";
|
||||
|
||||
/* End page div */
|
||||
echo '</div>' . "\n";
|
||||
@@ -160,6 +160,7 @@ class GridHelper extends AppHelper {
|
||||
$included = array_merge($included, $config['include']);
|
||||
if (isset($config['exclude']))
|
||||
$excluded = array_merge($excluded, $config['exclude']);
|
||||
unset($config['include'], $config['exclude']);
|
||||
|
||||
// Calculate the actual inclusion set
|
||||
$included = array_diff(array_merge($this->included, $included),
|
||||
@@ -169,6 +170,10 @@ class GridHelper extends AppHelper {
|
||||
$this->jqGrid_options['jqGridColumns']
|
||||
= array_intersect_key($this->columns, array_flip($included));
|
||||
|
||||
// Make sure search fields are all part of the inclusion set
|
||||
$this->jqGrid_options['search_fields']
|
||||
= array_intersect($this->jqGrid_options['search_fields'], $included);
|
||||
|
||||
// As an exception to the normal config variables,
|
||||
// handle 'rows' here. The reason is so that we
|
||||
// ease the burden on views which have a list of
|
||||
@@ -178,8 +183,17 @@ class GridHelper extends AppHelper {
|
||||
if (isset($config['rows'])) {
|
||||
// Shrink the limit... user can always override
|
||||
$this->id_list($config['rows'])->limit(10);
|
||||
unset($config['rows']);
|
||||
}
|
||||
|
||||
// One more exception, as the search fields get
|
||||
// defined, but not passed to jqGrid unless
|
||||
// specifically requested.
|
||||
if (isset($config['search']))
|
||||
unset($config['search']);
|
||||
else
|
||||
unset($this->jqGrid_options['search_fields']);
|
||||
|
||||
// Figure out what controller we're using to
|
||||
// populate the grid via ajax, and set it.
|
||||
$controller = $this->controller;
|
||||
|
||||
@@ -16,29 +16,31 @@ $unit = $lease['Unit'];
|
||||
if (isset($lease['Lease']))
|
||||
$lease = $lease['Lease'];
|
||||
|
||||
$rows = array(array('ID', $lease['id']),
|
||||
array('Number', $lease['number']),
|
||||
array('Lease Type', $lease_type['name']),
|
||||
array('Unit', $html->link($unit['name'],
|
||||
$rows = array();
|
||||
|
||||
$rows[] = array('ID', $lease['id']);
|
||||
$rows[] = array('Number', $lease['number']);
|
||||
$rows[] = array('Lease Type', $lease_type['name']);
|
||||
$rows[] = array('Unit', $html->link($unit['name'],
|
||||
array('controller' => 'units',
|
||||
'action' => 'view',
|
||||
$unit['id']))),
|
||||
array('Customer', $html->link($customer['name'],
|
||||
$unit['id'])));
|
||||
$rows[] = array('Customer', $html->link($customer['name'],
|
||||
array('controller' => 'customers',
|
||||
'action' => 'view',
|
||||
$customer['id']))),
|
||||
array('Lease_Date', FormatHelper::date($lease['lease_date'], true)),
|
||||
array('Move-in Planned', FormatHelper::date($lease['movein_planned_date'], true)),
|
||||
array('Move-in', FormatHelper::date($lease['movein_date'], true)),
|
||||
array('Move-out', FormatHelper::date($lease['moveout_date'], true)),
|
||||
array('Move-out Planned', FormatHelper::date($lease['moveout_planned_date'], true)),
|
||||
array('Notice Given', FormatHelper::date($lease['notice_given_date'], true)),
|
||||
array('Notice Received', FormatHelper::date($lease['notice_received_date'], true)),
|
||||
array('Closed', FormatHelper::date($lease['close_date'], true)),
|
||||
array('Deposit', FormatHelper::currency($lease['deposit'])),
|
||||
array('Rent', FormatHelper::currency($lease['rent'])),
|
||||
array('Paid Through', FormatHelper::date($lease['paid_through'], true)),
|
||||
array('Comment', $lease['comment']));
|
||||
$customer['id'])));
|
||||
$rows[] = array('Lease_Date', FormatHelper::date($lease['lease_date'], true));
|
||||
$rows[] = array('Move-in Planned', FormatHelper::date($lease['movein_planned_date'], true));
|
||||
$rows[] = array('Move-in', FormatHelper::date($lease['movein_date'], true));
|
||||
$rows[] = array('Move-out', FormatHelper::date($lease['moveout_date'], true));
|
||||
$rows[] = array('Move-out Planned', FormatHelper::date($lease['moveout_planned_date'], true));
|
||||
$rows[] = array('Notice Given', FormatHelper::date($lease['notice_given_date'], true));
|
||||
$rows[] = array('Notice Received', FormatHelper::date($lease['notice_received_date'], true));
|
||||
$rows[] = array('Closed', FormatHelper::date($lease['close_date'], true));
|
||||
$rows[] = array('Deposit', FormatHelper::currency($lease['deposit']));
|
||||
$rows[] = array('Rent', FormatHelper::currency($lease['rent']));
|
||||
$rows[] = array('Paid Through', FormatHelper::date($lease['paid_through'], true));
|
||||
$rows[] = array('Comment', $lease['comment']);
|
||||
|
||||
|
||||
echo $this->element('table',
|
||||
@@ -79,15 +81,12 @@ echo '<div CLASS="detail supporting">' . "\n";
|
||||
* Lease Account History
|
||||
*/
|
||||
|
||||
echo $this->element('ledger_entries', array
|
||||
(// Element configuration
|
||||
'lease_id' => $lease['id'],
|
||||
|
||||
// Grid configuration
|
||||
echo $this->element('statement_entries', array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
('caption' => 'Account',
|
||||
),
|
||||
));
|
||||
'filter' => array('lease_id' => $lease['id']),
|
||||
)));
|
||||
|
||||
|
||||
/* End "detail supporting" div */
|
||||
|
||||
78
site/views/ledger_entries/view.ctp
Normal file
78
site/views/ledger_entries/view.ctp
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php /* -*- mode:PHP -*- */
|
||||
|
||||
echo '<div class="ledger-entry view">' . "\n";
|
||||
|
||||
/**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
* Ledger Entry Detail Main Section
|
||||
*/
|
||||
|
||||
$transaction = $entry['Transaction'];
|
||||
$ledger = $entry['Ledger'];
|
||||
$account = $ledger['Account'];
|
||||
$tender = $entry['Tender'];
|
||||
$matching = $entry['MatchingEntry'];
|
||||
$entry = $entry['LedgerEntry'];
|
||||
|
||||
$rows = array();
|
||||
$rows[] = array('ID', $entry['id']);
|
||||
$rows[] = array('Transaction', $html->link('#'.$transaction['id'],
|
||||
array('controller' => 'transactions',
|
||||
'action' => 'view',
|
||||
$transaction['id'])));
|
||||
$rows[] = array('Timestamp', FormatHelper::datetime($transaction['stamp']));
|
||||
$rows[] = array('Amount', FormatHelper::currency($entry['amount']));
|
||||
$rows[] = array('Tender', $html->link($tender['name'],
|
||||
array('controller' => 'tenders',
|
||||
'action' => 'view',
|
||||
$tender['id'])));
|
||||
$rows[] = array('Account', $html->link($account['name'],
|
||||
array('controller' => 'accounts',
|
||||
'action' => 'view',
|
||||
$account['id'])));
|
||||
$rows[] = array('Ledger', $html->link($ledger['name'],
|
||||
array('controller' => 'ledgers',
|
||||
'action' => 'view',
|
||||
$ledger['id'])));
|
||||
$rows[] = array('Cr/Dr', ($entry['crdr'] .
|
||||
' (Matching ' . $matching['crdr'] . ': ' .
|
||||
$html->link('#'.$matching['id'],
|
||||
array('controller' => 'ledger_entries',
|
||||
'action' => 'view',
|
||||
$matching['id'])) .
|
||||
')'));
|
||||
$rows[] = array('Comment', $entry['comment']);
|
||||
|
||||
echo $this->element('table',
|
||||
array('class' => 'item entry detail',
|
||||
'caption' => 'Ledger Entry Detail',
|
||||
'rows' => $rows,
|
||||
'column_class' => array('field', 'value')));
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Entry Info Box
|
||||
*/
|
||||
|
||||
echo '<div class="infobox">' . "\n";
|
||||
|
||||
echo '</div>' . "\n";
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
* Supporting Elements Section
|
||||
*/
|
||||
|
||||
echo '<div CLASS="detail supporting">' . "\n";
|
||||
|
||||
|
||||
/* End "detail supporting" div */
|
||||
echo '</div>' . "\n";
|
||||
|
||||
/* End page div */
|
||||
echo '</div>' . "\n";
|
||||
@@ -15,14 +15,16 @@ $account = $ledger['Account'];
|
||||
if (isset($ledger['Ledger']))
|
||||
$ledger = $ledger['Ledger'];
|
||||
|
||||
$rows = array(array('ID', $ledger['id']),
|
||||
array('Account', $html->link($account['name'],
|
||||
array('controller' => 'accounts',
|
||||
'action' => 'view',
|
||||
$account['id']))),
|
||||
array('Sequence', $ledger['sequence']),
|
||||
array('Status', $ledger['close_id'] ? 'Closed' : 'Open'),
|
||||
array('Comment', $ledger['comment']));
|
||||
$rows = array();
|
||||
$rows[] = array('ID', $ledger['id']);
|
||||
$rows[] = array('Name', $ledger['name']);
|
||||
$rows[] = array('Account', $html->link($account['name'],
|
||||
array('controller' => 'accounts',
|
||||
'action' => 'view',
|
||||
$account['id'])));
|
||||
$rows[] = array('Sequence', $ledger['sequence']);
|
||||
$rows[] = array('Status', $ledger['close_id'] ? 'Closed' : 'Open');
|
||||
$rows[] = array('Comment', $ledger['comment']);
|
||||
|
||||
echo $this->element('table',
|
||||
array('class' => 'item ledger detail',
|
||||
@@ -63,16 +65,12 @@ echo '<div CLASS="detail supporting">' . "\n";
|
||||
* Ledger Entries
|
||||
*/
|
||||
|
||||
echo $this->element('entries', array
|
||||
(// Element configuration
|
||||
'ledger_id' => $ledger['id'],
|
||||
'account_type' => $account['type'],
|
||||
|
||||
// Grid configuration
|
||||
echo $this->element('ledger_entries', array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
('caption' => "Ledger Entries",
|
||||
),
|
||||
));
|
||||
'filter' => array('ledger_id' => $ledger['id']),
|
||||
)));
|
||||
|
||||
|
||||
/* End "detail supporting" div */
|
||||
|
||||
@@ -103,8 +103,8 @@ echo $this->element('statement_entries', array
|
||||
// Grid configuration
|
||||
'config' => array
|
||||
('caption' => 'Entries Applied',
|
||||
),
|
||||
));
|
||||
//'filter' => array('statement_entry_id' => $entry['id']),
|
||||
)));
|
||||
|
||||
|
||||
/* End "detail supporting" div */
|
||||
|
||||
@@ -1,33 +1,34 @@
|
||||
<?php /* -*- mode:PHP -*- */
|
||||
|
||||
echo '<div class="monetary-source view">' . "\n";
|
||||
echo '<div class="tender view">' . "\n";
|
||||
|
||||
/**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
* MonetarySource Detail Main Section
|
||||
* Tender Detail Main Section
|
||||
*/
|
||||
|
||||
$source = $monetarySource['MonetarySource'];
|
||||
$tender = $tender['Tender'];
|
||||
|
||||
$rows = array(array('ID', $source['id']),
|
||||
array('Name', $source['name']),
|
||||
array('Data 1', $source['data1']),
|
||||
array('Data 2', $source['data2']),
|
||||
array('Data 3', $source['data3']),
|
||||
array('Data 4', $source['data4']),
|
||||
array('Comment', $source['comment']));
|
||||
$rows = array();
|
||||
$rows[] = array('ID', $tender['id']);
|
||||
$rows[] = array('Name', $tender['name']);
|
||||
$rows[] = array('Data 1', $tender['data1']);
|
||||
$rows[] = array('Data 2', $tender['data2']);
|
||||
$rows[] = array('Data 3', $tender['data3']);
|
||||
$rows[] = array('Data 4', $tender['data4']);
|
||||
$rows[] = array('Comment', $tender['comment']);
|
||||
|
||||
echo $this->element('table',
|
||||
array('class' => 'item monetary-source detail',
|
||||
'caption' => 'Monetary Source Detail',
|
||||
array('class' => 'item tender detail',
|
||||
'caption' => 'Legal Tender Detail',
|
||||
'rows' => $rows,
|
||||
'column_class' => array('field', 'value')));
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* MonetarySource Info Box
|
||||
* Tender Info Box
|
||||
*/
|
||||
|
||||
echo '<div class="infobox">' . "\n";
|
||||
@@ -56,14 +57,11 @@ echo '<div CLASS="detail supporting">' . "\n";
|
||||
*/
|
||||
|
||||
echo $this->element('ledger_entries', array
|
||||
(// Element configuration
|
||||
'monetary_source_id' => $source['id'],
|
||||
|
||||
// Grid configuration
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
('caption' => "Ledger Entries",
|
||||
),
|
||||
));
|
||||
'filter' => array('tender_id' => $tender['id']),
|
||||
)));
|
||||
|
||||
|
||||
/* End "detail supporting" div */
|
||||
@@ -9,10 +9,26 @@ echo '<div class="transaction view">' . "\n";
|
||||
* Transaction Detail Main Section
|
||||
*/
|
||||
|
||||
$rows = array(array('ID', $transaction['Transaction']['id']),
|
||||
array('Timestamp', FormatHelper::datetime($transaction['Transaction']['stamp'])),
|
||||
array('Due', FormatHelper::date($transaction['Transaction']['due_date'])),
|
||||
array('Comment', $transaction['Transaction']['comment']));
|
||||
$account = $transaction['Account'];
|
||||
$ledger = $transaction['Ledger'];
|
||||
|
||||
if (isset($transaction['Transaction']))
|
||||
$transaction = $transaction['Transaction'];
|
||||
|
||||
$rows = array();
|
||||
$rows[] = array('ID', $transaction['id']);
|
||||
$rows[] = array('Type', $transaction['type']);
|
||||
$rows[] = array('Timestamp', FormatHelper::datetime($transaction['stamp']));
|
||||
$rows[] = array('Amount', FormatHelper::currency($transaction['amount']));
|
||||
$rows[] = array('Account', $html->link($account['name'],
|
||||
array('controller' => 'accounts',
|
||||
'action' => 'view',
|
||||
$account['id'])));
|
||||
$rows[] = array('Ledger', $html->link($ledger['name'],
|
||||
array('controller' => 'ledgers',
|
||||
'action' => 'view',
|
||||
$ledger['id'])));
|
||||
$rows[] = array('Comment', $transaction['comment']);
|
||||
|
||||
echo $this->element('table',
|
||||
array('class' => 'item transaction detail',
|
||||
@@ -27,7 +43,7 @@ echo $this->element('table',
|
||||
|
||||
echo '<div class="infobox">' . "\n";
|
||||
$rows = array();
|
||||
$rows[] = array('Total:', FormatHelper::currency($total));
|
||||
$rows[] = array('Total:', FormatHelper::currency($transaction['amount']));
|
||||
echo $this->element('table',
|
||||
array('class' => 'summary',
|
||||
'rows' => $rows,
|
||||
@@ -48,24 +64,29 @@ echo '<div CLASS="detail supporting">' . "\n";
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Entries
|
||||
* Statement Entries
|
||||
*/
|
||||
|
||||
echo $this->element('statement_entries', array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
(
|
||||
'caption' => 'Statement Entries',
|
||||
'filter' => array('transaction_id' => $transaction['id']),
|
||||
)));
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Ledger Entries
|
||||
*/
|
||||
|
||||
echo $this->element('ledger_entries', array
|
||||
(// Element configuration
|
||||
'transaction_id' => $transaction['Transaction']['id'],
|
||||
|
||||
// Default for grouping by transaction is already false,
|
||||
// but we'll get explicit here, since we clearly want to
|
||||
// see all of the ledger entries not grouped by tx.
|
||||
'group_by_tx' => false,
|
||||
|
||||
// Grid configuration
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
(
|
||||
'caption' => 'Entries in Transaction',
|
||||
),
|
||||
));
|
||||
'caption' => 'Ledger Entries',
|
||||
'filter' => array('transaction_id' => $transaction['id']),
|
||||
)));
|
||||
|
||||
|
||||
/* End "detail supporting" div */
|
||||
|
||||
@@ -16,12 +16,13 @@ $unit_size = $unit['UnitSize'];
|
||||
if (isset($unit['Unit']))
|
||||
$unit = $unit['Unit'];
|
||||
|
||||
$rows = array(array('Name', $unit['name']),
|
||||
array('Status', $unit['status']),
|
||||
array('Size', $unit_size['name']),
|
||||
array('Deposit', FormatHelper::currency($unit['deposit'])),
|
||||
array('Rent', FormatHelper::currency($unit['rent'])),
|
||||
array('Comment', $unit['comment']));
|
||||
$rows = array();
|
||||
$rows[] = array('Name', $unit['name']);
|
||||
$rows[] = array('Status', $unit['status']);
|
||||
$rows[] = array('Size', $unit_size['name']);
|
||||
$rows[] = array('Deposit', FormatHelper::currency($unit['deposit']));
|
||||
$rows[] = array('Rent', FormatHelper::currency($unit['rent']));
|
||||
$rows[] = array('Comment', $unit['comment']);
|
||||
|
||||
echo $this->element('table',
|
||||
array('class' => 'item unit detail',
|
||||
@@ -62,9 +63,10 @@ echo '<div CLASS="detail supporting">' . "\n";
|
||||
*/
|
||||
|
||||
echo $this->element('leases', array
|
||||
('config' => array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
('caption' => 'Lease History',
|
||||
'rows' => $leases,
|
||||
'filter' => array('Unit.id' => $unit['id']),
|
||||
)));
|
||||
|
||||
|
||||
@@ -74,19 +76,15 @@ echo $this->element('leases', array
|
||||
|
||||
if (isset($current_lease['id'])) {
|
||||
echo $this->element('ledger_entries', array
|
||||
(// Element configuration
|
||||
'ar_account' => true,
|
||||
'lease_id' => $current_lease['id'],
|
||||
|
||||
// Grid configuration
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
(
|
||||
'caption' =>
|
||||
('Current Lease Account ('
|
||||
. $current_lease['Customer']['name']
|
||||
. ')'),
|
||||
),
|
||||
));
|
||||
'filter' => array('Lease.id' => $current_lease['id']),
|
||||
)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user