[open-ils-commits] ***SPAM*** [GIT] Evergreen ILS branch master updated. 2df5aff9f202b9d2fa0cb5d2d63ccfbd358b5495
Evergreen Git
git at git.evergreen-ils.org
Mon Nov 10 16:13:24 EST 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via 2df5aff9f202b9d2fa0cb5d2d63ccfbd358b5495 (commit)
from caf6c6a1162f248376c14bb0e32461bbe02224a5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2df5aff9f202b9d2fa0cb5d2d63ccfbd358b5495
Author: Thomas Berezansky <tsbere at mvlc.org>
Date: Mon Sep 9 15:49:47 2013 -0400
Use xact_start for due date calc instead of now
If you don't supply a due date when creating a circulation with the
open-ils.circ.checkout family of calls, the due date is currently
calculated from now(). This code modification changes that so that
if a checkout_date is supplied that is used to calculate the due date
instead of now().
This enables some interesting uses of the open-ils.circ module for
batch circulation in the cases of offline use from a spreadsheet and
not the offline client or in the case of migrating circulations from
another ILS into Evergreen.
Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
Signed-off-by: Dan Wells <dbw2 at calvin.edu>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
index f37c0fb..307d962 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
@@ -2044,7 +2044,7 @@ sub build_checkout_circ_object {
# if a patron is renewing, 'requestor' will be the patron
$circ->circ_staff($self->editor->requestor->id);
- $circ->due_date( $self->create_due_date($circ->duration, $duration_date_ceiling, $duration_date_ceiling_force) ) if $circ->duration;
+ $circ->due_date( $self->create_due_date($circ->duration, $duration_date_ceiling, $duration_date_ceiling_force, $circ->xact_start) ) if $circ->duration;
$self->circ($circ);
}
@@ -2252,7 +2252,7 @@ sub apply_modified_due_date {
sub create_due_date {
- my( $self, $duration, $date_ceiling, $force_date ) = @_;
+ my( $self, $duration, $date_ceiling, $force_date, $start_time ) = @_;
# if there is a raw time component (e.g. from postgres),
# turn it into an interval that interval_to_seconds can parse
@@ -2260,6 +2260,7 @@ sub create_due_date {
# for now, use the server timezone. TODO: use workstation org timezone
my $due_date = DateTime->now(time_zone => 'local');
+ $due_date = DateTime::Format::ISO8601->new->parse_datetime(cleanse_ISO8601($start_time)) if $start_time;
# add the circ duration
$due_date->add(seconds => OpenSRF::Utils->interval_to_seconds($duration));
-----------------------------------------------------------------------
Summary of changes:
.../lib/OpenILS/Application/Circ/Circulate.pm | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list