7 use C4::Interface::CGI::Output;
14 my ($template, $loggedinuser, $cookie)
15 = get_template_and_user({template_name => "acqui/acqui-home.tmpl",
19 flagsrequired => {acquisition => 1},
24 my ($count,@results)=bookfunds;
31 for (my $i=0;$i<$count;$i++){
32 my ($spent,$comtd)=bookfundbreakdown($results[$i]->{'bookfundid'});
33 my $avail=$results[$i]->{'budgetamount'}-($spent+$comtd);
35 $line{bookfundname} = $results[$i]->{'bookfundname'};
36 $line{budgetamount} = $results[$i]->{'budgetamount'};
37 $line{spent} = sprintf ("%.2f", $spent);
38 $line{comtd} = sprintf ("%.2f",$comtd);
39 $line{avail} = sprintf ("%.2f",$avail);
40 push @loop_budget, \%line;
41 $total+=$results[$i]->{'budgetamount'};
47 my ($count,$rates)=getcurrencies();
48 my @loop_currency = ();
49 for (my $i=0;$i<$count;$i++){
51 $line{currency} = $rates->[$i]->{'currency'};
52 $line{rate} = $rates->[$i]->{'rate'};
53 push @loop_currency, \%line;
57 my $suggestion = countsuggestion("ASKED");
58 $template->param(classlist => $classlist,
60 loop_budget => \@loop_budget,
61 loop_currency => \@loop_currency,
62 total => sprintf("%.2f",$total),
63 suggestion => $suggestion,
64 totspent => sprintf("%.2f",$totspent),
65 totcomtd => sprintf("%.2f",$totcomtd),
66 totavail => sprintf("%.2f",$totavail));
68 output_html_with_http_headers $query, $cookie, $template->output;