LP#1635737 Non-cataloged circ dynamic durations user/berick/lp1635737-due-date-interval-from-pg
authorBill Erickson <berickxx@gmail.com>
Fri, 19 May 2017 15:22:29 +0000 (11:22 -0400)
committerBill Erickson <berickxx@gmail.com>
Fri, 19 May 2017 16:09:13 +0000 (12:09 -0400)
Use the new dynamic duration math (in Postgres) to calculate durations
for non-cataloged circulations.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/NonCat.pm

index 26b85d2..9c691f2 100644 (file)
@@ -187,9 +187,8 @@ sub noncat_due_date {
         or return $e->die_event;
 
     my $duedate = $_dt_parser->parse_datetime( cleanse_ISO8601($circ->circ_time) );
-    $duedate = $duedate
-        ->add( seconds => interval_to_seconds($otype->circ_duration) )
-        ->strftime('%FT%T%z');
+    $duedate = $U->date_plus_interval($duedate, $otype->circ_duration, $e);
+    $duedate = $duedate->strftime('%FT%T%z');
 
     my $offset = $U->storagereq(
         'open-ils.storage.actor.org_unit.closed_date.overlap',