Bug 13035: Overdue notices send notices for due date in future.
authorRafal Kopaczka <rkk0@poczta.onet.pl>
Tue, 7 Oct 2014 12:43:36 +0000 (14:43 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Sun, 19 Oct 2014 14:37:44 +0000 (11:37 -0300)
commit4114495d05a98237d1454845d7851e52178924fb
tree85167c4afda0e798a2ce596fedd882c52dbcabd5
parent8848e72d781d53941446bed36d574d9311ffa0fc
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.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
misc/cronjobs/overdue_notices.pl