LP#1661754 - Prevent staff users from marking a Long Overdue item Lost
authorMichele Morgan <mmorgan@noblenet.org>
Tue, 7 Feb 2017 18:21:48 +0000 (13:21 -0500)
committerKathy Lussier <klussier@masslnc.org>
Fri, 17 Feb 2017 19:00:08 +0000 (14:00 -0500)
Prevents circulations that are already Lost or Long Overdue from being
marked Lost or Long Overdue. Avoiding patrons being billed twice for the
same item.

Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>

Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm

index 50a4fc3..a07c9be 100644 (file)
@@ -722,6 +722,7 @@ sub set_item_lost {
         $e, $copy_id,
         perm => 'SET_CIRC_LOST',
         status => OILS_COPY_STATUS_LOST,
+        alt_status => 16, #Long Overdue,
         ous_proc_fee => OILS_SETTING_LOST_PROCESSING_FEE,
         ous_void_od => OILS_SETTING_VOID_OVERDUE_ON_LOST,
         bill_type => 3,
@@ -741,6 +742,7 @@ sub set_item_long_overdue {
         $e, $copy_id,
         perm => 'SET_CIRC_LONG_OVERDUE',
         status => 16, # Long Overdue
+        alt_status => OILS_COPY_STATUS_LOST,
         ous_proc_fee => 'circ.longoverdue_materials_processing_fee',
         ous_void_od => 'circ.void_overdue_on_longoverdue',
         bill_type => 10,
@@ -774,7 +776,7 @@ sub set_item_lost_or_lod {
     $e->allowed($args{perm}, $circ->circ_lib) or return $e->die_event;
 
     return $e->die_event(OpenILS::Event->new($args{event}))
-           if $copy->status == $args{status};
+           if ($copy->status == $args{status} || $copy->status == $args{alt_status});
 
     # ---------------------------------------------------------------------
     # fetch the related org settings