Bug 13679

Summary: If you have overdues that match a rule, and have some items due in the future they are included in the list of overdues
Product: Koha Reporter: Chris Cormack <chris>
Component: NoticesAssignee: Bugs List <koha-bugs>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: gmcharlt, jonathan.druart, katrin.fischer, kyle.m.hall, nick, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 12529    
Bug Blocks:    
Attachments: Bug 13679 : Bug in listing overdues
[SIGNED OFF] Bug 13679 : Bug in listing overdues
Bug 13679 : Bug in listing overdues

Description Chris Cormack 2015-02-07 04:04:12 UTC

    
Comment 1 Chris Cormack 2015-02-07 04:06:29 UTC Comment hidden (obsolete)
Comment 2 Nick Clemens 2015-02-13 19:42:55 UTC
I tried testing but cannot recreate

Patron has items due: 2 days ago, yesterday, today, and 2 weeks in future

Notice triggers at 1,5 and 10 days

Running script with -csv and I only see the two overdues
I checked the message queue and see the same there

testing on kohadevbox
Comment 3 Jonathan Druart 2015-02-16 08:23:15 UTC
Did you launch with or without the -t parameter?
Comment 4 Nick Clemens 2015-02-16 20:19:08 UTC
(In reply to Jonathan Druart from comment #3)
> Did you launch with or without the -t parameter?

With -t I only see the item 2 days overdue
Without -t  I see the items due yesterday and 2 days before.
Comment 5 Jonathan Druart 2015-02-17 08:37:50 UTC
Nick,
Yes actually the test plan is not precis enough.
The problem comes from the 3rd overdue, so you need something like:
- Notice triggers at 1, 5, 10 days
- And items due 1, 2 days ago and 11+ (<90) days in the future.
Comment 6 Nick Clemens 2015-02-17 19:49:13 UTC Comment hidden (obsolete)
Comment 7 Nick Clemens 2015-02-17 19:50:02 UTC
(In reply to Jonathan Druart from comment #5)
> Nick,
> Yes actually the test plan is not precis enough.
> The problem comes from the 3rd overdue, so you need something like:
> - Notice triggers at 1, 5, 10 days
> - And items due 1, 2 days ago and 11+ (<90) days in the future.

Somehow leaving my VM over the weekend and coming back today made it trigger right. :-)
Comment 8 Jonathan Druart 2015-02-19 10:56:09 UTC
Created attachment 36020 [details] [review]
Bug 13679 : Bug in listing overdues

To test
1/ Create some overdues and some issues due in the future
2/ Run the overdues script
3/ Notice item due in the future is in the list
4/ Apply patch
5/ Run script again
6/ Notice in the future not in the list

Signed-off-by: Nick <Nick@quechelibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 9 Jonathan Druart 2015-02-19 10:58:01 UTC
I am raising the severity of this bug.
I confirm it could affect the -t parameter also.
For instance, if you have a trigger at day = X and you have 2 overdue items due at today - X and today + X, both will be marked as late.
Comment 10 Tomás Cohen Arazi 2015-02-20 14:13:04 UTC
Patch pushed to master.

Thanks Chrïs!
Comment 11 Chris Cormack 2015-02-22 23:04:08 UTC
Pushed to 3.18.x will be in 3.18.4