Bugzilla – Attachment 138971 Details for
Bug 2894
Routing list holds are broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 2894: Fix Routing list holds
Bug-2894-Fix-Routing-list-holds.patch (text/plain), 3.57 KB, created by
Jonathan Druart
on 2022-08-10 10:38:14 UTC
(
hide
)
Description:
Bug 2894: Fix Routing list holds
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-08-10 10:38:14 UTC
Size:
3.57 KB
patch
obsolete
>From b7a5fe392a2e99f78e800df8c840339b60fad24c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 10 Aug 2022 12:31:43 +0200 >Subject: [PATCH] Bug 2894: Fix Routing list holds > >This is a try to fix a very old bug. Not familiar with the workflow so >cannot confirm it will fix everything. >The idea is to fix the behaviour of RoutingListAddReserves, and create >item-level holds (so only if items have been created). >--- > serials/routing-preview.pl | 45 ++++++++++++++++++++++---------------- > 1 file changed, 26 insertions(+), 19 deletions(-) > >diff --git a/serials/routing-preview.pl b/serials/routing-preview.pl >index e12cd17af0d..1486021d4a5 100755 >--- a/serials/routing-preview.pl >+++ b/serials/routing-preview.pl >@@ -66,41 +66,48 @@ if($ok){ > my $biblio = Koha::Biblios->find( $biblionumber ); > my $branchcode = $subs->{branchcode}; > my $serialitem = Koha::Serial::Items->search( { serialid => $serialid } )->next; >- if ( $serialitem ) { >+ >+ if ( C4::Context->preference('RoutingListAddReserves') && $serialitem ) { > my $item = Koha::Items->find($serialitem->itemnumber); > $branchcode = $item->holdingbranch || $branchcode; >- } >- $library = Koha::Libraries->find($branchcode); >- >- if (C4::Context->preference('RoutingListAddReserves')){ >- my $notes; >- my $title = $subs->{'bibliotitle'}; >- for my $routing ( @routinglist ) { >- my $sth = $dbh->prepare('SELECT * FROM reserves WHERE biblionumber = ? AND borrowernumber = ? LIMIT 1'); >- $sth->execute($biblionumber,$routing->{borrowernumber}); >+ $library = Koha::Libraries->find($branchcode); >+ >+ my $notes; >+ my $title = $subs->{'bibliotitle'}; >+ for my $routing (@routinglist) { >+ my $sth = $dbh->prepare( >+ 'SELECT * FROM reserves WHERE biblionumber = ? AND borrowernumber = ? LIMIT 1' >+ ); >+ $sth->execute( $biblionumber, $routing->{borrowernumber} ); > my $reserve = $sth->fetchrow_hashref; > >- if($routing->{borrowernumber} == $reserve->{borrowernumber}){ >- ModReserve({ >- rank => $routing->{ranking}, >- biblionumber => $biblionumber, >- borrowernumber => $routing->{borrowernumber}, >- branchcode => $branchcode, >- }); >- } else { >+ if ( $routing->{borrowernumber} == $reserve->{borrowernumber} ) >+ { >+ ModReserve( >+ { >+ rank => $routing->{ranking}, >+ biblionumber => $biblionumber, >+ itemnumber => $serialitem->itemnumber, >+ borrowernumber => $routing->{borrowernumber}, >+ branchcode => $branchcode, >+ } >+ ); >+ } >+ else { > AddReserve( > { > branchcode => $branchcode, > borrowernumber => $routing->{borrowernumber}, > biblionumber => $biblionumber, >+ itemnumber => $serialitem->itemnumber, > priority => $routing->{ranking}, > notes => $notes, > title => $title, > } > ); >+ } > } > } >- } > > ($template, $loggedinuser, $cookie) > = get_template_and_user({template_name => "serials/routing-preview-slip.tt", >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 2894
:
7758
|
138971
|
164892