7 use C4::Interface::CGI::Output;
12 my ($template, $loggedinuser, $cookie)
13 = get_template_and_user({template_name => "bull/search-supply.tmpl",
17 flagsrequired => {acquisition => 1},
22 my ($count,@results)=&bookfunds;
29 for (my $i=0;$i<$count;$i++){
30 my ($spent,$comtd)=bookfundbreakdown($results[$i]->{'bookfundid'});
31 my $avail=$results[$i]->{'budgetamount'}-($spent+$comtd);
33 $line{bookfundname} = $results[$i]->{'bookfundname'};
34 $line{budgetamount} = $results[$i]->{'budgetamount'};
35 $line{spent} = sprintf ("%.2f", $spent);
36 $line{comtd} = sprintf ("%.2f",$comtd);
37 $line{avail} = sprintf ("%.2f",$avail);
38 push @loop_budget, \%line;
39 $total+=$results[$i]->{'budgetamount'};
45 my ($count,$rates)=getcurrencies();
46 my @loop_currency = ();
47 for (my $i=0;$i<$count;$i++){
49 $line{currency} = $rates->[$i]->{'currency'};
50 $line{rate} = $rates->[$i]->{'rate'};
51 push @loop_currency, \%line;
53 $template->param(classlist => $classlist,
55 loop_budget => \@loop_budget,
56 loop_currency => \@loop_currency,
57 total => sprintf("%.2f",$total),
58 totspent => sprintf("%.2f",$totspent),
59 totcomtd => sprintf("%.2f",$totcomtd),
60 totavail => sprintf("%.2f",$totavail));
62 output_html_with_http_headers $query, $cookie, $template->output;