From 56d24973c4801eebdb9d94eefb9792d8381ae63b Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 26 Nov 2025 16:29:12 +0000 Subject: [PATCH] Bug 41316: Use patrons homelibrary for selecting overdues that should be sent Currently the patron homelibrary option for OverdueNoticeFrom will select overdues for a branches triggers based on the issuing branch The other two options select the trigger/overdues based on the selection This patch alters the selection of overdues to match only for the patrons branch To test: 1 - Apply 41315 and follow the plan there 2 - Apply this bug and run the overdues script, assuming CPL is branch A: perl misc/cronjobs/overdue_notices.pl --triggered --library CPL --test --nomail -v -v 3 - No overdues should be triggered 4 - Run the script for one of the patrons home libraries, in my case MPL perl misc/cronjobs/overdue_notices.pl --triggered --library MPL --test --nomail -v -v 5 - Note only overdues for patrons from that branch are triggered --- misc/cronjobs/overdue_notices.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index f6bd9b2449e..b2acceb3348 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -578,6 +578,8 @@ END_SQL if ($owning_library) { $borrower_sql .= ' AND items.homebranch=? '; + } elsif ($patron_homelibrary) { + $borrower_sql .= ' AND borrowers.branchcode=? '; } else { $borrower_sql .= ' AND issues.branchcode=? '; } @@ -748,7 +750,7 @@ END_SQL $item_statement->finish; my @message_transport_types = - @{ GetOverdueMessageTransportTypes( $branchcode, $overdue_rules->{categorycode}, $i ) }; + @{ GetOverdueMessageTransportTypes( $notice_branchcode, $overdue_rules->{categorycode}, $i ) }; @message_transport_types = @{ GetOverdueMessageTransportTypes( q{}, $overdue_rules->{categorycode}, $i ) } unless @message_transport_types; -- 2.39.5