LP#1412893: Only apply lost and paid status with the proper transactions
authorBen Shum <bshum@biblio.org>
Wed, 21 Jan 2015 21:30:53 +0000 (16:30 -0500)
committerBen Shum <bshum@biblio.org>
Fri, 23 Jan 2015 21:46:02 +0000 (16:46 -0500)
As discovered while testing the lost and paid feature, when closing earlier transactions where
the item is currently lost, it could change the item status to lost and paid prematurely.

Change the logic so that it only does this if the current transaction being closed either has
a status of lost or longoverdue.

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm

index 0401876..6c59ad1 100644 (file)
@@ -497,7 +497,7 @@ sub make_payments {
                 # check org_unit_settings for the copy owning library
                 # and adjust and possibly adjust copy status to lost
                 # and paid.
-                if ($circ) {
+                if ($circ && ($circ->stop_fines eq 'LOST' || $circ->stop_fines eq 'LONGOVERDUE')) {
                     # We need the copy to check settings and to possibly
                     # change its status.
                     my $copy = $circ->target_copy();