Project

General

Profile

Feature #190

ALREADY FIXED IN COMMUNITY - Fix serials routing preview and serials routing.

Added by Olli-Antti Kivilahti about 2 years ago. Updated 11 months ago.

Status:
New
Priority:
Normal
Start date:
20.11.2019
Due date:
% Done:

0%

Estimated time:
Spent time:
Koha Bugzilla Bug#:

Description

Work from Koha-Suomi dev fund.

Repaired this for PKKS

History

#1

Updated by Olli-Antti Kivilahti about 2 years ago

  • Description updated (diff)

Need to share with Koha-Suomi

#2

Updated by Olli-Antti Kivilahti about 2 years ago

root@koha-production-pkks:/home/koha/Koha# cat 0001-ALREADY-FIXED-IN-COMMUNITY-Fix-serials-routing-previ.patch 
From d7fa9136c6d5b1f135e0117096e1b1019cf0e517 Mon Sep 17 00:00:00 2001
From: root <root@koha-production-pkks.lxd>
Date: Wed, 20 Nov 2019 03:34:14 +0200
Subject: [PATCH 1/2] ALREADY FIXED IN COMMUNITY - Fix serials routing preview
 and serials routing.

---
 C4/Serials.pm              |  3 ++-
 serials/routing-preview.pl | 18 +++++++++---------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/C4/Serials.pm b/C4/Serials.pm
index 24dee49f3f..05c43ca244 100644
--- a/C4/Serials.pm
+++ b/C4/Serials.pm
@@ -419,7 +419,8 @@ sub GetSubscription {
                 subscriptionhistory.*,
                 aqbooksellers.name AS aqbooksellername,
                 biblio.title AS bibliotitle,
-                subscription.biblionumber as bibnum
+                subscription.biblionumber as bibnum,
+                subscription.branchcode
        FROM subscription
        LEFT JOIN subscriptionhistory ON subscription.subscriptionid=subscriptionhistory.subscriptionid
        LEFT JOIN aqbooksellers ON subscription.aqbooksellerid=aqbooksellers.id
diff --git a/serials/routing-preview.pl b/serials/routing-preview.pl
index 491bf2b2e1..1a93413efa 100755
--- a/serials/routing-preview.pl
+++ b/serials/routing-preview.pl
@@ -62,13 +62,13 @@ my $subs = GetSubscription($subscriptionid);
 my ($tmp ,@serials) = GetSerials($subscriptionid);
 my ($template, $loggedinuser, $cookie);

+my $library;
 if($ok){
     # get biblio information....
-    my $biblionumber = $subs->{'biblionumber'};
-    my ($count2,@bibitems) = GetBiblioItemByBiblioNumber($biblionumber);
-       my @itemresults = GetItemsInfo( $subs->{biblionumber} );
-       my $branch = $itemresults[0]->{'holdingbranch'};
-    my $branchname = Koha::Libraries->find($branch)->branchname;
+    my $biblionumber = $subs->{'bibnum'};
+    my @itemresults = GetItemsInfo( $biblionumber );
+    my $branch = @itemresults ? $itemresults[0]->{'holdingbranch'} : $subs->{branchcode};
+    $library = Koha::Libraries->find($branch);

        if (C4::Context->preference('RoutingListAddReserves')){
                # get existing reserves .....
@@ -94,11 +94,10 @@ if($ok){
                     branchcode     => $branch
                 });
             } else {
-                AddReserve($branch,$routing->{borrowernumber},$biblionumber,\@bibitems,$routing->{ranking}, undef, undef, $notes,$title);
+                AddReserve($branch,$routing->{borrowernumber},$biblionumber,undef,$routing->{ranking}, undef, undef, $notes,$title);
         }
     }
-       }
-
+}
     ($template, $loggedinuser, $cookie)
 = get_template_and_user({template_name => "serials/routing-preview-slip.tt",
                                query => $query,
@@ -107,7 +106,6 @@ if($ok){
                                flagsrequired => {serials => '*'},
                                debug => 1,
                                });
-    $template->param("libraryname"=>$branchname);
 } else {
     ($template, $loggedinuser, $cookie)
 = get_template_and_user({template_name => "serials/routing-preview.tt",
@@ -119,6 +117,8 @@ if($ok){
                                });
 }

+$template->param( libraryname => $library->branchname ) if $library;
+
 my $memberloop = [];
 for my $routing (@routinglist) {
     my $member = GetMember( borrowernumber => $routing->{borrowernumber} );
-- 
2.17.1

#3

Updated by Lari Taskula 11 months ago

  • Project changed from Koha Development to Koha Fund

Also available in: Atom PDF