@@ -, +, @@ --- C4/Circulation.pm | 14 ++++++++++++++ Koha/Checkouts/ReturnClaim.pm | 12 ++++++++++++ circ/returns.pl | 4 +++- .../prog/en/modules/circ/returns.tt | 19 +++++++++++++++++++ 4 files changed, 48 insertions(+), 1 deletion(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -60,6 +60,7 @@ use Koha::Account::Offsets; use Koha::Config::SysPrefs; use Koha::Charges::Fees; use Koha::Util::SystemPreferences; +use Koha::Checkouts::ReturnClaims; use Carp; use List::MoreUtils qw( uniq any ); use Scalar::Util qw( looks_like_number ); @@ -2120,6 +2121,19 @@ sub AddReturn { } } + if ( C4::Context->preference('ClaimReturnedLostValue') ) { + my $claims = Koha::Checkouts::ReturnClaims->search( + { + itemnumber => $item->id, + resolution => undef, + } + ); + + if ( $claims->count ) { + $messages->{ReturnClaims} = $claims; + } + } + return ( $doreturn, $messages, $issue, ( $patron ? $patron->unblessed : {} )); } --- a/Koha/Checkouts/ReturnClaim.pm +++ a/Koha/Checkouts/ReturnClaim.pm @@ -23,6 +23,7 @@ use base qw(Koha::Object); use Koha::Checkouts; use Koha::Old::Checkouts; +use Koha::Patrons; =head1 NAME @@ -48,6 +49,17 @@ sub checkout { return Koha::Old::Checkout->_new_from_dbic( $old_issue ) if $old_issue; } +=head3 patron + +=cut + +sub patron { + my ( $self ) = @_; + + my $borrower = $self->_result->borrowernumber; + return Koha::Patron->_new_from_dbic( $borrower ) if $borrower; +} + =head3 _type =cut --- a/circ/returns.pl +++ a/circ/returns.pl @@ -542,7 +542,9 @@ foreach my $code ( keys %$messages ) { elsif ( $code eq 'DataCorrupted' ) { $err{data_corrupted} = 1; } - else { + elsif ( $code eq 'ReturnClaims' ) { + $template->param( ReturnClaims => $messages->{ReturnClaims} ); + } else { die "Unknown error code $code"; # note we need all the (empty) elsif's above, or we die. # This forces the issue of staying in sync w/ Circulation.pm } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -166,6 +166,25 @@ [% END %] + + [% IF ( ReturnClaims ) %] +
+

+ This item has been claimed as returned by: + +

+
+ [% END %] + [% IF ( waiting_holds ) %]
--