From: miker Date: Fri, 15 Sep 2006 14:50:25 +0000 (+0000) Subject: adding grace after a closed day X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=342e4ce80398154fef53760eebd4d0f0d0327cd2;p=Evergreen.git adding grace after a closed day git-svn-id: svn://svn.open-ils.org/ILS/trunk@6116 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm index b0dbb874c2..7ae1a19509 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm @@ -559,7 +559,7 @@ sub generate_fines { my $recuring_fine = int($c->recuring_fine * 100); my $max_fine = int($c->max_fine * 100); - my ($latest_billing_ts, $latest_amount) = ('',0);; + my ($latest_billing_ts, $latest_amount) = ('',0); for (my $bill = 1; $bill <= $pending_fine_count; $bill++) { if ($current_fine_total >= $max_fine) { @@ -581,6 +581,16 @@ sub generate_fines { next if ( $h->$dow_open eq '00:00:00' and $h->$dow_close eq '00:00:00'); } + if ($last_fine eq $due) { # first time we've billed for this + $dow = $billing_ts->subtract( days => 1 )->day_of_week_0(); + $dow_open = "dow_${dow}_open"; + $dow_close = "dow_${dow}_close"; + + if (my $h = $hoo{$c->circ_lib}) { # if the day before now was a closed day, skip today (adding grace) + next if ( $h->$dow_open eq '00:00:00' and $h->$dow_close eq '00:00:00'); + } + } + my $timestamptz = $billing_ts->strftime('%FT%T%z'); my @cl = actor::org_unit::closed_date->search_where( { close_start => { '<=' => $timestamptz },