template_name => "circ/returns.tt",
query => $query,
type => "intranet",
- authnotrequired => 0,
flagsrequired => { circulate => "circulate_remaining_permissions" },
}
);
if ( $query->param('print_slip') ) {
$template->param(
print_slip => 1,
- borrowernumber => scalar $query->param('borrowernumber'), # FIXME We should send a Koha::Patron and raise an error if not exist.
- biblionumber => scalar $query->param('biblionumber'),
- itemnumber => scalar $query->param('itemnumber'),
+ reserve_id => scalar $query->param('reserve_id'),
);
}
my $checkout = $item->checkout;
my $biblio = $item->biblio;
$template->param(
- title => $biblio->title,
- homebranch => $item->homebranch,
- holdingbranch => $item->holdingbranch,
- returnbranch => $returnbranch,
- author => $biblio->author,
- itembarcode => $item->barcode,
- itemtype => $item->effective_itemtype,
- ccode => $item->ccode,
- itembiblionumber => $biblio->biblionumber,
- biblionumber => $biblio->biblionumber,
+ title => $biblio->title,
+ homebranch => $item->homebranch,
+ holdingbranch => $item->holdingbranch,
+ returnbranch => $returnbranch,
+ author => $biblio->author,
+ itembarcode => $item->barcode,
+ itemtype => $item->effective_itemtype,
+ ccode => $item->ccode,
+ itembiblionumber => $biblio->biblionumber,
+ biblionumber => $biblio->biblionumber,
additional_materials => $materials,
- issue => $checkout,
+ issue => $checkout,
);
} # FIXME else we should not call AddReturn but set BadBarcode directly instead
my $return_date = $dropboxmode ? $dropboxdate : $return_date_override_dt;
+ # Block return if multi-part and confirm has not been received
+ my $needs_confirm =
+ C4::Context->preference("CircConfirmItemParts")
+ && $item
+ && $item->materials
+ && !$query->param('multiple_confirm');
+ $template->param( 'multiple_confirmed' => 1 )
+ if $query->param('multiple_confirm');
+
# do the return
( $returned, $messages, $issue, $borrower ) =
- AddReturn( $barcode, $userenv_branch, $exemptfine, $return_date );
+ AddReturn( $barcode, $userenv_branch, $exemptfine, $return_date )
+ unless $needs_confirm;
if ($returned) {
my $time_now = dt_from_string()->truncate( to => 'minute');
);
}
}
- } elsif ( C4::Context->preference('ShowAllCheckins') and !$messages->{'BadBarcode'} ) {
+ } elsif ( C4::Context->preference('ShowAllCheckins') and !$messages->{'BadBarcode'} and !$needs_confirm ) {
$input{duedate} = 0;
$returneditems{0} = $barcode;
$riduedate{0} = 0;
push( @inputloop, \%input );
}
$template->param( privacy => $borrower->{privacy} );
+
+ if ( $needs_confirm ) {
+ $template->param( needs_confirm => $needs_confirm );
+ }
}
$template->param( inputloop => \@inputloop );
+
my $found = 0;
my $waiting = 0;
my $reserved = 0;
ModReserveAffect( $reserve->{itemnumber}, $reserve->{borrowernumber}, $diffBranchSend, $reserve->{reserve_id} );
my ( $messages, $nextreservinfo ) = GetOtherReserves($reserve->{itemnumber});
- my $patron = Koha::Patrons->find( $nextreservinfo );
-
$template->param(
hold_auto_filled => 1,
print_slip => C4::Context->preference('HoldsAutoFillPrintSlip'),
- patron => $patron,
- borrowernumber => $patron->id,
- biblionumber => $biblio->id,
+ reserve_id => $nextreservinfo->{reserve_id},
+ itemnumber => $itemnumber,
);
if ( $messages->{'transfert'} ) {
$template->param(
- itemtitle => $biblio->title,
- itemnumber => $item->itemnumber,
+ itemtitle => $biblio->title,
itembiblionumber => $biblio->biblionumber,
- iteminfo => $biblio->author,
- diffbranch => 1,
+ iteminfo => $biblio->author,
+ diffbranch => 1,
);
}
}
transfertodo => $branchCheck ? undef : 1,
reserve_id => $reserve->{reserve_id},
reserved => 1,
+ itemnumber => $itemnumber,
);
}
patron => $patron,
barcode => $barcode,
destbranch => $reserve->{'branchcode'},
- itemnumber => $reserve->{'itemnumber'},
reservenotes => $reserve->{'reservenotes'},
reserve_id => $reserve->{reserve_id},
bormessagepref => $holdmsgpreferences->{'transports'},
}
elsif ( $code eq 'NeedsTransfer' ) {
}
+ elsif ( $code eq 'TransferTrigger' ) {
+ ; # Handled alongside NeedsTransfer
+ }
elsif ( $code eq 'Wrongbranch' ) {
}
elsif ( $code eq 'Debarred' ) {