[open-ils-commits] r15064 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Dec 3 09:49:44 EST 2009
Author: erickson
Date: 2009-12-03 09:49:42 -0500 (Thu, 03 Dec 2009)
New Revision: 15064
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/NonCat.pm
Log:
calculate/flesh non-cat circ due date during circ creation
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/NonCat.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/NonCat.pm 2009-12-03 14:48:54 UTC (rev 15063)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/NonCat.pm 2009-12-03 14:49:42 UTC (rev 15064)
@@ -38,6 +38,7 @@
$evt = $editor->event unless
$circ = $editor->create_action_non_cataloged_circulation( $circ )
+
} else {
$id = $U->simplereq(
'open-ils.storage',
@@ -46,6 +47,11 @@
$circ->id($id);
}
+ if($circ) {
+ my $e = ($editor) ? $editor : new_editor();
+ $circ = noncat_due_date($e, $circ);
+ }
+
return( $circ, $evt );
}
@@ -159,25 +165,30 @@
if( $c->patron ne $e->requestor->id ) {
return $e->event unless $e->allowed('VIEW_CIRCULATIONS'); # XXX rely on editor perm
}
+ return noncat_due_date($e, $c);
+}
- my $otype = $e->retrieve_config_non_cataloged_type($c->item_type)
+sub noncat_due_date {
+ my($e, $circ) = @_;
+
+ my $otype = $e->retrieve_config_non_cataloged_type($circ->item_type)
or return $e->die_event;
- my $duedate = $_dt_parser->parse_datetime( clense_ISO8601($c->circ_time) );
+ my $duedate = $_dt_parser->parse_datetime( clense_ISO8601($circ->circ_time) );
$duedate = $duedate
->add( seconds => interval_to_seconds($otype->circ_duration) )
->strftime('%FT%T%z');
my $offset = $e->request(
'open-ils.storage.actor.org_unit.closed_date.overlap',
- $c->circ_lib,
+ $circ->circ_lib,
$duedate
);
$duedate = $offset->{end} if ($offset);
- $c->duedate($duedate);
+ $circ->duedate($duedate);
- return $c;
+ return $circ;
}
More information about the open-ils-commits
mailing list