Bug 16570: Do not tell all checked-in items are part of a rotating collection
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 24 May 2016 18:57:16 +0000 (19:57 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 10 Jun 2016 16:38:07 +0000 (16:38 +0000)
When an item is checked-in a message will tell you it's part of a
rotating collection, even if it's not true.

Test plan:
Make sure the message appears only when needed.

Signed-off-by: Marc VĂ©ron <veron@veron.ch>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

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

circ/returns.pl

index 3804543..c91d784 100755 (executable)
@@ -642,16 +642,18 @@ $template->param(
 
 $itemnumber = GetItemnumberFromBarcode( $barcode );
 if ( $itemnumber ) {
-   my ( $holdingBranch, $collectionBranch ) = GetCollectionItemBranches( $itemnumber );
-    $holdingBranch //= '';
-    $collectionBranch //= $returnbranch;
-    if ( ! ( $holdingBranch eq $collectionBranch ) ) {
-        $template->param(
-          collectionItemNeedsTransferred => 1,
-          collectionBranchName => GetBranchName($collectionBranch),
-          collectionBranch => $collectionBranch,
-          itemnumber => $itemnumber,
-        );
+    my ( $holdingBranch, $collectionBranch ) = GetCollectionItemBranches( $itemnumber );
+    if ( $holdingBranch and $collectionBranch ) {
+        $holdingBranch //= '';
+        $collectionBranch //= $returnbranch;
+        if ( ! ( $holdingBranch eq $collectionBranch ) ) {
+            $template->param(
+              collectionItemNeedsTransferred => 1,
+              collectionBranchName => GetBranchName($collectionBranch),
+              collectionBranch => $collectionBranch,
+              itemnumber => $itemnumber,
+            );
+        }
     }
 }