Be warned that to be able to select a budget which is not from patron's Branch, you should have a '' Branch information.
group by aqbookfund.bookfundid order by bookfundname";
} else {
$strsth="Select * from aqbookfund,aqbudget where aqbookfund.bookfundid
- =aqbudget.bookfundid and (aqbookfund.branchcode='' or aqbookfund.branchcode= ? )
+ =aqbudget.bookfundid and (aqbookfund.branchcode is null or aqbookfund.branchcode='' or aqbookfund.branchcode= ? )
group by aqbookfund.bookfundid order by bookfundname";
}
my $sth=$dbh->prepare($strsth);
});
# budget
-my ($count,@results)=bookfunds;
+my $dbh = C4::Context->dbh;
+my $sthtemp = $dbh->prepare("Select flags, branchcode from borrowers where borrowernumber = ?");
+$sthtemp->execute($loggedinuser);
+my ($flags, $homebranch)=$sthtemp->fetchrow;
+
+my ($count,@results)=bookfunds($homebranch);
my $classlist='';
my $total=0;
my $totspent=0;
flagsrequired => {acquisition => 1},
debug => 1,
});
-
$template->param($count);
+my $sthtemp = $dbh->prepare("Select flags, branchcode from borrowers where borrowernumber = ?");
+$sthtemp->execute($borrowernumber);
+my ($flags, $homebranch)=$sthtemp->fetchrow;
+
if ($count == 1){
my $sth;
# my $sth=$dbh->prepare("Select itemtype,description from itemtypes order by description");
-multiple => 0 );
# build bookfund list
+my $sthtemp = $dbh->prepare("Select flags, branchcode from borrowers where borrowernumber = ?");
+$sthtemp->execute($loggedinuser);
+my ($flags, $homebranch)=$sthtemp->fetchrow;
+
my @bookfund;
my @select_bookfund;
my %select_bookfunds;
-($count2,@bookfund)=bookfunds();
+($count2,@bookfund)=bookfunds($homebranch);
for (my $i=0;$i<$count2;$i++){
push @select_bookfund, $bookfund[$i]->{'bookfundid'};
$select_bookfunds{$bookfund[$i]->{'bookfundid'}} = $bookfund[$i]->{'bookfundname'}
debug => 1,
});
+#FIXME : Is this page still used ????
+# looks like no.
+
# budget
-my ($count,@results)=&bookfunds;
+my $dbh = C4::Context->dbh;
+my $sthtemp = $dbh->prepare("Select flags, branchcode from borrowers where borrowernumber = ?");
+$sthtemp->execute($loggedinuser);
+my ($flags, $homebranch)=$sthtemp->fetchrow;
+my ($count,@results)=bookfunds($homebranch);
my $classlist='';
my $total=0;
my $totspent=0;
});
+#FIXME : If Budgets are never used, then these lines are useless.
+my $dbh = C4::Context->dbh;
+my $sthtemp = $dbh->prepare("Select flags, branchcode from borrowers where borrowernumber = ?");
+$sthtemp->execute($loggedinuser);
+my ($flags, $homebranch)=$sthtemp->fetchrow;
+#FIXME : END added by hdl on July,14 2005
+
if ($op eq 'mod') {
my $subscriptionid = $query->param('subscriptionid');
my $subs = &getsubscription($subscriptionid);
"dow$dow" => 1,
);
}
-(my $temp,@budgets) = bookfunds();
+##FIXME : Looks like never used.
+(my $temp,@budgets) = bookfunds($homebranch);
# find default value & set it for the template
for (my $i=0;$i<=$#budgets;$i++) {
if ($budgets[$i]->{'aqbudgetid'} eq $aqbudgetid) {
}
}
$template->param(budgets => \@budgets);
+#FIXME : END Added by hdl on July, 14 2005
if ($op eq 'addsubscription') {
my $auser = $query->param('user');