From bbd86d7a3043c6b39faba8c4cd1eaf91635d22b7 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 9 Oct 2020 13:08:45 +0100 Subject: [PATCH] Bug 26643: Notify librarian of completed transfers It came to light that it's not clear to all users that a checkin results in the completion of a transfer if one exists for the item being checked in. This patch adds such a notification to the error messages loop to highlight that the item has been recieved from it's sending brnach. To test 1/ Setup a transfer from branch A to branch B 2/ Check the item in at branch B 3/ Note that a new message appears in the 'Check in message' alert box saying "Item recieved from branch A" 4/ Signoff Signed-off-by: Sally Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- C4/Circulation.pm | 3 ++- circ/returns.pl | 3 +++ koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 420bd286ed..29b3347666 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2053,7 +2053,7 @@ sub AddReturn { # check if we have a transfer for this document my ($datesent,$frombranch,$tobranch) = GetTransfers( $item->itemnumber ); - # if we have a transfer to do, we update the line of transfers with the datearrived + # if we have a transfer to complete, we update the line of transfers with the datearrived my $is_in_rotating_collection = C4::RotatingCollections::isItemInAnyCollection( $item->itemnumber ); if ($datesent) { # At this point we will either fill the transfer or it is a wrong transfer @@ -2064,6 +2064,7 @@ sub AddReturn { "UPDATE branchtransfers SET datearrived = now() WHERE itemnumber= ? AND datearrived IS NULL" ); $sth->execute( $item->itemnumber ); + $messages->{'TransferArrived'} = $frombranch; } else { $messages->{'WrongTransfer'} = $tobranch; $messages->{'WrongTransferItem'} = $item->itemnumber; diff --git a/circ/returns.pl b/circ/returns.pl index d3bd81d7bc..bcafdae502 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -511,6 +511,9 @@ foreach my $code ( keys %$messages ) { elsif ( $code eq 'TransferTrigger' ) { ; # Handled alongside NeedsTransfer } + elsif ( $code eq 'TransferArrived' ) { + $err{transferred} = $messages->{'TransferArrived'}; + } elsif ( $code eq 'Wrongbranch' ) { } elsif ( $code eq 'Debarred' ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index 31c03fa898..e5890a6f6b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -255,6 +255,9 @@ [% IF ( errmsgloo.localuse) %]

Local use recorded

[% END %] + [% IF ( errmsgloo.transferred ) %] +

Item recieved from [% Branches.GetName( errmsgloo.transferred ) | html %]

+ [% END %] [% IF ( errmsgloo.waslost ) %] [% IF Koha.Preference('BlockReturnOfLostItems') %]

Item is lost, cannot be checked in.

-- 2.39.5