diff --git a/site/controllers/ledger_entries_controller.php b/site/controllers/ledger_entries_controller.php index bdc55fd..8a4dafc 100644 --- a/site/controllers/ledger_entries_controller.php +++ b/site/controllers/ledger_entries_controller.php @@ -40,7 +40,7 @@ class LedgerEntriesController extends AppController { ), 'Tender' => - array('fields' => array('id', 'name'), + array('fields' => array('id', 'name', 'nsf_transaction_id'), ), /* 'DebitEntry', */ @@ -102,6 +102,21 @@ class LedgerEntriesController extends AppController { return $order; } + function gridDataPostProcessCalculatedFields(&$params, &$model, &$records) { + parent::gridDataPostProcessCalculatedFields($params, $model, $records); + foreach ($records AS &$record) { + // REVISIT : 20090730 + // We really need the grid to handle this. We probably need to + // either create a hidden column with the nsf id, or pass back + // a list of nsf items as user data. We can then add an onload + // function to sweep through the nsf items and format them. + // For now... this works. + if (!empty($record['Tender']['nsf_transaction_id'])) + $record['Tender']['name'] = + '' . $record['Tender']['name'] . ''; + } + } + function gridDataPostProcessLinks(&$params, &$model, &$records, $links) { $links['LedgerEntry'] = array('id'); $links['Transaction'] = array('id'); diff --git a/site/controllers/tenders_controller.php b/site/controllers/tenders_controller.php index a8ae2af..2509f8b 100644 --- a/site/controllers/tenders_controller.php +++ b/site/controllers/tenders_controller.php @@ -57,6 +57,21 @@ class TendersController extends AppController { return parent::gridDataRecordsExecute($params, $model, $query); } + function gridDataPostProcessCalculatedFields(&$params, &$model, &$records) { + parent::gridDataPostProcessCalculatedFields($params, $model, $records); + foreach ($records AS &$record) { + // REVISIT : 20090730 + // We really need the grid to handle this. We probably need to + // either create a hidden column with the nsf id, or pass back + // a list of nsf items as user data. We can then add an onload + // function to sweep through the nsf items and format them. + // For now... this works. + if (!empty($record['Tender']['nsf_transaction_id'])) + $record['Tender']['name'] = + '' . $record['Tender']['name'] . ''; + } + } + function gridDataPostProcessLinks(&$params, &$model, &$records, $links) { $links['Tender'] = array('name', 'id'); $links['Customer'] = array('name'); diff --git a/site/webroot/css/layout.css b/site/webroot/css/layout.css index 2707196..0699da8 100644 --- a/site/webroot/css/layout.css +++ b/site/webroot/css/layout.css @@ -239,6 +239,10 @@ table.deposit-summary td.quantity { padding-right: 0.8em; } form#collected-form input[type=button] { float : left; clear : left; } +/* NSF items */ +.nsf-tender { text-decoration: line-through; } + + /************************************************************ ************************************************************ * jqGrid