From: Jason Stephenson Date: Thu, 9 Feb 2017 20:27:58 +0000 (-0500) Subject: LP 1170794: Skip Deposit Fee on Renewal X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fdyrcona%2Flp1170794-skip-deposit-fee-on-renewal;p=working%2FEvergreen.git LP 1170794: Skip Deposit Fee on Renewal Skip charging the deposit fee if the circulation is a renewal. This commit sets the Circulator object's skip_deposit_fee to true in mk_env if the current action is renew. This causes the deposit fee to not be charged. It also adds a check to the Circulator object's check_item_deposits method so that the ITEM_DEPOSIT_REQUIRED event is not thrown if skip_deposit_fee is true. Something similar should be done for the ITEM_RENTAL_FEE_REQUIRED event, but that is beyond the scope of this bug. We also add a rudimentary, but hopefully sufficient, release note. Signed-off-by: Jason Stephenson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm index 8daab0cb9e..de73ae634b 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm @@ -752,6 +752,11 @@ sub mk_env { $self->bail_on_events(OpenILS::Event->new('PATRON_ACCOUNT_EXPIRED')) if( CORE::time > $expire->epoch ) ; } + + if ($self->is_renewal) { + # Skip the deposit fee if this is a renewal. + $self->skip_deposit_fee(1); + } } @@ -792,7 +797,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->skip_deposit_fee; $self->push_events(OpenILS::Event->new('ITEM_RENTAL_FEE_REQUIRED', payload => $self->copy)) if $self->is_rental and not $self->is_rental_exempt; } diff --git a/docs/RELEASE_NOTES_NEXT/Circulation/skip_deposit_fee_on_renewal.adoc b/docs/RELEASE_NOTES_NEXT/Circulation/skip_deposit_fee_on_renewal.adoc new file mode 100644 index 0000000000..9f84b559ad --- /dev/null +++ b/docs/RELEASE_NOTES_NEXT/Circulation/skip_deposit_fee_on_renewal.adoc @@ -0,0 +1,5 @@ +Skip Deposit Fee On Renewal +^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Fix Launchpad bug 1170794 and do not charge the deposit fee on copy +renewals. +