Bug 6490 - Lost and paid not updated when book is checked out.
authorKyle M Hall <kyle.m.hall@gmail.com>
Thu, 2 Feb 2012 15:15:43 +0000 (10:15 -0500)
committerPaul Poulain <paul.poulain@biblibre.com>
Fri, 3 Feb 2012 16:37:52 +0000 (17:37 +0100)
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Tested:

item checked out and marked lost - item is removed from borrower's checkouts and charged to patron
Checking out the item (without checking it in first) removed the fines and issued the item normally.

Passed prove t xt t/db_dependent (results congruent with current master failures)

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
C4/Circulation.pm

index 2bf5d51..e68db64 100644 (file)
@@ -1025,6 +1025,12 @@ sub AddIssue {
           CartToShelf( $item->{'itemnumber'} );
         }
         $item->{'issues'}++;
+
+        ## If item was lost, it has now been found, reverse any list item charges if neccessary.
+        if ( $item->{'itemlost'} ) {
+            _FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, $item->{'barcode'} );
+        }
+
         ModItem({ issues           => $item->{'issues'},
                   holdingbranch    => C4::Context->userenv->{'branch'},
                   itemlost         => 0,