[Koha-patches] [PATCH] Bug 6080: total is wrong in acqui-home.pl

Julian Maurice julian.maurice at biblibre.com
Wed Apr 6 11:21:48 CEST 2011


From: Paul Poulain <paul.poulain at biblibre.com>

In Acqui-home, with hierarchic bugdets, it's a non sense to do total & sub-totals:
we're adding budgets more than once.

For example :
Books 1000
  fictions books 500
  NF books 500
result in a total of 2000 !

This patch removes the total

BibLibre MT5446
---
 acqui/acqui-home.pl                                |   16 ----------------
 .../prog/en/modules/acqui/acqui-home.tmpl          |   11 -----------
 2 files changed, 0 insertions(+), 27 deletions(-)

diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl
index ed96a9e..b95e082 100755
--- a/acqui/acqui-home.pl
+++ b/acqui/acqui-home.pl
@@ -82,12 +82,6 @@ my $budget_arr =
   GetBudgetHierarchy( '', $user->{branchcode},
     $template->{param_map}->{'USER_INFO'}[0]->{'borrowernumber'} );
 
-my $total      = 0;
-my $totspent   = 0;
-my $totordered = 0;
-my $totcomtd   = 0;
-my $totavail   = 0;
-
 foreach my $budget ( @{$budget_arr} ) {
 
     $budget->{budget_code_indent} =~ s/\ /\&nbsp\;/g;
@@ -116,11 +110,6 @@ foreach my $budget ( @{$budget_arr} ) {
     $budget->{'budget_avail'} =
       $budget->{'budget_amount'} - ( $budget->{'budget_spent'} + $budget->{'budget_ordered'} );
 
-    $total      += $budget->{'budget_amount'};
-    $totspent   += $budget->{'budget_spent'};
-    $totordered += $budget->{'budget_ordered'};
-    $totavail   += $budget->{'budget_avail'};
-
     for my $field (qw( budget_amount budget_spent budget_ordered budget_avail ) ) {
         $budget->{$field} = $num_formatter->format_price( $budget->{$field} );
     }
@@ -130,11 +119,6 @@ $template->param(
     type          => 'intranet',
     loop_budget   => $budget_arr,
     branchname    => $branchname,
-    total         => $num_formatter->format_price($total),
-    totspent      => $num_formatter->format_price($totspent),
-    totordered    => $num_formatter->format_price($totordered),
-    totcomtd      => $num_formatter->format_price($totcomtd),
-    totavail      => $num_formatter->format_price($totavail),
     suggestions_count    => $suggestions_count,
 );
 
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..5e4bec4 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
@@ -78,17 +78,6 @@
             <th>Avail</th>
         </tr>
         </thead>
-        <tfoot>
-        <tr>
-            <th>Total</th>
-            <th>&nbsp;</th>
-            <th>&nbsp;</th>
-            <th align="right" ><!-- TMPL_VAR name="total" --></th>
-            <th align="right" ><!-- TMPL_VAR name="totordered" --></th>
-            <th align="right" ><!-- TMPL_VAR name="totspent" --></th>
-            <th align="right" ><!-- TMPL_VAR name="totavail" --></th>
-        </tr>
-        </tfoot>
         <tbody>
         <!-- TMPL_LOOP name="loop_budget" -->
             <!--TMPL_IF NAME="__odd__" -->
-- 
1.7.4.1



More information about the Koha-patches mailing list