[open-ils-commits] r15695 - in trunk/Open-ILS/src/perlmods/OpenILS/Application: . Circ (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Mar 4 11:19:17 EST 2010
Author: miker
Date: 2010-03-04 11:19:14 -0500 (Thu, 04 Mar 2010)
New Revision: 15695
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
Log:
forward-porting r15694: preserve time component of original circ when backdating -- mainly to avoid over-voiding billings
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm 2010-03-04 16:16:55 UTC (rev 15694)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm 2010-03-04 16:19:14 UTC (rev 15695)
@@ -2781,9 +2781,12 @@
# clean up the backdate for date comparison
# we want any bills created on or after the backdate
# ------------------------------------------------------------------
- $bd =~ s/^(\d{4}-\d{2}-\d{2}).*/$1/og;
- #$bd = "${bd}T23:59:59";
+ my $original_date = DateTime::Format::ISO8601->new->parse_datetime(cleanse_ISO8601($self->circ->due_date));
+ my $new_date = DateTime::Format::ISO8601->new->parse_datetime($bd);
+ $bd = $new_date->ymd . 'T' . $original_date->strftime('%T%z');
+ $self->backdate($bd);
+
my $bills = $self->editor->search_money_billing(
{
billing_ts => { '>=' => $bd },
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm 2010-03-04 16:16:55 UTC (rev 15694)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm 2010-03-04 16:19:14 UTC (rev 15695)
@@ -367,8 +367,14 @@
$circ->stop_fines_time('now') unless $circ->stop_fines_time;
if( $backdate ) {
+ $backdate = cleanse_ISO8601($backdate);
+
+ my $original_date = DateTime::Format::ISO8601->new->parse_datetime(cleanse_ISO8601($circ->due_date));
+ my $new_date = DateTime::Format::ISO8601->new->parse_datetime($backdate);
+ $backdate = $new_date->ymd . 'T' . $original_date->strftime('%T%z');
+
# make it look like the circ stopped at the cliams returned time
- $circ->stop_fines_time(cleanse_ISO8601($backdate));
+ $circ->stop_fines_time($backdate);
my $evt = OpenILS::Application::Circ::CircCommon->void_overdues($e, $circ, $backdate);
return $evt if $evt;
}
More information about the open-ils-commits
mailing list