From 62621825e5f12c203a10c59464e5f5ed6cc3c0a6 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Wed, 21 Mar 2012 11:09:51 +1300 Subject: [PATCH] Bug 5549 : _FixFineDaysOnReturn was using C4::Dates in calling days_between, fixed to use DateTime objects --- C4/Circulation.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 59f01fae58..0adc8dc971 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1785,7 +1785,9 @@ Internal function, called only by AddReturn that calculate and update the user f sub _FixFineDaysOnReturn { my ( $borrower, $item, $datedue ) = @_; - + + my $dt_due = dt_from_string($datedue); + my $dt_today = DateTime->now( time_zone => C4::Context->tz() ); if ($datedue) { $datedue = C4::Dates->new( $datedue, "iso" ); } else { @@ -1796,7 +1798,7 @@ sub _FixFineDaysOnReturn { my $calendar = Koha::Calendar->new( branchcode => $branchcode ); my $today = C4::Dates->new(); - my $deltadays = $calendar->days_between( $datedue, C4::Dates->new() ); + my $deltadays = $calendar->days_between( $dt_due, $dt_today ); my $circcontrol = C4::Context::preference('CircControl'); my $issuingrule = GetIssuingRule( $borrower->{categorycode}, $item->{itype}, $branchcode ); -- 2.39.5