Bugzilla – Attachment 37356 Details for
Bug 13109
Serial failure for received and general viewing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13109 - Serial failure for received and general viewing.
Bug-13109---Serial-failure-for-received-and-genera.patch (text/plain), 2.07 KB, created by
Mason James
on 2015-03-30 06:41:09 UTC
(
hide
)
Description:
Bug 13109 - Serial failure for received and general viewing.
Filename:
MIME Type:
Creator:
Mason James
Created:
2015-03-30 06:41:09 UTC
Size:
2.07 KB
patch
obsolete
>From d3d7e3d6a38ba5fbd5afbcf16daa5311dd09ea7c Mon Sep 17 00:00:00 2001 >From: Mason James <mtj@kohaaloha.com> >Date: Mon, 30 Mar 2015 19:33:45 +1300 >Subject: [PATCH] Bug 13109 - Serial failure for received and general viewing. >Content-Type: text/plain; charset="utf-8" > > modified: C4/Serials.pm >--- > C4/Serials.pm | 20 +++++++++++++++----- > 1 file changed, 15 insertions(+), 5 deletions(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index 538d4bd..4c2376e 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -1023,7 +1023,9 @@ sub GetExpirationDate { > # we don't do the same test if the subscription is based on X numbers or on X weeks/months > $enddate = $startdate || $subscription->{startdate}; > my @date = split( /-/, $enddate ); >+ > return if ( scalar(@date) != 3 || not check_date(@date) ); >+ > my $frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity}); > if ( $frequency and $frequency->{unit} ) { > >@@ -2319,18 +2321,26 @@ sub abouttoexpire { > my $per = $subscription->{'periodicity'}; > my $frequency = C4::Serials::Frequency::GetSubscriptionFrequency($per); > if ($frequency and $frequency->{unit}){ >+ > my $expirationdate = GetExpirationDate($subscriptionid); >+ > my ($res) = $dbh->selectrow_array('select max(planneddate) from serial where subscriptionid = ?', undef, $subscriptionid); > my $nextdate = GetNextDate($subscription, $res); >- if(Date::Calc::Delta_Days( >- split( /-/, $nextdate ), >- split( /-/, $expirationdate ) >- ) <= 0) { >- return 1; >+ >+ # BZ 13109, only compare dates if both dates exist. >+ if ($nextdate and $expirationdate) { >+ if(Date::Calc::Delta_Days( >+ split( /-/, $nextdate ), >+ split( /-/, $expirationdate ) >+ ) <= 0) { >+ return 1; >+ } > } >+ > } elsif ($subscription->{numberlength}>0) { > return (countissuesfrom($subscriptionid,$subscription->{'startdate'}) >=$subscription->{numberlength}-1); > } >+ > return 0; > } > >-- >1.7.10.4
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 13109
:
37356
|
37357
|
37716
|
37915