X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=acqui%2Facqui-home.pl;h=69482a819e985bac78cabfe4c35905bd3d87582d;hb=16e067953bff831e6363c81f4980588fb2d76027;hp=ed96a9eba6fdc5fbb670d1553bf7892e6fd00698;hpb=a8222aeeb1169d7b1939d1e64c319a16e3846e8c;p=koha_gimpoz diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl index ed96a9eba6..69482a819e 100755 --- a/acqui/acqui-home.pl +++ b/acqui/acqui-home.pl @@ -80,7 +80,7 @@ my $suggestions_count = CountSuggestion($status); my $budget_arr = GetBudgetHierarchy( '', $user->{branchcode}, - $template->{param_map}->{'USER_INFO'}[0]->{'borrowernumber'} ); + $template->{VARS}->{'USER_INFO'}[0]->{'borrowernumber'} ); my $total = 0; my $totspent = 0; @@ -88,6 +88,11 @@ my $totordered = 0; my $totcomtd = 0; my $totavail = 0; +my $total_active = 0; +my $totspent_active = 0; +my $totordered_active = 0; +my $totavail_active = 0; + foreach my $budget ( @{$budget_arr} ) { $budget->{budget_code_indent} =~ s/\ /\ \;/g; @@ -121,6 +126,13 @@ foreach my $budget ( @{$budget_arr} ) { $totordered += $budget->{'budget_ordered'}; $totavail += $budget->{'budget_avail'}; + if ($budget->{budget_period_active}){ + $total_active += $budget->{'budget_amount'}; + $totspent_active += $budget->{'budget_spent'}; + $totordered_active += $budget->{'budget_ordered'}; + $totavail_active += $budget->{'budget_avail'}; + } + for my $field (qw( budget_amount budget_spent budget_ordered budget_avail ) ) { $budget->{$field} = $num_formatter->format_price( $budget->{$field} ); } @@ -135,7 +147,11 @@ $template->param( totordered => $num_formatter->format_price($totordered), totcomtd => $num_formatter->format_price($totcomtd), totavail => $num_formatter->format_price($totavail), - suggestions_count => $suggestions_count, + total_active => $num_formatter->format_price($total_active), + totspent_active => $num_formatter->format_price($totspent_active), + totordered_active => $num_formatter->format_price($totordered_active), + totavail_active => $num_formatter->format_price($totavail_active), + suggestions_count => $suggestions_count, ); output_html_with_http_headers $query, $cookie, $template->output;