From 229cb65629c93d30191bc6c797d06021942239b2 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 7 Jan 2015 08:26:57 -0500 Subject: [PATCH] Bug 13525 - Date sorting on accounts (fines) tab doesn't work correctly Date sorting of charges under Patron -> Fines -> Account is done based on formatted dates, so sorting is broken depending on your dateformat system preference. This patch implements the standard "title-string" date sorting method. To test, apply the patch and view the Account tab. Test sorting of charges under various settings of the dateformat system preference. Date sorting should work correctly in all cases. Signed-off-by: Katrin Fischer Works as described and fixes sorting problem. Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- .../prog/en/modules/members/boraccount.tt | 10 +++++++--- members/boraccount.pl | 2 -- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt index f87c475343..109bdfc9c5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -1,3 +1,4 @@ +[% USE KohaDates %] [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › Account for [% INCLUDE 'patron-title.inc' %] [% INCLUDE 'doc-head-close.inc' %] @@ -10,7 +11,10 @@ $(document).ready(function() { var table_account_fines = $("#table_account_fines").dataTable($.extend(true, {}, dataTablesDefaults, { "sPaginationType": "four_button", 'aaSorting': [[0, 'desc']], - "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>' + "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>', + "aoColumnDefs": [ + { "sType": "title-string", "aTargets" : [ "title-string" ] } + ] })); $("#filter_c").html('

'+txtActivefilter+''); $('#filter_transacs').click(function(e) { @@ -55,7 +59,7 @@ $(document).ready(function() { - + @@ -71,7 +75,7 @@ $(document).ready(function() { [% FOREACH account IN accounts %] [% IF ( loop.odd ) %][% ELSE %][% END %] - +
DateDate Description of charges Note Amount
[% account.date %][% account.date |$KohaDates %] [% SWITCH account.accounttype %] [% CASE 'Pay' %]Payment, thanks diff --git a/members/boraccount.pl b/members/boraccount.pl index d3b5240566..b9eaad6b8a 100755 --- a/members/boraccount.pl +++ b/members/boraccount.pl @@ -27,7 +27,6 @@ use warnings; use C4::Auth; use C4::Output; -use C4::Dates qw/format_date/; use CGI qw ( -utf8 ); use C4::Members; use C4::Branch; @@ -84,7 +83,6 @@ foreach my $accountline ( @{$accts}) { $accountline->{amountoutstandingcredit} = 1; } - $accountline->{date} = format_date($accountline->{date}); $accountline->{amount} = sprintf '%.2f', $accountline->{amount}; $accountline->{amountoutstanding} = sprintf '%.2f', $accountline->{amountoutstanding}; if ($accountline->{accounttype} =~ /^Pay/) { -- 2.39.5