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 <jason@sigio.com>
$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);
+ }
}
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;
}
--- /dev/null
+Skip Deposit Fee On Renewal
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Fix Launchpad bug 1170794 and do not charge the deposit fee on copy
+renewals.
+