From 30dc04c74a2ef00c22667f722746c2c6be1da6b1 Mon Sep 17 00:00:00 2001 From: Alex Arnaud Date: Thu, 11 Feb 2016 16:02:42 +0100 Subject: [PATCH] Bug 15564 - Fix tranfert branch: Set collection branch with return branch if it is empty. Signed-off-by: Benjamin Rokseth Signed-off-by: Kyle M Hall Signed-off-by: Kyle M Hall --- circ/returns.pl | 8 +++++--- koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/circ/returns.pl b/circ/returns.pl index fe8fb5028a..49899f0c4b 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -249,6 +249,7 @@ if ($canceltransfer){ } # actually return book and prepare item table..... +my $returnbranch; if ($barcode) { $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace $barcode = barcodedecode($barcode) if C4::Context->preference('itemBarcodeInputFilter'); @@ -275,7 +276,7 @@ if ($barcode) { # make sure return branch respects home branch circulation rules, default to homebranch my $hbr = GetBranchItemRule($biblio->{'homebranch'}, $itemtype ? $itemtype->itemtype : undef )->{'returnbranch'} || "homebranch"; - my $returnbranch = $biblio->{$hbr} ; + $returnbranch = $biblio->{$hbr}; my $materials = $biblio->{'materials'}; my $avcode = GetAuthValCode('items.materials'); @@ -641,11 +642,12 @@ $itemnumber = GetItemnumberFromBarcode( $barcode ); if ( $itemnumber ) { my ( $holdingBranch, $collectionBranch ) = GetCollectionItemBranches( $itemnumber ); $holdingBranch //= ''; - $collectionBranch //= ''; + $collectionBranch //= $returnbranch; if ( ! ( $holdingBranch eq $collectionBranch ) ) { $template->param( collectionItemNeedsTransferred => 1, - collectionBranch => GetBranchName($collectionBranch), + collectionBranchName => GetBranchName($collectionBranch), + collectionBranch => $collectionBranch, itemnumber => $itemnumber, ); } 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 24ee9afe43..6a9f868a70 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -146,10 +146,10 @@ $(document).ready(function () { [% IF ( collectionItemNeedsTransferred ) %]
-

Please transfer item to: [% collectionBranch %]

+

Please transfer item to: [% collectionBranchName %]

[% itembarcode |html %]: [% title |html %]

This item is part of a rotating collection.

-

Print slip

+

Print slip

[% END %] -- 2.39.5