Very, very messy and broken. It does work somewhat, but I can see just what a mess it's going to be to carry it out, so I'm abandoning.
git-svn-id: file:///svn-source/pmgr/branches/reconcile_entry_to_receipt_20090629@187 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -119,7 +119,7 @@ foreach ($jqGridColumns AS &$col) {
|
||||
}
|
||||
elseif ($col['formatter'] === 'date') {
|
||||
$default['formatoptions'] = array('newformat' => 'm/d/Y');
|
||||
$default['width'] = 90;
|
||||
$default['width'] = 100;
|
||||
$default['align'] = 'center';
|
||||
}
|
||||
elseif ($col['formatter'] === 'name' || $col['formatter'] === 'longname') {
|
||||
|
||||
@@ -1,17 +1,24 @@
|
||||
<?php /* -*- mode:PHP -*- */
|
||||
|
||||
if (isset($account_ftype) || isset($ledger_id) || isset($account_id) || isset($ar_account)) {
|
||||
if (isset($account_ftype) || isset($ledger_id) || isset($lease_id) || isset($account_id) || isset($ar_account)) {
|
||||
$single_account = true;
|
||||
} else {
|
||||
$single_account = false;
|
||||
}
|
||||
|
||||
if (isset($ledger_id) || isset($account_id) || isset($ar_account)) {
|
||||
if (isset($ledger_id) || isset($lease_id) || isset($account_id) || isset($ar_account)) {
|
||||
$single_amount = false;
|
||||
} else {
|
||||
$single_amount = true;
|
||||
}
|
||||
|
||||
if (isset($lease_id) || isset($customer_id)) {
|
||||
$references = false;
|
||||
}
|
||||
else {
|
||||
$references = true;
|
||||
}
|
||||
|
||||
if (isset($reconcile_id)) {
|
||||
$applied_amount = true;
|
||||
} else {
|
||||
@@ -47,9 +54,13 @@ else {
|
||||
$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');
|
||||
|
||||
if ($references) {
|
||||
$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);
|
||||
|
||||
|
||||
@@ -1,17 +1,38 @@
|
||||
<?php /* -*- mode:PHP -*- */
|
||||
|
||||
if (isset($reconcile_ledger_entry_id)) {
|
||||
$applied_amount = true;
|
||||
} else {
|
||||
$applied_amount = false;
|
||||
}
|
||||
|
||||
$subtotal_amount = false;
|
||||
|
||||
// Define the table columns
|
||||
$cols = array();
|
||||
$cols['ID'] = array('index' => 'Transaction.id', 'formatter' => 'id');
|
||||
//$cols['Customer'] = array('index' => 'Customer.name', 'formatter' => 'longname');
|
||||
$cols['Timesamp'] = array('index' => 'Transaction.stamp', 'formatter' => 'date');
|
||||
$cols['Timestamp'] = array('index' => 'Transaction.stamp', 'formatter' => 'date');
|
||||
$cols['Through'] = array('index' => 'Transaction.through_date', 'formatter' => 'date');
|
||||
$cols['Due'] = array('index' => 'Transaction.due_date', 'formatter' => 'date');
|
||||
$cols['Comment'] = array('index' => 'Transaction.comment', 'formatter' => 'comment');
|
||||
|
||||
if ($applied_amount) {
|
||||
$cols['Applied'] = array('index' => "Reconciliation.amount", 'formatter' => 'currency');
|
||||
}
|
||||
|
||||
if ($subtotal_amount) {
|
||||
$cols['Sub-Total'] = array('index' => 'subtotal', 'formatter' => 'currency', 'sortable' => false);
|
||||
}
|
||||
|
||||
$jqGrid_options = array('jqGridColumns' => $cols,
|
||||
'controller' => 'transactions',
|
||||
'caption' => isset($caption) ? $caption : null);
|
||||
);
|
||||
|
||||
$jqGrid_options += compact('grid_div_id', 'grid_id', 'caption', 'grid_setup', 'limit');
|
||||
|
||||
$custom_post_data = compact('reconcile_type', 'reconcile_ledger_entry_id');
|
||||
|
||||
|
||||
if (isset($transactions)) {
|
||||
$jqGrid_options += array('custom_ids' =>
|
||||
@@ -20,8 +41,14 @@ if (isset($transactions)) {
|
||||
$transactions),
|
||||
'limit' => 5);
|
||||
}
|
||||
elseif (isset($reconcile_ledger_entry_id)) {
|
||||
$jqGrid_options += array('limit' => 5);
|
||||
}
|
||||
else {
|
||||
$jqGrid_options += array('search_fields' => array('Due', 'Comment'));
|
||||
}
|
||||
|
||||
$jqGrid_options += compact('custom_post_data');
|
||||
$jqGrid_options['sort_column'] = 'Timestamp';
|
||||
|
||||
echo $this->element('jqGrid', $jqGrid_options);
|
||||
|
||||
@@ -81,7 +81,7 @@ echo '<div CLASS="detail supporting">' . "\n";
|
||||
echo $this->element('ledger_entries',
|
||||
array('caption' => 'Account',
|
||||
'lease_id' => $lease['id'],
|
||||
'ar_account' => true,
|
||||
//'ar_account' => true,
|
||||
));
|
||||
|
||||
|
||||
|
||||
@@ -112,22 +112,20 @@ echo '<div CLASS="detail supporting">' . "\n";
|
||||
*/
|
||||
|
||||
if ($debit_ledger['Account']['trackable']) {
|
||||
echo $this->element('ledger_entries',
|
||||
echo $this->element('transactions',
|
||||
array('caption' => "Payments Received",
|
||||
'grid_div_id' => 'debit_reconciliation_ledger_entries',
|
||||
'account_ftype' => 'debit',
|
||||
'reconcile_id' => $entry['id'],
|
||||
//'ledger_entries' => $reconciled['debit']['entry'],
|
||||
'reconcile_type' => 'debit',
|
||||
'reconcile_ledger_entry_id' => $entry['id'],
|
||||
));
|
||||
}
|
||||
|
||||
if ($credit_ledger['Account']['trackable']) {
|
||||
echo $this->element('ledger_entries',
|
||||
echo $this->element('transactions',
|
||||
array('caption' => "Charges Paid",
|
||||
'grid_div_id' => 'credit_reconciliation_ledger_entries',
|
||||
'account_ftype' => 'credit',
|
||||
'reconcile_id' => $entry['id'],
|
||||
//'ledger_entries' => $reconciled['credit']['entry'],
|
||||
'reconcile_type' => 'credit',
|
||||
'reconcile_ledger_entry_id' => $entry['id'],
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user