Bug 13035 - Overdue notices send notices for due date in future.
Summary: Overdue notices send notices for due date in future.
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Rafal Kopaczka
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-07 12:43 UTC by Rafal Kopaczka
Modified: 2015-06-04 23:33 UTC (History)
1 user (show)

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


Attachments
Bug 13035: Overdue notices send notices for due date in future. (1.62 KB, patch)
2014-10-07 12:47 UTC, Rafal Kopaczka
Details | Diff | Splinter Review
Bug 13035: Overdue notices send notices for due date in future. (1.67 KB, patch)
2014-10-14 15:06 UTC, Chris Cormack
Details | Diff | Splinter Review
[PASSED QA] Bug 13035: Overdue notices send notices for due date in future. (1.79 KB, patch)
2014-10-16 13:05 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Rafal Kopaczka 2014-10-07 12:43:12 UTC
Overdue notices, script uses method days_between which returns always positive value of days, no mater if due_date is higher or lower from date_to_run. This causes overdue notices to be send for real overdue and for checkouts with due date in future, which have same days_between as in notice triggers. 

To reproduce:
1. Set up overdue notice triggers for eg. 2 day.
2. Checkout items for 2 borrowers first gets item with due date 2 days in past and second gets 2 days in future.
3. run ./misc/cronjobs/overdue_notices.pl -n -t
4. watch that notices was generated for both of them.
Comment 1 Rafal Kopaczka 2014-10-07 12:47:43 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2014-10-14 15:06:33 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2014-10-16 13:05:10 UTC
Created attachment 32406 [details] [review]
[PASSED QA] Bug 13035: Overdue notices send notices for due date in future.

Overdue notices, script uses method days_between which returns always
positive value of days, no mater if due_date is higher or lower from
date_to_run. This causes overdue notices to be send for real overdue and
for checkouts with due date in future, which have same days_between as
in notice triggers.

To reproduce:
1. Set up overdue notice triggers for eg. 2 day.
2. Checkout items for 2 borrowers first gets item with due date 2 days
in past and second gets 2 days in future.
3. run ./misc/cronjobs/overdue_notices.pl -n -t
4. watch that notices was generated for both of them.

To test:
1. Repeat steps 1,2
2. Apply patch
3. run ./misc/cronjobs/overdue_notices.pl -n -t
4. should be 1 notice for borrower with overdue item.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script, just adds an additional test.
Comment 4 Tomás Cohen Arazi 2014-10-19 14:43:50 UTC
Patch pushed to master.

Thanks Rafal!