Bug 13035

Summary: Overdue notices send notices for due date in future.
Product: Koha Reporter: Rafal Kopaczka <rkopaczka>
Component: NoticesAssignee: Rafal Kopaczka <rkopaczka>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: tomascohen
Version: Main   
Hardware: All   
OS: All   
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.
Bug 13035: Overdue notices send notices for due date in future.
[PASSED QA] Bug 13035: Overdue notices send notices for due date in future.

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!