From 2e262b4997a04f3b5fbc4705a54b0156eb87fac2 Mon Sep 17 00:00:00 2001 From: hdl Date: Mon, 26 Jun 2006 00:17:11 +0000 Subject: [PATCH] Bug FIX : subscription renewal would renew ANY subscription and not the only one selected. --- C4/Bull.pm | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/C4/Bull.pm b/C4/Bull.pm index 8c05068786..74980fb21d 100755 --- a/C4/Bull.pm +++ b/C4/Bull.pm @@ -226,12 +226,8 @@ sub get_full_subscription_list_from_biblionumber { my $first; my $previousnote=""; while (my $subs = $sth->fetchrow_hashref) { -# my $sth2 = $dbh->prepare('select * from serial where serial.biblionumber = ? and serial.subscriptionid=? order by serial.planneddate'); -# $sth2->execute($biblionumber,$subs->{'subscriptionid'}); -# while (my $issues = $sth2->fetchrow_hashref){ -# warn "planneddate ".$issues->{'planneddate'}; -# warn "serialseq".$issues->{'serialseq'}; -# } +### BUG To FIX: When there is no published date, will create many null ids!!! + if ($year and ($year==$subs->{year})){ if ($first eq 1){$first=0;} my $temp=$res[scalar(@res)-1]->{'serials'}; @@ -745,7 +741,7 @@ sub subscriptionrenew { my $biblio = $sth->fetchrow_hashref; newsuggestion($user,$subscription->{bibliotitle},$biblio->{author},$biblio->{publishercode},$biblio->{note},'','','','','',$subscription->{biblionumber}); # renew subscription - $sth=$dbh->prepare("update subscription set startdate=?,numberlength=?,weeklength=?,monthlength=?"); - $sth->execute(format_date_in_iso($startdate),$numberlength,$weeklength,$monthlength); + $sth=$dbh->prepare("update subscription set startdate=?,numberlength=?,weeklength=?,monthlength=? where subscriptionid=?"); + $sth->execute(format_date_in_iso($startdate),$numberlength,$weeklength,$monthlength, $subscriptionid); } END { } # module clean-up code here (global destructor)