From 57f133e156a7ddd74076c041c04bdff492d1d810 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Thu, 9 Feb 2017 15:27:58 -0500 Subject: [PATCH] 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 --- Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm | 7 ++++++- .../Circulation/skip_deposit_fee_on_renewal.adoc | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/skip_deposit_fee_on_renewal.adoc 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. + -- 2.11.0