Bug 17001: fix due date filter on the overdue report
authorGalen Charlton <gmcharlt@gmail.com>
Fri, 29 Jul 2016 20:41:19 +0000 (20:41 +0000)
committerFrédéric Demians <f.demians@tamil.fr>
Tue, 23 Aug 2016 10:49:38 +0000 (12:49 +0200)
commit2ce7bf6ed5c6d74e3635666f93ef9e1f90d091c0
tree42470bba02eb7f2c333b7aa0509d1e02da47527d
parent7547ffcc96a43fb4228896a431344155c72bc910
Bug 17001: fix due date filter on the overdue report

When the TimeFormat system preference is set to "12 hour",
setting a filter on the due date can result in:

- no overdue loans being reported, even if there are some
  that meet the criteria

OR

- overdue loans being omitted from the report if they
  are due on the "until" date in the filter

This patch fixes this by replacing output_pref() with
DateTime::Format::MySQL to format the date filter values
to pass to the SQL query.

To test
-------
[1] Run the overdue report (circ/overdue.pl) and set a filter
    on due date, using values that should bring up one or
    more overdue loans.
[2] Note that zero overdue loans are returned (if using MySQL
    5.5, 5.6, or 5.7 or MariaDB 5) or that loans due on the
    "until" date are omitted (if using MarioDB 10).
[3] Apply the patch and repeat step 1. This time, the correct
    set of overdue loans should be reported.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Jason Robb <jrobb@sekls.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 761001add1a95d147a23b74e8d817890ffc08ac5)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
circ/overdue.pl