Sorting by billing date in the invoices table in acquisitions doesn't work. In my case there was only one date and the other fields were empty. Sorting the column didn't result in any change. Other columns sort nicely.
Created attachment 20924 [details] [review] Bug 10794 - Sorting on billing date column in invoices table doesn't work This patch adds the sorting by title string option to the table of invoices. This allows column data to be sorted based on the ISO-formatted date rather than the formatted-for-display date. A "blank" (0000-00-00) date is added to cells which contain no date data. To test, view the Acquisitions Invoices page (acqui/invoices.pl) and confirm that the "Billing date" column is sorted correctly regardless of the dateformat system preference. http://bugs.koha-community.org/show_bug.cgi?id=10749
Patch applied cleanly, go forth and signoff
Created attachment 21738 [details] [review] [SIGNED-OFF] Bug 10794 - Sorting on billing date column in invoices table doesn't work This patch adds the sorting by title string option to the table of invoices. This allows column data to be sorted based on the ISO-formatted date rather than the formatted-for-display date. A "blank" (0000-00-00) date is added to cells which contain no date data. To test, view the Acquisitions Invoices page (acqui/invoices.pl) and confirm that the "Billing date" column is sorted correctly regardless of the dateformat system preference. http://bugs.koha-community.org/show_bug.cgi?id=10749 Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Created attachment 21830 [details] [review] Bug 10794 - Sorting on billing date column in invoices table doesn't work This patch adds the sorting by title string option to the table of invoices. This allows column data to be sorted based on the ISO-formatted date rather than the formatted-for-display date. A "blank" (0000-00-00) date is added to cells which contain no date data. To test, view the Acquisitions Invoices page (acqui/invoices.pl) and confirm that the "Billing date" column is sorted correctly regardless of the dateformat system preference. http://bugs.koha-community.org/show_bug.cgi?id=10749 Signed-off-by: Srdjan <srdjan@catalyst.net.nz> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Template only change, passes all tests and QA script. Sorting of the billing column now works as expected.
Pushed to master. Thanks, Owen!
This bug is still showing up in Koha 3.14 and 3.14.3. It seems like the patch should have been implemented in one of the more recent updates, but it has not.
It was implemented and it worked, at least for a while ;) But indeed, it's not working properly since "Bug 10401: Add ability to merge invoices" has been pushed - there was 1st extra column with checkboxes added, and this code $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, { sDom: "t", "aoColumns": [ null,null,{ "sType": "title-string" },null,null,null,null ], aoColumnDefs: [ { "bSortable": false, "aTargets": [0, 7] } ] })); was not fully adjusted to reflect this change ( "sType": "title-string" now applies to "Vendor" column, not "Billing date"). BTW, I think it may be something else not quite right with this code; that's what I'm getting in 3.14 and in (not so current) master: 1) "Billing date" sorting is not OK, 2) "Vendor" column is not sortable at all, 3) top/bottom DataTables pagination bars are missing (tested in Firefox 27.0, might be browser dependant?) - only "top ten" invoices are always displayed in the table, and it's not possible to change that without pagination bars. By some trial-and-error, I got it working (1-3) with: $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, { aoColumnDefs: [ { "bSortable": false, "aTargets": [0, 7] }, { "sType": "string", "aTargets": [ 3 ] } ] })); but it's my first real experience with DataTables; not sure if I know what I'm doing.
Or perhaps something like this $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, { bPaginate: false, sDom: "t", aoColumnDefs: [ { "bSortable": false, "aTargets": [0, 7] }, { "sType": "string", "aTargets": [ 3 ] } ] })); will be better (= no pagination bars/no filter on table, but all rows being displayed, not just top 10)? Unless "top ten rows only display" is a feature, and not a bug? If so, personally I find it not very intuitive..
Yeah, I did notice that it was only displaying 10 items and there was no option to show the rest. Which would be another bug. Unless they are being caused by the same thing. I tested it in Firefox and Google Chrome, so I would guess that the Data Table Pagination bars are not a browser issue.
(In reply to Joseph Alway from comment #9) > Yeah, I did notice that it was only displaying 10 items and there was no > option to show the rest. Which would be another bug. Unless they are being > caused by the same thing. Still don't know if the "top 10 only display" is a bug or a feature but I made a patch to fix both issues; see bug 11798.
(In reply to Joseph Alway from comment #9) BTW (on a not quite related subject - but we'll be grateful if someone can shed some light on this mystery) we/our translation people were wondering what is the precise meaning of the "Billing date": - date the invoice was issued by vendor, - date the invoice was shipped to/given to, or arrived to the client, - date the payment is due, - date the payment was actually made ?