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

Jonathan Druart jonathan.druart at biblibre.com
Fri Jul 8 10:45:07 CEST 2011


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.tt            |   11 -----------
 2 files changed, 0 insertions(+), 27 deletions(-)

diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl
index 0d9c207..74d504e 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;
-
 my $total_active        = 0;
 my $totspent_active     = 0;
 my $totordered_active   = 0;
@@ -121,11 +115,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'};
-
     if ($budget->{budget_period_active}){
 	$total_active      += $budget->{'budget_amount'};
 	$totspent_active   += $budget->{'budget_spent'};
@@ -142,11 +131,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),
     total_active  => $num_formatter->format_price($total_active),
     totspent_active     => $num_formatter->format_price($totspent_active),
     totordered_active   => $num_formatter->format_price($totordered_active),
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt
index a274365..87343bf 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt
@@ -99,17 +99,6 @@ $(document).ready(function() {
             <th>Avail</th>
         </tr>
         </thead>
-        <tfoot>
-        <tr>
-            <th>Total</th>
-            <th>&nbsp;</th>
-            <th>&nbsp;</th>
-            <th align="right" ><span class="bu_active" style="display : none;">[% total %]</span><span class="bu_inactive" >[% total_active %]</span></th>
-            <th align="right" ><span class="bu_active" style="display : none;">[% totordered %]</span><span class="bu_inactive" >[% totordered_active %]</span></th>
-            <th align="right" ><span class="bu_active" style="display : none;">[% totspent %]</span><span class="bu_inactive" >[% totspent_active %]</span></th>
-            <th align="right" ><span class="bu_active" style="display : none;">[% totavail %]</span><span class="bu_inactive" >[% totavail_active %]</span></th>
-        </tr>
-        </tfoot>
         <tbody>
         [% FOREACH loop_budge IN loop_budget %]
 	    [% IF ( loop_budge.budget_period_active ) %]
-- 
1.7.1



More information about the Koha-patches mailing list