Merging Katipo changes.

Got acqui homepage actually displaying suggestions - only displayed count before - need to get the suggestedby diplaying borrowers name rather than id number.
Showing budget breakdowns.
Slight alteration - let $status be an input parameter.
This commit is contained in:
sushi 2006-06-07 02:45:26 +00:00
parent b98cbde880
commit 2ee33de5ef
1 changed files with 20 additions and 12 deletions

View File

@ -46,11 +46,15 @@ for ( my $i = 0 ; $i < $count ; $i++ ) {
$toggle = 0;
}
my ( $spent, $comtd ) = bookfundbreakdown( $results[$i]->{'bookfundid'} );
my $avail = $results[$i]->{'budgetamount'} - ( $spent + $comtd );
my %line;
$line{bookfundname} = $results[$i]->{'bookfundname'};
$line{budgetamount} = $results[$i]->{'budgetamount'};
$line{bookfundid} = $results[$i]->{'bookfundid'};
$line{sdate} = $results[$i]->{'startdate'};
$line{edate} = $results[$i]->{'enddate'};
$line{aqbudgetid} = $results[$i]->{'aqbudgetid'};
$line{spent} = sprintf( "%.2f", $spent );
$line{comtd} = sprintf( "%.2f", $comtd );
$line{avail} = sprintf( "%.2f", $avail );
@ -74,18 +78,22 @@ for ( my $i = 0 ; $i < $count ; $i++ ) {
}
# suggestions ?
my $suggestion = countsuggestion("ASKED");
my $status = $query->param('status') || "ASKED";
my $suggestion = countsuggestion($status);
my $suggestions_loop = &searchsuggestion( '', '', '', '', $status, '' );
$template->param(
classlist => $classlist,
type => 'intranet',
loop_budget => \@loop_budget,
loop_currency => \@loop_currency,
total => sprintf( "%.2f", $total ),
suggestion => $suggestion,
totspent => sprintf( "%.2f", $totspent ),
totcomtd => sprintf( "%.2f", $totcomtd ),
totavail => sprintf( "%.2f", $totavail ),
nobudget => $#results == -1 ? 1 : 0
classlist => $classlist,
type => 'intranet',
loop_budget => \@loop_budget,
loop_currency => \@loop_currency,
total => sprintf( "%.2f", $total ),
suggestion => $suggestion,
suggestions_loop => $suggestions_loop,
totspent => sprintf( "%.2f", $totspent ),
totcomtd => sprintf( "%.2f", $totcomtd ),
totavail => sprintf( "%.2f", $totavail ),
nobudget => $#results == -1 ? 1 : 0
);
output_html_with_http_headers $query, $cookie, $template->output;