From: Liam Whalen Date: Mon, 15 Jul 2013 04:00:14 +0000 (-0700) Subject: Fixes error with generate_fines for overdues returned after closed date X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f040814c7507291c388a35a23c8878293a2524e4;p=evergreen%2Fpines.git Fixes error with generate_fines for overdues returned after closed date If an overdue is returned after a closed date, the generate_fines code will not generate fines for those items because the section of code that checks for closed dates returns from the function if a closed date is encountered. For example, if an item is due on June 29th, but is not returned until after July 1st (Canada Day), then when fines are generated for the item, generate fines creates a fine for the 30th of June, but when it gets to the 1st of July it encouters a closed date and executes a 'return' statement which exits the generate_fines code causing the fine from June 30th to be rolled back as well as preventing further fines from being generated. This fix replaces the 'return' statements inside the 'for' loop that is nested within the eval with 'next' statements. Signed-off-by: Liam Whalen Signed-off-by: Dan Scott --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm index 9c06c6274e..9692f27fb0 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm @@ -1186,7 +1186,7 @@ sub generate_fines { my $dow_close = "dow_${dow}_close"; if (my $h = $hoo{$c->$circ_lib_method}) { - return if ( $h->$dow_open eq '00:00:00' and $h->$dow_close eq '00:00:00'); + next if ( $h->$dow_open eq '00:00:00' and $h->$dow_close eq '00:00:00'); } my @cl = actor::org_unit::closed_date->search_where( @@ -1194,7 +1194,7 @@ sub generate_fines { close_end => { '>=' => $timestamptz }, org_unit => $c->$circ_lib_method } ); - return if (@cl); + next if (@cl); } # The billing amount for this billing normally ought to be the recurring fine amount.