Bug 15564 - Fix tranfert branch: Set collection branch with return branch if it is...
authorAlex Arnaud <alex.arnaud@biblibre.com>
Thu, 11 Feb 2016 15:02:42 +0000 (16:02 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Wed, 4 May 2016 13:32:55 +0000 (13:32 +0000)
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

circ/returns.pl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt

index fe8fb50..49899f0 100755 (executable)
@@ -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,
         );
     }
index 24ee9af..6a9f868 100644 (file)
@@ -146,10 +146,10 @@ $(document).ready(function () {
 
 [% IF ( collectionItemNeedsTransferred ) %]
  <div id="rotating-collection" class="dialog message">
-        <h3>Please transfer item to: [% collectionBranch %]</h3>
+        <h3>Please transfer item to: [% collectionBranchName %]</h3>
             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
             <p>This item is part of a rotating collection.</p>
-            <p><a href="#" onclick="Dopop('transfer-slip.pl?transferitem=[% itemnumber %]&amp;branchcode=[% returnbranch %]&amp;op=slip'); return true;">Print slip</a></p>
+            <p><a href="#" onclick="Dopop('transfer-slip.pl?transferitem=[% itemnumber %]&amp;branchcode=[% collectionBranch %]&amp;op=slip'); return true;">Print slip</a></p>
 </div>
 [% END %]