From b0ed658d3ba990282d21132443efde89ed517d54 Mon Sep 17 00:00:00 2001 From: John Beppu Date: Tue, 3 Feb 2009 16:02:14 -0600 Subject: [PATCH] bug 341: Use the Right Branch When sending circulation alerts, use the branch that the event happened on instead of $item->{homebranch}. Signed-off-by: Daniel Sweeney Signed-off-by: Galen Charlton --- C4/Circulation.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index d22e28ceaf..e4019a4246 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1032,6 +1032,7 @@ sub AddIssue { type => 'CHECKOUT', item => $item, borrower => $borrower, + branch => $branch, }); } } @@ -1531,6 +1532,7 @@ sub AddReturn { type => 'CHECKIN', item => $iteminformation, borrower => $borrower, + branch => $branch, }); } @@ -2380,6 +2382,10 @@ Hashref of information about the item being checked in or out. Hashref of information about the borrower of the item. +=item branch + +The branchcode from where the checkout or check-in took place. + =back B: @@ -2388,13 +2394,15 @@ B: type => 'CHECKOUT', item => $item, borrower => $borrower, + branch => $branch, }); =cut sub SendCirculationAlert { my ($opts) = @_; - my ($type, $item, $borrower) = ($opts->{type}, $opts->{item}, $opts->{borrower}); + my ($type, $item, $borrower, $branch) = + ($opts->{type}, $opts->{item}, $opts->{borrower}, $opts->{branch}); my %message_name = ( CHECKIN => 'Item Check-in', CHECKOUT => 'Item Checkout', @@ -2407,7 +2415,7 @@ sub SendCirculationAlert { C4::Letters::parseletter($letter, 'biblio', $item->{biblionumber}); C4::Letters::parseletter($letter, 'biblioitems', $item->{biblionumber}); C4::Letters::parseletter($letter, 'borrowers', $borrower->{borrowernumber}); - C4::Letters::parseletter($letter, 'branches', $item->{homebranch}); + C4::Letters::parseletter($letter, 'branches', $branch); my @transports = @{ $borrower_preferences->{transports} }; # warn "no transports" unless @transports; for (@transports) { -- 2.39.5