Bug 6115 - Acquisition reports : date filter & sorting don't work
Summary: Acquisition reports : date filter & sorting don't work
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: 3.6
Hardware: All All
: P3 major (vote)
Assignee: Paul Poulain
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-07 13:39 UTC by Paul Poulain
Modified: 2013-12-05 19:59 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:


Attachments
proposed patch (11.28 KB, patch)
2011-04-07 13:41 UTC, Paul Poulain
Details | Diff | Splinter Review
proposed patch (updated) (11.37 KB, patch)
2011-05-23 12:59 UTC, Paul Poulain
Details | Diff | Splinter Review
columns sorted wrong (20.71 KB, image/png)
2011-07-06 16:08 UTC, Nicole C. Engard
Details
rows sorting right (23.46 KB, image/png)
2011-07-06 16:08 UTC, Nicole C. Engard
Details
proposed patch (updated again) (11.37 KB, patch)
2011-07-19 15:53 UTC, Paul Poulain
Details | Diff | Splinter Review
proposed patch (updated again) (11.72 KB, patch)
2011-07-22 08:25 UTC, Paul Poulain
Details | Diff | Splinter Review
before patch (23.46 KB, image/png)
2011-08-05 00:04 UTC, Nicole C. Engard
Details
after patch (21.15 KB, image/png)
2011-08-05 00:05 UTC, Nicole C. Engard
Details
wrong order screenshot (152.38 KB, image/png)
2011-08-05 09:28 UTC, Paul Poulain
Details
wrong order screenshot (152.05 KB, image/png)
2011-08-05 09:31 UTC, Paul Poulain
Details
BZ6115: Acquisition reports : date filter & sorting don't work (11.49 KB, patch)
2011-12-26 17:23 UTC, Paul Poulain
Details | Diff | Splinter Review
BZ6115: Acquisition reports : date filter & sorting don't work (11.54 KB, patch)
2011-12-27 23:26 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Poulain 2011-04-07 13:39:53 UTC
* the filter on dates don't work
* when displaying by day or month, it was 100% alphabetic, april was before january for example. Adding the month number before the month name to get proper sorting
Comment 1 Paul Poulain 2011-04-07 13:41:12 UTC Comment hidden (obsolete)
Comment 2 Frederic Durand 2011-04-08 12:44:01 UTC
This patch working for sort grouping by month (march is getting before april).
But not for day of week : 4-Friday is coming before 0-Monday.
Comment 3 Paul Poulain 2011-05-23 12:59:25 UTC Comment hidden (obsolete)
Comment 4 Nicole C. Engard 2011-07-06 16:07:42 UTC
Saturday is coming before Wednesday in the column headings - but is right in the row headings.  marking failed-qa
Comment 5 Nicole C. Engard 2011-07-06 16:08:02 UTC
Created attachment 4567 [details]
columns sorted wrong
Comment 6 Nicole C. Engard 2011-07-06 16:08:17 UTC
Created attachment 4568 [details]
rows sorting right
Comment 7 Paul Poulain 2011-07-19 15:53:55 UTC Comment hidden (obsolete)
Comment 8 Paul Poulain 2011-07-22 08:25:56 UTC Comment hidden (obsolete)
Comment 9 Paul Poulain 2011-07-22 08:26:43 UTC
diff between the previous one and the correct one: 
-    $strsth2 .= " ORDER BY $column";
+    $strsth2 .= " ORDER BY $colfield";
Comment 10 Nicole C. Engard 2011-08-05 00:04:52 UTC
Created attachment 4851 [details]
before patch

I'm not sure I like the change this patch applies.  The reports are in order by date just fine without the patch as shown in the attachment.
Comment 11 Nicole C. Engard 2011-08-05 00:05:24 UTC
Created attachment 4852 [details]
after patch

after the patch it's showing the month number which is kind of distracting ... or am i missing what else this patch is doing?
Comment 12 Paul Poulain 2011-08-05 09:28:02 UTC
Created attachment 4856 [details]
wrong order screenshot

Nicole, here is a screenshot with the problems (it's for weekdays).
Comment 13 Paul Poulain 2011-08-05 09:31:09 UTC
Created attachment 4857 [details]
wrong order screenshot

Here is a wrong screenshot based on months

Nicole: after investigating, it seems that the problem is visible only under certain circumstances.
I think -but am not sure- if your datas alway have closedate ordered like basketid, then the result is correct, but it's by chance.
My test DB contains :
mysql> select closedate,basketno FROM aqbasket;
+------------+----------+
| closedate  | basketno |
+------------+----------+
| 2011-06-20 |        1 |
| 2010-07-20 |        2 |

(basket 1 closed after basket 2)
Comment 14 Katrin Fischer 2011-12-21 05:26:18 UTC
Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all y
Applying: BZ6115: Acquisition reports : date filter & sorting don't work
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging reports/acquisitions_stats.pl
CONFLICT (content): Merge conflict in reports/acquisitions_stats.pl
Failed to merge in the changes.
Patch failed at 0001 BZ6115: Acquisition reports : date filter & sorting don't work
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
Comment 15 Paul Poulain 2011-12-26 17:23:31 UTC Comment hidden (obsolete)
Comment 16 Chris Cormack 2011-12-27 23:26:05 UTC
Created attachment 6939 [details] [review]
BZ6115: Acquisition reports : date filter & sorting don't work

* the filter on dates don't work
* when displaying by day or month, it was 100% alphabetic, april was before
january for example. Adding the month number before the month name to get
proper sorting
* removed many commented warn & lines

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Comment 17 Chris Cormack 2011-12-27 23:28:09 UTC
Testing results

1/ Date filters work well

2/ Grouping by month/day of week/year produces a well sorted list
Comment 18 Marcel de Rooy 2012-01-18 12:50:48 UTC
QA Comment:
Looks good. Lots of warns removed. Has a solid signoff. patch_status++
Comment 19 Jared Camins-Esakov 2012-05-23 12:55:41 UTC
This fix was included in the 3.6.x branch prior to 3.6.4.