From b6adbf2db2c37080f92a5d0a419559fafdf49430 Mon Sep 17 00:00:00 2001 From: Alex Arnaud Date: Tue, 5 Apr 2011 13:33:11 +0200 Subject: [PATCH] [SIGNED-OFF] bug #6054 - Add a filter by active budget on acqui-home Content-Type: text/plain; charset="utf-8" Signed-off-by: Katrin Fischer --- acqui/acqui-home.pl | 18 +++++++- .../prog/en/modules/acqui/acqui-home.tmpl | 46 +++++++++++++++++-- 2 files changed, 58 insertions(+), 6 deletions(-) diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl index ed96a9e..0d9c207 100755 --- a/acqui/acqui-home.pl +++ b/acqui/acqui-home.pl @@ -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; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tmpl index 02f5f22..66df546 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tmpl @@ -1,6 +1,27 @@ Koha › Acquisitions + + @@ -83,14 +104,15 @@ Total     - - - - + + + + + @@ -104,10 +126,24 @@ + + + + + + + + + + + + + + - + Show all :  -- 1.7.1