$e->update_asset_copy($copy) or return $e->die_event;
}
+ # Check if the copy circ lib wants lost fees voided on claims
+ # returned.
+ if ($U->is_true($U->ou_ancestor_setting_value($copy->circ_lib, 'circ.void_lost_on_claimsreturned', $e))) {
+ my $result = OpenILS::Application::Circ::CircCommon->void_lost(
+ $e,
+ $circ,
+ 3
+ );
+ return $result if ($result);
+ }
+
$e->commit;
return 1;
}
return undef;
}
+# ------------------------------------------------------------------
+# remove charge from patron's account if lost item is returned
+# ------------------------------------------------------------------
+sub void_lost {
+ my ($class, $e, $circ, $btype) = @_;
+
+ my $bills = $e->search_money_billing(
+ {
+ xact => $circ->id,
+ btype => $btype
+ }
+ );
+
+ $logger->debug("voiding lost item charge of ".scalar(@$bills));
+ for my $bill (@$bills) {
+ if( !$U->is_true($bill->voided) ) {
+ $logger->info("lost item returned - voiding bill ".$bill->id);
+ $bill->voided('t');
+ $bill->void_time('now');
+ $bill->voider($e->requestor->id);
+ my $note = ($bill->note) ? $bill->note . "\n" : '';
+ $bill->note("${note}System: VOIDED FOR LOST ITEM RETURNED");
+
+ return $e->die_event
+ unless $e->update_money_billing($bill);
+ }
+ }
+ return undef;
+}
sub reopen_xact {
my($class, $e, $xactid) = @_;
sub checkin_handle_lost_now_found {
my ($self, $bill_type) = @_;
-
- # ------------------------------------------------------------------
- # remove charge from patron's account if lost item is returned
- # ------------------------------------------------------------------
-
- my $bills = $self->editor->search_money_billing(
- {
- xact => $self->circ->id,
- btype => $bill_type
- }
+ my $result = OpenILS::Application::Circ::CircCommon->void_lost(
+ $self->editor,
+ $self->circ,
+ $bill_type
);
-
- $logger->debug("voiding lost item charge of ".scalar(@$bills));
- for my $bill (@$bills) {
- if( !$U->is_true($bill->voided) ) {
- $logger->info("lost item returned - voiding bill ".$bill->id);
- $bill->voided('t');
- $bill->void_time('now');
- $bill->voider($self->editor->requestor->id);
- my $note = ($bill->note) ? $bill->note . "\n" : '';
- $bill->note("${note}System: VOIDED FOR LOST ITEM RETURNED");
-
- $self->bail_on_events($self->editor->event)
- unless $self->editor->update_money_billing($bill);
- }
- }
+ $self->bail_on_events($result) if ($result);
}
sub checkin_handle_lost_now_found_restore_od {
'bool'
);
+INSERT INTO config.org_unit_setting_type
+ (name, grp, label, description, datatype)
+ VALUES
+ ('circ.void_lost_on_claimsreturned',
+ 'circ',
+ oils_i18n_gettext('circ.void_lost_on_claimsreturned',
+ 'Void lost item billing when claims returned',
+ 'coust', 'label'),
+ oils_i18n_gettext('circ.void_lost_on_claimsreturned',
+ 'Void lost item billing when claims returned',
+ 'coust', 'description'),
+ 'bool');
--- /dev/null
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT INTO config.org_unit_setting_type
+ (name, grp, label, description, datatype)
+ VALUES
+ ('circ.void_lost_on_claimsreturned',
+ 'circ',
+ oils_i18n_gettext('circ.void_lost_on_claimsreturned',
+ 'Void lost item billing when claims returned',
+ 'coust', 'label'),
+ oils_i18n_gettext('circ.void_lost_on_claimsreturned',
+ 'Void lost item billing when claims returned',
+ 'coust', 'description'),
+ 'bool');
+
+COMMIT;