Bug 9362: fix query that finds upcoming due loans
authorFridolyn SOMERS <fridolyn.somers@biblibre.com>
Tue, 9 Jul 2013 15:38:04 +0000 (17:38 +0200)
committerChris Hall <followingthepath@gmail.com>
Sun, 15 Sep 2013 05:06:06 +0000 (17:06 +1200)
commitb06b6f2438aca661929d4233f2b2ca24ba8589c6
tree2b04d588801c72993fd8e2c9dfe81af2deaf5459
parente601e013db6954cb0d5f647337bb08b6e9b8317e
Bug 9362: fix query that finds upcoming due loans

C4:Circulation:GetUpcomingDueIssues is used in the advance_notices.pl
script.  This patch corrects an error in its handling of the maxdays
parameter that resulted in it picking up *all* upcoming due loans and
recently overdue loans.

Test plan :
- Create an issue with a date due in the paste
- Create an issue with a date due in two days
- Launch advance notices with due date in max 2 days : perl misc/cronjobs/advance_notices.pl -c -n -v -m=2
=> You get a warn "found 0 issues"
- Launch advance notices with due date in max 3 days : perl misc/cronjobs/advance_notices.pl -c -n -v -m=3
=> You get a warn "found 1 issues"

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
I did the following test :

- 1 book to check in 2 days
- 2 books to check in in the past

before applying the patch :

$perl ../misc/cronjobs/advance_notices.pl -c -n -v -m=2
getting upcoming due issues at ../misc/cronjobs/advance_notices.pl line 203.
found 1 issues at ../misc/cronjobs/advance_notices.pl line 205.

I changed the value of "-m" : 0, 1, 2, 3, 4
=> always 1 issue found (the book to check in in 2 days)

after applying the patch :

$perl ../misc/cronjobs/advance_notices.pl -c -n -v -m=2
found 0 issues
for m = 0, 1, 2 => 0 issues

$perl ../misc/cronjobs/advance_notices.pl -c -n -v -m=3
found 1 issues
for m = 3,4,5 => 1 issues (the book to check in in 2 days)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, works as advertised.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit ff7f37202949bb6d60cdf30de4e237e6b1de93eb)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit f40924b317e37757f1e552ab466dc840304c6182)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit f40924b317e37757f1e552ab466dc840304c6182)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit fb11fb31a4357777328b80fd5ad6ce5694823d11)
C4/Circulation.pm