From f2274b5d93fa2cffc61fa6afa025218d0afac180 Mon Sep 17 00:00:00 2001 From: kohamaster Date: Mon, 7 Nov 2016 18:43:41 +0100 Subject: [PATCH] Bug 17470 Make overdue notices according to branch item only When a patron had overdues on items from different branches he received from each corresponding branch a notice claiming the complete list of these items. --- misc/cronjobs/overdue_notices.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index 7504c7a..fcde42b 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -465,6 +465,7 @@ SELECT biblio.*, items.*, issues.*, biblioitems.itemtype, branchname AND b.branchcode = items.homebranch AND biblio.biblionumber = biblioitems.biblionumber AND issues.borrowernumber = ? + AND items.homebranch=? AND TO_DAYS($date)-TO_DAYS(issues.date_due) >= 0 END_SQL @@ -613,7 +614,7 @@ END_SQL ) unless $test_mode; $verbose and warn "debarring $borr\n"; } - my @params = ($borrowernumber); + my @params = ($borrowernumber,$branchcode); $verbose and warn "STH2 PARAMS: borrowernumber = $borrowernumber"; $sth2->execute(@params); -- 2.1.4