Lines 1866-1875
sub _FixAccountForLostAndReturned {
Link Here
|
1866 |
my $item_id = @_ ? shift : $itemnumber; # Send the barcode if you want that logged in the description |
1866 |
my $item_id = @_ ? shift : $itemnumber; # Send the barcode if you want that logged in the description |
1867 |
my $dbh = C4::Context->dbh; |
1867 |
my $dbh = C4::Context->dbh; |
1868 |
# check for charge made for lost book |
1868 |
# check for charge made for lost book |
1869 |
my $sth = $dbh->prepare("SELECT * FROM accountlines WHERE (itemnumber = ?) AND (accounttype='L' OR accounttype='Rep') ORDER BY date DESC"); |
1869 |
my $sth = $dbh->prepare("SELECT * FROM accountlines WHERE itemnumber = ? AND accounttype IN ('L', 'Rep', 'W') ORDER BY date DESC"); |
1870 |
$sth->execute($itemnumber); |
1870 |
$sth->execute($itemnumber); |
1871 |
my $data = $sth->fetchrow_hashref; |
1871 |
my $data = $sth->fetchrow_hashref; |
1872 |
$data or return; # bail if there is nothing to do |
1872 |
$data or return; # bail if there is nothing to do |
|
|
1873 |
$data->{accounttype} eq 'W' and return; # Written off |
1873 |
|
1874 |
|
1874 |
# writeoff this amount |
1875 |
# writeoff this amount |
1875 |
my $offset; |
1876 |
my $offset; |
1876 |
- |
|
|