[Koha-bugs] [Bug 10792] Amounts in funds table on acquisitions home page not sorting correctly

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sat Sep 7 02:36:02 CEST 2013


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10792

Chris Cormack <chris at bigballofwax.co.nz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #20805|0                           |1
        is obsolete|                            |

--- Comment #2 from Chris Cormack <chris at bigballofwax.co.nz> ---
Created attachment 20839
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=20839&action=edit
Bug 10792: fix sorting of funds table on acquisitions home page

This patch introduces a DataTables sorting plugin, title-numeric,
for sorting cells based on a decimal number embedded in a span title
attribute.  This allows currency amounts to be formatted properly
for display without having to writing a sorting plugin that's
super-smart about removing the formatting, particularly for locales
that use a comma as the decimal mark.

The sorter plugin can be used like this:

- In the DataTables config:

"aoColumns": [
   { "sType": "title-numeric" },
]

- In the table data

<td><span title="[% decimal_number_that_JS_parseFloat_accepts %]">
    [% formatted currency %]
</span></td>

To test:

[1] Go to the acquisitions home page.  Note that changing the sort order
    on the amount, ordered, spent, or avail columns results in incorrect
    sorting that is either ASCII-betical or which ignores any component
    of large numbers that occur after the thousands separator.
[2] Apply the patch.
[3] Verify that the sorting now works correctly and that no JavaScript
    errors appear in the JS debug console of your choice.

Signed-off-by: Galen Charlton <gmc at esilibrary.com>
Signed-off-by: Chris Cormack <chris at bigballofwax.co.nz>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list