From a8991d21b7e358c639efa7a41986015ba37add5a Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 1 Oct 2014 08:25:02 -0400 Subject: [PATCH] Bug 13020 - Checkouts table default ordering is incorrect The checkouts table is no longer keeping "today's checkouts" in the order they were scanned. Test Plan: 1) Create 3 records "Test 1", "Test 2" and "Test 3" each with one item 2) Check out the items to a patron in the order "Test 2", "Test 1", "Test 3". 3) Note the order is incorrect. 4) Apply this patch 5) Refresh the page 6) Note the order is now correct --- koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js | 6 +++--- svc/checkouts | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js index 910cd1f..055d8aa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js @@ -156,9 +156,9 @@ $(document).ready(function() { { "mDataProp": function( oObj ) { if ( oObj.issued_today ) { - return "0"; + return "1" + oObj.timestamp; } else { - return "100"; + return "0" + oObj.date_due; } } }, @@ -370,7 +370,7 @@ $(document).ready(function() { { iGroupingColumnIndex: 1, iGroupingOrderByColumnIndex: 0, - sGroupingColumnSortDirection: "asc" + sGroupingColumnSortDirection: "desc" } ); diff --git a/svc/checkouts b/svc/checkouts index f56bdff..11f0895 100755 --- a/svc/checkouts +++ b/svc/checkouts @@ -61,6 +61,7 @@ my $sql = ' issuedate, date_due, date_due < now() as date_due_overdue, + issues.timestamp, biblionumber, biblio.title, @@ -150,6 +151,7 @@ while ( my $c = $sth->fetchrow_hashref() ) { issuedate => $c->{issuedate}, date_due => $c->{date_due}, date_due_overdue => $c->{date_due_overdue} ? JSON::true : JSON::false, + timestamp => $c->{timestamp}, renewals_count => $renewals_count, renewals_allowed => $renewals_allowed, renewals_remaining => $renewals_remaining, -- 1.7.2.5