[open-ils-commits] r19288 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ (dbwells)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Jan 25 15:43:51 EST 2011
Author: dbwells
Date: 2011-01-25 15:43:47 -0500 (Tue, 25 Jan 2011)
New Revision: 19288
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
Log:
Fix checkin backdate assumptions
checkin_handle_backdate() did not properly interpret bill data (voided too much), so lets use void_overdues() instead
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm 2011-01-25 20:22:37 UTC (rev 19287)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm 2011-01-25 20:43:47 UTC (rev 19288)
@@ -2942,8 +2942,8 @@
# backdate the circ if necessary
if($self->backdate) {
- $self->checkin_handle_backdate;
- return if $self->bail_out;
+ my $evt = $self->checkin_handle_backdate;
+ return $self->bail_on_events($evt) if $evt;
}
if($self->void_overdues) {
@@ -3062,41 +3062,23 @@
sub checkin_handle_backdate {
my $self = shift;
- my $bd = cleanse_ISO8601($self->backdate);
-
# ------------------------------------------------------------------
# clean up the backdate for date comparison
- # we want any bills created on or after the backdate
+ # XXX We are currently taking the due-time from the original due-date,
+ # not the input. Do we need to do this? This certainly interferes with
+ # backdating of hourly checkouts, but that is likely a very rare case.
# ------------------------------------------------------------------
+ my $bd = cleanse_ISO8601($self->backdate);
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 = cleanse_ISO8601($new_date->ymd . 'T' . $original_date->strftime('%T%z'));
$self->backdate($bd);
- my $bills = $self->editor->search_money_billing(
- {
- billing_ts => { '>=' => $bd },
- xact => $self->circ->id,
- btype => 1
- }
- );
+ my $evt = OpenILS::Application::Circ::CircCommon->void_overdues($self->editor, $self->circ, $bd);
+ return $evt if $evt;
- $logger->debug("backdate found ".scalar(@$bills)." bills to void");
-
- for my $bill (@$bills) {
- unless( $U->is_true($bill->voided) ) {
- $logger->info("backdate voiding bill ".$bill->id);
- $bill->voided('t');
- $bill->void_time('now');
- $bill->voider($self->editor->requestor->id);
- my $n = $bill->note || "";
- $bill->note("$n\nSystem: VOIDED FOR BACKDATE");
-
- $self->bail_on_events($self->editor->event)
- unless $self->editor->update_money_billing($bill);
- }
- }
+ return undef;
}
More information about the open-ils-commits
mailing list