7 use C4::Interface::CGI::Output;
13 my ($template, $loggedinuser, $cookie)
14 = get_template_and_user({template_name => "acqui/acqui-home.tmpl",
18 flagsrequired => {acquisition => 1},
23 my ($count,@results)=bookfunds;
30 for (my $i=0;$i<$count;$i++){
31 my ($spent,$comtd)=bookfundbreakdown($results[$i]->{'bookfundid'});
32 my $avail=$results[$i]->{'budgetamount'}-($spent+$comtd);
34 $line{bookfundname} = $results[$i]->{'bookfundname'};
35 $line{budgetamount} = $results[$i]->{'budgetamount'};
36 $line{spent} = sprintf ("%.2f", $spent);
37 $line{comtd} = sprintf ("%.2f",$comtd);
38 $line{avail} = sprintf ("%.2f",$avail);
39 push @loop_budget, \%line;
40 $total+=$results[$i]->{'budgetamount'};
46 my ($count,$rates)=getcurrencies();
47 my @loop_currency = ();
48 for (my $i=0;$i<$count;$i++){
50 $line{currency} = $rates->[$i]->{'currency'};
51 $line{rate} = $rates->[$i]->{'rate'};
52 push @loop_currency, \%line;
54 $template->param(loggedinuser => $loggedinuser,
55 classlist => $classlist,
57 loop_budget => \@loop_budget,
58 loop_currency => \@loop_currency,
59 total => sprintf("%.2f",$total),
60 totspent => sprintf("%.2f",$totspent),
61 totcomtd => sprintf("%.2f",$totcomtd),
62 totavail => sprintf("%.2f",$totavail));
64 output_html_with_http_headers $query, $cookie, $template->output;