Skip to content
Browse files

[addresses #15528107 and #15895609] more holds and tranfer fixes

- handle case: item already waiting at pickup branch, checkin at pickup
  branch; relax previous assumption that item is permanent collection (not always true)
- allow ignore hold upon checkin at pickup library and not yet waiting
  (don't automatically set hold to waiting in AddReturn())
  • Loading branch information...
1 parent 2da07ea commit 7b5e3cd080ce62e3886cced812837e652e8ed3c1 @hgq hgq committed Jul 18, 2011
Showing with 34 additions and 19 deletions.
  1. +4 −2 C4/Circulation.pm
  2. +8 −5 catalogue/detail.pl
  3. +10 −9 circ/returns.pl
  4. +12 −3 koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl
View
6 C4/Circulation.pm
@@ -1659,8 +1659,10 @@ sub AddReturn {
);
$sth->execute( $item->{'itemnumber'} );
# if we have a reservation with valid transfer, we can set it's status to 'W'
- my ($resfound,$resrec) = C4::Reserves::CheckReserves($item->{'itemnumber'});
- C4::Reserves::ModReserveStatus($item->{'itemnumber'}, 'W', $resrec) if ($resfound);
+ ## UPDATE: hold is trapped outside of and after AddReturn()...
+ ## transfer does not have to for hold but for other reasons -hQ
+ #my ($resfound,$resrec) = C4::Reserves::CheckReserves($item->{'itemnumber'});
+ #C4::Reserves::ModReserveStatus($item->{'itemnumber'}, 'W', $resrec) if ($resfound);
} else {
$messages->{'WrongTransfer'} = $tobranch;
$messages->{'WrongTransferItem'} = $item->{'itemnumber'};
View
13 catalogue/detail.pl
@@ -79,12 +79,15 @@
exit;
}
-my $biblionumber = $query->param('biblionumber');
-my $fw = GetFrameworkCode($biblionumber);
-
-## get notes and subjects from MARC record
-my $marcflavour = C4::Context->preference("marcflavour");
+my $biblionumber = $query->param('biblionumber');
my $record = GetMarcBiblio($biblionumber);
+unless ($record) {
+ print "Content-type: text/plain\n\n";
+ print "Cannot find biblionumber=$biblionumber";
+ exit;
+}
+my $fw = GetFrameworkCode($biblionumber);
+my $marcflavour = C4::Context->preference("marcflavour");
if (C4::Context->preference("XSLTDetailsDisplay") ) {
$template->param(
View
19 circ/returns.pl
@@ -235,7 +235,7 @@ =head1 returns.pl
# An item has been returned to a branch other than the homebranch, and the librarian has chosen to initiate a transfer
my $transferitem = $query->param('transferitem');
my $tobranch = $query->param('tobranch');
- C4::Items::ModItemTransfer($transferitem, $userenv_branch, $tobranch);
+ C4::Items::ModItemTransfer($transferitem, $userenv_branch, $tobranch);
}
elsif ($query->param('cancelTransfer')) {
C4::Items::ModItemTransfer($query->param('itemnumber'));
@@ -254,31 +254,30 @@ =head1 returns.pl
$barcode = C4::Circulation::barcodedecode(barcode=>$barcode)
if(C4::Context->preference('itemBarcodeInputFilter')
|| C4::Context->preference('itembarcodelength'));
- $itemnumber = GetItemnumberFromBarcode($barcode);
-
+ $itemnumber = C4::Items::GetItemnumberFromBarcode($barcode);
if ( C4::Context->preference("InProcessingToShelvingCart") ) {
- my $item = GetItem( $itemnumber );
+ my $item = C4::Items::GetItem( $itemnumber );
if ( $item->{'location'} eq 'PROC' ) {
$item->{'location'} = 'CART';
- ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
+ C4::Items::ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
}
}
if ( C4::Context->preference("ReturnToShelvingCart") ) {
my $item = GetItem( $itemnumber );
$item->{'location'} = 'CART';
- ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
+ C4::Items::ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
}
#
# save the return
#
if ($checkin_override_date ) {
( $returned, $messages, $issueinformation, $borrower ) =
- AddReturn( $barcode, C4::Context->userenv->{'branch'}, $exemptfine, $dropboxmode, $checkin_override_date->output('iso'));
+ C4::Circulation::AddReturn( $barcode, C4::Context->userenv->{'branch'}, $exemptfine, $dropboxmode, $checkin_override_date->output('iso'));
} else {
( $returned, $messages, $issueinformation, $borrower ) =
- AddReturn( $barcode, C4::Context->userenv->{'branch'}, $exemptfine, $dropboxmode);
+ C4::Circulation::AddReturn( $barcode, C4::Context->userenv->{'branch'}, $exemptfine, $dropboxmode);
}
# get biblio description
my $biblio = GetBiblioFromItemNumber($itemnumber);
@@ -493,7 +492,9 @@ =head1 returns.pl
}
elsif ( $code eq 'NotIssued' ) {
$err{notissued} = 1;
- $err{msg} = $branches->{ $messages->{'IsPermanent'} }->{'branchname'};
+ if ($branches->{$messages->{IsPermanent}}) {
+ $err{msg} = $branches->{ $messages->{'IsPermanent'} }->{'branchname'};
+ }
}
elsif ( $code eq 'WasLost' ) {
$err{waslost} = 1;
View
15 koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl
@@ -230,6 +230,7 @@ function ContinueReturns() {
<!-- TMPL_IF NAME="wboremail" --><li><a id="boremail" href="mailto:<!-- TMPL_VAR NAME="wboremail" -->"><!-- TMPL_VAR NAME="wboremail" --></a></li><!-- /TMPL_IF -->
</ul>
<form method="post" action="returns.pl" class="confirm">
+ <input type=hidden name="resbarcode" value="<TMPL_VAR NAME="barcode">">
<input type=hidden name="dotransfer" value="1">
<input type=hidden name="transferitem" value="<TMPL_VAR NAME="WrongTransferItem">">
<input type=hidden name="tobranch" value="<TMPL_VAR NAME="wpickbranch">">
@@ -293,7 +294,11 @@ function ContinueReturns() {
<input type=hidden name="lostbarcode" value="">
<input type=hidden name="lostborrowernumber" value="">
<input type=hidden name="unlinkFromAccount" value="0">
- <h3>Hold Found<TMPL_IF NAME="pull"> (please pull)<TMPL_ELSE> (item is already waiting)</TMPL_IF>:<br><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="itembiblionumber" -->"><!-- TMPL_VAR Name="title" escape="html" --></a></h3>
+ <h3>Hold Found
+ <TMPL_IF NAME="pull">(please pull)
+ <TMPL_ELSIF EXPR="waiting">(item is already waiting)
+ <TMPL_ELSE>ERROR: uncaught exception
+ </TMPL_IF>:<br><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="itembiblionumber" -->"><!-- TMPL_VAR Name="title" escape="html" --></a></h3>
<!-- TMPL_IF NAME="reservenotes" --><h4>Notes: <!-- TMPL_VAR Name="reservenotes" --></h4><!-- /TMPL_IF -->
<br><h4>Hold for:</h4>
<ul>
@@ -343,10 +348,14 @@ function ContinueReturns() {
</form>
</div>
<TMPL_ELSE>
- <TMPL_IF EXPR="currentbranch ne destbranchname and foundwait">
+ <TMPL_IF EXPR="currentbranch ne destbranchname and (foundwait or pull) and not WrongTransfer">
<div class="dialog message">
<span class="error">Unexpected check in.</span>
- <h3>Hold found marked as <span class=error>Waiting</span>:</h3>
+ <h3>Hold found marked as <span class=error>
+ <TMPL_IF EXPR="res_found eq 'W'">Waiting
+ <TMPL_ELSIF EXPR="res_found eq 'T'">In Transit
+ <TMPL_ELSE>ERROR
+ </TMPL_IF></span>:</h3>
<h4><a href="/cgi-bin/koha/detail.pl?biblionumber=<TMPL_VAR NAME="biblionumber">"><TMPL_VAR NAME="title"></a><br>
at <TMPL_VAR NAME="pickbranchname"> for</h4>
<ul>

0 comments on commit 7b5e3cd

Please sign in to comment.
Something went wrong with that request. Please try again.