From 07df9956822a484d1a983ff4c11e38cfdc1741de Mon Sep 17 00:00:00 2001 From: Srdjan Jankovic Date: Tue, 24 Jan 2012 16:46:21 +1300 Subject: [PATCH] bug_7190: Do not reverse writeoffs when item is returned --- C4/Circulation.pm | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 0b5068c..2282d5c 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1866,10 +1866,11 @@ sub _FixAccountForLostAndReturned { my $item_id = @_ ? shift : $itemnumber; # Send the barcode if you want that logged in the description my $dbh = C4::Context->dbh; # check for charge made for lost book - my $sth = $dbh->prepare("SELECT * FROM accountlines WHERE (itemnumber = ?) AND (accounttype='L' OR accounttype='Rep') ORDER BY date DESC"); + my $sth = $dbh->prepare("SELECT * FROM accountlines WHERE itemnumber = ? AND accounttype IN ('L', 'Rep', 'W') ORDER BY date DESC"); $sth->execute($itemnumber); my $data = $sth->fetchrow_hashref; $data or return; # bail if there is nothing to do + $data->{accounttype} eq 'W' and return; # Written off # writeoff this amount my $offset; -- 1.6.5