supress deposit billings and messages on renewal
authorRogan Hamby <rogan.hamby@gmail.com>
Fri, 24 May 2019 16:06:51 +0000 (12:06 -0400)
committerRogan Hamby <rogan.hamby@gmail.com>
Mon, 24 Feb 2020 17:26:31 +0000 (12:26 -0500)
Signed-off-by: Rogan Hamby <rogan.hamby@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm

index d99d525..046ff05 100644 (file)
@@ -1071,7 +1071,7 @@ sub do_permit {
 sub check_item_deposit_events {
     my $self = shift;
     $self->push_events(OpenILS::Event->new('ITEM_DEPOSIT_REQUIRED', payload => $self->copy)) 
-        if $self->is_deposit and not $self->is_deposit_exempt;
+        if $self->is_deposit and not $self->is_deposit_exempt and not $self->is_renewal;
     $self->push_events(OpenILS::Event->new('ITEM_RENTAL_FEE_REQUIRED', payload => $self->copy)) 
         if $self->is_rental and not $self->is_rental_exempt;
 }
@@ -1086,6 +1086,7 @@ sub is_deposit_exempt {
     for my $grp (@$groups) {
         return 1 if $self->is_group_descendant($grp, $pid);
     }
+       return 1 if $self->is_renewal;
     return 0;
 }
 
@@ -3037,7 +3038,7 @@ sub check_circ_deposit {
         }, {idlist => 1})->[0];
 
     $self->push_events(OpenILS::Event->new(
-        'ITEM_DEPOSIT_PAID', payload => $deposit)) if $deposit;
+        'ITEM_DEPOSIT_PAID', payload => $deposit)) if $deposit and not $self->is_renewal;
 }
 
 sub reshelve_copy {