[open-ils-commits] r10134 - in
trunk/Open-ILS/src/perlmods/OpenILS/Application: . Circ
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Jul 25 15:00:26 EDT 2008
Author: erickson
Date: 2008-07-25 15:00:18 -0400 (Fri, 25 Jul 2008)
New Revision: 10134
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
Log:
turning raw time durations into h/m/s notation so interval_to_seconds can parse it
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm 2008-07-25 18:59:50 UTC (rev 10133)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm 2008-07-25 19:00:18 UTC (rev 10134)
@@ -263,7 +263,6 @@
$$args{is_precat} = $$args{precat};
delete $$args{precat};
}
-
}
@@ -1167,6 +1166,9 @@
sub create_due_date {
my( $self, $duration ) = @_;
+ # if there is a raw time component (e.g. from postgres),
+ # turn it into an interval that interval_to_seconds can parse
+ $duration =~ s/(\d{2}):(\d{2}):(\d{2})/$1 h $2 m $3 s/o;
my ($sec,$min,$hour,$mday,$mon,$year) =
gmtime(OpenSRF::Utils->interval_to_seconds($duration) + int(time()));
$year += 1900; $mon += 1;
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm 2008-07-25 18:59:50 UTC (rev 10133)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm 2008-07-25 19:00:18 UTC (rev 10134)
@@ -380,7 +380,13 @@
# one fine interval to the backdate to ensure that we are not
# voiding fines that were applicable before the backdate.
# ------------------------------------------------------------------
- my $interval = OpenSRF::Utils->interval_to_seconds($circ->fine_interval);
+
+ # if there is a raw time component (e.g. from postgres),
+ # turn it into an interval that interval_to_seconds can parse
+ my $duration = $circ->fine_interval;
+ $duration =~ s/(\d{2}):(\d{2}):(\d{2})/$1 h $2 m $3 s/o;
+ my $interval = OpenSRF::Utils->interval_to_seconds($duration);
+
my $date = DateTime::Format::ISO8601->parse_datetime($backdate);
$backdate = $U->epoch2ISO8601($date->epoch + $interval);
$logger->info("applying backdate $backdate in overdue voiding");
@@ -1103,7 +1109,7 @@
};
}
+# {"select":{"acp":["id"],"circ":[{"aggregate":true,"transform":"count","alias":"count","column":"id"}]},"from":{"acp":{"circ":{"field":"target_copy","fkey":"id","type":"left"},"acn"{"field":"id","fkey":"call_number"}}},"where":{"+acn":{"record":200057}}
-
1;
More information about the open-ils-commits
mailing list