From 94826ed2d0c297f92d1956bc0d0a31c661721800 Mon Sep 17 00:00:00 2001 From: Blou Date: Wed, 19 Aug 2015 17:03:57 -0400 Subject: [PATCH] Bug 16126 - Display base-level amounts on the acquisition module home page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch will display on the acquisition module home page the information already displayed on the "manage fund" page (aqbudgets.pl). Currently, Koha display the base-level amounts only. This patch will : 1. rename the column "ordered", "spent" and "available" to "base-level [ordered|spent|available]" 2. add the column "ordered", "spent" and available with the same calculation from the "manage fund" page. TEST PLAN : 1. Go to the Administration module 2. Add a new budget (ie : Budget 2016) 3. Add a fund to this budget (ie : Book) 4. Add a child fund (ie : Adult fiction) You will have this hierarchy : Budget 2016 |____ Book |_____ Adult fiction 5. Go to the Acquisition module 6. Place an order and use the "Adult fiction" budget 7. Go back the Acquisition home page and compare the table with the table from the aqbudgets.pl page (Administration > Budget > Fund) 8. You will see : BEFORE PATCH : the base level amounts only AFTER PATCH : the base level and the total amounts Followed test plan, works as expected. Signed-off-by: Marc VĂ©ron --- acqui/acqui-home.pl | 4 +++- .../intranet-tmpl/prog/en/modules/acqui/acqui-home.tt | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl index 804e3ce..b323bce 100755 --- a/acqui/acqui-home.pl +++ b/acqui/acqui-home.pl @@ -90,6 +90,8 @@ foreach my $budget ( @{$budget_arr} ) { $budget->{'budget_ordered'} = GetBudgetOrdered( $budget->{'budget_id'} ); $budget->{'budget_spent'} = GetBudgetSpent( $budget->{'budget_id'} ); + $budget->{'total_spent'} = GetBudgetHierarchySpent( $budget->{'budget_id'} ) // 0; + $budget->{'total_ordered'} = GetBudgetHierarchyOrdered( $budget->{'budget_id'} ) // 0; if ( !defined $budget->{budget_spent} ) { $budget->{budget_spent} = 0; } @@ -97,7 +99,7 @@ foreach my $budget ( @{$budget_arr} ) { $budget->{budget_ordered} = 0; } $budget->{'budget_avail'} = - $budget->{'budget_amount'} - ( $budget->{'budget_spent'} + $budget->{'budget_ordered'} ); + $budget->{'budget_amount'} - ( $budget->{'total_spent'} + $budget->{'total_ordered'} ); $total += $budget->{'budget_amount'}; $totspent += $budget->{'budget_spent'}; 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 cb05068..572a7c2 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 @@ -43,7 +43,7 @@ $(document).ready(function() { }, "footerCallback": function ( row, data, start, end, display ) { var api = this.api(), data; - footer_column_sum( api, [ 6, 7, 8, 9 ] ); + footer_column_sum( api, [ 6, 11 ] ); }, "aoColumnDefs": [ { "bVisible": false, "aTargets": [ 0, 1 ] }, @@ -156,8 +156,10 @@ $(document).ready(function() { Owner Library Amount - Ordered - Spent + Base-level ordered + Total ordered + Base-level spent + Total spent Total available @@ -168,7 +170,9 @@ $(document).ready(function() { Total + [% totordered_active | $Price %] + [% totspent_active | $Price %] @@ -214,6 +218,9 @@ $(document).ready(function() { + [% loop_budge.total_ordered | $Price %] + + [% IF loop_budge.budget_parent_id %] [% loop_budge.budget_spent | $Price %] @@ -223,6 +230,9 @@ $(document).ready(function() { + [% loop_budge.total_spent | $Price %] + + [% IF loop_budge.budget_parent_id %] [% loop_budge.budget_avail | $Price %] [% ELSE %] -- 1.7.10.4