Bugzilla – Attachment 1978 Details for
Bug 4286
Subscription expired at its creation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
bugfix
0001-MT-3035-subscription-created-expired.patch (text/plain), 2.70 KB, created by
Chris Cormack
on 2010-03-01 08:30:00 UTC
(
hide
)
Description:
bugfix
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2010-03-01 08:30:00 UTC
Size:
2.70 KB
patch
obsolete
>From 4902d0a632ff9ec2086d1c14b1dc88699dc7243d Mon Sep 17 00:00:00 2001 >From: Henri-Damien LAURENT <henridamien.laurent@biblibre.com> >Date: Tue, 23 Feb 2010 08:56:27 +0100 >Subject: [PATCH] (MT 3035) subscription created expired > >Subscription expiration date was not calculated on creation of a subscription >(cherry picked from commit 263e9217c8cd736924f66d699981949e29b4c200) >--- > C4/Serials.pm | 21 ++++++++++++++++----- > 1 files changed, 16 insertions(+), 5 deletions(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index d72e98c..439bd01 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -380,7 +380,8 @@ sub GetSubscription { > $debug and warn "query : $query\nsubsid :$subscriptionid"; > my $sth = $dbh->prepare($query); > $sth->execute($subscriptionid); >- return $sth->fetchrow_hashref; >+ my $data= $sth->fetchrow_hashref; >+ return $data; > } > > =head2 GetFullSubscription >@@ -987,7 +988,7 @@ sub GetSeq { > > =head2 GetExpirationDate > >-$sensddate = GetExpirationDate($subscriptionid) >+$enddate = GetExpirationDate($subscriptionid,$startdate) > > this function return the next expiration date for a subscription given on input args. > >@@ -1349,15 +1350,25 @@ sub NewSubscription { > $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate > ); > >- #then create the 1st waited number > my $subscriptionid = $dbh->{'mysql_insertid'}; >+ unless ($enddate){ >+ $enddate=GetExpirationDate($subscriptionid,$startdate); >+ $query = qq| >+ UPDATE subscription >+ SET enddate=? >+ WHERE subscriptionid=? >+ |; >+ $sth = $dbh->prepare($query); >+ $sth->execute( $enddate, $subscriptionid ); >+ } >+ #then create the 1st waited number > $query = qq( > INSERT INTO subscriptionhistory > (biblionumber, subscriptionid, histstartdate, opacnote, librariannote) > VALUES (?,?,?,?,?) > ); > $sth = $dbh->prepare($query); >- $sth->execute( $biblionumber, $subscriptionid, $startdate, $notes, $internalnotes ); >+ $sth->execute( $biblionumber, $subscriptionid, $startdate, $notes, $internalnotes ); > > # reread subscription to get a hash (for calculation of the 1st issue number) > $query = qq( >@@ -1719,7 +1730,7 @@ sub HasSubscriptionExpired { > my $dbh = C4::Context->dbh; > my $subscription = GetSubscription($subscriptionid); > if ( ( $subscription->{periodicity} % 16 ) > 0 ) { >- my $expirationdate = $subscription->{enddate}; >+ my $expirationdate = $subscription->{enddate}||GetExpirationDate($subscriptionid); > my $query = qq| > SELECT max(planneddate) > FROM serial >-- >1.6.3.3 >
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 4286
: 1978 |
2189
|
2879