From: erickson Date: Tue, 29 Sep 2009 16:18:51 +0000 (+0000) Subject: added void_overdues flag to checkin API call to allow for an 'amnesty checkin mode... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1bf81a21d9a0ec88a3c933fd7af90dabcc612949;p=evergreen%2Fmasslnc.git added void_overdues flag to checkin API call to allow for an 'amnesty checkin mode'. added optional system note to shared void_overdues routine. updated some code comments git-svn-id: svn://svn.open-ils.org/ILS/trunk@14206 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/CircCommon.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/CircCommon.pm index ee20693192..048c0871c8 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/CircCommon.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/CircCommon.pm @@ -21,7 +21,7 @@ my $U = "OpenILS::Application::AppUtils"; # provided, then we only void back to the backdate # ----------------------------------------------------------------- sub void_overdues { - my($class, $e, $circ, $backdate) = @_; + my($class, $e, $circ, $backdate, $note) = @_; my $bill_search = { xact => $circ->id, @@ -56,8 +56,8 @@ sub void_overdues { $bill->voided('t'); $bill->void_time('now'); $bill->voider($e->requestor->id); - my $n = $bill->note || ""; - $bill->note("$n\nSystem: VOIDED FOR BACKDATE"); + my $n = ($bill->note) ? sprintf("%s\n", $bill->note) : ""; + $bill->note(sprintf("$n%s", ($note) ? $note : "System: VOIDED FOR BACKDATE")); $e->update_money_billing($bill) or return $e->die_event; } diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm index 39d1bece86..37123f5eaf 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm @@ -110,7 +110,9 @@ __PACKAGE__->register_method( @param authtoken The login session key @param params Hash of named parameters including: barcode - The copy barcode - force - If true, copies in bad statuses will be checked in and give good statuses + force - If true, copies in bad statuses will be checked in and give good statuses + noop - don't capture holds or put items into transit + void_overdues - void all overdues for the circulation (aka amnesty) ... / ); @@ -403,6 +405,7 @@ my @AUTOLOAD_FIELDS = qw/ rental_billing capture noop + void_overdues /; @@ -2264,6 +2267,12 @@ sub checkin_handle_circ { return if $self->bail_out; } + if($self->void_overdues) { + my $evt = OpenILS::Application::Circ::CircCommon->void_overdues( + $self->editor, $circ, undef, 'System: Amnesty Checkin'); # TODO i18n for system-generated notes + return $self->bail_on_events($evt) if $evt; + } + if(!$circ->stop_fines) { $circ->stop_fines(OILS_STOP_FINES_CHECKIN); $circ->stop_fines(OILS_STOP_FINES_RENEW) if $self->is_renewal;