@@ -, +, @@ --- C4/Circulation.pm | 18 ++++++++++-------- Koha/Account.pm | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -3663,16 +3663,18 @@ sub DeleteBranchTransferLimits { } sub ReturnLostItem{ - my ( $borrowernumber, $itemnum ) = @_; + my ( $borrowernumber, $itemnum, $offset_type ) = @_; MarkIssueReturned( $borrowernumber, $itemnum ); - my $patron = Koha::Patrons->find( $borrowernumber ); - my $item = Koha::Items->find($itemnum); - my $old_note = ($item->paidfor && ($item->paidfor ne q{})) ? $item->paidfor.' / ' : q{}; - my @datearr = localtime(time); - my $date = ( 1900 + $datearr[5] ) . "-" . ( $datearr[4] + 1 ) . "-" . $datearr[3]; - my $bor = $patron->firstname . ' ' . $patron->surname . ' ' . $patron->cardnumber; - ModItem({ paidfor => $old_note."Paid for by $bor $date" }, undef, $itemnum); + if ( $offset_type ne 'Writeoff' ) { + my $patron = Koha::Patrons->find( $borrowernumber ); + my $item = Koha::Items->find($itemnum); + my $old_note = ($item->paidfor && ($item->paidfor ne q{})) ? $item->paidfor.' / ' : q{}; + my @datearr = localtime(time); + my $date = ( 1900 + $datearr[5] ) . "-" . ( $datearr[4] + 1 ) . "-" . $datearr[3]; + my $bor = $patron->firstname . ' ' . $patron->surname . ' ' . $patron->cardnumber; + ModItem({ paidfor => $old_note."Paid for by $bor $date" }, undef, $itemnum); + } } --- a/Koha/Account.pm +++ a/Koha/Account.pm @@ -110,7 +110,7 @@ sub pay { if ( $fine->itemnumber && $fine->accounttype && ( $fine->accounttype eq 'L' ) ) { - C4::Circulation::ReturnLostItem( $self->{patron_id}, $fine->itemnumber ); + C4::Circulation::ReturnLostItem( $self->{patron_id}, $fine->itemnumber, $offset_type ); } my $account_offset = Koha::Account::Offset->new( --