Bug 17470 Make overdue notices according to branch item only
authorOlivier Crouzet <kohateam@univ-lyon3.fr>
Thu, 10 Nov 2016 16:25:09 +0000 (17:25 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 16 Dec 2016 11:06:52 +0000 (11:06 +0000)
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.

Signed-off-by: sbujam <sbujam@users.noreply.github.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
misc/cronjobs/overdue_notices.pl

index 7504c7a..0aaf22a 100755 (executable)
@@ -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 issues.branchcode = ?
     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);