@@ -, +, @@ --- Koha/Checkouts/ReturnClaim.pm | 16 +++++++++++++++- Koha/Schema/Result/ReturnClaim.pm | 15 +++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) --- a/Koha/Checkouts/ReturnClaim.pm +++ a/Koha/Checkouts/ReturnClaim.pm @@ -102,6 +102,20 @@ sub patron { return Koha::Patron->_new_from_dbic( $borrower ) if $borrower; } +=head3 item + + my $item = $claim->item; + +Return the return claim item + +=cut + +sub item { + my ( $self ) = @_; + my $item_rs = $self->_result->item; + return Koha::Item->_new_from_dbic( $item_rs ); +} + =head3 resolve $claim->resolve( @@ -138,7 +152,7 @@ sub resolve { )->store; if ( defined $params->{new_lost_status} ) { - $self->checkout->item->itemlost( $params->{new_lost_status} )->store; + $self->item->itemlost( $params->{new_lost_status} )->store; } } ); --- a/Koha/Schema/Result/ReturnClaim.pm +++ a/Koha/Schema/Result/ReturnClaim.pm @@ -316,6 +316,21 @@ __PACKAGE__->belongs_to( }, ); +=head2 item + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "item", + "Koha::Schema::Result::Item", + { itemnumber => "itemnumber" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + sub koha_objects_class { 'Koha::Checkouts::ReturnClaims'; } --