removed hard coded budget date from sub bookfunds();

Replaced with a check that today's date is after the startdate and before the enddate of the budget.
This commit is contained in:
tonnesen 2002-09-03 21:03:51 +00:00
parent 947b17824f
commit 6bcbfd23eb
1 changed files with 5 additions and 1 deletions

View File

@ -340,10 +340,14 @@ sub newbasket {
}
sub bookfunds {
my ($day,$month,$year)=(localtime(time))[3,4,5];
$year+=1900;
$month++;
my $today=sprintf "%4d-%02d-%02d", $year, $monthm, $day;
my $dbh=C4Connect;
my $query="Select * from aqbookfund,aqbudget where aqbookfund.bookfundid
=aqbudget.bookfundid
and aqbudget.startdate='2001-07-01'
and aqbudget.startdate<'$today' and aqbudget.enddate > '$today'
group by aqbookfund.bookfundid order by bookfundname";
my $sth=$dbh->prepare($query);
$sth->execute;