diff --git a/controllers/customers_controller.php b/controllers/customers_controller.php index df2e679..c0c5e1a 100644 --- a/controllers/customers_controller.php +++ b/controllers/customers_controller.php @@ -379,20 +379,9 @@ class CustomersController extends AppController { $this->Customer->recursive = -1; $customer = $this->Customer->read(null, $id); $customer = $customer['Customer']; - $unreconciled = $this->Customer->unreconciledCharges($id); - //pr($unreconciled); - $charges = $unreconciled['entries']; - $stats = $unreconciled['summary']['Charge']; - // Kludge until we update receipt to have the unpaid - // charges grid generated from a dynamic query instead - // of simply pre-providing the list of charge IDs - foreach ($charges AS &$charge) - $charge['id'] = $charge['StatementEntry']['id']; } else { $customer = null; - $charges = array(); - $stats = array('balance' => 0); } $TT = new TenderType(); @@ -401,7 +390,7 @@ class CustomersController extends AppController { $this->set(compact('payment_types', 'default_type')); $title = ($customer['name'] . ': Receipt Entry'); - $this->set(compact('customer', 'charges', 'stats', 'title')); + $this->set(compact('customer', 'title')); } diff --git a/controllers/statement_entries_controller.php b/controllers/statement_entries_controller.php index 26bbd86..6e4e52a 100644 --- a/controllers/statement_entries_controller.php +++ b/controllers/statement_entries_controller.php @@ -35,7 +35,7 @@ class StatementEntriesController extends AppController { * to jqGrid. */ - function gridDataTables(&$params, &$model) { + function gridDataCountTables(&$params, &$model) { $link = array(// Models 'Transaction' => @@ -58,25 +58,18 @@ class StatementEntriesController extends AppController { ), ); - if (isset($params['post']['custom']['statement_entry_id'])) { - $link['DisbursementEntry'] = array(); - $link['ChargeEntry'] = array(); + return array('link' => $link); + } + + function gridDataTables(&$params, &$model) { + $tables = $this->gridDataCountTables($params, $model); + + if (in_array('applied', $params['post']['fields'])) { + $tables['link']['DisbursementEntry'] = array(); + $tables['link']['ChargeEntry'] = array(); } -/* if ($params['action'] === 'collected') { */ -/* $link['DisbursementEntry'] = array('Receipt' => array('class' => 'Transaction')); */ -/* $link['ChargeEntry'] = array('Invoice' => array('class' => 'Transaction')); */ -/* } */ - -/* if (count(array_intersect($params['fields'], array('applied'))) == 1) { */ -/* $link['DisbursementEntry'] = array(); */ -/* $link['ChargeEntry'] = array(); */ -/* } */ -/* elseif (isset($params['post']['custom']['customer_id']) || isset($params['post']['custom']['lease_id'])) { */ -/* $link['DisbursementEntry'] = array(); */ -/* } */ - - return array('link' => $link); + return $tables; } function gridDataFields(&$params, &$model) { diff --git a/views/customers/receipt.ctp b/views/customers/receipt.ctp index d9e7ba5..1b1fb82 100644 --- a/views/customers/receipt.ctp +++ b/views/customers/receipt.ctp @@ -303,17 +303,17 @@ echo ('