Bugzilla – Attachment 10608 Details for
Bug 8110
Add tests for Calendar modules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8110 - Followup - Make days_between return a number of days, instead of an object.
Bug-8110---Followup---Make-daysbetween-return-a-nu.patch (text/plain), 2.12 KB, created by
Kyle M Hall
on 2012-07-02 15:30:32 UTC
(
hide
)
Description:
Bug 8110 - Followup - Make days_between return a number of days, instead of an object.
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2012-07-02 15:30:32 UTC
Size:
2.12 KB
patch
obsolete
>From 063a1fe66dd3b3bba71fbc2f696bde10cebbb43d Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 2 Jul 2012 11:30:08 -0400 >Subject: [PATCH] Bug 8110 - Followup - Make days_between return a number of days, instead of an object. > >--- > C4/Circulation.pm | 4 ++-- > C4/Overdues.pm | 2 +- > Koha/Calendar.pm | 2 +- > 3 files changed, 4 insertions(+), 4 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index ca2e94d..598743a 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1846,8 +1846,8 @@ sub _FixFineDaysOnReturn { > # grace period is measured in the same units as the loan > my $grace = DateTime::Duration->new( $unit => $issuingrule->{firstremind} ); > >- if ( ( $deltadays - $grace )->is_positive ) { # you can't compare DateTime::Durations with logical operators >- my $new_debar_dt = $dt_today->clone()->add_duration( $deltadays * $finedays ); >+ if ( $deltadays - $grace->in_units('days') { >+ my $new_debar_dt = $dt_today->clone()->add_duration( DateTime::Duration->new( days => $deltadays * $finedays ) ); > my $borrower_debar_dt = dt_from_string( $borrower->{debarred} ); > # check to see if the current debar date is a valid date > if ( $borrower->{debarred} && $borrower_debar_dt ) { >diff --git a/C4/Overdues.pm b/C4/Overdues.pm >index ffdeaf5..471c63a 100644 >--- a/C4/Overdues.pm >+++ b/C4/Overdues.pm >@@ -309,7 +309,7 @@ sub _get_chargeable_units { > else { # days > if(C4::Context->preference('finesCalendar') eq 'noFinesWhenClosed') { > my $calendar = Koha::Calendar->new( branchcode => $branchcode ); >- $charge_duration = $calendar->days_between( $dt1, $dt2 ); >+ return $calendar->days_between( $dt1, $dt2 ); > } else { > $charge_duration = $dt2->delta_days( $dt1 ); > } >diff --git a/Koha/Calendar.pm b/Koha/Calendar.pm >index dc132cd..b7d75e4 100644 >--- a/Koha/Calendar.pm >+++ b/Koha/Calendar.pm >@@ -182,7 +182,7 @@ sub days_between { > $duration->subtract( days => 1 ); > } > } >- return $duration; >+ return $duration->in_units('days'); > > } > >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8110
:
10349
|
10353
|
10356
|
10363
|
10368
|
10382
|
10383
|
10384
|
10385
|
10387
|
10388
|
10389
|
10608
|
11027