From aa42aa7f95f70d44db7a4b571fdb93c7534fa64a Mon Sep 17 00:00:00 2001 From: hdl Date: Wed, 27 Jun 2007 14:54:55 +0000 Subject: [PATCH] Bug Fixing. IndependantBranches would lead to void information in GetSubscription because select was for "''" and not "" --- C4/Serials.pm | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index f21f3be13c..10d684e90c 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -369,10 +369,11 @@ sub GetSubscription { C4::Context->userenv && C4::Context->userenv->{'flags'} != 1){ # warn "flags: ".C4::Context->userenv->{'flags'}; - $query.=" AND subscription.branchcode IN ('".C4::Context->userenv->{'branch'}."',\"''\")"; + $query.=" AND subscription.branchcode IN ('".C4::Context->userenv->{'branch'}."',\"\")"; } -# warn "query : $query"; +# warn "query : $query"; my $sth = $dbh->prepare($query); +# warn "subsid :$subscriptionid"; $sth->execute($subscriptionid); my $subs = $sth->fetchrow_hashref; return $subs; @@ -1441,31 +1442,31 @@ sub ReNewSubscription { = @_; my $dbh = C4::Context->dbh; my $subscription = GetSubscription($subscriptionid); - my $query = qq| - SELECT * - FROM biblio,biblioitems - WHERE biblio.biblionumber=biblioitems.biblionumber - AND biblio.biblionumber=? - |; - my $sth = $dbh->prepare($query); - $sth->execute( $subscription->{biblionumber} ); - my $biblio = $sth->fetchrow_hashref; - NewSuggestion( - $user, $subscription->{bibliotitle}, - $biblio->{author}, $biblio->{publishercode}, - $biblio->{note}, '', - '', '', - '', '', - $subscription->{biblionumber} - ); +# my $query = qq| +# SELECT * +# FROM biblio,biblioitems +# WHERE biblio.biblionumber=biblioitems.biblionumber +# AND biblio.biblionumber=? +# |; +# my $sth = $dbh->prepare($query); +# $sth->execute( $subscription->{biblionumber} ); +# my $biblio = $sth->fetchrow_hashref; +# NewSuggestion( +# $user, $subscription->{bibliotitle}, +# $biblio->{author}, $biblio->{publishercode}, +# $biblio->{note}, '', +# '', '', +# '', '', +# $subscription->{biblionumber} +# ); # renew subscription - $query = qq| + my $query = qq| UPDATE subscription SET startdate=?,numberlength=?,weeklength=?,monthlength=? WHERE subscriptionid=? |; - $sth = $dbh->prepare($query); + my $sth = $dbh->prepare($query); $sth->execute( format_date_in_iso($startdate), $numberlength, $weeklength, $monthlength, $subscriptionid ); -- 2.39.5