{flesh => 1, flesh_fields => {'acp' => ['call_number']}}])
or return $e->die_event;
- my $owning_lib =
- ($copy->call_number->id == OILS_PRECAT_CALL_NUMBER) ?
- $copy->circ_lib : $copy->call_number->owning_lib;
-
my $circ = $e->search_action_circulation(
{checkin_time => undef, target_copy => $copy->id} )->[0]
or return $e->die_event;
if ($copy->status == $args{status});
# ---------------------------------------------------------------------
- # fetch the related org settings
- my $proc_fee = $U->ou_ancestor_setting_value(
- $owning_lib, $args{ous_proc_fee}, $e) || 0;
- my $void_overdue = $U->ou_ancestor_setting_value(
- $owning_lib, $args{ous_void_od}, $e) || 0;
-
- # ---------------------------------------------------------------------
- # move the copy into LOST status
+ # move the copy into requested status
$copy->status($args{status});
$copy->editor($e->requestor->id);
$copy->edit_date('now');
# circulation
my $stop_fines = $circ->stop_fines || '';
if ($stop_fines !~ /^(LOST|LONGOVERDUE)$/) {
- my $price = $U->get_copy_price($e, $copy, $copy->call_number);
+ # ---------------------------------------------------------------------
+ # fetch the related org settings
+ my $owning_lib =
+ ($copy->call_number->id == OILS_PRECAT_CALL_NUMBER) ?
+ $copy->circ_lib : $copy->call_number->owning_lib;
+ my $proc_fee = $U->ou_ancestor_setting_value(
+ $owning_lib, $args{ous_proc_fee}, $e) || 0;
+ my $void_overdue = $U->ou_ancestor_setting_value(
+ $owning_lib, $args{ous_void_od}, $e) || 0;
+
+ my $price = $U->get_copy_price($e, $copy, $copy->call_number);
+
+ if( $price > 0 ) {
+ my $evt = OpenILS::Application::Circ::CircCommon->create_bill($e,
+ $price, $args{bill_type}, $args{bill_note}, $circ->id);
+ return $evt if $evt;
+ }
- if( $price > 0 ) {
- my $evt = OpenILS::Application::Circ::CircCommon->create_bill($e,
- $price, $args{bill_type}, $args{bill_note}, $circ->id);
- return $evt if $evt;
- }
+ # ---------------------------------------------------------------------
+ # if there is a processing fee, charge that too
+ if( $proc_fee > 0 ) {
+ my $evt = OpenILS::Application::Circ::CircCommon->create_bill($e,
+ $proc_fee, $args{bill_fee_type}, $args{bill_fee_note}, $circ->id);
+ return $evt if $evt;
+ }
- # ---------------------------------------------------------------------
- # if there is a processing fee, charge that too
- if( $proc_fee > 0 ) {
- my $evt = OpenILS::Application::Circ::CircCommon->create_bill($e,
- $proc_fee, $args{bill_fee_type}, $args{bill_fee_note}, $circ->id);
- return $evt if $evt;
- }
+ # ---------------------------------------------------------------------
+ # stop the fines
+ $circ->stop_fines($args{stop_fines});
+ $circ->stop_fines_time('now') unless $circ->stop_fines_time;
+ $e->update_action_circulation($circ) or return $e->die_event;
- # ---------------------------------------------------------------------
- # mark the circ as lost and stop the fines
- $circ->stop_fines($args{stop_fines});
- $circ->stop_fines_time('now') unless $circ->stop_fines_time;
- $e->update_action_circulation($circ) or return $e->die_event;
+ # ---------------------------------------------------------------------
+ # zero out overdue fines on this circ if configured
+ if( $void_overdue ) {
+ my $evt = OpenILS::Application::Circ::CircCommon->void_or_zero_overdues($e, $circ, {force_zero => 1, note => "System: OVERDUE REVERSED for " . $args{bill_note} . " Processing"});
+ return $evt if $evt;
+ }
- # ---------------------------------------------------------------------
- # zero out overdue fines on this circ if configured
- if( $void_overdue ) {
- my $evt = OpenILS::Application::Circ::CircCommon->void_or_zero_overdues($e, $circ, {force_zero => 1, note => "System: OVERDUE REVERSED for " . $args{bill_note} . " Processing"});
+ # ---------------------------------------------------------------------
+ # check if circ needs to be reopened due to billing changes
+ my $evt = OpenILS::Application::Circ::CircCommon->reopen_xact($e, $circ->id);
return $evt if $evt;
}
- my $evt = OpenILS::Application::Circ::CircCommon->reopen_xact($e, $circ->id);
- return $evt if $evt;
- }
-
my $ses = OpenSRF::AppSession->create('open-ils.trigger');
$ses->request(
'open-ils.trigger.event.autocreate',