diff --git a/site/controllers/statement_entries_controller.php b/site/controllers/statement_entries_controller.php index bc20932..f4779e4 100644 --- a/site/controllers/statement_entries_controller.php +++ b/site/controllers/statement_entries_controller.php @@ -158,8 +158,11 @@ class StatementEntriesController extends AppController { // defaults into the sort mechanism. If we're already // sorting by one of them, it will only be redundant, // and should cause no harm (possible a longer query?) - $order[] = 'Transaction.stamp ' . $direction; - $order[] = 'StatementEntry.effective_date ' . $direction; + if ($index != 'Transaction.stamp' && + $index != 'StatementEntry.effective_date') { + $order[] = 'Transaction.stamp ' . $direction; + $order[] = 'StatementEntry.effective_date ' . $direction; + } $order[] = 'StatementEntry.id ' . $direction; return $order;