From 8848e72d781d53941446bed36d574d9311ffa0fc 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 Signed-off-by: Owen Leonard Signed-off-by: Jonathan Druart Note that the bug already exists before bug 12550. I checked on a 3.14.x branch (without the ajax circ stuff), and the order is the same as with this patch. Signed-off-by: Tomas Cohen Arazi --- 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 af11a59ece..749a3f76cd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js @@ -161,9 +161,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; } } }, @@ -375,7 +375,7 @@ $(document).ready(function() { { iGroupingColumnIndex: 1, iGroupingOrderByColumnIndex: 0, - sGroupingColumnSortDirection: "asc" + sGroupingColumnSortDirection: "desc" } ); diff --git a/svc/checkouts b/svc/checkouts index f56bdffb83..11f0895a58 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, -- 2.39.2