From 16491610f04a9bc3539ecf044bbca9b0451aee81 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 --- 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 2f91511dbd..900fe1e096 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2038,7 +2038,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 @@ -2049,6 +2049,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 6c9718495b..c49261be59 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -515,6 +515,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.20.1