Backdate into grace period - include last second
authorThomas Berezansky <tsbere@mvlc.org>
Thu, 15 Mar 2012 21:04:51 +0000 (17:04 -0400)
committerMike Rylander <mrylander@gmail.com>
Tue, 20 Mar 2012 20:21:08 +0000 (16:21 -0400)
The last second of the grace period is ignored on backdated checkins, but
should still count as "in" the grace period.

This fixes that.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm

index 9daa10c..613447f 100644 (file)
@@ -47,7 +47,7 @@ sub void_overdues {
         my $date = DateTime::Format::ISO8601->parse_datetime($backdate);
         my $due_date = DateTime::Format::ISO8601->parse_datetime(cleanse_ISO8601($circ->due_date))->epoch;
         my $grace_period = extend_grace_period( $class, $circ->circ_lib, $circ->due_date, OpenSRF::Utils->interval_to_seconds($circ->grace_period), $e);
-        if($date->epoch < $due_date + $grace_period) {
+        if($date->epoch <= $due_date + $grace_period) {
             $logger->info("backdate $backdate is within grace period, voiding all");
         } else {
             $backdate = $U->epoch2ISO8601($date->epoch + $interval);